瀏覽代碼

Cherrypick texture uniform fixes from dev to stabilization for 2505.0 (#18935)

* Fix artifacts in Lyshine UI image by marking texture index as non-uniform. (#18930)

Closes: https://github.com/o3de/o3de/issues/18904

Signed-off-by: Ross Charles Campbell <[email protected]>

* Fix terrain artifacts by marking texture index as non-uniform. (#18932)

Closes: https://github.com/o3de/o3de/issues/18924

Signed-off-by: Ross Charles Campbell <[email protected]>

---------

Signed-off-by: Ross Charles Campbell <[email protected]>
Co-authored-by: Ross Charles C. <[email protected]>
Nicholas Lawson 3 月之前
父節點
當前提交
a4db34f8c5

+ 2 - 2
Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.azsl

@@ -87,11 +87,11 @@ float4 SampleTriangleTexture(uint texIndex, float2 uv)
 {
     if ((InstanceSrg::m_isClamp & (1U << texIndex)) != 0)
     {
-        return InstanceSrg::m_texture[texIndex].Sample(InstanceSrg::m_clampSampler, uv);
+        return InstanceSrg::m_texture[NonUniformResourceIndex(texIndex)].Sample(InstanceSrg::m_clampSampler, uv);
     }
     else
     {
-        return InstanceSrg::m_texture[texIndex].Sample(InstanceSrg::m_wrapSampler, uv);
+        return InstanceSrg::m_texture[NonUniformResourceIndex(texIndex)].Sample(InstanceSrg::m_wrapSampler, uv);
     }
 }
 

+ 1 - 1
Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli

@@ -96,7 +96,7 @@ void AddDetailSurface(inout DetailSurface surface, in DetailSurface surfaceToAdd
 
 float4 SampleTexture(uint index, in MaterialContext materialContext)
 {
-    return Bindless::GetTexture2D(index).SampleGrad(TerrainMaterialSrg::m_detailSampler, materialContext.m_uv, materialContext.m_ddx, materialContext.m_ddy);
+    return Bindless::GetTexture2D(NonUniformResourceIndex(index)).SampleGrad(TerrainMaterialSrg::m_detailSampler, materialContext.m_uv, materialContext.m_ddx, materialContext.m_ddy);
 }
 
 float3 GetDetailColor(in MaterialContext materialContext, in float3 macroColor)