diff --git a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/BindlessPrototypeSrg.azsli b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/BindlessPrototypeSrg.azsli index c955c5d2f8..7304af9e1e 100644 --- a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/BindlessPrototypeSrg.azsli +++ b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/BindlessPrototypeSrg.azsli @@ -31,10 +31,6 @@ ShaderResourceGroupSemantic FloatBufferSemanticId ShaderResourceGroup ImageSrg : FrequencyPerScene { - // Array of textures - // NOTE: The size of the texture array has to match the number of textures in the example - Texture2D m_textureArray[8]; - Sampler m_sampler { MaxAnisotropy = 16; @@ -42,6 +38,9 @@ ShaderResourceGroup ImageSrg : FrequencyPerScene AddressV = Wrap; AddressW = Wrap; }; + + // Array of textures + Texture2D m_textureArray[]; } ShaderResourceGroup FloatBufferSrg : FloatBufferSemanticId diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h index 8c53ed2eb2..6d99d287f3 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h @@ -75,6 +75,9 @@ namespace AZ RHI::ShaderInputSamplerIndex FindShaderInputSamplerIndex(const Name& name) const; RHI::ShaderInputConstantIndex FindShaderInputConstantIndex(const Name& name) const; + RHI::ShaderInputBufferUnboundedArrayIndex FindShaderInputBufferUnboundedArrayIndex(const Name& name) const; + RHI::ShaderInputImageUnboundedArrayIndex FindShaderInputImageUnboundedArrayIndex(const Name& name) const; + /// Returns the parent shader resource group asset. const Data::Asset& GetAsset() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp index 28ba48c370..77ea0b9494 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -118,6 +118,16 @@ namespace AZ return m_layout->FindShaderInputConstantIndex(name); } + RHI::ShaderInputBufferUnboundedArrayIndex ShaderResourceGroup::FindShaderInputBufferUnboundedArrayIndex(const Name& name) const + { + return m_layout->FindShaderInputBufferUnboundedArrayIndex(name); + } + + RHI::ShaderInputImageUnboundedArrayIndex ShaderResourceGroup::FindShaderInputImageUnboundedArrayIndex(const Name& name) const + { + return m_layout->FindShaderInputImageUnboundedArrayIndex(name); + } + const Data::Asset& ShaderResourceGroup::GetAsset() const { return m_asset;