From 4ff14104b08fa5a8cdb33faf3bca5f02f2bd3126 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov <nsivov@codeweavers.com> Date: Wed, 26 Mar 2025 20:18:41 +0100 Subject: [PATCH 1/2] vkd3d-shader/fx: Set GeometryShader state type as an object type. Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> --- libs/vkd3d-shader/fx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 7a226c1c8..c067f707c 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -2366,6 +2366,7 @@ static inline bool is_object_fx_type(enum state_property_component_type type) case FX_BLEND: case FX_VERTEXSHADER: case FX_PIXELSHADER: + case FX_GEOMETRYSHADER: return true; default: return false; -- GitLab From 254008198896248286846b64ad0613f37ddd9d7c Mon Sep 17 00:00:00 2001 From: Nikolay Sivov <nsivov@codeweavers.com> Date: Wed, 26 Mar 2025 20:58:42 +0100 Subject: [PATCH 2/2] vkd3d-shader/fx: Accept int(0) as well as uint(0) constant value for object-type states. Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> --- libs/vkd3d-shader/fx.c | 3 ++- tests/hlsl/effect-pass-states-fx_5.shader_test | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index c067f707c..debcb2618 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -2762,7 +2762,8 @@ static void resolve_fx_4_state_block_values(struct hlsl_ir_var *var, struct hlsl struct hlsl_ir_constant *c = hlsl_ir_constant(node); struct hlsl_type *data_type = c->node.data_type; - if (data_type->class == HLSL_CLASS_SCALAR && data_type->e.numeric.type == HLSL_TYPE_UINT) + if (data_type->class == HLSL_CLASS_SCALAR + && (data_type->e.numeric.type == HLSL_TYPE_INT || data_type->e.numeric.type == HLSL_TYPE_UINT)) { if (c->value.u[0].u != 0) hlsl_error(ctx, &ctx->location, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, diff --git a/tests/hlsl/effect-pass-states-fx_5.shader_test b/tests/hlsl/effect-pass-states-fx_5.shader_test index 651122d15..2ff187598 100644 --- a/tests/hlsl/effect-pass-states-fx_5.shader_test +++ b/tests/hlsl/effect-pass-states-fx_5.shader_test @@ -39,5 +39,19 @@ technique11 SetBlendState(NULL, float4(5, 6, 7, 8), 0xf0); SetVertexShader(NULL); SetPixelShader(NULL); + SetGeometryShader(NULL); + } + pass + { + SetDepthStencilState(1-1, 4); + SetRasterizerState(1-1); + SetHullShader(1-1); + SetComputeShader(1-1); + SetDomainShader(1-1); + OMSetRenderTargets(1-1, 1-1); + SetBlendState(1-1, float4(5, 6, 7, 8), 0xf0); + SetVertexShader(1-1); + SetPixelShader(1-1); + SetGeometryShader(0u); } } -- GitLab