From 894189e8f9b87673c83422b80974097e1317a59a Mon Sep 17 00:00:00 2001 From: Tim <15017472+doodlum@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:34:59 +0000 Subject: [PATCH 1/2] refactor: shader bindings --- .../Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli | 2 +- .../Shaders/DynamicCubemaps/DynamicCubemaps.hlsli | 4 ++-- .../Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli | 2 +- features/Skylighting/Shaders/Skylighting/Skylighting.hlsli | 2 +- .../Shaders/TerrainBlending/TerrainBlending.hlsli | 2 +- .../Shaders/TerrainShadows/TerrainShadows.hlsli | 2 +- .../Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli | 2 +- .../Shaders/WetnessEffects/WetnessEffects.hlsli | 2 +- package/Shaders/Common/Glints/Glints2023.hlsli | 2 +- package/Shaders/Common/ShadowSampling.hlsli | 4 ++-- package/Shaders/Common/SharedData.hlsli | 2 +- src/Deferred.cpp | 2 +- src/Features/CloudShadows.cpp | 2 +- src/Features/DynamicCubemaps.cpp | 2 +- src/Features/ScreenSpaceShadows.cpp | 2 +- src/Features/Skylighting.cpp | 2 +- src/Features/TerrainBlending.cpp | 2 +- src/Features/TerrainShadows.cpp | 2 +- src/Features/WaterEffects.cpp | 2 +- src/Features/WetnessEffects.cpp | 2 +- src/State.cpp | 2 +- src/TruePBR.cpp | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli b/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli index ab814bd29..f6ddf667d 100644 --- a/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli +++ b/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli @@ -1,5 +1,5 @@ -TextureCube cloudShadowsTexture : register(t27); +TextureCube cloudShadowsTexture : register(t30); #define CloudHeight (2e3f / 1.428e-2) #define PlanetRadius (6371e3f / 1.428e-2) diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli index 9d1c0350f..5dfd67883 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli @@ -1,5 +1,5 @@ -TextureCube specularTexture : register(t64); -TextureCube specularTextureNoReflections : register(t65); +TextureCube specularTexture : register(t40); +TextureCube specularTextureNoReflections : register(t41); namespace DynamicCubemaps { diff --git a/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli b/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli index 653981fca..d8130bd71 100644 --- a/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli +++ b/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli @@ -1,6 +1,6 @@ #include "Common/Math.hlsli" -Texture2D ScreenSpaceShadowsTexture : register(t17); +Texture2D ScreenSpaceShadowsTexture : register(t60); namespace ScreenSpaceShadows { diff --git a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli index 6451eb4cd..ab2bf126d 100644 --- a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli +++ b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli @@ -4,7 +4,7 @@ #include "Common/Spherical Harmonics/SphericalHarmonics.hlsli" #ifdef PSHADER -Texture3D SkylightingProbeArray : register(t29); +Texture3D SkylightingProbeArray : register(t70); #endif namespace Skylighting diff --git a/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli b/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli index 1f61d9f47..58f055b9e 100644 --- a/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli +++ b/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli @@ -1,5 +1,5 @@ -Texture2D TerrainBlendingMaskTexture : register(t35); +Texture2D TerrainBlendingMaskTexture : register(t80); namespace TerrainBlending { diff --git a/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli b/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli index 7554fdf33..4a187af95 100644 --- a/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli +++ b/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli @@ -1,4 +1,4 @@ -Texture2D TexShadowHeight : register(t42); +Texture2D TexShadowHeight : register(t90); namespace TerrainShadows { diff --git a/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli b/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli index 70abec790..e55d1f507 100644 --- a/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli +++ b/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli @@ -1,4 +1,4 @@ -Texture2D WaterCaustics : register(t70); +Texture2D WaterCaustics : register(t100); namespace WaterEffects { diff --git a/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli b/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli index bc8347e8e..c23b26258 100644 --- a/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli +++ b/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli @@ -2,7 +2,7 @@ namespace WetnessEffects { - Texture2D TexPrecipOcclusion : register(t31); + Texture2D TexPrecipOcclusion : register(t110); // https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile float2 EnvBRDFApproxWater(float3 F0, float Roughness, float NoV) diff --git a/package/Shaders/Common/Glints/Glints2023.hlsli b/package/Shaders/Common/Glints/Glints2023.hlsli index bbd05cd0b..e8366e8b7 100644 --- a/package/Shaders/Common/Glints/Glints2023.hlsli +++ b/package/Shaders/Common/Glints/Glints2023.hlsli @@ -1,6 +1,6 @@ #include "Common/Math.hlsli" -Texture2D _Glint2023NoiseMap : register(t28); +Texture2D _Glint2023NoiseMap : register(t20); namespace Glints { diff --git a/package/Shaders/Common/ShadowSampling.hlsli b/package/Shaders/Common/ShadowSampling.hlsli index 373d2f784..38affe0a2 100644 --- a/package/Shaders/Common/ShadowSampling.hlsli +++ b/package/Shaders/Common/ShadowSampling.hlsli @@ -5,7 +5,7 @@ #include "Common/Random.hlsli" #include "Common/SharedData.hlsli" -Texture2DArray SharedTexShadowMapSampler : register(t25); +Texture2DArray SharedTexShadowMapSampler : register(t18); struct PerGeometry { @@ -24,7 +24,7 @@ struct PerGeometry float4x4 CameraViewProjInverse[2]; }; -StructuredBuffer SharedPerShadow : register(t26); +StructuredBuffer SharedPerShadow : register(t19); namespace ShadowSampling { diff --git a/package/Shaders/Common/SharedData.hlsli b/package/Shaders/Common/SharedData.hlsli index b9b42f7b2..f766facd6 100644 --- a/package/Shaders/Common/SharedData.hlsli +++ b/package/Shaders/Common/SharedData.hlsli @@ -135,7 +135,7 @@ cbuffer FeatureData : register(b6) SkylightingSettings skylightingSettings; }; -Texture2D TexDepthSampler : register(t20); +Texture2D TexDepthSampler : register(t17); namespace SharedData { diff --git a/src/Deferred.cpp b/src/Deferred.cpp index e90454d16..bc055e71a 100644 --- a/src/Deferred.cpp +++ b/src/Deferred.cpp @@ -207,7 +207,7 @@ void Deferred::CopyShadowData() perShadow->srv.get(), }; - context->PSSetShaderResources(25, ARRAYSIZE(srvs), srvs); + context->PSSetShaderResources(18, ARRAYSIZE(srvs), srvs); } } diff --git a/src/Features/CloudShadows.cpp b/src/Features/CloudShadows.cpp index 67e9b2e25..d6f28931f 100644 --- a/src/Features/CloudShadows.cpp +++ b/src/Features/CloudShadows.cpp @@ -64,7 +64,7 @@ void CloudShadows::Prepass() auto& context = State::GetSingleton()->context; ID3D11ShaderResourceView* srv = texCubemapCloudOcc->srv.get(); - context->PSSetShaderResources(27, 1, &srv); + context->PSSetShaderResources(30, 1, &srv); } void CloudShadows::SetupResources() diff --git a/src/Features/DynamicCubemaps.cpp b/src/Features/DynamicCubemaps.cpp index ab39c9064..800146386 100644 --- a/src/Features/DynamicCubemaps.cpp +++ b/src/Features/DynamicCubemaps.cpp @@ -508,7 +508,7 @@ void DynamicCubemaps::PostDeferred() auto& context = State::GetSingleton()->context; ID3D11ShaderResourceView* views[2] = { (activeReflections ? envReflectionsTexture : envTexture)->srv.get(), envTexture->srv.get() }; - context->PSSetShaderResources(64, 2, views); + context->PSSetShaderResources(40, 2, views); } void DynamicCubemaps::SetupResources() diff --git a/src/Features/ScreenSpaceShadows.cpp b/src/Features/ScreenSpaceShadows.cpp index 23eb3dc98..3a293aeb1 100644 --- a/src/Features/ScreenSpaceShadows.cpp +++ b/src/Features/ScreenSpaceShadows.cpp @@ -234,7 +234,7 @@ void ScreenSpaceShadows::Prepass() DrawShadows(); auto view = screenSpaceShadowsTexture->srv.get(); - context->PSSetShaderResources(17, 1, &view); + context->PSSetShaderResources(60, 1, &view); } void ScreenSpaceShadows::LoadSettings(json& o_json) diff --git a/src/Features/Skylighting.cpp b/src/Features/Skylighting.cpp index 6d9e18f74..0e184d067 100644 --- a/src/Features/Skylighting.cpp +++ b/src/Features/Skylighting.cpp @@ -249,7 +249,7 @@ void Skylighting::Prepass() // set PS shader resource { ID3D11ShaderResourceView* srv = texProbeArray->srv.get(); - context->PSSetShaderResources(29, 1, &srv); + context->PSSetShaderResources(70, 1, &srv); } } diff --git a/src/Features/TerrainBlending.cpp b/src/Features/TerrainBlending.cpp index aaefad1ba..fc8c67c4e 100644 --- a/src/Features/TerrainBlending.cpp +++ b/src/Features/TerrainBlending.cpp @@ -188,7 +188,7 @@ void TerrainBlending::OverrideTerrainWorld() // Used to get the distance of the surface to the lowest depth auto view = terrainOffsetTexture->srv.get(); - context->PSSetShaderResources(35, 1, &view); + context->PSSetShaderResources(80, 1, &view); } void TerrainBlending::OverrideTerrainDepth() diff --git a/src/Features/TerrainShadows.cpp b/src/Features/TerrainShadows.cpp index 9bce09a1e..d8c76347a 100644 --- a/src/Features/TerrainShadows.cpp +++ b/src/Features/TerrainShadows.cpp @@ -387,6 +387,6 @@ void TerrainShadows::Prepass() std::array srvs = { nullptr }; if (texShadowHeight) srvs.at(2) = texShadowHeight->srv.get(); - context->PSSetShaderResources(40, (uint)srvs.size(), srvs.data()); + context->PSSetShaderResources(90, (uint)srvs.size(), srvs.data()); } } diff --git a/src/Features/WaterEffects.cpp b/src/Features/WaterEffects.cpp index f14783e3e..6764942b1 100644 --- a/src/Features/WaterEffects.cpp +++ b/src/Features/WaterEffects.cpp @@ -17,7 +17,7 @@ void WaterEffects::Prepass() { auto& context = State::GetSingleton()->context; auto srv = causticsView.get(); - context->PSSetShaderResources(70, 1, &srv); + context->PSSetShaderResources(100, 1, &srv); } bool WaterEffects::HasShaderDefine(RE::BSShader::Type) diff --git a/src/Features/WetnessEffects.cpp b/src/Features/WetnessEffects.cpp index 3b6944a00..717a958e1 100644 --- a/src/Features/WetnessEffects.cpp +++ b/src/Features/WetnessEffects.cpp @@ -271,7 +271,7 @@ void WetnessEffects::Prepass() auto state = State::GetSingleton(); auto& context = state->context; - context->PSSetShaderResources(31, 1, &precipOcclusionTexture.depthSRV); + context->PSSetShaderResources(110, 1, &precipOcclusionTexture.depthSRV); } void WetnessEffects::LoadSettings(json& o_json) diff --git a/src/State.cpp b/src/State.cpp index 173317edb..91afcc012 100644 --- a/src/State.cpp +++ b/src/State.cpp @@ -694,7 +694,7 @@ void State::UpdateSharedData() auto terrainBlending = TerrainBlending::GetSingleton(); auto srv = (terrainBlending->loaded ? terrainBlending->blendedDepthTexture16->srv.get() : depth.depthSRV); - context->PSSetShaderResources(20, 1, &srv); + context->PSSetShaderResources(17, 1, &srv); } void State::ClearDisabledFeatures() diff --git a/src/TruePBR.cpp b/src/TruePBR.cpp index 23ae3cba0..75156edb6 100644 --- a/src/TruePBR.cpp +++ b/src/TruePBR.cpp @@ -265,7 +265,7 @@ void TruePBR::PrePass() if (!glintsNoiseTexture) SetupGlintsTexture(); ID3D11ShaderResourceView* srv = glintsNoiseTexture->srv.get(); - context->PSSetShaderResources(28, 1, &srv); + context->PSSetShaderResources(20, 1, &srv); } void TruePBR::SetupGlintsTexture() From f05a1df285dd46a64195f2d9aec96bf1df19965a Mon Sep 17 00:00:00 2001 From: Tim <15017472+doodlum@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:42:23 +0000 Subject: [PATCH 2/2] chore: compact --- .../Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli | 2 +- .../Shaders/DynamicCubemaps/DynamicCubemaps.hlsli | 4 ++-- .../Shaders/LightLimitFix/LightLimitFix.hlsli | 8 ++++---- .../Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli | 2 +- .../Skylighting/Shaders/Skylighting/Skylighting.hlsli | 2 +- .../Shaders/TerrainBlending/TerrainBlending.hlsli | 2 +- .../Shaders/TerrainShadows/TerrainShadows.hlsli | 2 +- .../Shaders/WaterEffects/WaterCaustics.hlsli | 2 +- .../Shaders/WetnessEffects/WetnessEffects.hlsli | 2 +- src/Features/CloudShadows.cpp | 2 +- src/Features/DynamicCubemaps.cpp | 2 +- src/Features/LightLimitFix.cpp | 4 ++-- src/Features/ScreenSpaceShadows.cpp | 2 +- src/Features/Skylighting.cpp | 2 +- src/Features/TerrainBlending.cpp | 2 +- src/Features/TerrainShadows.cpp | 2 +- src/Features/WaterEffects.cpp | 2 +- src/Features/WetnessEffects.cpp | 2 +- 18 files changed, 23 insertions(+), 23 deletions(-) diff --git a/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli b/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli index f6ddf667d..06f5fc4b2 100644 --- a/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli +++ b/features/Cloud Shadows/Shaders/CloudShadows/CloudShadows.hlsli @@ -1,5 +1,5 @@ -TextureCube cloudShadowsTexture : register(t30); +TextureCube cloudShadowsTexture : register(t25); #define CloudHeight (2e3f / 1.428e-2) #define PlanetRadius (6371e3f / 1.428e-2) diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli index 5dfd67883..4eb8beb05 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli @@ -1,5 +1,5 @@ -TextureCube specularTexture : register(t40); -TextureCube specularTextureNoReflections : register(t41); +TextureCube specularTexture : register(t30); +TextureCube specularTextureNoReflections : register(t31); namespace DynamicCubemaps { diff --git a/features/Light Limit Fix/Shaders/LightLimitFix/LightLimitFix.hlsli b/features/Light Limit Fix/Shaders/LightLimitFix/LightLimitFix.hlsli index 053523ff3..938a3fc7a 100644 --- a/features/Light Limit Fix/Shaders/LightLimitFix/LightLimitFix.hlsli +++ b/features/Light Limit Fix/Shaders/LightLimitFix/LightLimitFix.hlsli @@ -7,10 +7,10 @@ struct StrictLightData uint pad0[2]; }; -StructuredBuffer lights : register(t50); -StructuredBuffer lightList : register(t51); //MAX_CLUSTER_LIGHTS * 16^3 -StructuredBuffer lightGrid : register(t52); //16^3 -StructuredBuffer strictLights : register(t53); +StructuredBuffer lights : register(t35); +StructuredBuffer lightList : register(t36); //MAX_CLUSTER_LIGHTS * 16^3 +StructuredBuffer lightGrid : register(t37); //16^3 +StructuredBuffer strictLights : register(t38); namespace LightLimitFix { diff --git a/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli b/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli index d8130bd71..41fe0f320 100644 --- a/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli +++ b/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/ScreenSpaceShadows.hlsli @@ -1,6 +1,6 @@ #include "Common/Math.hlsli" -Texture2D ScreenSpaceShadowsTexture : register(t60); +Texture2D ScreenSpaceShadowsTexture : register(t45); namespace ScreenSpaceShadows { diff --git a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli index ab2bf126d..5fe40a78d 100644 --- a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli +++ b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli @@ -4,7 +4,7 @@ #include "Common/Spherical Harmonics/SphericalHarmonics.hlsli" #ifdef PSHADER -Texture3D SkylightingProbeArray : register(t70); +Texture3D SkylightingProbeArray : register(t50); #endif namespace Skylighting diff --git a/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli b/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli index 58f055b9e..dabb5413a 100644 --- a/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli +++ b/features/Terrain Blending/Shaders/TerrainBlending/TerrainBlending.hlsli @@ -1,5 +1,5 @@ -Texture2D TerrainBlendingMaskTexture : register(t80); +Texture2D TerrainBlendingMaskTexture : register(t55); namespace TerrainBlending { diff --git a/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli b/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli index 4a187af95..005539d4d 100644 --- a/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli +++ b/features/Terrain Shadows/Shaders/TerrainShadows/TerrainShadows.hlsli @@ -1,4 +1,4 @@ -Texture2D TexShadowHeight : register(t90); +Texture2D TexShadowHeight : register(t60); namespace TerrainShadows { diff --git a/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli b/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli index e55d1f507..faf3da508 100644 --- a/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli +++ b/features/Water Effects/Shaders/WaterEffects/WaterCaustics.hlsli @@ -1,4 +1,4 @@ -Texture2D WaterCaustics : register(t100); +Texture2D WaterCaustics : register(t65); namespace WaterEffects { diff --git a/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli b/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli index c23b26258..1e2006007 100644 --- a/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli +++ b/features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli @@ -2,7 +2,7 @@ namespace WetnessEffects { - Texture2D TexPrecipOcclusion : register(t110); + Texture2D TexPrecipOcclusion : register(t70); // https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile float2 EnvBRDFApproxWater(float3 F0, float Roughness, float NoV) diff --git a/src/Features/CloudShadows.cpp b/src/Features/CloudShadows.cpp index d6f28931f..ce8190beb 100644 --- a/src/Features/CloudShadows.cpp +++ b/src/Features/CloudShadows.cpp @@ -64,7 +64,7 @@ void CloudShadows::Prepass() auto& context = State::GetSingleton()->context; ID3D11ShaderResourceView* srv = texCubemapCloudOcc->srv.get(); - context->PSSetShaderResources(30, 1, &srv); + context->PSSetShaderResources(25, 1, &srv); } void CloudShadows::SetupResources() diff --git a/src/Features/DynamicCubemaps.cpp b/src/Features/DynamicCubemaps.cpp index 800146386..bf09558ea 100644 --- a/src/Features/DynamicCubemaps.cpp +++ b/src/Features/DynamicCubemaps.cpp @@ -508,7 +508,7 @@ void DynamicCubemaps::PostDeferred() auto& context = State::GetSingleton()->context; ID3D11ShaderResourceView* views[2] = { (activeReflections ? envReflectionsTexture : envTexture)->srv.get(), envTexture->srv.get() }; - context->PSSetShaderResources(40, 2, views); + context->PSSetShaderResources(30, 2, views); } void DynamicCubemaps::SetupResources() diff --git a/src/Features/LightLimitFix.cpp b/src/Features/LightLimitFix.cpp index 6c4225069..33e31e89a 100644 --- a/src/Features/LightLimitFix.cpp +++ b/src/Features/LightLimitFix.cpp @@ -389,7 +389,7 @@ void LightLimitFix::BSLightingShader_SetupGeometry_After(RE::BSRenderPass*) static Util::FrameChecker frameChecker; if (frameChecker.IsNewFrame()) { ID3D11ShaderResourceView* view = strictLightData->srv.get(); - context->PSSetShaderResources(53, 1, &view); + context->PSSetShaderResources(38, 1, &view); } } @@ -458,7 +458,7 @@ void LightLimitFix::Prepass() views[0] = lights->srv.get(); views[1] = lightIndexList->srv.get(); views[2] = lightGrid->srv.get(); - context->PSSetShaderResources(50, ARRAYSIZE(views), views); + context->PSSetShaderResources(35, ARRAYSIZE(views), views); } bool LightLimitFix::IsValidLight(RE::BSLight* a_light) diff --git a/src/Features/ScreenSpaceShadows.cpp b/src/Features/ScreenSpaceShadows.cpp index 3a293aeb1..07b35fd35 100644 --- a/src/Features/ScreenSpaceShadows.cpp +++ b/src/Features/ScreenSpaceShadows.cpp @@ -234,7 +234,7 @@ void ScreenSpaceShadows::Prepass() DrawShadows(); auto view = screenSpaceShadowsTexture->srv.get(); - context->PSSetShaderResources(60, 1, &view); + context->PSSetShaderResources(45, 1, &view); } void ScreenSpaceShadows::LoadSettings(json& o_json) diff --git a/src/Features/Skylighting.cpp b/src/Features/Skylighting.cpp index 0e184d067..567e0280c 100644 --- a/src/Features/Skylighting.cpp +++ b/src/Features/Skylighting.cpp @@ -249,7 +249,7 @@ void Skylighting::Prepass() // set PS shader resource { ID3D11ShaderResourceView* srv = texProbeArray->srv.get(); - context->PSSetShaderResources(70, 1, &srv); + context->PSSetShaderResources(50, 1, &srv); } } diff --git a/src/Features/TerrainBlending.cpp b/src/Features/TerrainBlending.cpp index fc8c67c4e..031f7b37e 100644 --- a/src/Features/TerrainBlending.cpp +++ b/src/Features/TerrainBlending.cpp @@ -188,7 +188,7 @@ void TerrainBlending::OverrideTerrainWorld() // Used to get the distance of the surface to the lowest depth auto view = terrainOffsetTexture->srv.get(); - context->PSSetShaderResources(80, 1, &view); + context->PSSetShaderResources(55, 1, &view); } void TerrainBlending::OverrideTerrainDepth() diff --git a/src/Features/TerrainShadows.cpp b/src/Features/TerrainShadows.cpp index d8c76347a..06cedcdd5 100644 --- a/src/Features/TerrainShadows.cpp +++ b/src/Features/TerrainShadows.cpp @@ -387,6 +387,6 @@ void TerrainShadows::Prepass() std::array srvs = { nullptr }; if (texShadowHeight) srvs.at(2) = texShadowHeight->srv.get(); - context->PSSetShaderResources(90, (uint)srvs.size(), srvs.data()); + context->PSSetShaderResources(60, (uint)srvs.size(), srvs.data()); } } diff --git a/src/Features/WaterEffects.cpp b/src/Features/WaterEffects.cpp index 6764942b1..049261759 100644 --- a/src/Features/WaterEffects.cpp +++ b/src/Features/WaterEffects.cpp @@ -17,7 +17,7 @@ void WaterEffects::Prepass() { auto& context = State::GetSingleton()->context; auto srv = causticsView.get(); - context->PSSetShaderResources(100, 1, &srv); + context->PSSetShaderResources(65, 1, &srv); } bool WaterEffects::HasShaderDefine(RE::BSShader::Type) diff --git a/src/Features/WetnessEffects.cpp b/src/Features/WetnessEffects.cpp index 717a958e1..18e86aacd 100644 --- a/src/Features/WetnessEffects.cpp +++ b/src/Features/WetnessEffects.cpp @@ -271,7 +271,7 @@ void WetnessEffects::Prepass() auto state = State::GetSingleton(); auto& context = state->context; - context->PSSetShaderResources(110, 1, &precipOcclusionTexture.depthSRV); + context->PSSetShaderResources(70, 1, &precipOcclusionTexture.depthSRV); } void WetnessEffects::LoadSettings(json& o_json)