diff --git a/data/shaders/pushconstants/lights.frag.spv b/data/shaders/pushconstants/lights.frag.spv index 8a5f695a..1b4485de 100644 Binary files a/data/shaders/pushconstants/lights.frag.spv and b/data/shaders/pushconstants/lights.frag.spv differ diff --git a/data/shaders/pushconstants/lights.vert.spv b/data/shaders/pushconstants/lights.vert.spv index 044688c7..c1886cd0 100644 Binary files a/data/shaders/pushconstants/lights.vert.spv and b/data/shaders/pushconstants/lights.vert.spv differ diff --git a/pushconstants/pushconstants.cpp b/pushconstants/pushconstants.cpp index cd795dbb..5e01c6a6 100644 --- a/pushconstants/pushconstants.cpp +++ b/pushconstants/pushconstants.cpp @@ -172,18 +172,18 @@ public: #undef sin_t #undef cos_t - vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSet, 0, NULL); - vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.solid); - // Submit via push constant (rather than a UBO) vkCmdPushConstants( drawCmdBuffers[i], pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, - VK_FLAGS_NONE, + 0, sizeof(pushConstants), pushConstants.data()); + vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.solid); + vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSet, 0, NULL); + VkDeviceSize offsets[1] = { 0 }; vkCmdBindVertexBuffers(drawCmdBuffers[i], VERTEX_BUFFER_BIND_ID, 1, &meshes.scene.vertices.buf, offsets); vkCmdBindIndexBuffer(drawCmdBuffers[i], meshes.scene.indices.buf, 0, VK_INDEX_TYPE_UINT32); @@ -355,7 +355,7 @@ public: // inside push constants VkPushConstantRange pushConstantRange = vkTools::initializers::pushConstantRange( - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, + VK_SHADER_STAGE_VERTEX_BIT, sizeof(pushConstants), 0); diff --git a/shadowmappingomni/shadowmappingomni.cpp b/shadowmappingomni/shadowmappingomni.cpp index 5cbccbf9..7758b281 100644 --- a/shadowmappingomni/shadowmappingomni.cpp +++ b/shadowmappingomni/shadowmappingomni.cpp @@ -459,6 +459,9 @@ public: break; } + // Render scene from cube face's point of view + vkCmdBeginRenderPass(offScreenCmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); + // Update shader push constant block // Contains current face view matrix vkCmdPushConstants( @@ -469,11 +472,8 @@ public: sizeof(glm::mat4), &viewMatrix); - // Render scene from cube face's point of view - vkCmdBeginRenderPass(offScreenCmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); - - vkCmdBindDescriptorSets(offScreenCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.offscreen, 0, 1, &descriptorSets.offscreen, 0, NULL); vkCmdBindPipeline(offScreenCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.offscreen); + vkCmdBindDescriptorSets(offScreenCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.offscreen, 0, 1, &descriptorSets.offscreen, 0, NULL); VkDeviceSize offsets[1] = { 0 }; vkCmdBindVertexBuffers(offScreenCmdBuffer, VERTEX_BUFFER_BIND_ID, 1, &meshes.scene.vertices.buf, offsets); @@ -820,7 +820,7 @@ public: // Push constants for cube map face view matrices VkPushConstantRange pushConstantRange = vkTools::initializers::pushConstantRange( - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, + VK_SHADER_STAGE_VERTEX_BIT, sizeof(glm::mat4), 0);