Change BindlessPrototype to use an unbounded array

This commit is contained in:
dmcdiar
2021-05-08 19:56:40 -07:00
parent 1162177d61
commit 1e860e7c82
3 changed files with 16 additions and 4 deletions
@@ -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
@@ -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<ShaderResourceGroupAsset>& GetAsset() const;
@@ -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<ShaderResourceGroupAsset>& ShaderResourceGroup::GetAsset() const
{
return m_asset;