summaryrefslogtreecommitdiff
path: root/src/vk/graphics_pipeline_3d.cpp
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2023-01-06 17:30:12 -0300
committerFrederico Linhares <fred@linhares.blue>2023-01-06 17:30:12 -0300
commit62367a0bcca75c45eb3e7d1582c4fff18827ddc7 (patch)
tree0ac14c45bd0236104034d47401edc407ec94c94a /src/vk/graphics_pipeline_3d.cpp
parentb0b61c117c6e2bc7693802f005a2888e7cc073c2 (diff)
refa Use Push constants for sprites and rectangles
Diffstat (limited to 'src/vk/graphics_pipeline_3d.cpp')
-rw-r--r--src/vk/graphics_pipeline_3d.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vk/graphics_pipeline_3d.cpp b/src/vk/graphics_pipeline_3d.cpp
index 790cad7..f915c00 100644
--- a/src/vk/graphics_pipeline_3d.cpp
+++ b/src/vk/graphics_pipeline_3d.cpp
@@ -23,7 +23,7 @@
#include "core.hpp"
#include "image.hpp"
#include "vertex_3d.hpp"
-#include "uniform_buffer_object.hpp"
+#include "uniform_data_object.hpp"
namespace
{
@@ -38,7 +38,7 @@ load_world_vert_uniform_buffer(void *obj)
self->ub_world_vert.reserve(cg_core.vk_swapchain->images_count);
for(auto i{0}; i < cg_core.vk_swapchain->images_count; i++)
self->ub_world_vert.emplace_back(
- cg_core.vk_device_with_swapchain, sizeof(VK::UBOWorld3D_Vert));
+ cg_core.vk_device_with_swapchain, sizeof(VK::ODOWorld3D_Vert));
}
catch(const std::exception& e)
{
@@ -64,7 +64,7 @@ load_world_frag_uniform_buffer(void *obj)
self->ub_world_frag.reserve(cg_core.vk_swapchain->images_count);
for(auto i{0}; i < cg_core.vk_swapchain->images_count; i++)
self->ub_world_frag.emplace_back(
- cg_core.vk_device_with_swapchain, sizeof(VK::UBOWorld3D_Frag));
+ cg_core.vk_device_with_swapchain, sizeof(VK::ODOWorld3D_Frag));
}
catch(const std::exception& e)
{
@@ -148,12 +148,12 @@ load_resources_to_descriptor_sets(void *obj)
VkDescriptorBufferInfo world_vert_info{};
world_vert_info.buffer = self->ub_world_vert[i].buffer;
world_vert_info.offset = 0;
- world_vert_info.range = sizeof(VK::UBOWorld3D_Vert);
+ world_vert_info.range = sizeof(VK::ODOWorld3D_Vert);
VkDescriptorBufferInfo world_frag_info{};
world_frag_info.buffer = self->ub_world_frag[i].buffer;
world_frag_info.offset = 0;
- world_frag_info.range = sizeof(VK::UBOWorld3D_Frag);
+ world_frag_info.range = sizeof(VK::ODOWorld3D_Frag);
std::array<VkWriteDescriptorSet, 2> write_descriptors{};
write_descriptors[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
@@ -587,7 +587,7 @@ GraphicsPipeline3D::draw(
0, 0, 0);
}
- VK::UBOModelInstance ubo_model_instance;
+ VK::ODOModelInstance ubo_model_instance;
for(int i{0}; i < instances.size(); i++)
{
@@ -610,7 +610,7 @@ GraphicsPipeline3D::draw(
// Update view uniform buffers
{
- VK::UBOView3D ubo_view_3d{};
+ VK::ODOView3D ubo_view_3d{};
// View matrix.
ubo_view_3d.view = glm::mat4{1.0f};
@@ -635,11 +635,11 @@ GraphicsPipeline3D::draw(
// Update world uniform buffer
{
- UBOWorld3D_Vert ubo_world_3d_vert{};
+ ODOWorld3D_Vert ubo_world_3d_vert{};
ubo_world_3d_vert.ambient_light_color = glm::vec4{0.25, 0.25, 0.25, 1.0};
this->ub_world_vert[image_index].copy_data(&ubo_world_3d_vert);
- UBOWorld3D_Frag ubo_world_3d_frag{};
+ ODOWorld3D_Frag ubo_world_3d_frag{};
ubo_world_3d_frag.directional_light_direction =
glm::vec3{-0.57735, 0.57735, -0.57735};
ubo_world_3d_frag.directional_light_color = glm::vec4{0.8, 0.8, 0.8, 1.0};