diff options
author | Frederico Linhares <fred@linhares.blue> | 2023-09-30 16:35:55 -0300 |
---|---|---|
committer | Frederico Linhares <fred@linhares.blue> | 2023-09-30 16:35:55 -0300 |
commit | e5b15b871f0cf73563431565a492d9ae3e92e35b (patch) | |
tree | 34582bf9495d60636888e7d271aef919122beab6 /src/core.cpp | |
parent | 8b7b509077c52093a9fa936c0462248a24646c90 (diff) |
refa Remove redundant descriptor sets
* src/vk/light.hpp: Move to this class, the descriptor sets used for
lighting by the 3D graphics pipelines.
Diffstat (limited to 'src/core.cpp')
-rw-r--r-- | src/core.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core.cpp b/src/core.cpp index 2f3cd77..0197e97 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -623,6 +623,25 @@ unload_vk_graphics_pipeline_2d_wired_layout(void *obj) } void +load_vk_light(void *obj) +{ + try + { + cg_core.vk_light = new VK::Light(); + } + catch(const CommandError &e) + { + throw CommandError{"Failed to descriptor sets for light."}; + } +} + +void +unload_vk_light(void *obj) +{ + delete cg_core.vk_light; +} + +void load_vk_graphics_pipeline_3d(void *obj) { try @@ -774,6 +793,7 @@ const CommandChain cg_sCore::loader{ &unload_vk_graphics_pipeline_2d_solid_layout}, {&load_vk_graphics_pipeline_2d_wired_layout, &unload_vk_graphics_pipeline_2d_wired_layout}, + {&load_vk_light, &unload_vk_light}, // TODO: finish skeletal mesh animation // {&load_vk_graphics_pipeline_3d_skeletal, // &unload_vk_graphics_pipeline_3d_skeletal}, |