Fix some issues the validation layers found

This commit is contained in:
baldurk
2016-01-09 23:14:46 +01:00
parent 55d1ac930d
commit 2ea17e0394
4 changed files with 18 additions and 6 deletions
+10 -2
View File
@@ -1927,9 +1927,17 @@ VkBool32 WrappedVulkan::DebugCallback(
const char* pLayerPrefix,
const char* pMsg)
{
// VKTODOHIGH once on new layers, location will be unique enough
// msgCode isn't fine grained enough to ignore just this one type of message
if(pLayerPrefix[0] == 'D' && pLayerPrefix[1] == 'S' && string(pMsg).find("Additional bits in accessMask") != string::npos)
return false;
if(pLayerPrefix[0] == 'D' && pLayerPrefix[1] == 'S')
{
string msg(pMsg);
if(msg.find("Additional bits in accessMask") != string::npos)
return false;
if(msg.find("It is recommended you use RenderPass LOAD_OP_CLEAR") != string::npos)
return false;
}
RDCWARN("[%s] %s", pLayerPrefix, pMsg);
return false;
+2 -1
View File
@@ -540,6 +540,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 128, },
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 128, },
{ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 128, },
{ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 128, },
};
VkDescriptorPoolCreateInfo descpoolInfo = {
@@ -4518,7 +4519,7 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t frameID, uint32_t eventID)
// create buffer with unique 0-based indices
VkBufferCreateInfo bufInfo = {
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0,
indices.size()*sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
indices.size()*sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT|VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
};
vkr = m_pDriver->vkCreateBuffer(dev, &bufInfo, NULL, &uniqIdxBuf);
+4 -1
View File
@@ -1476,7 +1476,7 @@ FloatVector VulkanReplay::InterpretVertex(byte *data, uint32_t vert, MeshDisplay
void VulkanReplay::RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshFormat> &secondaryDraws, MeshDisplay cfg)
{
if(cfg.position.buf == ResourceId())
if(cfg.position.buf == ResourceId() || cfg.position.numVerts == 0)
return;
auto it = m_OutputWindows.find(m_ActiveWinID);
@@ -2548,6 +2548,9 @@ void VulkanReplay::ClearOutputWindowColour(uint64_t id, float col[4])
outw.bbBarrier.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
vt->CmdPipelineBarrier(Unwrap(cmd), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, false, 1, &barrier);
outw.bbBarrier.srcAccessMask = outw.bbBarrier.dstAccessMask;
outw.bbBarrier.oldLayout = outw.bbBarrier.newLayout;
vt->EndCommandBuffer(Unwrap(cmd));
}
@@ -180,7 +180,7 @@ bool WrappedVulkan::Serialise_vkAllocateMemory(
VkBufferCreateInfo bufInfo = {
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0,
info.allocationSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT|VK_BUFFER_USAGE_TRANSFER_DST_BIT,
info.allocationSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT|VK_BUFFER_USAGE_TRANSFER_DST_BIT,
};
ret = ObjDisp(device)->CreateBuffer(Unwrap(device), &bufInfo, NULL, &buf);
@@ -258,7 +258,7 @@ VkResult WrappedVulkan::vkAllocateMemory(
VkBufferCreateInfo bufInfo = {
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0,
info.allocationSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT|VK_BUFFER_USAGE_TRANSFER_DST_BIT,
info.allocationSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT|VK_BUFFER_USAGE_TRANSFER_DST_BIT,
};
ret = ObjDisp(device)->CreateBuffer(Unwrap(device), &bufInfo, NULL, &buf);