Various new metal fixes (#1465)

* - Fix the second window related tabbing issue
- Merge calls to UseResoources acrooaa all the SRGs
- Move SamplerCache to the device to ensure only one cache to reduce duplication
- Fixes to compute threading numbers getting reset to 0,0,0
- Cleanup withing BufferPoolResolver
- Argument buffers are now queued to be cleaned up upon shutdown
This commit is contained in:
moudgils
2021-06-22 08:58:15 -07:00
committed by GitHub
parent 0aad6ad08d
commit 4f84ec90d3
13 changed files with 127 additions and 61 deletions
@@ -30,6 +30,7 @@ namespace AZ
//! It does this by recursively creating Compute Passes to write to each mip using the Compute Shader.
class DownsampleMipChainPass
: public ParentPass
, private ShaderReloadNotificationBus::Handler
{
AZ_RPI_PASS(DownsampleMipChainPass);
@@ -39,6 +40,7 @@ namespace AZ
//! Creates a new pass without a PassTemplate
static Ptr<DownsampleMipChainPass> Create(const PassDescriptor& descriptor);
virtual ~DownsampleMipChainPass();
protected:
explicit DownsampleMipChainPass(const PassDescriptor& descriptor);
@@ -49,6 +51,11 @@ namespace AZ
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
// ShaderReloadNotificationBus::Handler overrides...
void OnShaderReinitialized(const Shader& shader) override;
void OnShaderAssetReinitialized(const Data::Asset<ShaderAsset>& shaderAsset) override;
void OnShaderVariantReinitialized(const ShaderVariant& shaderVariant) override;
private:
// Gets target height, width and mip levels from the input/output image attachment
@@ -54,8 +54,14 @@ namespace AZ
}
m_passData = *passData;
ShaderReloadNotificationBus::Handler::BusConnect(passData->m_shaderReference.m_assetId);
}
DownsampleMipChainPass::~DownsampleMipChainPass()
{
ShaderReloadNotificationBus::Handler::BusDisconnect();
}
void DownsampleMipChainPass::ResetInternal()
{
RemoveChildren();
@@ -206,5 +212,19 @@ namespace AZ
ParentPass::FrameBeginInternal(params);
}
void DownsampleMipChainPass::OnShaderReinitialized([[maybe_unused]] const Shader& shader)
{
m_needToUpdateChildren = true;
}
void DownsampleMipChainPass::OnShaderAssetReinitialized([[maybe_unused]] const Data::Asset<ShaderAsset>& shaderAsset)
{
m_needToUpdateChildren = true;
}
void DownsampleMipChainPass::OnShaderVariantReinitialized([[maybe_unused]] const ShaderVariant& shaderVariant)
{
m_needToUpdateChildren = true;
}
} // namespace RPI
} // namespace AZ