From 2333cfa2a1344d5a5b869dbf688827e1611e2fa1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 1 Feb 2021 13:31:23 +0000 Subject: [PATCH] Test that UAV reads in shader debugging read data prior to event --- util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp b/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp index 8702e1d7e..363a89890 100644 --- a/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp @@ -657,6 +657,19 @@ float4 main(v2f IN) : SV_Target0 unbounduav2[int2(0, 1)] = 1.234f; return unbounduav2[int2(0, 1)].xxxx; } + if(IN.tri == 78) + { + // use this to ensure the compiler doesn't know we're using fixed locations + uint z = intval - IN.tri - 7; + uint z2 = uint(zero); + + // read first. This should be zero + float read_val = asfloat(byterwtest.Load(z2+100).x); + + byterwtest.Store(z+100, asuint(1.2345f)); + + return read_val; + } return float4(0.4f, 0.4f, 0.4f, 0.4f); }