vkd3d-shader/hlsl: Use the semantic.resource_type field for texture DCL instructions.

ins->resource_type is intended for VKD3D_SM5_MODIFIER_RESOURCE_TYPE, which is
not used for DCL instructions. At the same time, the validator checks
semantic.resource_type, and would break on HLSL shaders.
This commit is contained in:
Elizabeth Figura
2025-10-01 13:32:35 -05:00
committed by Henri Verbeet
parent e524c36916
commit 62b7c5b5e6
Notes: Henri Verbeet 2025-10-06 19:48:04 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1718
2 changed files with 5 additions and 4 deletions

View File

@@ -3874,8 +3874,11 @@ static void tpf_dcl_texture(const struct tpf_compiler *tpf, const struct vkd3d_s
if (ins->opcode == VSIR_OP_DCL || ins->opcode == VSIR_OP_DCL_UAV_TYPED)
{
enum vkd3d_sm4_resource_type resource_type = sm4_resource_dimension(ins->declaration.semantic.resource_type);
instr.idx[0] = pack_resource_data_type(ins->declaration.semantic.resource_data_type);
instr.idx_count = 1;
instr.extra_bits |= resource_type << VKD3D_SM4_RESOURCE_TYPE_SHIFT;
instr.extra_bits |= ins->declaration.semantic.sample_count << VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT;
resource = &ins->declaration.semantic.resource;
}
@@ -3910,8 +3913,6 @@ static void tpf_dcl_texture(const struct tpf_compiler *tpf, const struct vkd3d_s
if (uav)
instr.extra_bits |= ins->flags << VKD3D_SM5_UAV_FLAGS_SHIFT;
instr.extra_bits |= (sm4_resource_dimension(ins->resource_type) << VKD3D_SM4_RESOURCE_TYPE_SHIFT);
write_sm4_instruction(tpf, &instr);
}