From da456b1fb463432274ea41e68b830e62c7c1bb76 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sun, 9 Nov 2025 12:58:23 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Do not deduplicate sampler types in the CTAB. --- libs/vkd3d-shader/hlsl_codegen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 543711287..80868a5bd 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -10609,7 +10609,11 @@ static void write_sm1_type(struct vkd3d_bytecode_buffer *buffer, struct hlsl_typ struct hlsl_struct_field *field; size_t i; - if (type->bytecode_offset) + /* Native deduplicates types, but emits the correct dimension for generic + * samplers. Apparently it deals with this by never deduplicating any + * sampler types. This is not very efficient, but we may as well do the + * same. */ + if (type->bytecode_offset && array_type->class != HLSL_CLASS_SAMPLER) return; if (array_type->class == HLSL_CLASS_STRUCT)