Vulkan validation fixes

This commit is contained in:
Jack Andersen 2016-07-26 17:37:39 -10:00
parent 55be829aca
commit cb2b33a42b
1 changed files with 18 additions and 13 deletions

View File

@ -2055,6 +2055,9 @@ struct VulkanShaderDataBinding : IShaderDataBinding
for (size_t i=0 ; i<BOO_GLSL_MAX_UNIFORM_COUNT ; ++i)
{
if (i<m_ubufCount)
{
VkDescriptorBufferInfo& modInfo = m_ubufOffs[i][b];
if (modInfo.range)
{
writes[totalWrites].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writes[totalWrites].pNext = nullptr;
@ -2062,7 +2065,6 @@ struct VulkanShaderDataBinding : IShaderDataBinding
writes[totalWrites].descriptorCount = 1;
writes[totalWrites].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
const VkDescriptorBufferInfo* origInfo = GetBufferGPUResource(m_ubufs[i], b);
VkDescriptorBufferInfo& modInfo = m_ubufOffs[i][b];
modInfo.buffer = origInfo->buffer;
modInfo.offset += origInfo->offset;
writes[totalWrites].pBufferInfo = &modInfo;
@ -2070,6 +2072,7 @@ struct VulkanShaderDataBinding : IShaderDataBinding
writes[totalWrites].dstBinding = binding;
++totalWrites;
}
}
++binding;
}
}
@ -2478,7 +2481,7 @@ struct VulkanCommandQueue : IGraphicsCommandQueue
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 1, 1);
SetImageLayout(cmdBuf, ctexture->m_colorBindTex, VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, 1);
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, 1);
VkImageCopy copyInfo = {};
copyInfo.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
@ -2550,6 +2553,8 @@ struct VulkanCommandQueue : IGraphicsCommandQueue
SetImageLayout(cmdBuf, ctexture->m_depthBindTex, VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 1, 1);
}
vk::CmdBeginRenderPass(cmdBuf, &m_boundTarget->m_passBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
}
void execute();