vkd3d-shader/ir: Run validation after remapping the output signature.

This commit is contained in:
Giovanni Mascellani 2024-09-05 17:11:59 +02:00 committed by Henri Verbeet
parent 5ebbba6fff
commit 5fd93c28c4
Notes: Henri Verbeet 2024-09-10 21:57:30 +02:00
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1049

View File

@ -551,9 +551,11 @@ static const struct vkd3d_shader_varying_map *find_varying_map(
} }
static enum vkd3d_result vsir_program_remap_output_signature(struct vsir_program *program, static enum vkd3d_result vsir_program_remap_output_signature(struct vsir_program *program,
const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context) struct vsir_normalisation_context *ctx)
{ {
const struct vkd3d_shader_location location = {.source_name = compile_info->source_name}; const struct vkd3d_shader_location location = {.source_name = ctx->compile_info->source_name};
struct vkd3d_shader_message_context *message_context = ctx->message_context;
const struct vkd3d_shader_compile_info *compile_info = ctx->compile_info;
struct shader_signature *signature = &program->output_signature; struct shader_signature *signature = &program->output_signature;
const struct vkd3d_shader_varying_map_info *varying_map; const struct vkd3d_shader_varying_map_info *varying_map;
unsigned int i; unsigned int i;
@ -6657,15 +6659,12 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t
} }
else else
{ {
if (program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL)
vsir_transform(&ctx, vsir_program_remap_output_signature);
if (ctx.result < 0) if (ctx.result < 0)
return ctx.result; return ctx.result;
if (program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL)
{
if ((result = vsir_program_remap_output_signature(program, compile_info, message_context)) < 0)
return result;
}
if (program->shader_version.type == VKD3D_SHADER_TYPE_HULL) if (program->shader_version.type == VKD3D_SHADER_TYPE_HULL)
{ {
if ((result = instruction_array_flatten_hull_shader_phases(&program->instructions)) < 0) if ((result = instruction_array_flatten_hull_shader_phases(&program->instructions)) < 0)