UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MetalCommandEncoder.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "MetalRHIPrivate.h"
6#include "MetalBuffer.h"
7#include "MetalFence.h"
8#include "MetalPipeline.h"
9#include "MetalProfiler.h"
10#include "MetalCounterSampler.h"
11
15class FMetalDevice;
20
22
24{
37 {
38 MTL::Buffer* ArgumentBuffer;
39 NS::UInteger ArgumentOffset;
40 };
42 union
43 {
44 MTL::DrawPrimitivesIndirectArguments Draw;
45 MTL::DrawIndexedPrimitivesIndirectArguments DrawIndexed;
46 MTL::DrawPatchIndirectArguments DrawPatch;
47 MTL::DispatchThreadgroupsIndirectArguments Dispatch;
49 };
50 FString ToString() const;
51};
52
62
64{
65 enum Type
66 {
67 None = 0,
68 BeforeVertex = 1 << 0, // Wait fence before VS/CS is executed
69 BeforeFragment = 1 << 1, // Wait fence before PS is executed
70 };
71};
72
73// An emulator of MTLBarrierScope that is supported since IOS 16.0
105
107{
108 // Resources produced in the prologue pass
110 // Fence written by the prologue pass
112 // The barrier state for the current pass
114
116
118 {
119 FenceResources = MoveTemp(In.FenceResources);
120 Fence = In.Fence;
121 }
122
124 {
125 if (this != &lhs)
126 {
127 FenceResources = MoveTemp(lhs.FenceResources);
128 Fence = lhs.Fence;
129 }
130 return *this;
131 }
132
133 void Reset()
134 {
135 FenceResources.Empty();
136 Fence = nullptr;
138 }
139};
140
149{
150public:
151#pragma mark - Public C++ Boilerplate -
152
155
157 void Release(void);
158
160 void Reset(void);
161
163 void ResetLive(void);
164
165#pragma mark - Public Command Buffer Mutators -
166
171 void StartCommandBuffer(void);
172
177
178#pragma mark - Public Command Buffer Accessors -
179
181 FMetalCommandBuffer* GetCommandBuffer() { return CommandBuffer; }
182
184 uint32 GetCommandBufferIndex() const { return CmdBufIndex; }
185
186#pragma mark - Public Command Encoder Accessors -
187
190 {
191 return ParallelRenderCommandEncoder.get() != nullptr;
192 }
193
195 inline bool IsRenderCommandEncoderActive(void) const
196 {
197 return RenderCommandEncoder.get() != nullptr;
198 }
199
201 inline bool IsComputeCommandEncoderActive(void) const
202 {
203 return ComputeCommandEncoder.get() != nullptr;
204 }
205
207 inline bool IsBlitCommandEncoderActive(void) const
208 {
209 return BlitCommandEncoder.get() != nullptr;
210 }
211
213 inline bool IsAnyCommandEncoderActive(void) const
214 {
217#if METAL_RHI_RAYTRACING
219#endif
222 }
223
224 inline bool IsParallelEncoding()
225 {
226 return bIsParallelEncoding;
227 }
228
229#if METAL_RHI_RAYTRACING
232#endif // METAL_RHI_RAYTRACING
233
235 bool IsRenderPassDescriptorValid(void) const;
236
238 const MTL::RenderPassDescriptor* GetRenderPassDescriptor(void) const;
239
241 MTL::RenderCommandEncoder* GetRenderCommandEncoder(void);
242
244 MTL::ComputeCommandEncoder* GetComputeCommandEncoder(void);
245
247 MTL::BlitCommandEncoder* GetBlitCommandEncoder(void);
248
249#if METAL_RHI_RAYTRACING
251 MTL::AccelerationStructureCommandEncoder* GetAccelerationStructureCommandEncoder(void);
252#endif // METAL_RHI_RAYTRACING
253
256
258 uint32 NumEncodedPasses(void) const { return EncoderNum; }
259
260#pragma mark - Public Command Encoder Mutators -
261
266
271
275 void BeginRenderCommandEncoding(MTL::RenderPassDescriptor* RenderPassDesc, MTLParallelRenderCommandEncoderPtr ParallelEncoder);
276
278 void BeginComputeCommandEncoding(MTL::DispatchType Type = MTL::DispatchTypeSerial, FMetalCounterSampler* Sampler = nullptr);
279
280#if METAL_RHI_RAYTRACING
283#endif // METAL_RHI_RAYTRACING
284
287
290
292 void UpdateFence(FMetalFence* Fence);
293
295 void WaitForFence(FMetalFence* Fence);
296
299
302
303#pragma mark - Public Debug Support -
304
305 /*
306 * Inserts a debug string into the command buffer. This does not change any API behavior, but can be useful when debugging.
307 * @param string The name of the signpost.
308 */
309 void InsertDebugSignpost(NS::String* String);
310
311 /*
312 * Push a new named string onto a stack of string labels.
313 * @param string The name of the debug group.
314 */
315 void PushDebugGroup(NS::String* String);
316
317 /* Pop the latest named string off of the stack. */
318 void PopDebugGroup(void);
319
320#if ENABLE_METAL_GPUPROFILE
321 /* Get the command-buffer stats object. */
323#endif
324
325#pragma mark - Public Render State Mutators -
326
331 void SetRenderPassDescriptor(MTL::RenderPassDescriptor* RenderPass);
332
339 void SetRenderPassStoreActions(MTL::StoreAction const* const ColorStore, MTL::StoreAction const DepthStore, MTL::StoreAction const StencilStore);
340
341 /*
342 * Sets the current render pipeline state object.
343 * @param PipelineState The pipeline state to set. Must not be null.
344 */
345 void SetRenderPipelineState(FMetalShaderPipeline* const PipelineState);
346
347 /*
348 * Set the viewport, which is used to transform vertexes from normalized device coordinates to window coordinates. Fragments that lie outside of the viewport are clipped, and optionally clamped for fragments outside of znear/zfar.
349 * @param Viewport The array of viewport dimensions to use.
350 * @param NumActive The number of active viewport dimensions to use.
351 */
352 void SetViewport(MTL::Viewport const Viewport[], uint32 NumActive);
353
354 /*
355 * The winding order of front-facing primitives.
356 * @param FrontFacingWinding The front face winding.
357 */
358 void SetFrontFacingWinding(MTL::Winding const FrontFacingWinding);
359
360 /*
361 * Controls if primitives are culled when front facing, back facing, or not culled at all.
362 * @param CullMode The cull mode.
363 */
364 void SetCullMode(MTL::CullMode const CullMode);
365
366 /*
367 * Depth Bias.
368 * @param DepthBias The depth-bias value.
369 * @param SlopeScale The slope-scale to apply.
370 * @param Clamp The value to clamp to.
371 */
372 void SetDepthBias(float const DepthBias, float const SlopeScale, float const Clamp);
373
374 /*
375 * Specifies a rectangle for a fragment scissor test. All fragments outside of this rectangle are discarded.
376 * @param Rect The array of scissor rect dimensions.
377 * @param NumActive The number of active scissor rect dimensions.
378 */
379 void SetScissorRect(MTL::ScissorRect const Rect[], uint32 NumActive);
380
381 /*
382 * Set how to rasterize triangle and triangle strip primitives.
383 * @param FillMode The fill mode.
384 */
385 void SetTriangleFillMode(MTL::TriangleFillMode const FillMode);
386
387 /*
388 * Set wether to clip or clamp triangles based on depth.
389 * @param FillMode The fill mode.
390 */
391 void SetDepthClipMode(MTL::DepthClipMode DepthClipMode);
392
393 /*
394 * Set the constant blend color used across all blending on all render targets
395 * @param Red The value for the red channel in 0-1.
396 * @param Green The value for the green channel in 0-1.
397 * @param Blue The value for the blue channel in 0-1.
398 * @param Alpha The value for the alpha channel in 0-1.
399 */
400 void SetBlendColor(float const Red, float const Green, float const Blue, float const Alpha);
401
402 /*
403 * Set the DepthStencil state object.
404 * @param DepthStencilState The depth-stencil state, must not be null.
405 */
406 void SetDepthStencilState(MTL::DepthStencilState* DepthStencilState);
407
408 /*
409 * Set the stencil reference value for both the back and front stencil buffers.
410 * @param ReferenceValue The stencil ref value to use.
411 */
412 void SetStencilReferenceValue(uint32 const ReferenceValue);
413
414 /*
415 * Monitor if samples pass the depth and stencil tests.
416 * @param Mode Controls if the counter is disabled or moniters passing samples.
417 * @param Offset The offset relative to the occlusion query buffer provided when the command encoder was created. offset must be a multiple of 8.
418 */
419 void SetVisibilityResultMode(MTL::VisibilityResultMode const Mode, NS::UInteger const Offset);
420
421#pragma mark - Public Shader Resource Mutators -
422#if METAL_RHI_RAYTRACING
423 /*
424 * Set a global acceleration structure for the specified shader frequency at the given bind point index.
425 * @param FunctionType The shader function to modify.
426 * @param AccelerationStructure The acceleration structure to bind or nullptr to clear.
427 * @param Index The index to modify.
428 */
429 void SetShaderAccelerationStructure(MTL::FunctionType const FunctionType, MTLAccelerationStructurePtr AccelerationStructure, NS::UInteger const Index);
430#endif // METAL_RHI_RAYTRACING
431
432 /*
433 * Set a global buffer for the specified shader frequency at the given bind point index.
434 * @param FunctionType The shader function to modify.
435 * @param Buffer The buffer to bind or nullptr to clear.
436 * @param Offset The offset in the buffer or 0 when Buffer is nullptr.
437 * @param Length The data length - caller is responsible for accounting for non-zero Offset.
438 * @param Index The index to modify.
439 * @param Usage The resource usage mask.
440 * @param Format The Pixel format to reinterpret the resource as.
441 * @param ReferencedResources Resources indirectly used by the bound buffer.
442 */
443 void SetShaderBuffer(MTL::FunctionType const FunctionType, FMetalBufferPtr Buffer, NS::UInteger const Offset, NS::UInteger const Length, NS::UInteger const Index, MTL::ResourceUsage const Usage, EPixelFormat const Format = PF_Unknown, NS::UInteger const ElementRowPitch = 0, TArray<TTuple<MTL::Resource*, MTL::ResourceUsage>> ReferencedResources = {});
444
445 /*
446 * Set an FMetalBufferData to the specified shader frequency at the given bind point index.
447 * @param FunctionType The shader function to modify.
448 * @param Data The data to bind or nullptr to clear.
449 * @param Offset The offset in the buffer or 0 when Buffer is nullptr.
450 * @param Index The index to modify.
451 * @param Format The pixel format to reinterpret the resource as.
452 */
453 void SetShaderData(MTL::FunctionType const FunctionType, FMetalBufferData* Data, NS::UInteger const Offset, NS::UInteger const Index, EPixelFormat const Format = PF_Unknown, NS::UInteger const ElementRowPitch = 0);
454
455 /*
456 * Set bytes to the specified shader frequency at the given bind point index.
457 * @param FunctionType The shader function to modify.
458 * @param Bytes The data to bind or nullptr to clear.
459 * @param Length The length of the buffer or 0 when Bytes is nullptr.
460 * @param Index The index to modify.
461 */
462 void SetShaderBytes(MTL::FunctionType const FunctionType, uint8 const* Bytes, NS::UInteger const Length, NS::UInteger const Index);
463
464 /*
465 * Set a global texture for the specified shader frequency at the given bind point index.
466 * @param FunctionType The shader function to modify.
467 * @param Texture The texture to bind or nullptr to clear.
468 * @param Index The index to modify.
469 * @param Usage The resource usage mask.
470 */
471 void SetShaderTexture(MTL::FunctionType const FunctionType, MTL::Texture* Texture, NS::UInteger const Index, MTL::ResourceUsage const Usage);
472
473 /*
474 * Set a global sampler for the specified shader frequency at the given bind point index.
475 * @param FunctionType The shader function to modify.
476 * @param Sampler The sampler state to bind or nullptr to clear.
477 * @param Index The index to modify.
478 */
479 void SetShaderSamplerState(MTL::FunctionType const FunctionType, MTL::SamplerState* Sampler, NS::UInteger const Index);
480
481 /*
482 * Set the shader side-table data for FunctionType at Index.
483 * @param FunctionType The shader function to modify.
484 * @param Index The index to bind data to.
485 */
486 void SetShaderSideTable(MTL::FunctionType const FunctionType, NS::UInteger const Index);
487
488 /*
489 * Inform the driver that an indirect argument resource will be used and what the usage mode will be.
490 * @param Texture The texture that will be used as an indirect argument.
491 * @param Usage The usage mode for the texture.
492 */
493 void UseIndirectArgumentResource(MTL::Texture* Texture, MTL::ResourceUsage const Usage);
494
495 /*
496 * Inform the driver that an indirect argument resource will be used and what the usage mode will be.
497 * @param Buffer The buffer that will be used as an indirect argument.
498 * @param Usage The usage mode for the texture.
499 */
500 void UseIndirectArgumentResource(FMetalBufferPtr Buffer, MTL::ResourceUsage const Usage);
501
502 /*
503 * Transition resource so that we can barrier fragment->vertex stages.
504 * @param Resource The resource we are going to make readable having been written.
505 */
506 void TransitionResources(MTL::Resource* Resource);
507
508#pragma mark - Public Compute State Mutators -
509
510 /*
511 * Set the compute pipeline state that will be used.
512 * @param State The state to set - must not be nullptr.
513 */
515
516#pragma mark - Public Ring-Buffer Accessor -
517
518 /*
519 * Get the internal ring-buffer used for temporary allocations.
520 * @returns The temporary allocation buffer for this command-encoder.
521 */
523
524#pragma mark - Public Resource query Access -
525
526private:
527#pragma mark - Private Functions -
528 /*
529 * Set the offset for the buffer bound on the specified shader frequency at the given bind point index.
530 * @param FunctionType The shader function to modify.
531 * @param Offset The offset in the buffer or 0 when Buffer is nullptr.
532 * @param Length The data length - caller is responsible for accounting for non-zero Offset.
533 * @param Index The index to modify.
534 */
535 void SetShaderBufferOffset(MTL::FunctionType const FunctionType, NS::UInteger const Offset, NS::UInteger const Length, NS::UInteger const Index);
536
537 void SetShaderBufferInternal(MTL::FunctionType Function, uint32 Index);
538
539 void FenceResource(MTL::Texture* Resource, const MTL::FunctionType Function, bool bIsRenderTarget = false);
540 void FenceResource(MTL::Buffer* Resource, const MTL::FunctionType Function);
541
542public:
543 void UseResource(MTL::Resource* Resource, MTL::ResourceUsage const Usage);
544 void UseResources(TArray<MTL::Resource*> const& Resources, MTL::ResourceUsage const Usage, MTL::RenderStages RenderStages = 0);
545 void UseHeaps(TArray<MTL::Heap*> const& Heaps, const MTL::FunctionType Function);
546
547#pragma mark - Private Type Declarations -
548private:
550 struct FMetalBufferBindings
551 {
553 FMetalBufferData* SideTable;
557#if METAL_RHI_RAYTRACING
560#endif // METAL_RHI_RAYTRACING
562 FMetalBufferData* Bytes[ML_MaxBuffers];
564 NS::UInteger Offsets[ML_MaxBuffers];
566 MTL::ResourceUsage Usage[ML_MaxBuffers];
580 uint32 Bound;
581
582public:
583 void SetBufferMetaData(NS::UInteger Index, NS::UInteger Length, NS::UInteger Format, NS::UInteger ElementRowPitch)
584 {
585 Lengths[Index].Length = Length;
586 Lengths[Index].Format = Format;
587 Lengths[Index].ElementRowPitch = ElementRowPitch;
588 }
589 void SetTextureSwizzle(NS::UInteger Index, uint8 (&Swizzle)[4])
590 {
591 FMemory::Memcpy(&Lengths[ML_MaxBuffers + Index].Swizzle, Swizzle, sizeof(Swizzle));
592 Lengths[ML_MaxBuffers + Index].Format = 0;
593 Lengths[ML_MaxBuffers + Index].ElementRowPitch = 0;
594 }
595 };
596
597#pragma mark - Private Member Variables -
598 FMetalDevice& Device;
599 FMetalCommandList& CommandList;
600
601 FMetalBufferBindings ShaderBuffers[int(MTL::FunctionTypeObject)+1];
602
603 MTL::StoreAction ColorStoreActions[MaxSimultaneousRenderTargets];
604 MTL::StoreAction DepthStoreAction;
605 MTL::StoreAction StencilStoreAction;
606
607 FMetalSubBufferRing RingBuffer;
608
609 MTL::RenderPassDescriptor* RenderPassDesc = nullptr;
610
611 FMetalCommandBuffer* CommandBuffer = nullptr;
612
613 MTLParallelRenderCommandEncoderPtr ParallelRenderCommandEncoder;
614 MTLRenderCommandEncoderPtr RenderCommandEncoder;
615 MTLComputeCommandEncoderPtr ComputeCommandEncoder;
616 MTLBlitCommandEncoderPtr BlitCommandEncoder;
617#if METAL_RHI_RAYTRACING
619#endif // METAL_RHI_RAYTRACING
620
621 TRefCountPtr<FMetalFence> EncoderFence;
622#if ENABLE_METAL_GPUPROFILE
624#endif
625
626 TArray<NS::String*> DebugGroups;
627
628 TSet<FMetalBufferPtr> ActiveBuffers;
629
631
632 TSet<MTL::Resource*> TransitionedResources;
633 FMetalCommandEncoderFence CommandEncoderFence;
634 uint32 EncoderNum;
635 uint32 CmdBufIndex;
636 bool bIsParallelEncoding = false;
637};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
TSharedPtr< FMetalShaderPipeline, ESPMode::ThreadSafe > FMetalShaderPipelinePtr
Definition MetalCommandEncoder.h:19
@ ML_MaxTextures
Definition MetalPipeline.h:49
@ ML_MaxBuffers
Definition MetalPipeline.h:48
EPixelFormat
Definition PixelFormat.h:16
@ PF_Unknown
Definition PixelFormat.h:17
@ MaxSimultaneousRenderTargets
Definition RHIDefinitions.h:287
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Offset
Definition VulkanMemory.cpp:4033
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition MetalResources.h:355
Definition MetalCommandBuffer.h:17
Definition MetalCommandEncoder.h:149
void WaitForFence(FMetalFence *Fence)
Definition MetalCommandEncoder.cpp:894
void SetScissorRect(MTL::ScissorRect const Rect[], uint32 NumActive)
Definition MetalCommandEncoder.cpp:1115
void SetShaderData(MTL::FunctionType const FunctionType, FMetalBufferData *Data, NS::UInteger const Offset, NS::UInteger const Index, EPixelFormat const Format=PF_Unknown, NS::UInteger const ElementRowPitch=0)
Definition MetalCommandEncoder.cpp:1245
MTL::RenderCommandEncoder * GetRenderCommandEncoder(void)
Definition MetalCommandEncoder.cpp:335
void SetShaderTexture(MTL::FunctionType const FunctionType, MTL::Texture *Texture, NS::UInteger const Index, MTL::ResourceUsage const Usage)
Definition MetalCommandEncoder.cpp:1373
void StartCommandBuffer(void)
Definition MetalCommandEncoder.cpp:231
void ResetLive(void)
Definition MetalCommandEncoder.cpp:186
bool IsAnyCommandEncoderActive(void) const
Definition MetalCommandEncoder.h:213
void SetBlendColor(float const Red, float const Green, float const Blue, float const Alpha)
Definition MetalCommandEncoder.cpp:1148
void SetComputePipelineState(FMetalShaderPipelinePtr State)
Definition MetalCommandEncoder.cpp:1460
void UseIndirectArgumentResource(MTL::Texture *Texture, MTL::ResourceUsage const Usage)
Definition MetalCommandEncoder.cpp:1440
TRefCountPtr< FMetalFence > EndEncoding()
Definition MetalCommandEncoder.cpp:638
void SetRenderPassStoreActions(MTL::StoreAction const *const ColorStore, MTL::StoreAction const DepthStore, MTL::StoreAction const StencilStore)
Definition MetalCommandEncoder.cpp:1053
MTL::BlitCommandEncoder * GetBlitCommandEncoder(void)
Definition MetalCommandEncoder.cpp:347
void SetViewport(MTL::Viewport const Viewport[], uint32 NumActive)
Definition MetalCommandEncoder.cpp:1074
const MTL::RenderPassDescriptor * GetRenderPassDescriptor(void) const
Definition MetalCommandEncoder.cpp:330
bool IsBlitCommandEncoderActive(void) const
Definition MetalCommandEncoder.h:207
void WaitForEvent(MTLEventPtr Event, uint32_t SignalCount)
Definition MetalCommandEncoder.cpp:917
void UseHeaps(TArray< MTL::Heap * > const &Heaps, const MTL::FunctionType Function)
Definition MetalCommandEncoder.cpp:1548
bool IsParallelRenderCommandEncoderActive(void) const
Definition MetalCommandEncoder.h:189
void SetVisibilityResultMode(MTL::VisibilityResultMode const Mode, NS::UInteger const Offset)
Definition MetalCommandEncoder.cpp:1172
uint32 GetCommandBufferIndex() const
Definition MetalCommandEncoder.h:184
bool IsParallelEncoding()
Definition MetalCommandEncoder.h:224
void BeginComputeCommandEncoding(MTL::DispatchType Type=MTL::DispatchTypeSerial, FMetalCounterSampler *Sampler=nullptr)
Definition MetalCommandEncoder.cpp:515
void UseResources(TArray< MTL::Resource * > const &Resources, MTL::ResourceUsage const Usage, MTL::RenderStages RenderStages=0)
Definition MetalCommandEncoder.cpp:1609
void PushDebugGroup(NS::String *String)
Definition MetalCommandEncoder.cpp:952
FMetalCommandBuffer * GetCommandBuffer()
Definition MetalCommandEncoder.h:181
TRefCountPtr< FMetalFence > const & GetEncoderFence(void) const
Definition MetalCommandEncoder.cpp:361
void SignalEvent(MTLEventPtr Event, uint32_t SignalCount)
Definition MetalCommandEncoder.cpp:906
MTLParallelRenderCommandEncoderPtr BeginParallelRenderCommandEncoding(FMetalCounterSampler *Sampler)
Definition MetalCommandEncoder.cpp:454
void SetDepthClipMode(MTL::DepthClipMode DepthClipMode)
Definition MetalCommandEncoder.cpp:1140
void SetRenderPipelineState(FMetalShaderPipeline *const PipelineState)
Definition MetalCommandEncoder.cpp:1066
void SetDepthBias(float const DepthBias, float const SlopeScale, float const Clamp)
Definition MetalCommandEncoder.cpp:1107
void SetShaderBytes(MTL::FunctionType const FunctionType, uint8 const *Bytes, NS::UInteger const Length, NS::UInteger const Index)
Definition MetalCommandEncoder.cpp:1270
void InsertDebugSignpost(NS::String *String)
Definition MetalCommandEncoder.cpp:927
void BeginRenderCommandEncoding(FMetalCounterSampler *Sampler)
Definition MetalCommandEncoder.cpp:368
void Release(void)
Definition MetalCommandEncoder.cpp:103
void SetShaderBuffer(MTL::FunctionType const FunctionType, FMetalBufferPtr Buffer, NS::UInteger const Offset, NS::UInteger const Length, NS::UInteger const Index, MTL::ResourceUsage const Usage, EPixelFormat const Format=PF_Unknown, NS::UInteger const ElementRowPitch=0, TArray< TTuple< MTL::Resource *, MTL::ResourceUsage > > ReferencedResources={})
Definition MetalCommandEncoder.cpp:1204
void BeginBlitCommandEncoding(FMetalCounterSampler *Sampler)
Definition MetalCommandEncoder.cpp:561
void SetStencilReferenceValue(uint32 const ReferenceValue)
Definition MetalCommandEncoder.cpp:1164
void PopDebugGroup(void)
Definition MetalCommandEncoder.cpp:980
bool IsRenderPassDescriptorValid(void) const
Definition MetalCommandEncoder.cpp:325
void UpdateFence(FMetalFence *Fence)
Definition MetalCommandEncoder.cpp:868
void SetShaderSideTable(MTL::FunctionType const FunctionType, NS::UInteger const Index)
Definition MetalCommandEncoder.cpp:1432
void SetFrontFacingWinding(MTL::Winding const FrontFacingWinding)
Definition MetalCommandEncoder.cpp:1091
void SetCullMode(MTL::CullMode const CullMode)
Definition MetalCommandEncoder.cpp:1099
FMetalSubBufferRing & GetRingBuffer(void)
Definition MetalCommandEncoder.cpp:1470
void SetDepthStencilState(MTL::DepthStencilState *DepthStencilState)
Definition MetalCommandEncoder.cpp:1156
MTL::ComputeCommandEncoder * GetComputeCommandEncoder(void)
Definition MetalCommandEncoder.cpp:341
void TransitionResources(MTL::Resource *Resource)
Definition MetalCommandEncoder.cpp:1453
void SetRenderPassDescriptor(MTL::RenderPassDescriptor *RenderPass)
Definition MetalCommandEncoder.cpp:1015
bool IsComputeCommandEncoderActive(void) const
Definition MetalCommandEncoder.h:201
void SetShaderSamplerState(MTL::FunctionType const FunctionType, MTL::SamplerState *Sampler, NS::UInteger const Index)
Definition MetalCommandEncoder.cpp:1409
void EndCommandBuffer(FMetalRHICommandContext *Context)
Definition MetalCommandEncoder.cpp:262
void Reset(void)
Definition MetalCommandEncoder.cpp:138
bool IsRenderCommandEncoderActive(void) const
Definition MetalCommandEncoder.h:195
void SetTriangleFillMode(MTL::TriangleFillMode const FillMode)
Definition MetalCommandEncoder.cpp:1132
uint32 NumEncodedPasses(void) const
Definition MetalCommandEncoder.h:258
void UseResource(MTL::Resource *Resource, MTL::ResourceUsage const Usage)
Definition MetalCommandEncoder.cpp:1582
Definition MetalCommandList.h:19
Definition MetalCommandQueue.h:39
Definition MetalComputeShader.h:19
Definition MetalCounterSampler.h:65
Definition MetalDevice.h:102
Definition MetalFence.h:12
Definition MetalGraphicsPipelineState.h:18
Definition MetalRHIContext.h:48
Definition MetalPipeline.h:110
Definition MetalBuffer.h:184
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition RefCounting.h:454
Definition SharedPointer.h:692
Definition MetalCommandEncoder.h:64
Type
Definition MetalCommandEncoder.h:66
@ BeforeFragment
Definition MetalCommandEncoder.h:69
@ BeforeVertex
Definition MetalCommandEncoder.h:68
@ None
Definition MetalCommandEncoder.h:67
int
Definition TestServer.py:515
U16 Index
Definition radfft.cpp:71
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
Definition MetalCommandEncoder.h:75
FMetalBarrierScope()
Definition MetalCommandEncoder.h:80
EMetalFenceWaitStage::Type TexturesWaitStage
Definition MetalCommandEncoder.h:78
EMetalFenceWaitStage::Type GetFenceWaitStage()
Definition MetalCommandEncoder.h:92
void Reset()
Definition MetalCommandEncoder.h:85
EMetalFenceWaitStage::Type BuffersWaitStage
Definition MetalCommandEncoder.h:76
EMetalFenceWaitStage::Type RenderTargetsWaitStage
Definition MetalCommandEncoder.h:77
Definition MetalProfiler.h:277
Definition MetalCommandEncoder.h:37
MTL::Buffer * ArgumentBuffer
Definition MetalCommandEncoder.h:38
NS::UInteger ArgumentOffset
Definition MetalCommandEncoder.h:39
Definition MetalCommandEncoder.h:24
Type
Definition MetalCommandEncoder.h:26
MTL::DispatchThreadgroupsIndirectArguments Dispatch
Definition MetalCommandEncoder.h:47
MTL::DrawPrimitivesIndirectArguments Draw
Definition MetalCommandEncoder.h:44
FString ToString() const
Definition MetalCommandEncoder.cpp:34
DispatchIndirectArgs DispatchIndirect
Definition MetalCommandEncoder.h:48
MTL::DrawPatchIndirectArguments DrawPatch
Definition MetalCommandEncoder.h:46
MTL::DrawIndexedPrimitivesIndirectArguments DrawIndexed
Definition MetalCommandEncoder.h:45
Type CommandType
Definition MetalCommandEncoder.h:41
Definition MetalCommandEncoder.h:54
FMetalCommandData Data
Definition MetalCommandEncoder.h:60
FMetalComputeShader * ComputeShader
Definition MetalCommandEncoder.h:59
uint32 Encoder
Definition MetalCommandEncoder.h:56
uint32 CmdBufIndex
Definition MetalCommandEncoder.h:55
FMetalGraphicsPipelineState * PSO
Definition MetalCommandEncoder.h:58
uint32 Index
Definition MetalCommandEncoder.h:57
Definition MetalCommandEncoder.h:107
TSet< MTL::Resource * > FenceResources
Definition MetalCommandEncoder.h:109
FMetalCommandEncoderFence(FMetalCommandEncoderFence &&In)
Definition MetalCommandEncoder.h:117
void Reset()
Definition MetalCommandEncoder.h:133
FMetalCommandEncoderFence & operator=(FMetalCommandEncoderFence &&lhs)
Definition MetalCommandEncoder.h:123
FMetalCommandEncoderFence()=default
TRefCountPtr< FMetalFence > Fence
Definition MetalCommandEncoder.h:111
FMetalBarrierScope BarrierScope
Definition MetalCommandEncoder.h:113
uint32 ElementRowPitch
Definition MetalCommandEncoder.h:576
uint32 Length
Definition MetalCommandEncoder.h:572
uint32 Swizzle
Definition MetalCommandEncoder.h:573
uint32 Format
Definition MetalCommandEncoder.h:575
Definition LinuxPlatformSplash.cpp:43
Definition Tuple.h:652