From f7e5199cf45d301ff94fda176ebe9c817a13205b Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 27 Nov 2019 11:02:25 +0000 Subject: [PATCH] Clamp out-of-bounds undefined results for resinfo --- util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp b/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp index f13999dff..116518bfb 100644 --- a/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp @@ -520,7 +520,7 @@ float4 main(v2f IN) : SV_Target0 { uint width = 0, height = 0, numLevels = 0; dimtex.GetDimensions(10, width, height, numLevels); - return float4(width, height, numLevels, 0.0f); + return float4(max(1,width), max(1,height), numLevels, 0.0f); } if(IN.tri == 59) @@ -548,7 +548,7 @@ float4 main(v2f IN) : SV_Target0 uint width = 0, height = 0, numLevels = 0; dimtex.GetDimensions(z+10, width, height, numLevels); - return float4(width, height, numLevels, 0.0f); + return float4(max(1,width), max(1,height), numLevels, 0.0f); } return float4(0.4f, 0.4f, 0.4f, 0.4f);