From 1c2f5ab6d5fa60ac25d0891a673c528c974fd90c Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:58:54 -0700 Subject: [PATCH] Add support for LowEndRenderPipeline for mobile and the cleanup associated with it (#2292) Signed-off-by: moudgils --- .../DiffuseGlobalFullscreen_nomsaa.pass | 51 -------- .../Passes/LightCullingTilePrepare.pass | 63 ---------- .../Assets/Passes/PassTemplates.azasset | 4 - .../ReflectionGlobalFullscreen_nomsaa.pass | 119 ------------------ .../DiffuseComposite_nomsaa.shader | 56 --------- .../DiffuseGlobalFullscreen_nomsaa.shader | 56 --------- .../DiffuseProbeGridDownsample_nomsaa.shader | 34 ----- .../LightCulling/LightCullingTilePrepare.azsl | 18 ++- .../ReflectionComposite_nomsaa.shader | 53 -------- .../ReflectionGlobalFullscreen_nomsaa.shader | 44 ------- .../atom_feature_common_asset_files.cmake | 14 --- .../CoreLights/LightCullingTilePreparePass.h | 2 +- .../Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp | 5 - .../Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp | 11 -- Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp | 5 - .../RPI.Public/Shader/ShaderResourceGroup.cpp | 2 +- 16 files changed, 15 insertions(+), 522 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass delete mode 100644 Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass delete mode 100644 Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass deleted file mode 100644 index 71121967a0..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass +++ /dev/null @@ -1,51 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "DiffuseGlobalFullscreenPass_nomsaaTemplate", - "PassClass": "FullScreenTriangle", - "Slots": [ - { - "Name": "AlbedoInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "NormalInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "DepthStencilTextureInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader", - "ImageViewDesc": { - "AspectFlags": [ - "Depth" - ] - } - }, - { - "Name": "DiffuseInputOutput", - "SlotType": "InputOutput", - "ScopeAttachmentUsage": "RenderTarget" - }, - { - "Name": "DepthStencilInputOutput", - "SlotType": "InputOutput", - "ScopeAttachmentUsage": "DepthStencil" - } - ], - "PassData": { - "$type": "FullscreenTrianglePassData", - "ShaderAsset": { - "FilePath": "Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader" - }, - "StencilRef": 128, // See RenderCommon.h and DiffuseGlobalFullscreen.shader - "PipelineViewTag": "MainCamera" - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass b/Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass deleted file mode 100644 index 83803bcbb7..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "LightCullingTilePrepareTemplate", - "PassClass": "LightCullingTilePreparePass", - "Slots": [ - { - "Name": "TileLightData", - "SlotType": "Output", - "ShaderInputName": "m_tileLightData", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "Depth", - "SlotType": "Input", - "ShaderInputName": "m_depthBuffer", - "ScopeAttachmentUsage": "Shader", - "ImageViewDesc": { - "AspectFlags": [ - "Depth" - ] - } - } - ], - "ImageAttachments": [ - { - "Name": "TileLightData", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "Depth" - }, - "Multipliers": { - "WidthMultiplier": 0.0625, - "HeightMultiplier": 0.0625 - } - }, - "ImageDescriptor": { - "Format": "R32G32B32A32_UINT" - } - } - ], - "Connections": [ - { - "LocalSlot": "TileLightData", - "AttachmentRef": { - "Pass": "This", - "Attachment": "TileLightData" - } - } - ], - "PassData": { - "$type": "ComputePassData", - "ShaderAsset": { - "FilePath": "Shaders/LightCulling/LightCullingTilePrepare.shader" - } - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index 702ac8fe72..57d35fb48d 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -212,10 +212,6 @@ "Name": "LightCullingTemplate", "Path": "Passes/LightCulling.pass" }, - { - "Name": "LightCullingTilePrepareTemplate", - "Path": "Passes/LightCullingTilePrepare.pass" - }, { "Name": "LightCullingTilePrepareMSAATemplate", "Path": "Passes/LightCullingTilePrepareMSAA.pass" diff --git a/Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass b/Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass deleted file mode 100644 index 26c90b90e5..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass +++ /dev/null @@ -1,119 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "ReflectionGlobalFullscreenPass_nomsaaTemplate", - "PassClass": "FullScreenTriangle", - "Slots": [ - { - "Name": "DepthStencilTextureInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader", - "ImageViewDesc": { - "AspectFlags": [ - "Depth" - ] - } - }, - { - "Name": "NormalInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "SpecularF0Input", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "ReflectionBlendWeightInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "BRDFTextureInput", - "ShaderInputName": "m_brdfMap", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "DepthStencilInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "DepthStencil", - "ImageViewDesc": { - "AspectFlags": [ - "Stencil" - ] - } - }, - { - "Name": "ReflectionOutput", - "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget", - "LoadStoreAction": { - "ClearValue": { - "Value": [ - 0.4000000059604645, - 0.4000000059604645, - 0.4000000059604645, - 0.0 - ] - }, - "LoadAction": "Clear" - } - } - ], - "ImageAttachments": [ - { - "Name": "ReflectionImage", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "SpecularF0Input" - } - }, - "MultisampleSource": { - "Pass": "This", - "Attachment": "SpecularF0Input" - }, - "ImageDescriptor": { - "Format": "R16G16B16A16_FLOAT", - "SharedQueueMask": "Graphics" - } - }, - { - "Name": "BRDFTexture", - "Lifetime": "Imported", - "AssetRef": { - "FilePath": "Textures/BRDFTexture.attimage" - } - } - ], - "Connections": [ - { - "LocalSlot": "ReflectionOutput", - "AttachmentRef": { - "Pass": "This", - "Attachment": "ReflectionImage" - } - }, - { - "LocalSlot": "BRDFTextureInput", - "AttachmentRef": { - "Pass": "This", - "Attachment": "BRDFTexture" - } - } - ], - "PassData": { - "$type": "FullscreenTrianglePassData", - "ShaderAsset": { - "FilePath": "Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader" - }, - "PipelineViewTag": "MainCamera" - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader deleted file mode 100644 index 76b64b6a19..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Source" : "DiffuseComposite_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0x80", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "Equal", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "BlendState" : { - "Enable" : true, - "BlendSource" : "One", - "BlendDest" : "One", - "BlendOp" : "Add", - "BlendAlphaSource" : "Zero", - "BlendAlphaDest" : "One", - "BlendAlphaOp" : "Add" - }, - - "DrawList" : "forward", - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader deleted file mode 100644 index c8aba3e4a7..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Source" : "DiffuseGlobalFullscreen_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0x80", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "Equal", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "BlendState" : { - "Enable" : true, - "BlendSource" : "One", - "BlendDest" : "One", - "BlendOp" : "Add", - "BlendAlphaSource" : "Zero", - "BlendAlphaDest" : "One", - "BlendAlphaOp" : "Add" - }, - - "DrawList" : "forward", - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader deleted file mode 100644 index 2dd5fb2419..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Source" : "DiffuseProbeGridDownsample_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : true, // required to bind the depth buffer SRV - "CompareFunc" : "Always" - } - }, - - "DrawList" : "forward", - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl index 8daaf482d4..dc0477fc36 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl @@ -66,9 +66,7 @@ void StoreTransparentMinMaxIntoSharedMemory(float2 data) ShaderResourceGroup PassSrg : SRG_PerPass { - // We will use one or the other depending upon if MSAA is enabled or not - Texture2D m_depthBuffer; - Texture2DMS m_depthBufferMSAA; + Texture2DMS m_depthBufferMSAA; // Depth buffer where we rendered the nearest pixels of transparent objects Texture2D m_depthBufferTransparentMin; @@ -282,9 +280,19 @@ void MainCS( float2 minmaxDepth_transparent = ReadTransparentMinMaxMSAA(dispatchThreadID.xy); - if (o_msaaMode == MsaaMode::Msaa2x) + if (o_msaaMode == MsaaMode::None || o_msaaMode == MsaaMode::Msaa2x) { - float2 opaqueDepthSamples = ReadOpaqueDepthSamples2xMSAA(dispatchThreadID.xy); + float2 opaqueDepthSamples; + if (o_msaaMode == MsaaMode::None) + { + float depth = PassSrg::m_depthBufferMSAA.Load(dispatchThreadID.xy, 0).x; + opaqueDepthSamples = float2(depth, depth); + } + else if (o_msaaMode == MsaaMode::Msaa2x) + { + opaqueDepthSamples = ReadOpaqueDepthSamples2xMSAA(dispatchThreadID.xy); + } + // Transparent geometry can't be behind opaque geometry. Just pick the first MSAA sample since we are trying to reduce reading from MSAA buffer minmaxDepth_transparent = DEPTH_MIN(minmaxDepth_transparent, opaqueDepthSamples.x); opaqueDepthSamples = ReplaceSkyPixelsWithFurthestPixelsFromTransparentObjects2x(opaqueDepthSamples, minmaxDepth_transparent); diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader deleted file mode 100644 index a7c893e5e8..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader +++ /dev/null @@ -1,53 +0,0 @@ -{ - "Source" : "ReflectionComposite_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false, - "WriteMask" : "Zero", - "CompareFunc" : "GreaterEqual" - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0xFF", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "LessEqual", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "BlendState" : { - "Enable" : true, - "BlendSource" : "One", - "BlendDest" : "One", - "BlendOp" : "Add" - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader deleted file mode 100644 index 13700a1fe0..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader +++ /dev/null @@ -1,44 +0,0 @@ -{ - "Source" : "ReflectionGlobalFullscreen_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0xFF", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "Equal", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index 4368f267c5..75181517a4 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -113,7 +113,6 @@ set(FILES Passes/DepthUpsample.pass Passes/DiffuseComposite.pass Passes/DiffuseGlobalFullscreen.pass - Passes/DiffuseGlobalFullscreen_nomsaa.pass Passes/DiffuseGlobalIllumination.pass Passes/DiffuseProbeGridBlendDistance.pass Passes/DiffuseProbeGridBlendIrradiance.pass @@ -152,7 +151,6 @@ set(FILES Passes/LightCullingHeatmap.pass Passes/LightCullingParent.pass Passes/LightCullingRemap.pass - Passes/LightCullingTilePrepare.pass Passes/LightCullingTilePrepareMSAA.pass Passes/LookModificationComposite.pass Passes/LookModificationTransform.pass @@ -176,7 +174,6 @@ set(FILES Passes/ReflectionComposite.pass Passes/ReflectionCopyFrameBuffer.pass Passes/ReflectionGlobalFullscreen.pass - Passes/ReflectionGlobalFullscreen_nomsaa.pass Passes/ReflectionProbeBlendWeight.pass Passes/ReflectionProbeRenderInner.pass Passes/ReflectionProbeRenderOuter.pass @@ -190,7 +187,6 @@ set(FILES Passes/ReflectionScreenSpaceComposite.pass Passes/ReflectionScreenSpaceMobile.pass Passes/ReflectionScreenSpaceTrace.pass - Passes/Reflections_nomsaa.pass Passes/ShadowParent.pass Passes/Skinning.pass Passes/SkyBox.pass @@ -320,16 +316,10 @@ set(FILES Shaders/Depth/DepthPassTransparentMin.shader Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl Shaders/DiffuseGlobalIllumination/DiffuseComposite.shader - Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.azsl - Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen.azsl Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen.shader - Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.azsl - Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample.azsl Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample.shader - Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.azsl - Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader Shaders/ImGui/ImGui.azsl Shaders/ImGui/ImGui.shader Shaders/LightCulling/LightCulling.azsl @@ -442,12 +432,8 @@ set(FILES Shaders/Reflections/ReflectionCommon.azsli Shaders/Reflections/ReflectionComposite.azsl Shaders/Reflections/ReflectionComposite.shader - Shaders/Reflections/ReflectionComposite_nomsaa.azsl - Shaders/Reflections/ReflectionComposite_nomsaa.shader Shaders/Reflections/ReflectionGlobalFullscreen.azsl Shaders/Reflections/ReflectionGlobalFullscreen.shader - Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.azsl - Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader Shaders/Reflections/ReflectionProbeBlendWeight.azsl Shaders/Reflections/ReflectionProbeBlendWeight.shader Shaders/Reflections/ReflectionProbeRenderCommon.azsli diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h index ccc707f575..f320c34629 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h @@ -38,7 +38,7 @@ namespace AZ static Name GetLightCullingTilePreparePassTemplateName() { - return AZ::Name("LightCullingTilePrepareTemplate"); + return AZ::Name("LightCullingTilePrepareMSAATemplate"); } private: diff --git a/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp b/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp index de20ea1a18..1a984e43ef 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp @@ -122,11 +122,6 @@ namespace Platform return reinterpret_cast([nativeWindow.contentViewController view]); } - void ApplyTileDimentions(MTLRenderPassDescriptor* mtlRenderPassDescriptor) - { - AZ_UNUSED(mtlRenderPassDescriptor); - } - void SynchronizeBufferOnCPU(id mtlBuffer, size_t bufferOffset, size_t bufferSize) { if(mtlBuffer.storageMode == MTLStorageModeManaged) diff --git a/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp b/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp index 0f07323525..faa1216c25 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp @@ -88,17 +88,6 @@ namespace Platform return reinterpret_cast([nativeWindow.rootViewController view]); } - void ApplyTileDimentions(MTLRenderPassDescriptor* mtlRenderPassDescriptor) - { - //Metal driver has a bug where if the tile dimensions changes between passes it will - //generate incorrect vertex positions (possible vertex invariance). For example vertex invariance was - //observed between Depth pass and forward pass. Hence for now we are setting global tile dimentions across all passes. - //For performance sake we should eventually remove this once this bug is addressed. - //[GFX_TODO][ATOM-13440] - Remove once driver bug is addressed. - mtlRenderPassDescriptor.tileWidth = 16; - mtlRenderPassDescriptor.tileHeight = 16; - } - void SynchronizeBufferOnCPU(id mtlBuffer, size_t bufferOffset, size_t bufferSize) { //No synchronization needed as ios uses shared memory and does not support MTLStorageModeManaged diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp index aad1b848e5..d70a4d4e60 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp @@ -17,10 +17,6 @@ #include #include -namespace Platform -{ - void ApplyTileDimentions(MTLRenderPassDescriptor* mtlRenderPassDescriptor); -} namespace AZ { @@ -88,7 +84,6 @@ namespace AZ { AZ_Assert(m_renderPassDescriptor == nil, "m_renderPassDescriptor should be null"); m_renderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor]; - Platform::ApplyTileDimentions(m_renderPassDescriptor); } if(GetEstimatedItemCount()) 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 e00a51d867..499365a9a9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -98,7 +98,7 @@ namespace AZ { return RHI::ResultCode::Fail; } - m_shaderResourceGroup->SetName(srgName); + m_shaderResourceGroup->SetName(m_pool->GetRHIPool()->GetName()); m_data = RHI::ShaderResourceGroupData(m_layout); m_asset = { &shaderAsset, AZ::Data::AssetLoadBehavior::PreLoad };