Skip to content

Commit

Permalink
Added counter
Browse files Browse the repository at this point in the history
  • Loading branch information
denis authored and denis committed Dec 6, 2024
1 parent e67f65e commit 404c682
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Engine/Shaders/TransparentPipeline/computeCopy.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,9 @@ void main() {

if (initIndices) {
indicesData[index].x = int(index);
atomicCounterExchange(counterSize, 0);
}
else {
if (index == 0) {
atomicCounterExchange(counterSize, 0);
}

barrier();// Wait till all threads reach this point

int sortedIndex = indicesData[index].x;

Expand Down
2 changes: 1 addition & 1 deletion Engine/src/SceneData/MeshIndirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void Prisma::MeshIndirect::renderMeshes() const
glBindBuffer(GL_PARAMETER_BUFFER_ARB, m_sizeAtomic);
glMemoryBarrier(GL_COMMAND_BARRIER_BIT);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, m_indirectSSBOId, m_indirectDraw);
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_INT, NULL, 0, m_drawCommands.size(), 0);
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_INT, nullptr, 0, m_drawCommands.size(), 0);
glBindBuffer(GL_PARAMETER_BUFFER_ARB, 0);
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0);
}
Expand Down

0 comments on commit 404c682

Please sign in to comment.