Skip to content

Commit

Permalink
Revert "mantle: bind atomic set once"
Browse files Browse the repository at this point in the history
Pointless

This reverts commit 6af705d.
  • Loading branch information
libcg committed Nov 12, 2022
1 parent 6af705d commit bc0e669
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 1 addition & 12 deletions src/mantle/mantle_cmd_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,30 +189,19 @@ static void grCmdBufferBindDescriptorSet(
const BindPoint* bindPoint = &grCmdBuffer->bindPoints[vkBindPoint];
const GrPipeline* grPipeline = bindPoint->grPipeline;

unsigned descriptorSetCount = 1;
const VkDescriptorSet descriptorSets[] = {
bindPoint->descriptorSet,
grCmdBuffer->atomicCounterSet,
};

if (vkBindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS &&
!grCmdBuffer->isGraphicsAtomicSetBound) {
descriptorSetCount = 2;
grCmdBuffer->isGraphicsAtomicSetBound = true;
} else if (vkBindPoint == VK_PIPELINE_BIND_POINT_COMPUTE &&
!grCmdBuffer->isComputeAtomicSetBound) {
descriptorSetCount = 2;
grCmdBuffer->isComputeAtomicSetBound = true;
}

uint32_t dynamicOffsets[MAX_STAGE_COUNT];

for (unsigned i = 0; i < grPipeline->dynamicOffsetCount; i++) {
dynamicOffsets[i] = bindPoint->dynamicOffset;
}

VKD.vkCmdBindDescriptorSets(grCmdBuffer->commandBuffer, vkBindPoint, grPipeline->pipelineLayout,
0, descriptorSetCount, descriptorSets,
0, COUNT_OF(descriptorSets), descriptorSets,
grPipeline->dynamicOffsetCount, dynamicOffsets);
}

Expand Down
2 changes: 0 additions & 2 deletions src/mantle/mantle_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ typedef struct _GrCmdBuffer {
// NOTE: grCmdBufferResetState resets everything past that point
bool isBuilding;
bool isRendering;
bool isGraphicsAtomicSetBound;
bool isComputeAtomicSetBound;
int descriptorPoolIndex;
GrFence* submitFence;
// Graphics and compute bind points
Expand Down

0 comments on commit bc0e669

Please sign in to comment.