From e72c3bab71b852da28e27e54282ba83d637d11f7 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 1 Mar 2024 13:25:32 +1000 Subject: [PATCH] vkd3d-shader/spirv: Ensure the data register is UINT in spirv_compiler_emit_store_tgsm(). --- libs/vkd3d-shader/spirv.c | 7 ++++--- tests/hlsl/tgsm.shader_test | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 8d139372..61390b09 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -8904,8 +8904,8 @@ static void spirv_compiler_emit_store_tgsm(struct spirv_compiler *compiler, const struct vkd3d_shader_dst_param *dst = instruction->dst; const struct vkd3d_shader_src_param *src = instruction->src; uint32_t base_coordinate_id, component_idx; - const struct vkd3d_shader_src_param *data; struct vkd3d_shader_register_info reg_info; + struct vkd3d_shader_src_param data; unsigned int component_count; if (!spirv_compiler_get_register_info(compiler, &dst->reg, ®_info)) @@ -8917,8 +8917,9 @@ static void spirv_compiler_emit_store_tgsm(struct spirv_compiler *compiler, base_coordinate_id = spirv_compiler_emit_raw_structured_addressing(compiler, type_id, reg_info.structure_stride, &src[0], VKD3DSP_WRITEMASK_0, &src[1], VKD3DSP_WRITEMASK_0); - data = &src[instruction->src_count - 1]; - val_id = spirv_compiler_emit_load_src(compiler, data, dst->write_mask); + data = src[instruction->src_count - 1]; + data.reg.data_type = VKD3D_DATA_UINT; + val_id = spirv_compiler_emit_load_src(compiler, &data, dst->write_mask); component_count = vsir_write_mask_component_count(dst->write_mask); for (component_idx = 0; component_idx < component_count; ++component_idx) diff --git a/tests/hlsl/tgsm.shader_test b/tests/hlsl/tgsm.shader_test index e6b1a685..4e0c7a49 100644 --- a/tests/hlsl/tgsm.shader_test +++ b/tests/hlsl/tgsm.shader_test @@ -116,7 +116,7 @@ void main(uint local_idx : SV_GroupIndex, uint group_id : SV_GroupID, [test] uniform 0 uint 1 -todo dispatch 2 1 1 +todo(sm<6) dispatch 2 1 1 probe uav 1 (0) r (0.0) probe uav 1 (1) r (0.0) probe uav 1 (2) r (0.0)