Merge pull request #659 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-15511

[ATOM-15511] Change AtomSampleViewer BindlessPrototype sample to use an unbounded array
This commit is contained in:
dmcdiarmid-ly
2021-05-11 11:58:31 -07:00
committed by GitHub
6 changed files with 22 additions and 4 deletions
@@ -76,6 +76,9 @@ namespace AZ
//! Whether Ray Tracing support is available.
bool m_rayTracing = false;
//! Whether Unbounded Array support is available.
bool m_unboundedArrays = false;
/// Additional features here.
};
}
@@ -166,6 +166,8 @@ namespace AZ
m_features.m_rayTracing = false;
#endif
m_features.m_unboundedArrays = true;
m_limits.m_maxImageDimension1D = D3D12_REQ_TEXTURE1D_U_DIMENSION;
m_limits.m_maxImageDimension2D = D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION;
m_limits.m_maxImageDimension3D = D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION;
@@ -720,6 +720,7 @@ namespace AZ
StringList deviceExtensions = physicalDevice.GetDeviceExtensionNames();
StringList::iterator itRayTracingExtension = AZStd::find(deviceExtensions.begin(), deviceExtensions.end(), VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME);
m_features.m_rayTracing = (itRayTracingExtension != deviceExtensions.end());
m_features.m_unboundedArrays = true;
const auto& deviceLimits = physicalDevice.GetDeviceLimits();
m_limits.m_maxImageDimension1D = deviceLimits.maxImageDimension1D;
@@ -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;