From cb3bc8b528a31382dc89e27836158025389211a2 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 20 Nov 2024 11:48:21 +0000 Subject: [PATCH] D3D12 Shader Debug Zoo: added a test case for f32tof16() & f16tof32() --- util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp b/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp index 501d31232c..725668c693 100644 --- a/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp @@ -742,6 +742,13 @@ float4 main(v2f IN) : SV_Target0 float2 uv = posone * float2(0.55f, 0.48f); return smileyint.Load(int3(uv*16,0)); } + if(IN.tri == 82) + { + uint f16_half = f32tof16(posone*0.5); + uint f16_one = f32tof16(posone*1.0); + uint f16_two = f32tof16(posone*2.0); + return float4(f16tof32(f16_half), f16tof32(f16_one), f16tof32(f16_two), 0.0f); + } return float4(0.4f, 0.4f, 0.4f, 0.4f); }