vulkan: push constants when starting render pass to avoid crash (mali)

This commit is contained in:
Flyinghead 2019-12-11 22:31:35 +01:00
parent 78987074a6
commit c683e0ded8
2 changed files with 8 additions and 0 deletions

View File

@ -375,6 +375,10 @@ bool Drawer::Draw(const Texture *fogTexture)
cmdBuffer.bindVertexBuffers(0, 1, &buffer, zeroOffset);
cmdBuffer.bindIndexBuffer(buffer, offsets.indexOffset, vk::IndexType::eUint32);
// Make sure to push constants even if not used
std::array<float, 5> pushConstants = { 0, 0, 0, 0, 0 };
cmdBuffer.pushConstants<float>(pipelineManager->GetPipelineLayout(), vk::ShaderStageFlagBits::eFragment, 0, pushConstants);
RenderPass previous_pass = {};
for (int render_pass = 0; render_pass < pvrrc.render_passes.used(); render_pass++)
{

View File

@ -284,6 +284,10 @@ bool OITDrawer::Draw(const Texture *fogTexture)
cmdBuffer.bindVertexBuffers(0, 1, &mainBuffer, zeroOffset);
cmdBuffer.bindIndexBuffer(mainBuffer, offsets.indexOffset, vk::IndexType::eUint32);
// Make sure to push constants even if not used
OITDescriptorSets::PushConstants pushConstants = { };
cmdBuffer.pushConstants<OITDescriptorSets::PushConstants>(pipelineManager->GetPipelineLayout(), vk::ShaderStageFlagBits::eFragment, 0, pushConstants);
const std::array<vk::ClearValue, 3> clear_colors = {
vk::ClearColorValue(std::array<float, 4>{0.f, 0.f, 0.f, 1.f}),
vk::ClearColorValue(std::array<float, 4>{0.f, 0.f, 0.f, 1.f}),