From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/spirv.c | 6 +++++- tests/hlsl/cast-64-bit.shader_test | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index e837fc2ef..7a5ca6f08 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3867,7 +3867,11 @@ static uint32_t spirv_compiler_emit_load_ssa_reg(struct spirv_compiler *compiler reg_component_type = vkd3d_component_type_from_data_type(ssa->data_type); if (component_type != reg_component_type) { - type_id = vkd3d_spirv_get_type_id(builder, component_type, 1); + /* SplitDouble bitcast emits two uint from a double. */ + if (reg_component_type == VKD3D_SHADER_COMPONENT_DOUBLE && component_type == VKD3D_SHADER_COMPONENT_UINT) + type_id = vkd3d_spirv_get_type_id(builder, component_type, 2); + else + type_id = vkd3d_spirv_get_type_id(builder, component_type, 1); val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id); }
diff --git a/tests/hlsl/cast-64-bit.shader_test b/tests/hlsl/cast-64-bit.shader_test index 1610207a7..eec22e9a8 100644 --- a/tests/hlsl/cast-64-bit.shader_test +++ b/tests/hlsl/cast-64-bit.shader_test @@ -72,5 +72,5 @@ float4 main() : sv_target
[test] uniform 0 double2 -4.5 8.5 -todo draw quad +draw quad probe all rgba (0.0, 3222405120, 0.0, 1075904512)