diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 1c7ed0d9e..50be8a4f5 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -3720,7 +3720,10 @@ static void sm6_parser_declare_tgsm_raw(struct sm6_parser *sm6, const struct sm6 dst->structure_stride = 0; sm6_register_from_value(&ins->declaration.tgsm_raw.reg.reg, dst, sm6); ins->declaration.tgsm_raw.alignment = alignment; - byte_count = elem_type->u.width / 8u; + byte_count = elem_type->u.width / CHAR_BIT; + /* Convert minimum precision types to their 32-bit equivalent. */ + if (byte_count == 2) + byte_count = 4; if (byte_count != 4) { FIXME("Unsupported byte count %u.\n", byte_count); diff --git a/tests/hlsl/tgsm.shader_test b/tests/hlsl/tgsm.shader_test index 6865aeaa7..6f567b694 100644 --- a/tests/hlsl/tgsm.shader_test +++ b/tests/hlsl/tgsm.shader_test @@ -305,15 +305,15 @@ void main(uint local_idx : SV_GroupIndex, uint group_id : SV_GroupID) } [test] -todo dispatch 2 1 1 -todo probe uav 0 (0) u32(0x14321) -todo probe uav 0 (1) u32(0x14321) -todo probe uav 0 (2) u32(0x14321) -todo probe uav 0 (3) u32(0x14321) -todo probe uav 0 (4) u32(0x24321) -todo probe uav 0 (5) u32(0x24321) -todo probe uav 0 (6) u32(0x24321) -todo probe uav 0 (7) u32(0x24321) +todo(sm<6) dispatch 2 1 1 +probe uav 0 (0) u32(0x14321) +probe uav 0 (1) u32(0x14321) +probe uav 0 (2) u32(0x14321) +probe uav 0 (3) u32(0x14321) +probe uav 0 (4) u32(0x24321) +probe uav 0 (5) u32(0x24321) +probe uav 0 (6) u32(0x24321) +probe uav 0 (7) u32(0x24321) [require] shader model >= 6.2