Skip to content

Commit

Permalink
igl | Remove old multiDrawIndirect()
Browse files Browse the repository at this point in the history
Summary: Removed unused code.

Reviewed By: EricGriffith, rudybear, rameshviswanathan

Differential Revision: D57806942

fbshipit-source-id: 7fed698cba0f656d4832be11e4a731a3397fb8ff
  • Loading branch information
corporateshark authored and facebook-github-bot committed May 31, 2024
1 parent a591a10 commit f38d97b
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 75 deletions.
5 changes: 0 additions & 5 deletions src/igl/RenderCommandEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ class IRenderCommandEncoder : public ICommandEncoder {
uint32_t firstIndex = 0,
int32_t vertexOffset = 0,
uint32_t baseInstance = 0) = 0;
virtual void multiDrawIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
uint32_t drawCount = 1,
uint32_t stride = 0) = 0; // old-n-sad
virtual void multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
Expand Down
5 changes: 0 additions & 5 deletions src/igl/metal/RenderCommandEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ class RenderCommandEncoder final : public IRenderCommandEncoder {
uint32_t firstIndex,
int32_t vertexOffset,
uint32_t baseInstance) override;
void multiDrawIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
uint32_t drawCount,
uint32_t stride) override;
void multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
Expand Down
20 changes: 0 additions & 20 deletions src/igl/metal/RenderCommandEncoder.mm
Original file line number Diff line number Diff line change
Expand Up @@ -424,26 +424,6 @@
#endif // IGL_PLATFORM_IOS
}

void RenderCommandEncoder::multiDrawIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
// Ignore bugprone-easily-swappable-parameters
// @lint-ignore CLANGTIDY
size_t indirectBufferOffset,
uint32_t drawCount,
uint32_t stride) {
IGL_ASSERT(encoder_);
stride = stride ? stride : sizeof(MTLDrawPrimitivesIndirectArguments);
auto& indirectBufferRef = (Buffer&)(indirectBuffer);
MTLPrimitiveType metalPrimitive = convertPrimitiveType(primitiveType);

for (uint32_t drawIndex = 0; drawIndex < drawCount; drawIndex++) {
getCommandBuffer().incrementCurrentDrawCount();
[encoder_ drawPrimitives:metalPrimitive
indirectBuffer:indirectBufferRef.get()
indirectBufferOffset:indirectBufferOffset + static_cast<size_t>(stride) * drawIndex];
}
}

void RenderCommandEncoder::multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
// Ignore bugprone-easily-swappable-parameters
Expand Down
8 changes: 0 additions & 8 deletions src/igl/opengl/RenderCommandEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,6 @@ void RenderCommandEncoder::drawIndexed(PrimitiveType primitiveType,
}
}

void RenderCommandEncoder::multiDrawIndirect(PrimitiveType /*primitiveType*/,
IBuffer& /*indirectBuffer*/,
size_t /*indirectBufferOffset*/,
uint32_t /*drawCount*/,
uint32_t /*stride*/) {
IGL_ASSERT_NOT_IMPLEMENTED();
}

void RenderCommandEncoder::multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
Expand Down
5 changes: 0 additions & 5 deletions src/igl/opengl/RenderCommandEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ class RenderCommandEncoder final : public IRenderCommandEncoder, public WithCont
uint32_t firstIndex,
int32_t vertexOffset,
uint32_t baseInstance) override;
void multiDrawIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
uint32_t drawCount,
uint32_t stride) override;
void multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
Expand Down
27 changes: 0 additions & 27 deletions src/igl/vulkan/RenderCommandEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,33 +682,6 @@ void RenderCommandEncoder::drawIndexed(PrimitiveType primitiveType,
cmdBuffer_, (uint32_t)indexCount, instanceCount, firstIndex, vertexOffset, baseInstance);
}

void RenderCommandEncoder::multiDrawIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
uint32_t drawCount,
uint32_t stride) {
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DRAW);
IGL_PROFILER_ZONE_GPU_COLOR_VK(
"multiDrawIndirect()", ctx_.tracyCtx_, cmdBuffer_, IGL_PROFILER_COLOR_DRAW);

IGL_ASSERT_MSG(rps_, "Did you forget to call bindRenderPipelineState()?");

ensureVertexBuffers();

dynamicState_.setTopology(primitiveTypeToVkPrimitiveTopology(primitiveType));
flushDynamicState();

ctx_.drawCallCount_ += drawCallCountEnabled_;

const igl::vulkan::Buffer* bufIndirect = static_cast<igl::vulkan::Buffer*>(&indirectBuffer);

ctx_.vf_.vkCmdDrawIndirect(cmdBuffer_,
bufIndirect->getVkBuffer(),
indirectBufferOffset,
drawCount,
stride ? stride : sizeof(VkDrawIndirectCommand));
}

void RenderCommandEncoder::multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
Expand Down
5 changes: 0 additions & 5 deletions src/igl/vulkan/RenderCommandEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ class RenderCommandEncoder : public IRenderCommandEncoder {
uint32_t firstIndex,
int32_t vertexOffset,
uint32_t baseInstance) override;
void multiDrawIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
uint32_t drawCount,
uint32_t stride = 0) override;
void multiDrawIndexedIndirect(PrimitiveType primitiveType,
IBuffer& indirectBuffer,
size_t indirectBufferOffset,
Expand Down

0 comments on commit f38d97b

Please sign in to comment.