Expose camera position to shader

This commit is contained in:
2021-02-14 02:12:13 +01:00
parent 8f1c7e4bd4
commit b1b4c117f2
3 changed files with 4 additions and 2 deletions

View File

@@ -147,7 +147,7 @@ namespace openVulkanoCpp::Vulkan
vk::CommandBufferInheritanceInfo inheritance = { context.swapChainRenderPass.renderPass, 0, context.swapChainRenderPass.GetFrameBuffer()->GetCurrentFrameBuffer() };
cmdHelper->cmdBuffer.begin(vk::CommandBufferBeginInfo{ vk::CommandBufferUsageFlagBits::eOneTimeSubmit | vk::CommandBufferUsageFlagBits::eRenderPassContinue, &inheritance });
shader->Record(cmdHelper->cmdBuffer, currentImageId);
cmdHelper->cmdBuffer.pushConstants(context.pipeline.pipelineLayout, vk::ShaderStageFlagBits::eVertex, 0, 3 * sizeof(Math::Matrix4f), &scene->GetCamera()->GetViewProjectionMatrix());
cmdHelper->cmdBuffer.pushConstants(context.pipeline.pipelineLayout, vk::ShaderStageFlagBits::eVertex, 0, 3 * sizeof(Math::Matrix4f) + sizeof(Math::Vector4f), &scene->GetCamera()->GetViewProjectionMatrix());
Scene::Drawable** drawablePointer;
while((drawablePointer = jobQueue->Pop()) != nullptr)
{