From b027a7573c4520b2e0d2bdaf3d7ae41b12f8215c Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Tue, 1 Oct 2024 20:20:47 -0700 Subject: [PATCH] feat: cleanup Signed-off-by: Michael Pollind --- Source/Metal/CommandBufferMTL.mm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Source/Metal/CommandBufferMTL.mm b/Source/Metal/CommandBufferMTL.mm index 2810030f..4dbadb66 100644 --- a/Source/Metal/CommandBufferMTL.mm +++ b/Source/Metal/CommandBufferMTL.mm @@ -2,15 +2,12 @@ #include "CommandBufferMTL.h" -//#include "AccelerationStructureVK.h" #include "BufferMTL.h" #include "CommandBufferMTL.h" #include "CommandQueueMTL.h" -//#include "DescriptorSetMTL.h" #include "DescriptorMTL.h" #include "PipelineLayoutMTL.h" #include "PipelineMTL.h" -//#include "QueryPoolMTL.h" #include "TextureMTL.h" #include @@ -28,11 +25,13 @@ Result CommandBufferMTL::Begin(const DescriptorPool* descriptorPool) { [m_Handle computeCommandEncoderWithDescriptor: NULL]; } + Result CommandBufferMTL::End() { m_ComputeEncoder = nil; m_RendererEncoder = nil; } + void CommandBufferMTL::SetPipeline(const Pipeline& pipeline) { if (m_CurrentPipeline == (PipelineMTL*)&pipeline) return; @@ -93,6 +92,15 @@ } void CommandBufferMTL::BeginRendering(const AttachmentsDesc& attachmentsDesc) { + MTLRenderPassDescriptor* renderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor]; + for(uint32_t i = 0; i < attachmentsDesc.colorNum; i++) { + + } + + //renderPassDescriptor.colorAttachments[ + + //renderPassDescriptor.colorAttachments + m_RendererEncoder = [m_Handle renderCommandEncoderWithDescriptor: NULL]; } void CommandBufferMTL::EndRendering() { @@ -182,10 +190,9 @@ // TODO: implement count Buffer NSCAssert(!countBuffer, @"count buffer not supported"); [m_RendererEncoder - drawPrimitives: m_CurrentPipeline->m_primitiveType - indirectBuffer:((BufferMTL&)buffer).GetHandle() + drawPrimitives: m_CurrentPipeline->m_primitiveType + indirectBuffer:((BufferMTL&)buffer).GetHandle() indirectBufferOffset: offset]; - } void CommandBufferMTL::DrawIndexedIndirect(const Buffer& buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const Buffer* countBuffer, uint64_t countBufferOffset) {