mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
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:
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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user