From f50b20ddd61131c8e026cc7277a0b70cfedf398b Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Mon, 4 Nov 2024 22:31:49 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Enforce PSIZE component count for sm1 VS output. --- libs/vkd3d-shader/hlsl_codegen.c | 5 +++++ tests/hlsl/shader-point-size.shader_test | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 8cb4b0f0..2a6dbbca 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -6519,6 +6519,11 @@ static void generate_vsir_signature_entry(struct hlsl_ctx *ctx, struct vsir_prog sysval = VKD3D_SHADER_SV_POSITION; } + if (!ascii_strcasecmp(var->semantic.name, "PSIZE") && output + && program->shader_version.type == VKD3D_SHADER_TYPE_VERTEX && var->data_type->dimx > 1) + hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC, + "PSIZE output must have only 1 component in this shader model."); + mask = (1 << var->data_type->dimx) - 1; use_mask = mask; /* FIXME: retrieve use mask accurately. */ component_type = VKD3D_SHADER_COMPONENT_FLOAT; diff --git a/tests/hlsl/shader-point-size.shader_test b/tests/hlsl/shader-point-size.shader_test index a77259bb..00bf157d 100644 --- a/tests/hlsl/shader-point-size.shader_test +++ b/tests/hlsl/shader-point-size.shader_test @@ -9,7 +9,7 @@ shader model < 4.0 -0.5 0 20 0.5 0 40 -[vertex shader fail todo] +[vertex shader fail] void main(inout float4 pos : position, out float2 size : psize) { size = 1;