Skip to content

Commit

Permalink
Metal: mesh-indirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Feb 10, 2024
1 parent c9c8680 commit 2d118bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Engine/gapi/metal/mtcommandbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ void MtCommandBuffer::dispatchMesh(size_t x, size_t y, size_t z) {
encDraw->drawMeshThreadgroups(MTL::Size(x,y,z), localSize, localSizeMesh);
}

void MtCommandBuffer::dispatchMeshIndirect(const AbstractGraphicsApi::Buffer& indirect, size_t offset) {
auto& ind = reinterpret_cast<const MtBuffer&>(indirect);
encDraw->drawMeshThreadgroups(ind.impl.get(), offset, localSize, localSizeMesh);
}

void MtCommandBuffer::dispatch(size_t x, size_t y, size_t z) {
encComp->dispatchThreadgroups(MTL::Size(x,y,z), localSize);
}
Expand Down
2 changes: 2 additions & 0 deletions Engine/gapi/metal/mtcommandbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class MtCommandBuffer : public AbstractGraphicsApi::CommandBuffer {
void drawIndirect(const AbstractGraphicsApi::Buffer& indirect, size_t offset) override;

void dispatchMesh(size_t x, size_t y, size_t z) override;
void dispatchMeshIndirect(const AbstractGraphicsApi::Buffer& indirect, size_t offset) override;

void dispatch (size_t x, size_t y, size_t z) override;

void barrier (const AbstractGraphicsApi::BarrierDesc* desc, size_t cnt) override;
Expand Down

0 comments on commit 2d118bf

Please sign in to comment.