Browse Source

Reduced number of SPD mip levels used by luma pyramid and shading change pyramid passes by one for OpenGL Core, to ensure they stay within the limit of 8 UAV bindings.

fsr3.1.1
Nico de Poel 1 year ago
parent
commit
f8f5f9077d
  1. 4
      Shaders/shaders/ffx_fsr3upscaler_luma_pyramid_pass.hlsl
  2. 2
      Shaders/shaders/ffx_fsr3upscaler_shading_change_pyramid_pass.hlsl
  3. 10
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h
  4. 4
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_shading_change_pyramid.h

4
Shaders/shaders/ffx_fsr3upscaler_luma_pyramid_pass.hlsl

@ -30,8 +30,12 @@
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_2 4
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_3 5
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_4 6
#ifdef SHADER_API_GLCORE
#define FSR3UPSCALER_BIND_UAV_FARTHEST_DEPTH_MIP1 7
#else
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_5 7
#define FSR3UPSCALER_BIND_UAV_FARTHEST_DEPTH_MIP1 8
#endif
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0

2
Shaders/shaders/ffx_fsr3upscaler_shading_change_pyramid_pass.hlsl

@ -32,7 +32,9 @@
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_2 3
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_3 4
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_4 5
#ifndef SHADER_API_GLCORE
#define FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_5 6
#endif
#define FSR3UPSCALER_BIND_CB_FSR3UPSCALER 0

10
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h

@ -929,14 +929,18 @@ FfxFloat32x4 FrameInfo()
defined(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_2) && \
defined(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_3) && \
defined(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_4) && \
defined(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_5)
(defined(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_5) || defined(SHADER_API_GLCORE))
RWTexture2D<FfxFloat32x2> rw_spd_mip0 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_0);
RWTexture2D<FfxFloat32x2> rw_spd_mip1 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_1);
RWTexture2D<FfxFloat32x2> rw_spd_mip2 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_2);
RWTexture2D<FfxFloat32x2> rw_spd_mip3 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_3);
#ifdef SHADER_API_GLCORE
globallycoherent RWTexture2D<FfxFloat32x2> rw_spd_mip4 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_4);
#else
RWTexture2D<FfxFloat32x2> rw_spd_mip4 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_4);
globallycoherent RWTexture2D<FfxFloat32x2> rw_spd_mip5 : FFX_DECLARE_UAV(FSR3UPSCALER_BIND_UAV_SPD_MIPS_LEVEL_5);
#endif
FfxFloat32x2 RWLoadPyramid(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN FfxUInt32 index)
{
@ -950,7 +954,9 @@ FfxFloat32x2 RWLoadPyramid(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN
LOAD(2);
LOAD(3);
LOAD(4);
#ifndef SHADER_API_GLCORE
LOAD(5);
#endif
return 0;
@ -970,7 +976,9 @@ void StorePyramid(FFX_PARAMETER_IN FfxInt32x2 iPxPos, FFX_PARAMETER_IN FfxFloat3
STORE(2);
STORE(3);
STORE(4);
#ifndef SHADER_API_GLCORE
STORE(5);
#endif
#undef STORE
}

4
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_shading_change_pyramid.h

@ -200,7 +200,11 @@ FfxFloat32x4 SpdLoadSourceImage(FfxFloat32x2 iPxPos, FfxUInt32 slice)
FfxFloat32x4 SpdLoad(FfxInt32x2 tex, FfxUInt32 slice)
{
#ifdef SHADER_API_GLCORE
return FfxFloat32x4(RWLoadPyramid(tex, 4), 0, 0);
#else
return FfxFloat32x4(RWLoadPyramid(tex, 5), 0, 0);
#endif
}
FfxFloat32x4 SpdReduce4(FfxFloat32x4 v0, FfxFloat32x4 v1, FfxFloat32x4 v2, FfxFloat32x4 v3)

Loading…
Cancel
Save