Browse Source

Fixed a number of shader compiler warnings from using a more modern compiler

srp
Nico de Poel 3 weeks ago
parent
commit
d153e59498
  1. 2
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h
  2. 2
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_common.h
  3. 4
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h
  4. 8
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h
  5. 10
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h
  6. 10
      Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h

2
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h

@ -86,7 +86,7 @@ cbuffer cbFSR3Upscaler : FFX_FSR3UPSCALER_DECLARE_CB(FSR3UPSCALER_BIND_CB_FSR3UP
#define FFX_FSR3UPSCALER_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR3Upscaler) / 4) // Number of 32-bit values. This must be kept in sync with the cbFSR3Upscaler size. #define FFX_FSR3UPSCALER_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR3Upscaler) / 4) // Number of 32-bit values. This must be kept in sync with the cbFSR3Upscaler size.
/* Define getter functions in the order they are defined in the CB! */ /* Define getter functions in the order they are defined in the CB! */
FfxInt32x2 RenderSize()
FfxUInt32x2 RenderSize()
{ {
return iRenderSize; return iRenderSize;
} }

2
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_common.h

@ -49,7 +49,7 @@ FFX_STATIC const FfxFloat32 fAverageLanczosWeightPerFrame = 0.74f * fUpsampleL
FFX_STATIC const FfxFloat32 fAccumulationMaxOnMotion = 3.0f * fUpsampleLanczosWeightScale; FFX_STATIC const FfxFloat32 fAccumulationMaxOnMotion = 3.0f * fUpsampleLanczosWeightScale;
#define SHADING_CHANGE_SET_SIZE 5 #define SHADING_CHANGE_SET_SIZE 5
FFX_STATIC const FfxInt32 iShadingChangeMipStart = 0;
FFX_STATIC const FfxUInt32 iShadingChangeMipStart = 0;
FFX_STATIC const FfxFloat32 fShadingChangeSamplePow = 1.0f / 1.0f; FFX_STATIC const FfxFloat32 fShadingChangeSamplePow = 1.0f / 1.0f;

4
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h

@ -48,9 +48,9 @@ FFX_STATIC const FfxInt32 LUMA = 1;
FFX_STATIC const FfxInt32 DEPTH_IN_METERS = 2; FFX_STATIC const FfxInt32 DEPTH_IN_METERS = 2;
#ifdef SHADER_API_GLCORE #ifdef SHADER_API_GLCORE
FFX_STATIC const FfxInt32 MAX_MIP = 4;
FFX_STATIC const FfxUInt32 MAX_MIP = 4;
#else #else
FFX_STATIC const FfxInt32 MAX_MIP = 5;
FFX_STATIC const FfxUInt32 MAX_MIP = 5;
#endif #endif
FfxFloat32x4 SpdLoadSourceImage(FfxFloat32x2 iPxPos, FfxUInt32 slice) FfxFloat32x4 SpdLoadSourceImage(FfxFloat32x2 iPxPos, FfxUInt32 slice)

8
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h

@ -140,8 +140,10 @@ FfxFloat32 ComputeThinFeatureConfidence(FfxInt32x2 iPxPos)
FfxFloat32 fLumaMin = FSR3UPSCALER_FP32_MAX; FfxFloat32 fLumaMin = FSR3UPSCALER_FP32_MAX;
FfxFloat32 fLumaMax = FSR3UPSCALER_FP32_MIN; FfxFloat32 fLumaMax = FSR3UPSCALER_FP32_MIN;
FfxInt32 iSampleIndex;
FFX_UNROLL FFX_UNROLL
for (FfxInt32 iSampleIndex = 0; iSampleIndex < iSampleCount; ++iSampleIndex) {
for (iSampleIndex = 0; iSampleIndex < iSampleCount; ++iSampleIndex) {
const FfxInt32x2 iPxSamplePos = ClampLoad(iPxPos, iSampleOffsets[iSampleIndex], FfxInt32x2(RenderSize())); const FfxInt32x2 iPxSamplePos = ClampLoad(iPxPos, iSampleOffsets[iSampleIndex], FfxInt32x2(RenderSize()));
fSamples[iSampleIndex] = LoadCurrentLuma(iPxSamplePos) * Exposure(); fSamples[iSampleIndex] = LoadCurrentLuma(iPxSamplePos) * Exposure();
@ -167,7 +169,7 @@ FfxFloat32 ComputeThinFeatureConfidence(FfxInt32x2 iPxPos)
FfxInt32 iBitIndex = 1; FfxInt32 iBitIndex = 1;
FFX_UNROLL FFX_UNROLL
for (FfxInt32 iSampleIndex = 1; iSampleIndex < iSampleCount; ++iSampleIndex, ++iBitIndex) {
for (iSampleIndex = 1; iSampleIndex < iSampleCount; ++iSampleIndex, ++iBitIndex) {
const FfxFloat32 fDifference = abs(fSamples[iSampleIndex] - fSamples[iNucleusIndex]) / (fLumaMax - fLumaMin); const FfxFloat32 fDifference = abs(fSamples[iSampleIndex] - fSamples[iNucleusIndex]) / (fLumaMax - fLumaMin);
@ -190,7 +192,7 @@ FfxFloat32 ComputeThinFeatureConfidence(FfxInt32x2 iPxPos)
} }
FFX_UNROLL FFX_UNROLL
for (FfxInt32 i = 0; i < uNumRejectionMasks; i++)
for (FfxUInt32 i = 0; i < uNumRejectionMasks; i++)
{ {
if ((uPatternMask & uRejectionMasks[i]) == uRejectionMasks[i]) if ((uPatternMask & uRejectionMasks[i]) == uRejectionMasks[i])
{ {

10
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h

@ -189,9 +189,11 @@ FFX_MIN16_F ComputeAabbOverlap(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPre
#endif #endif
FfxFloat32x3 minPrev = FFX_MIN16_F3(+1000.f, +1000.f, +1000.f); FfxFloat32x3 minPrev = FFX_MIN16_F3(+1000.f, +1000.f, +1000.f);
FfxFloat32x3 maxPrev = FFX_MIN16_F3(-1000.f, -1000.f, -1000.f); FfxFloat32x3 maxPrev = FFX_MIN16_F3(-1000.f, -1000.f, -1000.f);
for (int y = -1; y < 2; ++y)
int x, y;
for (y = -1; y < 2; ++y)
{ {
for (int x = -1; x < 2; ++x)
for (x = -1; x < 2; ++x)
{ {
FfxFloat32x3 W = LoadPrevPostAlpha(iPrevIdx + FFX_MIN16_I2(x, y)); FfxFloat32x3 W = LoadPrevPostAlpha(iPrevIdx + FFX_MIN16_I2(x, y));
@ -205,9 +207,9 @@ FFX_MIN16_F ComputeAabbOverlap(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPre
// instead of computing the overlap: simply count how many samples are outside // instead of computing the overlap: simply count how many samples are outside
// set reactive based on that // set reactive based on that
FFX_MIN16_F count = FFX_MIN16_F(0.f); FFX_MIN16_F count = FFX_MIN16_F(0.f);
for (int y = -1; y < 2; ++y)
for (y = -1; y < 2; ++y)
{ {
for (int x = -1; x < 2; ++x)
for (x = -1; x < 2; ++x)
{ {
FfxFloat32x3 Y = LoadInputColor(uDispatchThreadId + FFX_MIN16_I2(x, y)); FfxFloat32x3 Y = LoadInputColor(uDispatchThreadId + FFX_MIN16_I2(x, y));

10
Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h

@ -408,10 +408,12 @@ void ComputeUpsampledColorAndWeight(const AccumulationPassCommonParams params, F
FfxFloat32x3 fSamples[9]; FfxFloat32x3 fSamples[9];
FfxInt32 iSampleIndex = 0; FfxInt32 iSampleIndex = 0;
FfxInt32 row, col;
FFX_UNROLL FFX_UNROLL
for (FfxInt32 row = 0; row < 3; row++) {
for (row = 0; row < 3; row++) {
FFX_UNROLL FFX_UNROLL
for (FfxInt32 col = 0; col < 3; col++) {
for (col = 0; col < 3; col++) {
const FfxInt32x2 iSampleColRow = FfxInt32x2(bFlipCol ? (3 - col) : col, bFlipRow ? (3 - row) : row); const FfxInt32x2 iSampleColRow = FfxInt32x2(bFlipCol ? (3 - col) : col, bFlipRow ? (3 - row) : row);
const FfxInt32x2 iSrcSamplePos = FfxInt32x2(iSrcInputPos) + offsetTL + iSampleColRow; const FfxInt32x2 iSrcSamplePos = FfxInt32x2(iSrcInputPos) + offsetTL + iSampleColRow;
const FfxInt32x2 iSampleCoord = ClampLoad(iSrcSamplePos, FfxInt32x2(0, 0), FfxInt32x2(RenderSize())); const FfxInt32x2 iSampleCoord = ClampLoad(iSrcSamplePos, FfxInt32x2(0, 0), FfxInt32x2(RenderSize()));
@ -584,10 +586,10 @@ void ComputeUpsampledColorAndWeight(const AccumulationPassCommonParams params, F
iSampleIndex = 0; iSampleIndex = 0;
FFX_UNROLL FFX_UNROLL
for (FfxInt32 row = 0; row < 3; row++)
for (row = 0; row < 3; row++)
{ {
FFX_UNROLL FFX_UNROLL
for (FfxInt32 col = 0; col < 3; col++)
for (col = 0; col < 3; col++)
{ {
const FfxInt32x2 sampleColRow = FfxInt32x2(bFlipCol ? (3 - col) : col, bFlipRow ? (3 - row) : row); const FfxInt32x2 sampleColRow = FfxInt32x2(bFlipCol ? (3 - col) : col, bFlipRow ? (3 - row) : row);
const FfxFloat32x2 fOffset = fOffsetTL + FfxFloat32x2(sampleColRow); const FfxFloat32x2 fOffset = fOffsetTL + FfxFloat32x2(sampleColRow);

Loading…
Cancel
Save