Skip to content

Commit

Permalink
MAINT: rename variables and methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Odd Kiva committed Nov 27, 2023
1 parent 8b4eba4 commit ae9fbb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cpp/examples/Shakti/Vulkan/hello_vulkan_image/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class VulkanImageRenderer : public kvk::GraphicsBackend
static_cast<std::uint32_t>(_swapchain.images.size());

// Each descriptor set has the same uniform descriptor layout.
const auto& ubo_layout = _graphics_pipeline.model_view_projection_layout();
const auto& ubo_layout = _graphics_pipeline.descriptor_set_layout();
const auto ubo_layout_handle =
static_cast<VkDescriptorSetLayout>(ubo_layout);

Expand All @@ -292,7 +292,7 @@ class VulkanImageRenderer : public kvk::GraphicsBackend
static_cast<std::uint32_t>(_swapchain.images.size());

// Each descriptor set has the same uniform descriptor layout.
const auto& ubo_layout = _graphics_pipeline.model_view_projection_layout();
const auto& ubo_layout = _graphics_pipeline.descriptor_set_layout();
const auto ubo_layout_handle =
static_cast<VkDescriptorSetLayout>(ubo_layout);

Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/Shakti/Vulkan/hello_vulkan_triangle/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class VulkanTriangleRenderer : public kvk::GraphicsBackend
static_cast<std::uint32_t>(_swapchain.images.size());

// Each descriptor set has the same uniform descriptor layout.
const auto& ubo_layout = _graphics_pipeline.model_view_projection_layout();
const auto& ubo_layout = _graphics_pipeline.descriptor_set_layout();
const auto ubo_layout_handle =
static_cast<VkDescriptorSetLayout>(ubo_layout);

Expand Down
12 changes: 6 additions & 6 deletions cpp/src/DO/Shakti/Vulkan/GraphicsPipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ namespace DO::Kalpana::Vulkan {
return _device;
}

auto model_view_projection_layout() const
auto descriptor_set_layout() const
-> const Shakti::Vulkan::DescriptorSetLayout&
{
return _mvp_layout;
return _desc_set_layout;
}

auto pipeline_layout() const -> VkPipelineLayout
Expand All @@ -94,15 +94,15 @@ namespace DO::Kalpana::Vulkan {
auto swap(GraphicsPipeline& other) -> void
{
std::swap(_device, other._device);
_mvp_layout.swap(other._mvp_layout);
_desc_set_layout.swap(other._desc_set_layout);
std::swap(_pipeline_layout, other._pipeline_layout);
std::swap(_pipeline, other._pipeline);
}

private:
VkDevice _device = nullptr;
// Model View Projection matrix stack etc.
Shakti::Vulkan::DescriptorSetLayout _mvp_layout;
Shakti::Vulkan::DescriptorSetLayout _desc_set_layout;
VkPipelineLayout _pipeline_layout = nullptr;
VkPipeline _pipeline = nullptr;
};
Expand Down Expand Up @@ -212,7 +212,7 @@ namespace DO::Kalpana::Vulkan {

graphics_pipeline._device = device;

graphics_pipeline._mvp_layout =
graphics_pipeline._desc_set_layout =
Shakti::Vulkan::DescriptorSetLayout::Builder{device}
.push_uniform_buffer_layout_binding()
.create();
Expand All @@ -225,7 +225,7 @@ namespace DO::Kalpana::Vulkan {
VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipeline_layout_info.setLayoutCount = 1;
pipeline_layout_info.pSetLayouts =
&static_cast<VkDescriptorSetLayout&>(graphics_pipeline._mvp_layout);
&static_cast<VkDescriptorSetLayout&>(graphics_pipeline._desc_set_layout);
pipeline_layout_info.pushConstantRangeCount = 0;
};
auto status = vkCreatePipelineLayout( //
Expand Down

0 comments on commit ae9fbb0

Please sign in to comment.