From 397745ce1485f7612c97029efb1bbb10095424c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 9 Oct 2023 21:48:33 +0200 Subject: [PATCH] Remove unused code --- Common/GPU/Vulkan/VulkanQueueRunner.cpp | 12 ++------ Common/GPU/Vulkan/VulkanQueueRunner.h | 2 -- Common/GPU/Vulkan/VulkanRenderManager.h | 38 +------------------------ 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.cpp b/Common/GPU/Vulkan/VulkanQueueRunner.cpp index 0b774b25690f..34f70ec545db 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.cpp +++ b/Common/GPU/Vulkan/VulkanQueueRunner.cpp @@ -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; @@ -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) { diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.h b/Common/GPU/Vulkan/VulkanQueueRunner.h index e26b33cf4ea5..2cbdd3277a3e 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.h +++ b/Common/GPU/Vulkan/VulkanQueueRunner.h @@ -70,7 +70,6 @@ struct VkRenderData { VKRPipelineLayout *pipelineLayout; } compute_pipeline; struct { - VkDescriptorSet ds; uint32_t descSetIndex; int numUboOffsets; uint32_t uboOffsets[3]; @@ -80,7 +79,6 @@ struct VkRenderData { uint32_t offset; } draw; struct { - VkDescriptorSet ds; uint32_t descSetIndex; uint32_t uboOffsets[3]; uint16_t numUboOffsets; diff --git a/Common/GPU/Vulkan/VulkanRenderManager.h b/Common/GPU/Vulkan/VulkanRenderManager.h index 32472682d567..56fa19111efb 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.h +++ b/Common/GPU/Vulkan/VulkanRenderManager.h @@ -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; } @@ -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; @@ -489,22 +488,6 @@ 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); @@ -512,7 +495,6 @@ class VulkanRenderManager { 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; @@ -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) {