Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVKCmdDrawIndirect: Fix indirect index for triangle fans. #2420

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
MVKCmdDrawIndirect: Fix indirect index for triangle fans.
Analogously to #2419, this fixes generation to add `vertexStart` to the
_generated_ indices, and start from zero in the array.
  • Loading branch information
cdavis5e committed Jan 13, 2025
commit 947858bd550a98bf1f4e811b2a092d32032674a4
Original file line number Diff line number Diff line change
@@ -334,14 +334,14 @@ kernel void cmdDrawIndirectPopulateIndexes(const device char* srcBuff [[buffer(0
const device auto& src = *reinterpret_cast<const device MTLDrawPrimitivesIndirectArguments*>(srcBuff + idx * srcStride);\n\
device auto& dst = destBuff[idx]; \n\
dst.indexCount = src.vertexCount; \n\
dst.indexStart = src.vertexStart; \n\
dst.indexStart = 0; \n\
dst.baseVertex = 0; \n\
dst.instanceCount = src.instanceCount; \n\
dst.baseInstance = src.baseInstance; \n\
\n\
for (uint32_t idxIdx = 0; idxIdx < dst.indexCount; idxIdx++) { \n\
uint32_t idxBuffIdx = dst.indexStart + idxIdx; \n\
idxBuff[idxBuffIdx] = idxBuffIdx; \n\
idxBuff[idxBuffIdx] = src.vertexStart + idxBuffIdx; \n\
} \n\
} \n\
\n\