1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-05 17:28:47 +00:00

wined3d: Do not check the input signature element count for sm4+ shaders in shader_spirv_compile_arguments_init().

Shader model 4 fragment shaders can have more than 12 input varyings. That's
fine though, because we don't need to build a varying map for them in the
first place. Note that in principle the ERR in question could still be
triggered by e.g. attempting to use a shader model 4 fragment shader with a
shader model 3 vertex shader.
This commit is contained in:
Henri Verbeet 2024-03-13 13:15:53 +01:00 committed by Alexandre Julliard
parent d6ac41a9f4
commit 47be32f3d1

View File

@ -169,16 +169,15 @@ static void shader_spirv_compile_arguments_init(struct shader_spirv_compile_argu
{
struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
if (ps)
if (shader->reg_maps.shader_version.major < 4 && ps)
{
struct shader_spirv_graphics_program_vk *vs_program = shader->backend_data;
struct shader_spirv_graphics_program_vk *ps_program = ps->backend_data;
if (ps_program->signature_info.input.element_count > ARRAY_SIZE(args->u.vs.varying_map))
ERR("Unexpected inter-stage varying count %u.\n", ps_program->signature_info.input.element_count);
if (shader->reg_maps.shader_version.major < 4)
vkd3d_shader_build_varying_map(&vs_program->signature_info.output,
&ps_program->signature_info.input, &args->u.vs.varying_count, args->u.vs.varying_map);
vkd3d_shader_build_varying_map(&vs_program->signature_info.output,
&ps_program->signature_info.input, &args->u.vs.varying_count, args->u.vs.varying_map);
}
break;
}