Skip to content

Commit b027a75

Browse files
committed
feat: cleanup
Signed-off-by: Michael Pollind <mpollind@gmail.com>
1 parent f0de1b2 commit b027a75

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Source/Metal/CommandBufferMTL.mm

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
#include "CommandBufferMTL.h"
44

5-
//#include "AccelerationStructureVK.h"
65
#include "BufferMTL.h"
76
#include "CommandBufferMTL.h"
87
#include "CommandQueueMTL.h"
9-
//#include "DescriptorSetMTL.h"
108
#include "DescriptorMTL.h"
119
#include "PipelineLayoutMTL.h"
1210
#include "PipelineMTL.h"
13-
//#include "QueryPoolMTL.h"
1411
#include "TextureMTL.h"
1512

1613
#include <math.h>
@@ -28,11 +25,13 @@
2825
Result CommandBufferMTL::Begin(const DescriptorPool* descriptorPool) {
2926
[m_Handle computeCommandEncoderWithDescriptor: NULL];
3027
}
28+
3129
Result CommandBufferMTL::End() {
3230
m_ComputeEncoder = nil;
3331
m_RendererEncoder = nil;
3432

3533
}
34+
3635
void CommandBufferMTL::SetPipeline(const Pipeline& pipeline) {
3736
if (m_CurrentPipeline == (PipelineMTL*)&pipeline)
3837
return;
@@ -93,6 +92,15 @@
9392

9493
}
9594
void CommandBufferMTL::BeginRendering(const AttachmentsDesc& attachmentsDesc) {
95+
MTLRenderPassDescriptor* renderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];
96+
for(uint32_t i = 0; i < attachmentsDesc.colorNum; i++) {
97+
98+
}
99+
100+
//renderPassDescriptor.colorAttachments[
101+
102+
//renderPassDescriptor.colorAttachments
103+
96104
m_RendererEncoder = [m_Handle renderCommandEncoderWithDescriptor: NULL];
97105
}
98106
void CommandBufferMTL::EndRendering() {
@@ -182,10 +190,9 @@
182190
// TODO: implement count Buffer
183191
NSCAssert(!countBuffer, @"count buffer not supported");
184192
[m_RendererEncoder
185-
drawPrimitives: m_CurrentPipeline->m_primitiveType
186-
indirectBuffer:((BufferMTL&)buffer).GetHandle()
193+
drawPrimitives: m_CurrentPipeline->m_primitiveType
194+
indirectBuffer:((BufferMTL&)buffer).GetHandle()
187195
indirectBufferOffset: offset];
188-
189196
}
190197
void CommandBufferMTL::DrawIndexedIndirect(const Buffer& buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const Buffer* countBuffer, uint64_t countBufferOffset) {
191198

0 commit comments

Comments
 (0)