Module: vkd3d
Branch: master
Commit: 0a7e200f893a8cae07215fc502c640780bff57ec
URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/0a7e200f893a8cae07215fc502c64…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Mon Nov 6 13:49:35 2023 +0100
vkd3d-shader/ir: Do not enfore DCL_TEMPS count for hull shaders.
Hull shaders have a different temps count for each phase, and the
parser only reports the count for the patch constant phase.
In order to properly check for temps count on hull shaders, we first
need to decode its phases.
---
libs/vkd3d-shader/ir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c
index 40db494f..c954ad16 100644
--- a/libs/vkd3d-shader/ir.c
+++ b/libs/vkd3d-shader/ir.c
@@ -1631,7 +1631,8 @@ static void vsir_validate_instruction(struct validation_context *ctx)
if (ctx->dcl_temps_found && ctx->parser->shader_version.type != VKD3D_SHADER_TYPE_HULL)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_DUPLICATE_DCL_TEMPS, "Duplicate DCL_TEMPS instruction.");
ctx->dcl_temps_found = true;
- if (instruction->declaration.count != ctx->parser->shader_desc.temp_count)
+ if (instruction->declaration.count != ctx->parser->shader_desc.temp_count &&
+ ctx->parser->shader_version.type != VKD3D_SHADER_TYPE_HULL)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DCL_TEMPS, "Invalid DCL_TEMPS count %u, expected %u.",
instruction->declaration.count, ctx->parser->shader_desc.temp_count);
break;