Files
UnrealEngineUWP/Engine/Shaders/Private/UpdateDescriptorHandle.usf
carl lloyd 056d57f3e7 Metal RHI Context Refactor
- Removed MetalContext and MetalRenderPass.
- Removed all code to restart renderpasses
- Added support in the RHI for a new UploadContext which allows uploads to execute before the submission of contexts using them.
- Most functionality is now within MetalRHIContext and removed dependancies so that multiple MetalRHIContext's can execute in parallel.
- MetalDeviceContext has been removed and replaced with MetalDevice.
- Removed the previous FrameAllocator and replaced with a temporary heap based allocator.
- Metal no longer uses SubmitCommandsHint and now builds/submits command buffers through RHIFinalizeContext/RHISubmitCommandLists
- Added initial support for MetalRHI parallel encoding, can be tested with -rhiparallel.
- Removed addition temporary allocations when uploading to buffers

#rb Luke.Thatcher
#jira UE-212349

[CL 35450226 by carl lloyd in ue5-main branch]
2024-08-12 08:41:13 -04:00

40 lines
953 B
Plaintext

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
UpdateDescriptorHandle.usf
=============================================================================*/
#include "Common.ush"
#if COMPILER_METAL_SHADER_CONVERTER
struct MetalDescriptor
{
uint64_t gpuVA;
uint64_t textureViewID;
uint64_t metadata;
};
typedef MetalDescriptor Descriptor;
#else
struct DefaultDescriptor
{
uint64_t gpuIndex;
};
typedef DefaultDescriptor Descriptor;
#endif
uint NumUpdates;
StructuredBuffer<uint> DescriptorIndices;
StructuredBuffer<Descriptor> DescriptorEntries;
RWStructuredBuffer<Descriptor> OutputData;
[numthreads(1, 1, 1)]
void MainCS(uint DispatchThreadId : SV_DispatchThreadID)
{
if(DispatchThreadId < NumUpdates)
{
uint DestEntryIdx = DescriptorIndices[DispatchThreadId];
OutputData[DestEntryIdx] = DescriptorEntries[DispatchThreadId];
}
}