|
2 | 2 |
|
3 | 3 | #include "CommandBufferMTL.h" |
4 | 4 |
|
5 | | -//#include "AccelerationStructureVK.h" |
6 | 5 | #include "BufferMTL.h" |
7 | 6 | #include "CommandBufferMTL.h" |
8 | 7 | #include "CommandQueueMTL.h" |
9 | | -//#include "DescriptorSetMTL.h" |
10 | 8 | #include "DescriptorMTL.h" |
11 | 9 | #include "PipelineLayoutMTL.h" |
12 | 10 | #include "PipelineMTL.h" |
13 | | -//#include "QueryPoolMTL.h" |
14 | 11 | #include "TextureMTL.h" |
15 | 12 |
|
16 | 13 | #include <math.h> |
|
28 | 25 | Result CommandBufferMTL::Begin(const DescriptorPool* descriptorPool) { |
29 | 26 | [m_Handle computeCommandEncoderWithDescriptor: NULL]; |
30 | 27 | } |
| 28 | + |
31 | 29 | Result CommandBufferMTL::End() { |
32 | 30 | m_ComputeEncoder = nil; |
33 | 31 | m_RendererEncoder = nil; |
34 | 32 |
|
35 | 33 | } |
| 34 | + |
36 | 35 | void CommandBufferMTL::SetPipeline(const Pipeline& pipeline) { |
37 | 36 | if (m_CurrentPipeline == (PipelineMTL*)&pipeline) |
38 | 37 | return; |
|
93 | 92 |
|
94 | 93 | } |
95 | 94 | 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 | + |
96 | 104 | m_RendererEncoder = [m_Handle renderCommandEncoderWithDescriptor: NULL]; |
97 | 105 | } |
98 | 106 | void CommandBufferMTL::EndRendering() { |
|
182 | 190 | // TODO: implement count Buffer |
183 | 191 | NSCAssert(!countBuffer, @"count buffer not supported"); |
184 | 192 | [m_RendererEncoder |
185 | | - drawPrimitives: m_CurrentPipeline->m_primitiveType |
186 | | - indirectBuffer:((BufferMTL&)buffer).GetHandle() |
| 193 | + drawPrimitives: m_CurrentPipeline->m_primitiveType |
| 194 | + indirectBuffer:((BufferMTL&)buffer).GetHandle() |
187 | 195 | indirectBufferOffset: offset]; |
188 | | - |
189 | 196 | } |
190 | 197 | void CommandBufferMTL::DrawIndexedIndirect(const Buffer& buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const Buffer* countBuffer, uint64_t countBufferOffset) { |
191 | 198 |
|
|
0 commit comments