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
|
// Map for host access
|
||||||
VK_CHECK_RESULT(graphics.uniformBuffer.map());
|
VK_CHECK_RESULT(graphics.uniformBuffer.map());
|
||||||
|
|
||||||
|
updateComputeUniformBuffers();
|
||||||
updateGraphicsUniformBuffers();
|
updateGraphicsUniformBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateUniformBuffers()
|
void updateComputeUniformBuffers()
|
||||||
{
|
{
|
||||||
compute.ubo.deltaT = paused ? 0.0f : frameTimer * 0.05f;
|
compute.ubo.deltaT = paused ? 0.0f : frameTimer * 0.05f;
|
||||||
compute.ubo.destX = sin(glm::radians(timer * 360.0f)) * 0.75f;
|
compute.ubo.destX = sin(glm::radians(timer * 360.0f)) * 0.75f;
|
||||||
|
|
@ -754,13 +755,11 @@ public:
|
||||||
if (!prepared)
|
if (!prepared)
|
||||||
return;
|
return;
|
||||||
draw();
|
draw();
|
||||||
updateUniformBuffers();
|
updateComputeUniformBuffers();
|
||||||
}
|
if (camera.updated) {
|
||||||
|
|
||||||
virtual void viewChanged()
|
|
||||||
{
|
|
||||||
updateGraphicsUniformBuffers();
|
updateGraphicsUniformBuffers();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
VULKAN_EXAMPLE_MAIN()
|
VULKAN_EXAMPLE_MAIN()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue