Don't dirty buffers, and don't create any init state for them

* Buffers have no state, they're immutable, and contents are handled by
  device memory initial state
This commit is contained in:
baldurk
2015-09-22 14:18:36 +02:00
parent c6fd6e80f2
commit eb18687fb2
2 changed files with 6 additions and 5 deletions
+4
View File
@@ -346,6 +346,10 @@ void WrappedVulkan::Create_InitialState(ResourceId id, WrappedVkRes *live, bool
{
RDCWARN("Framebuffer without initial state! should clear all attachments");
}
else if(type == eResBuffer)
{
// don't have to do anything for buffers, initial state is all handled by memory
}
else
{
RDCERR("Unhandled resource type %d", type);
@@ -248,7 +248,6 @@ void WrappedVulkan::vkCmdCopyImage(
record->MarkResourceFrameReferenced(GetResID(srcImage), eFrameRef_Read);
record->MarkResourceFrameReferenced(GetResID(destImage), eFrameRef_Write);
// VKTODOHIGH init states not implemented yet...
record->dirtied.insert(GetResID(destImage));
{
VkResourceRecord *im = GetRecord(destImage);
@@ -412,8 +411,7 @@ void WrappedVulkan::vkCmdCopyImageToBuffer(
record->MarkResourceFrameReferenced(GetResID(srcImage), eFrameRef_Read);
record->MarkResourceFrameReferenced(GetResID(destBuffer), eFrameRef_Write);
// VKTODOMED: need to dirty the memory bound to the buffer?
record->dirtied.insert(GetResID(destBuffer));
// Don't dirty the buffer, just the memory behind it.
{
VkResourceRecord *buf = GetRecord(destBuffer);
if(buf->GetMemoryRecord())
@@ -499,8 +497,7 @@ void WrappedVulkan::vkCmdCopyBuffer(
record->MarkResourceFrameReferenced(GetResID(srcBuffer), eFrameRef_Read);
record->MarkResourceFrameReferenced(GetResID(destBuffer), eFrameRef_Write);
// VKTODOMED: need to dirty the memory bound to the buffer?
record->dirtied.insert(GetResID(destBuffer));
// Don't dirty the buffer, just the memory behind it.
{
VkResourceRecord *buf = GetRecord(destBuffer);
if(buf->GetMemoryRecord())