Handle range adaption in texture remapping

* This can be used in saving overlays, stencil, etc
This commit is contained in:
baldurk
2019-11-27 11:05:24 +00:00
parent f7e5199cf4
commit 11c39377b1
2 changed files with 9 additions and 3 deletions
+2
View File
@@ -69,6 +69,8 @@ void main(void)
color_out = SampleTextureFloat4(texType, scr, texdisplay.Slice, texdisplay.MipLevel,
texdisplay.SampleIdx, texdisplay.TextureResolutionPS,
texdisplay.YUVDownsampleRate, texdisplay.YUVAChannels);
color_out = ((color_out - texdisplay.RangeMinimum) * texdisplay.InverseRangeSize);
#endif
if(texdisplay.Channels == vec4(1, 0, 0, 0))
+7 -3
View File
@@ -33,9 +33,13 @@ struct v2f
float4 RENDERDOC_TexRemapFloat(v2f IN) : SV_Target0
{
return SampleTextureFloat4(OutputDisplayFormat & TEXDISPLAY_TYPEMASK,
(ScalePS < 1 && MipLevel == 0), IN.tex.xy, Slice, MipLevel, SampleIdx,
TextureResolutionPS, YUVDownsampleRate, YUVAChannels);
float4 ret = SampleTextureFloat4(OutputDisplayFormat & TEXDISPLAY_TYPEMASK,
(ScalePS < 1 && MipLevel == 0), IN.tex.xy, Slice, MipLevel,
SampleIdx, TextureResolutionPS, YUVDownsampleRate, YUVAChannels);
ret = ((ret - RangeMinimum) * InverseRangeSize);
return ret;
}
uint4 RENDERDOC_TexRemapUInt(v2f IN) : SV_Target0