Fixed SRG updated related crash (#6317)
Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
This commit is contained in:
@@ -202,23 +202,19 @@ namespace AZ
|
||||
{
|
||||
ShaderResourceGroup& group = static_cast<ShaderResourceGroup&>(groupBase);
|
||||
auto& device = static_cast<Device&>(GetDevice());
|
||||
group.m_compiledDataIndex = (group.m_compiledDataIndex + 1) % RHI::Limits::Device::FrameCountMax;
|
||||
|
||||
if (!groupData.IsAnyResourceTypeUpdated())
|
||||
{
|
||||
return RHI::ResultCode::Success;
|
||||
}
|
||||
|
||||
if (m_constantBufferSize &&
|
||||
groupData.IsResourceTypeEnabledForCompilation(static_cast<uint32_t>(RHI::ShaderResourceGroupData::ResourceTypeMask::ConstantDataMask)))
|
||||
group.m_compiledDataIndex = (group.m_compiledDataIndex + 1) % RHI::Limits::Device::FrameCountMax;
|
||||
if (m_constantBufferSize)
|
||||
{
|
||||
memcpy(group.GetCompiledData().m_cpuConstantAddress, groupData.GetConstantData().data(), groupData.GetConstantData().size());
|
||||
}
|
||||
|
||||
if (m_viewsDescriptorTableSize &&
|
||||
groupData.IsResourceTypeEnabledForCompilation(
|
||||
static_cast<uint32_t>(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewMask) |
|
||||
static_cast<uint32_t>(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewMask)))
|
||||
if (m_viewsDescriptorTableSize)
|
||||
{
|
||||
//Lazy initialization for cbv/srv/uav Descriptor Tables
|
||||
if (!group.m_viewsDescriptorTable.IsValid())
|
||||
@@ -243,17 +239,12 @@ namespace AZ
|
||||
UpdateViewsDescriptorTable(descriptorTable, groupData);
|
||||
}
|
||||
|
||||
if (m_unboundedArrayCount &&
|
||||
groupData.IsResourceTypeEnabledForCompilation(
|
||||
static_cast<uint32_t>(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewUnboundedArrayMask) |
|
||||
static_cast<uint32_t>(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewUnboundedArrayMask)))
|
||||
if (m_unboundedArrayCount)
|
||||
{
|
||||
UpdateUnboundedArrayDescriptorTables(group, groupData);
|
||||
}
|
||||
|
||||
if (m_samplersDescriptorTableSize &&
|
||||
groupData.IsResourceTypeEnabledForCompilation(
|
||||
static_cast<uint32_t>(RHI::ShaderResourceGroupData::ResourceTypeMask::SamplerMask)))
|
||||
if (m_samplersDescriptorTableSize)
|
||||
{
|
||||
const DescriptorTable descriptorTable(
|
||||
group.m_samplersDescriptorTable.GetOffset() + group.m_compiledDataIndex * m_samplersDescriptorTableSize,
|
||||
|
||||
@@ -104,13 +104,13 @@ namespace AZ
|
||||
RHI::ResultCode ShaderResourceGroupPool::CompileGroupInternal(RHI::ShaderResourceGroup& groupBase, const RHI::ShaderResourceGroupData& groupData)
|
||||
{
|
||||
auto& group = static_cast<ShaderResourceGroup&>(groupBase);
|
||||
group.UpdateCompiledDataIndex(m_currentIteration);
|
||||
|
||||
if (!groupData.IsAnyResourceTypeUpdated())
|
||||
{
|
||||
return RHI::ResultCode::Success;
|
||||
}
|
||||
|
||||
group.UpdateCompiledDataIndex(m_currentIteration);
|
||||
DescriptorSet& descriptorSet = *group.m_compiledData[group.GetCompileDataIndex()];
|
||||
|
||||
const RHI::ShaderResourceGroupLayout* layout = groupData.GetLayout();
|
||||
|
||||
Reference in New Issue
Block a user