Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 10, 2023
1 parent 9c1c09f commit 397745c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 49 deletions.
12 changes: 2 additions & 10 deletions Common/GPU/Vulkan/VulkanQueueRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1338,11 +1338,7 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c

case VKRRenderCommand::DRAW_INDEXED:
if (pipelineOK) {
VkDescriptorSet set;
if (c.drawIndexed.ds)
set = c.drawIndexed.ds;
else
set = vkrPipelineLayout->descSets_[curFrame][c.drawIndexed.descSetIndex].set;
VkDescriptorSet set = vkrPipelineLayout->descSets_[curFrame][c.drawIndexed.descSetIndex].set;
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &set, c.drawIndexed.numUboOffsets, c.drawIndexed.uboOffsets);
vkCmdBindIndexBuffer(cmd, c.drawIndexed.ibuffer, c.drawIndexed.ioffset, VK_INDEX_TYPE_UINT16);
VkDeviceSize voffset = c.drawIndexed.voffset;
Expand All @@ -1353,11 +1349,7 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c

case VKRRenderCommand::DRAW:
if (pipelineOK) {
VkDescriptorSet set;
if (c.drawIndexed.ds)
set = c.drawIndexed.ds;
else
set = vkrPipelineLayout->descSets_[curFrame][c.drawIndexed.descSetIndex].set;
VkDescriptorSet set = vkrPipelineLayout->descSets_[curFrame][c.drawIndexed.descSetIndex].set;
_dbg_assert_(set != VK_NULL_HANDLE);
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &set, c.draw.numUboOffsets, c.draw.uboOffsets);
if (c.draw.vbuffer) {
Expand Down
2 changes: 0 additions & 2 deletions Common/GPU/Vulkan/VulkanQueueRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ struct VkRenderData {
VKRPipelineLayout *pipelineLayout;
} compute_pipeline;
struct {
VkDescriptorSet ds;
uint32_t descSetIndex;
int numUboOffsets;
uint32_t uboOffsets[3];
Expand All @@ -80,7 +79,6 @@ struct VkRenderData {
uint32_t offset;
} draw;
struct {
VkDescriptorSet ds;
uint32_t descSetIndex;
uint32_t uboOffsets[3];
uint16_t numUboOffsets;
Expand Down
38 changes: 1 addition & 37 deletions Common/GPU/Vulkan/VulkanRenderManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class VulkanRenderManager {
PendingDescSet &descSet = curPipelineLayout_->descSets_[curFrame].push_uninitialized();
descSet.offset = (uint32_t)offset;
descSet.count = count;
descSet.set = VK_NULL_HANDLE; // to be filled in
// descSet.set = VK_NULL_HANDLE; // to be filled in
return setIndex;
}

Expand All @@ -478,7 +478,6 @@ class VulkanRenderManager {
data.cmd = VKRRenderCommand::DRAW;
data.draw.count = count;
data.draw.offset = offset;
data.draw.ds = VK_NULL_HANDLE;
data.draw.descSetIndex = setIndex;
data.draw.vbuffer = vbuffer;
data.draw.voffset = voffset;
Expand All @@ -489,30 +488,13 @@ class VulkanRenderManager {
curRenderStep_->render.numDraws++;
}

void Draw(VkDescriptorSet descSet, int numUboOffsets, const uint32_t *uboOffsets, VkBuffer vbuffer, int voffset, int count, int offset = 0) {
_dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER && curStepHasViewport_ && curStepHasScissor_);
VkRenderData &data = curRenderStep_->commands.push_uninitialized();
data.cmd = VKRRenderCommand::DRAW;
data.draw.count = count;
data.draw.offset = offset;
data.draw.ds = descSet;
data.draw.vbuffer = vbuffer;
data.draw.voffset = voffset;
data.draw.numUboOffsets = numUboOffsets;
_dbg_assert_(numUboOffsets <= ARRAY_SIZE(data.draw.uboOffsets));
for (int i = 0; i < numUboOffsets; i++)
data.draw.uboOffsets[i] = uboOffsets[i];
curRenderStep_->render.numDraws++;
}

void DrawIndexed(const PackedDescriptor *desc, int descCount, int numUboOffsets, const uint32_t *uboOffsets, VkBuffer vbuffer, int voffset, VkBuffer ibuffer, int ioffset, int count, int numInstances) {
_dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER && curStepHasViewport_ && curStepHasScissor_);
int setIndex = BindDescriptors(desc, descCount);
VkRenderData &data = curRenderStep_->commands.push_uninitialized();
data.cmd = VKRRenderCommand::DRAW_INDEXED;
data.drawIndexed.count = count;
data.drawIndexed.instances = numInstances;
data.drawIndexed.ds = VK_NULL_HANDLE;
data.drawIndexed.descSetIndex = setIndex;
data.drawIndexed.vbuffer = vbuffer;
data.drawIndexed.voffset = voffset;
Expand All @@ -525,24 +507,6 @@ class VulkanRenderManager {
curRenderStep_->render.numDraws++;
}

void DrawIndexed(VkDescriptorSet descSet, int numUboOffsets, const uint32_t *uboOffsets, VkBuffer vbuffer, int voffset, VkBuffer ibuffer, int ioffset, int count, int numInstances) {
_dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER && curStepHasViewport_ && curStepHasScissor_);
VkRenderData &data = curRenderStep_->commands.push_uninitialized();
data.cmd = VKRRenderCommand::DRAW_INDEXED;
data.drawIndexed.count = count;
data.drawIndexed.instances = numInstances;
data.drawIndexed.ds = descSet;
data.drawIndexed.vbuffer = vbuffer;
data.drawIndexed.voffset = voffset;
data.drawIndexed.ibuffer = ibuffer;
data.drawIndexed.ioffset = ioffset;
data.drawIndexed.numUboOffsets = numUboOffsets;
_dbg_assert_(numUboOffsets <= ARRAY_SIZE(data.drawIndexed.uboOffsets));
for (int i = 0; i < numUboOffsets; i++)
data.drawIndexed.uboOffsets[i] = uboOffsets[i];
curRenderStep_->render.numDraws++;
}

// These can be useful both when inspecting in RenderDoc, and when manually inspecting recorded commands
// in the debugger.
void DebugAnnotate(const char *annotation) {
Expand Down

0 comments on commit 397745c

Please sign in to comment.