diff --git a/Sources/globals.c b/Sources/globals.c index ec93d20..1da30db 100644 --- a/Sources/globals.c +++ b/Sources/globals.c @@ -16,6 +16,25 @@ void globals_init(void) { add_global_with_value(float_id, add_name("COMPARE_LESS_EQUAL"), 5); add_global_with_value(float_id, add_name("COMPARE_GREATER"), 6); add_global_with_value(float_id, add_name("COMPARE_GREATER_EQUAL"), 7); + + add_global_with_value(float_id, add_name("BLEND_ONE"), 0); + add_global_with_value(float_id, add_name("BLEND_ZERO"), 1); + add_global_with_value(float_id, add_name("BLEND_SOURCE_ALPHA"), 2); + add_global_with_value(float_id, add_name("BLEND_DEST_ALPHA"), 3); + add_global_with_value(float_id, add_name("BLEND_INV_SOURCE_ALPHA"), 4); + add_global_with_value(float_id, add_name("BLEND_INV_DEST_ALPHA"), 5); + add_global_with_value(float_id, add_name("BLEND_SOURCE_COLOR"), 6); + add_global_with_value(float_id, add_name("BLEND_DEST_COLOR"), 7); + add_global_with_value(float_id, add_name("BLEND_INV_SOURCE_COLOR"), 8); + add_global_with_value(float_id, add_name("BLEND_INV_DEST_COLOR"), 9); + add_global_with_value(float_id, add_name("BLEND_CONSTANT"), 10); + add_global_with_value(float_id, add_name("BLEND_INV_CONSTANT"), 11); + + add_global_with_value(float_id, add_name("BLENDOP_ADD"), 0); + add_global_with_value(float_id, add_name("BLENDOP_SUBTRACT"), 1); + add_global_with_value(float_id, add_name("BLENDOP_REVERSE_SUBTRACT"), 2); + add_global_with_value(float_id, add_name("BLENDOP_MIN"), 3); + add_global_with_value(float_id, add_name("BLENDOP_MAX"), 4); } global_id add_global(type_id type, name_id name) { diff --git a/Sources/integrations/kinc.c b/Sources/integrations/kinc.c index f3b58e6..f9aed25 100644 --- a/Sources/integrations/kinc.c +++ b/Sources/integrations/kinc.c @@ -495,6 +495,42 @@ void kinc_export(char *directory, api_kind api) { global g = find_global(t->members.m[j].value.identifier); fprintf(output, "\t%s.depth_mode = %i;\n\n", get_name(t->name), (int)g.value); } + else if (t->members.m[j].name == add_name("blend_source")) { + debug_context context = {0}; + check(t->members.m[j].value.kind == TOKEN_IDENTIFIER, context, "blend_source expects an identifier"); + global g = find_global(t->members.m[j].value.identifier); + fprintf(output, "\t%s.blend_source = %i;\n\n", get_name(t->name), (int)g.value); + } + else if (t->members.m[j].name == add_name("blend_destination")) { + debug_context context = {0}; + check(t->members.m[j].value.kind == TOKEN_IDENTIFIER, context, "blend_destination expects an identifier"); + global g = find_global(t->members.m[j].value.identifier); + fprintf(output, "\t%s.blend_destination = %i;\n\n", get_name(t->name), (int)g.value); + } + else if (t->members.m[j].name == add_name("blend_operation")) { + debug_context context = {0}; + check(t->members.m[j].value.kind == TOKEN_IDENTIFIER, context, "blend_operation expects an identifier"); + global g = find_global(t->members.m[j].value.identifier); + fprintf(output, "\t%s.blend_operation = %i;\n\n", get_name(t->name), (int)g.value); + } + else if (t->members.m[j].name == add_name("alpha_blend_source")) { + debug_context context = {0}; + check(t->members.m[j].value.kind == TOKEN_IDENTIFIER, context, "alpha_blend_source expects an identifier"); + global g = find_global(t->members.m[j].value.identifier); + fprintf(output, "\t%s.alpha_blend_source = %i;\n\n", get_name(t->name), (int)g.value); + } + else if (t->members.m[j].name == add_name("alpha_blend_destination")) { + debug_context context = {0}; + check(t->members.m[j].value.kind == TOKEN_IDENTIFIER, context, "alpha_blend_destination expects an identifier"); + global g = find_global(t->members.m[j].value.identifier); + fprintf(output, "\t%s.alpha_blend_destination = %i;\n\n", get_name(t->name), (int)g.value); + } + else if (t->members.m[j].name == add_name("alpha_blend_operation")) { + debug_context context = {0}; + check(t->members.m[j].value.kind == TOKEN_IDENTIFIER, context, "alpha_blend_operation expects an identifier"); + global g = find_global(t->members.m[j].value.identifier); + fprintf(output, "\t%s.alpha_blend_operation = %i;\n\n", get_name(t->name), (int)g.value); + } else { debug_context context = {0}; error(context, "Unsupported pipe member %s", get_name(t->members.m[j].name));