Properly initialize compute UBO before first submit
Better naming Fixes #552
This commit is contained in:
parent
783199b1c8
commit
99a52ed64b
1 changed files with 6 additions and 7 deletions
|
|
@ -693,10 +693,11 @@ public:
|
|||
// Map for host access
|
||||
VK_CHECK_RESULT(graphics.uniformBuffer.map());
|
||||
|
||||
updateComputeUniformBuffers();
|
||||
updateGraphicsUniformBuffers();
|
||||
}
|
||||
|
||||
void updateUniformBuffers()
|
||||
void updateComputeUniformBuffers()
|
||||
{
|
||||
compute.ubo.deltaT = paused ? 0.0f : frameTimer * 0.05f;
|
||||
compute.ubo.destX = sin(glm::radians(timer * 360.0f)) * 0.75f;
|
||||
|
|
@ -754,13 +755,11 @@ public:
|
|||
if (!prepared)
|
||||
return;
|
||||
draw();
|
||||
updateUniformBuffers();
|
||||
}
|
||||
|
||||
virtual void viewChanged()
|
||||
{
|
||||
updateComputeUniformBuffers();
|
||||
if (camera.updated) {
|
||||
updateGraphicsUniformBuffers();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
VULKAN_EXAMPLE_MAIN()
|
||||
Loading…
Add table
Add a link
Reference in a new issue