Clamp out-of-bounds undefined results for resinfo

This commit is contained in:
baldurk
2019-11-27 11:02:25 +00:00
parent 8e338de519
commit f7e5199cf4
@@ -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);