Skip to content

Commit

Permalink
Removed some redundant vkCmdBindDescriptorSets calls.
Browse files Browse the repository at this point in the history
Fixed whitespace a bit
  • Loading branch information
Mankarse committed Jun 20, 2021
1 parent b1f53e6 commit de5a23e
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/hg/FrontEnd/GameDisplayHelpersVulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ inline VkPipelineLayoutCreateInfo makePipelineLayoutCreateInfo(
VkPipelineLayoutCreateInfo pipelineLayoutInfo = {};
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
//TODO: Make 2 set layouts: one for projection uniform and one
// for texture.
// for texture.
pipelineLayoutInfo.setLayoutCount = gsl::narrow<uint32_t>(descriptorSetLayouts.size());
pipelineLayoutInfo.pSetLayouts = descriptorSetLayouts.data();
/*
Expand Down
2 changes: 0 additions & 2 deletions src/hg/FrontEnd/LoadingLevelScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ namespace hg {
vkCmdBeginRenderPass(drawCommandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->graphicsPipeline.h());

vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->pipelineLayout.pipelineLayout, 1, 1, &sceneData->fontTexDescriptorSet, 0, nullptr);

reallyDoRender(preDrawCommandBuffer, drawCommandBuffer, target, targetFrameBuffer);

vkCmdEndRenderPass(drawCommandBuffer);
Expand Down
12 changes: 5 additions & 7 deletions src/hg/FrontEnd/MainMenuScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ class MainMenuSceneRenderer : public SceneRenderer {
vkCmdBeginRenderPass(drawCommandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->graphicsPipeline.h());

vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->pipelineLayout.pipelineLayout, 1, 1, &sceneData->fontTexDescriptorSet, 0, nullptr);

reallyDoRender(preDrawCommandBuffer, drawCommandBuffer, target, targetFrameBuffer);

vkCmdEndRenderPass(drawCommandBuffer);
Expand All @@ -387,11 +385,11 @@ class MainMenuSceneRenderer : public SceneRenderer {

target.updateUniformBuffer(
UniformBufferObject{
//Out x y z v
a, 0.0, 0.0, 0.0,//In x
0.0, b, 0.0, 0.0,//In y
0.0, 0.0, 1.0, 0.0,//In z
c, d, 0.0, 1.0 //In v
//Out x y z v
a, 0.0, 0.0, 0.0,//In x
0.0, b, 0.0, 0.0,//In y
0.0, 0.0, 1.0, 0.0,//In z
c, d, 0.0, 1.0 //In v
}
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/hg/FrontEnd/PostLevelSceneRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ class PostLevelSceneRenderer : public SceneRenderer {
vkCmdBeginRenderPass(drawCommandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->graphicsPipeline.h());

vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->pipelineLayout.pipelineLayout, 1, 1, &sceneData->textures.fontTexDescriptorSet, 0, nullptr);

reallyDoRender(preDrawCommandBuffer, drawCommandBuffer, target, targetFrameBuffer, timelineTexture);

vkCmdEndRenderPass(drawCommandBuffer);
Expand Down
2 changes: 0 additions & 2 deletions src/hg/FrontEnd/RunningGameSceneRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ namespace hg {
vkCmdBeginRenderPass(drawCommandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->graphicsPipeline.h());

vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->pipelineLayout.pipelineLayout, 1, 1, &sceneData->textures.fontTexDescriptorSet, 0, nullptr);

reallyDoRender(preDrawCommandBuffer, drawCommandBuffer, target, targetFrameBuffer, timelineTexture);

vkCmdEndRenderPass(drawCommandBuffer);
Expand Down
2 changes: 0 additions & 2 deletions src/hg/FrontEnd/RuntimeErrorScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ class RuntimeErrorSceneRenderer : public SceneRenderer {
vkCmdBeginRenderPass(drawCommandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->graphicsPipeline.h());

vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->pipelineLayout.pipelineLayout, 1, 1, &sceneData->fontTexDescriptorSet, 0, nullptr);

reallyDoRender(preDrawCommandBuffer, drawCommandBuffer, target, targetFrameBuffer);

vkCmdEndRenderPass(drawCommandBuffer);
Expand Down
2 changes: 0 additions & 2 deletions src/hg/FrontEnd/SelectionScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ namespace hg {
vkCmdBeginRenderPass(drawCommandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->graphicsPipeline.h());

vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, sceneData->pipelineLayout.pipelineLayout, 1, 1, &sceneData->fontTexDescriptorSet, 0, nullptr);

reallyDoRender(preDrawCommandBuffer, drawCommandBuffer, target, targetFrameBuffer);

vkCmdEndRenderPass(drawCommandBuffer);
Expand Down
1 change: 0 additions & 1 deletion src/hg/FrontEnd/VulkanRenderTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ struct VulkanRenderTarget {

uniformBuffers.back().descriptorSets.push_back(descriptorSet);

//vkCmdBindDescriptorSets
vkCmdBindDescriptorSets(drawCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSet, 0, nullptr);
}
void newFrame() {
Expand Down

0 comments on commit de5a23e

Please sign in to comment.