瀏覽代碼

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]>
Ross Charles C. 2 月之前
父節點
當前提交
c96198e01e
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.azsl

+ 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);
     }
 }