vkd3d-shader/ir: Allow a patch constant signature only for Hull and Domain Shaders.

This commit is contained in:
Giovanni Mascellani 2024-10-08 15:01:12 +02:00 committed by Henri Verbeet
parent 16efb7c0c6
commit 7202e6e2f3
Notes: Henri Verbeet 2024-10-09 13:19:13 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1159
2 changed files with 13 additions and 0 deletions

View File

@ -7042,6 +7042,18 @@ enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t c
if (!(config_flags & VKD3D_SHADER_CONFIG_FLAG_FORCE_VALIDATION)) if (!(config_flags & VKD3D_SHADER_CONFIG_FLAG_FORCE_VALIDATION))
return VKD3D_OK; return VKD3D_OK;
switch (program->shader_version.type)
{
case VKD3D_SHADER_TYPE_HULL:
case VKD3D_SHADER_TYPE_DOMAIN:
break;
default:
if (program->patch_constant_signature.element_count != 0)
validator_error(&ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
"Patch constant signature is only valid for hull and domain shaders.");
}
if (!(ctx.temps = vkd3d_calloc(ctx.program->temp_count, sizeof(*ctx.temps)))) if (!(ctx.temps = vkd3d_calloc(ctx.program->temp_count, sizeof(*ctx.temps))))
goto fail; goto fail;

View File

@ -245,6 +245,7 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_VSIR_INVALID_GS = 9019, VKD3D_SHADER_ERROR_VSIR_INVALID_GS = 9019,
VKD3D_SHADER_ERROR_VSIR_INVALID_PARAMETER = 9020, VKD3D_SHADER_ERROR_VSIR_INVALID_PARAMETER = 9020,
VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC = 9021, VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC = 9021,
VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE = 9022,
VKD3D_SHADER_WARNING_VSIR_DYNAMIC_DESCRIPTOR_ARRAY = 9300, VKD3D_SHADER_WARNING_VSIR_DYNAMIC_DESCRIPTOR_ARRAY = 9300,