vkd3d-shader/spirv: Normalise the shader before allocating registers.

So registers are allocated after normalisation (which could require
additional registers).
This commit is contained in:
Giovanni Mascellani 2024-01-17 14:07:27 +01:00 committed by Alexandre Julliard
parent 9ad48f16ea
commit 1d45b7a422
Notes: Alexandre Julliard 2024-01-18 23:20:56 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/573

View File

@ -9680,6 +9680,9 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
enum vkd3d_result result = VKD3D_OK; enum vkd3d_result result = VKD3D_OK;
unsigned int i; unsigned int i;
if ((result = vkd3d_shader_normalise(parser, compile_info)) < 0)
return result;
if (parser->shader_desc.temp_count) if (parser->shader_desc.temp_count)
spirv_compiler_emit_temps(compiler, parser->shader_desc.temp_count); spirv_compiler_emit_temps(compiler, parser->shader_desc.temp_count);
if (parser->shader_desc.ssa_count) if (parser->shader_desc.ssa_count)
@ -9690,9 +9693,6 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
compiler->location.column = 0; compiler->location.column = 0;
compiler->location.line = 1; compiler->location.line = 1;
if ((result = vkd3d_shader_normalise(parser, compile_info)) < 0)
return result;
if (parser->shader_desc.block_count && !spirv_compiler_init_blocks(compiler, parser->shader_desc.block_count)) if (parser->shader_desc.block_count && !spirv_compiler_init_blocks(compiler, parser->shader_desc.block_count))
return VKD3D_ERROR_OUT_OF_MEMORY; return VKD3D_ERROR_OUT_OF_MEMORY;