Code cleanup
This commit is contained in:
parent
3019e4a7a6
commit
f211a64153
1 changed files with 34 additions and 42 deletions
|
|
@ -55,17 +55,17 @@ public:
|
|||
} uboParams;
|
||||
|
||||
struct {
|
||||
VkPipeline skybox;
|
||||
VkPipeline pbr;
|
||||
VkPipeline skybox{ VK_NULL_HANDLE };
|
||||
VkPipeline pbr{ VK_NULL_HANDLE };
|
||||
} pipelines;
|
||||
|
||||
struct {
|
||||
VkDescriptorSet object;
|
||||
VkDescriptorSet skybox;
|
||||
VkDescriptorSet object{ VK_NULL_HANDLE };
|
||||
VkDescriptorSet skybox{ VK_NULL_HANDLE };
|
||||
} descriptorSets;
|
||||
|
||||
VkPipelineLayout pipelineLayout;
|
||||
VkDescriptorSetLayout descriptorSetLayout;
|
||||
VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE };
|
||||
VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE };
|
||||
|
||||
VulkanExample() : VulkanExampleBase()
|
||||
{
|
||||
|
|
@ -82,6 +82,7 @@ public:
|
|||
|
||||
~VulkanExample()
|
||||
{
|
||||
if (device) {
|
||||
vkDestroyPipeline(device, pipelines.skybox, nullptr);
|
||||
vkDestroyPipeline(device, pipelines.pbr, nullptr);
|
||||
|
||||
|
|
@ -102,6 +103,7 @@ public:
|
|||
textures.metallicMap.destroy();
|
||||
textures.roughnessMap.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void getEnabledFeatures()
|
||||
{
|
||||
|
|
@ -1300,17 +1302,6 @@ public:
|
|||
memcpy(uniformBuffers.params.mapped, &uboParams, sizeof(uboParams));
|
||||
}
|
||||
|
||||
void draw()
|
||||
{
|
||||
VulkanExampleBase::prepareFrame();
|
||||
|
||||
submitInfo.commandBufferCount = 1;
|
||||
submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
|
||||
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
||||
|
||||
VulkanExampleBase::submitFrame();
|
||||
}
|
||||
|
||||
void prepare()
|
||||
{
|
||||
VulkanExampleBase::prepare();
|
||||
|
|
@ -1325,20 +1316,21 @@ public:
|
|||
prepared = true;
|
||||
}
|
||||
|
||||
void draw()
|
||||
{
|
||||
VulkanExampleBase::prepareFrame();
|
||||
submitInfo.commandBufferCount = 1;
|
||||
submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
|
||||
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
||||
VulkanExampleBase::submitFrame();
|
||||
}
|
||||
|
||||
virtual void render()
|
||||
{
|
||||
if (!prepared)
|
||||
return;
|
||||
updateUniformBuffers();
|
||||
draw();
|
||||
if (camera.updated)
|
||||
{
|
||||
updateUniformBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void viewChanged()
|
||||
{
|
||||
updateUniformBuffers();
|
||||
}
|
||||
|
||||
virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue