mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-27 20:31:02 +00:00
Fix issues with float inaccuracy on 'clipping' overlay
* There was a problem where a value of 1.0 would show up as 'clipping' if the range meant that it was transformed to something like 1.0000000432f so we use FLT_EPSILON as a slight fudge factor.
This commit is contained in:
@@ -139,6 +139,9 @@ cbuffer HistogramCBufferData REG(b0)
|
||||
#define TEXDISPLAY_SINT_TEX 0x0800
|
||||
#define TEXDISPLAY_GAMMA_CURVE 0x1000
|
||||
|
||||
#ifndef FLT_EPSILON
|
||||
#define FLT_EPSILON 1.192092896e-07f
|
||||
#endif
|
||||
|
||||
// histogram/minmax is calculated in blocks of NxN each with MxM tiles.
|
||||
// e.g. a tile is 32x32 pixels, then this is arranged in blocks of 32x32 tiles.
|
||||
|
||||
@@ -137,7 +137,7 @@ float4 RENDERDOC_TexDisplayPS(v2f IN) : SV_Target0
|
||||
if(col.r < 0 || col.g < 0 || col.b < 0 || col.a < 0)
|
||||
return float4(1, 0, 0, 1);
|
||||
|
||||
if(col.r > 1 || col.g > 1 || col.b > 1 || col.a > 1)
|
||||
if(col.r > (1+FLT_EPSILON) || col.g > (1+FLT_EPSILON) || col.b > (1+FLT_EPSILON) || col.a > (1+FLT_EPSILON))
|
||||
return float4(0, 1, 0, 1);
|
||||
|
||||
col = float4(dot(col.xyz, float3(0.2126, 0.7152, 0.0722)).xxx, 1);
|
||||
|
||||
Reference in New Issue
Block a user