Skip to content

Commit

Permalink
feat: cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Pollind <[email protected]>
  • Loading branch information
pollend committed Nov 14, 2024
1 parent f0de1b2 commit b027a75
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Source/Metal/CommandBufferMTL.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <math.h>
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {

Expand Down

0 comments on commit b027a75

Please sign in to comment.