Update kong

This commit is contained in:
luboslenco
2025-04-11 17:41:53 +02:00
parent 01b739bab8
commit 9601a7a80f
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -856,7 +856,7 @@ static void write_functions(char *hlsl, size_t *offset, shader_stage stage, func
sprintf(&hlsl[*offset], ", %s _%" PRIu64, type_string(f->parameter_types[parameter_index].type), parameter_ids[parameter_index]);
}
}
*offset += sprintf(&hlsl[*offset], ") {\n");
*offset += sprintf(&hlsl[*offset], ", in uint _kong_vertex_id : SV_VertexID) {\n");
}
else if (stage == SHADER_STAGE_FRAGMENT) {
if (get_type(f->return_type.type)->array_size > 0) {
@@ -1338,6 +1338,10 @@ static void write_functions(char *hlsl, size_t *offset, shader_stage stage, func
check(o->op_call.parameters_size == 0, context, "instance_id can not have a parameter");
*offset += sprintf(&hlsl[*offset], "%s _%" PRIu64 " = InstanceID();\n", type_string(o->op_call.var.type.type), o->op_call.var.index);
}
else if (o->op_call.func == add_name("vertex_id")) {
check(o->op_call.parameters_size == 0, context, "vertex_id can not have a parameter");
*offset += sprintf(&hlsl[*offset], "%s _%" PRIu64 " = _kong_vertex_id;\n", type_string(o->op_call.var.type.type), o->op_call.var.index);
}
else if (o->op_call.func == add_name("world_ray_direction")) {
check(o->op_call.parameters_size == 0, context, "world_ray_direction can not have a parameter");
*offset += sprintf(&hlsl[*offset], "%s _%" PRIu64 " = WorldRayDirection();\n", type_string(o->op_call.var.type.type), o->op_call.var.index);
+1
View File
@@ -785,6 +785,7 @@ void functions_init(void) {
add_func_uint3("dispatch_thread_id");
add_func_int("group_index");
add_func_int("instance_id");
add_func_int("vertex_id");
////
// add_func_float3_float_float_float("lerp");