diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index e7dd65d1..0d5e6dc2 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -1317,7 +1317,7 @@ static enum vkd3d_result shader_sm1_init(struct vkd3d_shader_sm1_parser *sm1, st /* Estimate instruction count to avoid reallocation in most shaders. */ if (!vsir_program_init(program, compile_info, &version, - code_size != ~(size_t)0 ? token_count / 4u + 4 : 16, VSIR_CF_STRUCTURED, VSIR_NOT_NORMALISED)) + code_size != ~(size_t)0 ? token_count / 4u + 4 : 16, VSIR_CF_STRUCTURED, VSIR_NORMALISED_SM4)) return VKD3D_ERROR_OUT_OF_MEMORY; vkd3d_shader_parser_init(&sm1->p, program, message_context, compile_info->source_name); diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index d76f9bcc..4493602d 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -10356,7 +10356,7 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, struct vsir_pro /* Estimate instruction count to avoid reallocation in most shaders. */ count = max(token_count, 400) - 400; if (!vsir_program_init(program, compile_info, &version, - (count + (count >> 2)) / 2u + 10, VSIR_CF_BLOCKS, VSIR_FULLY_NORMALISED_IO)) + (count + (count >> 2)) / 2u + 10, VSIR_CF_BLOCKS, VSIR_NORMALISED_SM6)) return VKD3D_ERROR_OUT_OF_MEMORY; vkd3d_shader_parser_init(&sm6->p, program, message_context, compile_info->source_name); sm6->ptr = &sm6->start[1]; diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index 113c7eee..ab6604bd 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -2469,7 +2469,7 @@ int glsl_compile(struct vsir_program *program, uint64_t config_flags, if ((ret = vsir_program_transform(program, config_flags, compile_info, message_context)) < 0) return ret; - VKD3D_ASSERT(program->normalisation_level == VSIR_FULLY_NORMALISED_IO); + VKD3D_ASSERT(program->normalisation_level == VSIR_NORMALISED_SM6); vkd3d_glsl_generator_init(&generator, program, compile_info, descriptor_info, combined_sampler_info, message_context); diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 0f394fb2..c3c8e5d5 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -8051,7 +8051,7 @@ static void sm1_generate_vsir(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl version.major = ctx->profile->major_version; version.minor = ctx->profile->minor_version; version.type = ctx->profile->type; - if (!vsir_program_init(program, NULL, &version, 0, VSIR_CF_STRUCTURED, VSIR_NOT_NORMALISED)) + if (!vsir_program_init(program, NULL, &version, 0, VSIR_CF_STRUCTURED, VSIR_NORMALISED_SM4)) { ctx->result = VKD3D_ERROR_OUT_OF_MEMORY; return; @@ -9922,7 +9922,7 @@ static void sm4_generate_vsir(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl version.minor = ctx->profile->minor_version; version.type = ctx->profile->type; - if (!vsir_program_init(program, NULL, &version, 0, VSIR_CF_STRUCTURED, VSIR_NOT_NORMALISED)) + if (!vsir_program_init(program, NULL, &version, 0, VSIR_CF_STRUCTURED, VSIR_NORMALISED_SM4)) { ctx->result = VKD3D_ERROR_OUT_OF_MEMORY; return; diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 5366f6cd..f9b88dc9 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1582,7 +1582,7 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i enum vkd3d_result ret; unsigned int i, j; - VKD3D_ASSERT(program->normalisation_level == VSIR_NOT_NORMALISED); + VKD3D_ASSERT(program->normalisation_level == VSIR_NORMALISED_SM4); if (program->shader_version.type != VKD3D_SHADER_TYPE_HULL) { @@ -2340,7 +2340,7 @@ static enum vkd3d_result vsir_program_normalise_io_registers(struct vsir_program program->instructions = normaliser.instructions; program->use_vocp = normaliser.use_vocp; - program->normalisation_level = VSIR_FULLY_NORMALISED_IO; + program->normalisation_level = VSIR_NORMALISED_SM6; return VKD3D_OK; } @@ -7234,7 +7234,7 @@ static const struct shader_signature *vsir_signature_from_register_type(struct v { case VKD3D_SHADER_TYPE_HULL: if (ctx->phase == VKD3DSIH_HS_CONTROL_POINT_PHASE - || ctx->program->normalisation_level >= VSIR_FULLY_NORMALISED_IO) + || ctx->program->normalisation_level >= VSIR_NORMALISED_SM6) { *has_control_point = ctx->program->normalisation_level >= VSIR_NORMALISED_HULL_CONTROL_POINT_IO; *control_point_count = ctx->program->output_control_point_count; @@ -7276,7 +7276,7 @@ static void vsir_validate_io_register(struct validation_context *ctx, const stru signature = vsir_signature_from_register_type(ctx, reg->type, &has_control_point, &control_point_count); VKD3D_ASSERT(signature); - if (ctx->program->normalisation_level < VSIR_FULLY_NORMALISED_IO) + if (ctx->program->normalisation_level < VSIR_NORMALISED_SM6) { /* Indices are [register] or [control point, register]. Both are * allowed to have a relative address. */ @@ -8374,7 +8374,7 @@ static void vsir_validate_signature(struct validation_context *ctx, const struct } /* After I/O normalisation tessellation factors are merged in a single array. */ - if (ctx->program->normalisation_level >= VSIR_FULLY_NORMALISED_IO) + if (ctx->program->normalisation_level >= VSIR_NORMALISED_SM6) { expected_outer_count = min(1, expected_outer_count); expected_inner_count = min(1, expected_inner_count); @@ -8568,7 +8568,7 @@ static void vsir_validate_dcl_index_range(struct validation_context *ctx, const struct shader_signature *signature; bool has_control_point; - if (ctx->program->normalisation_level >= VSIR_FULLY_NORMALISED_IO) + if (ctx->program->normalisation_level >= VSIR_NORMALISED_SM6) { validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_HANDLER, "DCL_INDEX_RANGE is not allowed with fully normalised input/output."); diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 881e5152..bb85e62e 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -1314,7 +1314,7 @@ int msl_compile(struct vsir_program *program, uint64_t config_flags, if ((ret = vsir_program_transform(program, config_flags, compile_info, message_context)) < 0) return ret; - VKD3D_ASSERT(program->normalisation_level == VSIR_FULLY_NORMALISED_IO); + VKD3D_ASSERT(program->normalisation_level == VSIR_NORMALISED_SM6); if ((ret = msl_generator_init(&generator, program, compile_info, descriptor_info, message_context)) < 0) return ret; diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index ee7a2799..d53a8ad4 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -10826,7 +10826,7 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, struct compile_info, compiler->message_context)) < 0) return result; - VKD3D_ASSERT(program->normalisation_level == VSIR_FULLY_NORMALISED_IO); + VKD3D_ASSERT(program->normalisation_level == VSIR_NORMALISED_SM6); max_element_count = max(program->output_signature.element_count, program->patch_constant_signature.element_count); if (!(compiler->output_info = vkd3d_calloc(max_element_count, sizeof(*compiler->output_info)))) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index 5b5ce1e3..3cb03649 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -2793,7 +2793,7 @@ static bool shader_sm4_init(struct vkd3d_shader_sm4_parser *sm4, struct vsir_pro /* Estimate instruction count to avoid reallocation in most shaders. */ if (!vsir_program_init(program, compile_info, - &version, token_count / 7u + 20, VSIR_CF_STRUCTURED, VSIR_NOT_NORMALISED)) + &version, token_count / 7u + 20, VSIR_CF_STRUCTURED, VSIR_NORMALISED_SM4)) return false; vkd3d_shader_parser_init(&sm4->p, program, message_context, compile_info->source_name); sm4->ptr = sm4->start; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 3980b67c..1afdf482 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -1411,9 +1411,9 @@ enum vsir_control_flow_type enum vsir_normalisation_level { - VSIR_NOT_NORMALISED, + VSIR_NORMALISED_SM4, VSIR_NORMALISED_HULL_CONTROL_POINT_IO, - VSIR_FULLY_NORMALISED_IO, + VSIR_NORMALISED_SM6, }; struct vsir_program