15 OBJC_ID(MTLCommandBuffer) currentCommandBuffer =
nullptr;
16 OBJC_ID(MTLRenderCommandEncoder) currentCommandEncoder =
nullptr;
17 OBJC_ID(MTLComputeCommandEncoder) currentComputeCommandEncoder =
nullptr;
18 OBJC_ID(MTLDepthStencilState) noDepthStencil =
nullptr;
19 int currentPrimitiveType = 0;
21 std::shared_ptr<BufferMTL> indexBuffer;
22 std::shared_ptr<BufferMTL> vertexBuffer;
24 const std::shared_ptr<CommandQueueMTL> owningQueue;
31 void BindRenderPipeline(RGLRenderPipelinePtr)
final;
32 void BeginCompute(RGLComputePipelinePtr)
final;
33 void EndCompute()
final;
34 void DispatchCompute(uint32_t threadsX, uint32_t threadsY, uint32_t threadsZ, uint32_t threadsPerThreadgroupX=1, uint32_t threadsPerThreadgroupY=1, uint32_t threadsPerThreadgroupZ=1)
final;
36 void BeginRendering(RGLRenderPassPtr)
final;
37 void EndRendering()
final;
39 void BindBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer = 0)
final;
40 void BindComputeBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer = 0)
final;
41 void SetVertexBuffer(RGLBufferPtr buffer,
const VertexBufferBinding& bindingInfo = {})
final;
43 void SetIndexBuffer(RGLBufferPtr buffer)
final;
45 void SetVertexBytes(
const untyped_span data, uint32_t offset)
final;
46 void SetFragmentBytes(
const untyped_span data, uint32_t offset)
final;
47 void SetComputeBytes(
const untyped_span data, uint32_t offset)
final;
49 void SetVertexSampler(RGLSamplerPtr sampler, uint32_t index)
final;
50 void SetFragmentSampler(RGLSamplerPtr sampler, uint32_t index)
final;
51 void SetComputeSampler(RGLSamplerPtr sampler, uint32_t index)
final;
53 void SetVertexTexture(
const TextureView& texture, uint32_t index)
final;
54 void SetFragmentTexture(
const TextureView& texture, uint32_t index)
final;
55 void SetComputeTexture(
const TextureView& texture, uint32_t index)
final;
57 void BindBindlessBufferDescriptorSet(uint32_t set_idx)
final;
62 void SetViewport(
const Viewport&)
final;
63 void SetScissor(
const Rect&)
final;
65 void CopyTextureToBuffer(
RGL::TextureView& sourceTexture,
const Rect& sourceRect,
size_t offset, RGLBufferPtr desetBuffer)
final;
68 void CopyBufferToTexture(RGLBufferPtr source, uint32_t size,
const TextureDestConfig& dest)
final;
71 void UseResource(
const RGLBufferPtr buffer)
final;
81 void BeginRenderDebugMarker(
const std::string& label)
final;
82 void BeginComputeDebugMarker(
const std::string& label)
final;
84 void EndRenderDebugMarker()
final;
85 void EndComputeDebugMarker()
final;
87 void BlockUntilCompleted()
final;
89 bool isRender =
false;
91 std::shared_ptr<RenderPipelineMTL> currentRenderPipeline =
nullptr;
92 std::shared_ptr<ComputePipelineMTL> currentComputePipeline =
nullptr;
Definition CommandBuffer.hpp:159
Definition CommandBuffer.hpp:146
Definition Texture.hpp:43