From d153e59498d415c75fe1b0e413bacf3a4fd277cb Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sun, 11 Oct 2026 14:11:00 +0200 Subject: [PATCH] Fixed a number of shader compiler warnings from using a more modern compiler --- .../fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h | 2 +- Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_common.h | 2 +- .../fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h | 4 ++-- .../fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h | 8 +++++--- .../fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h | 10 ++++++---- .../shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h | 10 ++++++---- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h index 6f616e3..53413d2 100644 --- a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_callbacks_hlsl.h +++ b/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 getter functions in the order they are defined in the CB! */ -FfxInt32x2 RenderSize() +FfxUInt32x2 RenderSize() { return iRenderSize; } diff --git a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_common.h b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_common.h index 87aa596..1db926e 100644 --- a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_common.h +++ b/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; #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; diff --git a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h index 6d6b629..3317cd8 100644 --- a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_luma_pyramid.h +++ b/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; #ifdef SHADER_API_GLCORE -FFX_STATIC const FfxInt32 MAX_MIP = 4; +FFX_STATIC const FfxUInt32 MAX_MIP = 4; #else -FFX_STATIC const FfxInt32 MAX_MIP = 5; +FFX_STATIC const FfxUInt32 MAX_MIP = 5; #endif FfxFloat32x4 SpdLoadSourceImage(FfxFloat32x2 iPxPos, FfxUInt32 slice) diff --git a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h index ae24545..59583a1 100644 --- a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h +++ b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_prepare_reactivity.h @@ -139,9 +139,11 @@ FfxFloat32 ComputeThinFeatureConfidence(FfxInt32x2 iPxPos) FfxFloat32 fLumaMin = FSR3UPSCALER_FP32_MAX; FfxFloat32 fLumaMax = FSR3UPSCALER_FP32_MIN; + + FfxInt32 iSampleIndex; FFX_UNROLL - for (FfxInt32 iSampleIndex = 0; iSampleIndex < iSampleCount; ++iSampleIndex) { + for (iSampleIndex = 0; iSampleIndex < iSampleCount; ++iSampleIndex) { const FfxInt32x2 iPxSamplePos = ClampLoad(iPxPos, iSampleOffsets[iSampleIndex], FfxInt32x2(RenderSize())); fSamples[iSampleIndex] = LoadCurrentLuma(iPxSamplePos) * Exposure(); @@ -167,7 +169,7 @@ FfxFloat32 ComputeThinFeatureConfidence(FfxInt32x2 iPxPos) FfxInt32 iBitIndex = 1; 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); @@ -190,7 +192,7 @@ FfxFloat32 ComputeThinFeatureConfidence(FfxInt32x2 iPxPos) } FFX_UNROLL - for (FfxInt32 i = 0; i < uNumRejectionMasks; i++) + for (FfxUInt32 i = 0; i < uNumRejectionMasks; i++) { if ((uPatternMask & uRejectionMasks[i]) == uRejectionMasks[i]) { diff --git a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h index 2d446bb..8c5f90f 100644 --- a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_tcr_autogen.h +++ b/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 FfxFloat32x3 minPrev = 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)); @@ -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 // set reactive based on that 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)); diff --git a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h index 801a0a9..cb7b22f 100644 --- a/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h +++ b/Shaders/shaders/fsr3upscaler/ffx_fsr3upscaler_upsample.h @@ -407,11 +407,13 @@ void ComputeUpsampledColorAndWeight(const AccumulationPassCommonParams params, F #else FfxFloat32x3 fSamples[9]; FfxInt32 iSampleIndex = 0; + + FfxInt32 row, col; FFX_UNROLL - for (FfxInt32 row = 0; row < 3; row++) { + for (row = 0; row < 3; row++) { 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 iSrcSamplePos = FfxInt32x2(iSrcInputPos) + offsetTL + iSampleColRow; const FfxInt32x2 iSampleCoord = ClampLoad(iSrcSamplePos, FfxInt32x2(0, 0), FfxInt32x2(RenderSize())); @@ -584,10 +586,10 @@ void ComputeUpsampledColorAndWeight(const AccumulationPassCommonParams params, F iSampleIndex = 0; FFX_UNROLL - for (FfxInt32 row = 0; row < 3; row++) + for (row = 0; row < 3; row++) { 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 FfxFloat32x2 fOffset = fOffsetTL + FfxFloat32x2(sampleColRow);