Follow the spec strictly - only coherent memory is 'implicitly flushed'

* Technically coherent memory isn't implicitly flushed either, but this
  is handling is required if memory is mapped, written to, and unmapped
  without ever hitting a QueueSubmit where we will check any current
  coherent map, and treat it as persistent to flush it out.
This commit is contained in:
baldurk
2015-12-02 20:40:42 +01:00
parent 5bb4b0dc13
commit fa1520bc13
@@ -417,7 +417,13 @@ void WrappedVulkan::vkUnmapMemory(
if(capframe)
{
if(!state.mapFlushed)
// coherent maps must always serialise all data on unmap, even if a flush was seen, because
// unflushed data is *also* visible. This is a bit redundant since data is serialised here
// and in any flushes, but that's the app's fault - the spec calls out flushing coherent maps
// as inefficient
// if the memory is not coherent, we must have a flush for every region written while it is
// mapped, there is no implicit flush on unmap, so we follow the spec strictly on this.
if(state.mapCoherent)
{
CACHE_THREAD_SERIALISER();
@@ -436,11 +442,6 @@ void WrappedVulkan::vkUnmapMemory(
GetResourceManager()->MarkResourceFrameReferenced(id, eFrameRef_Write);
}
}
else
{
// VKTODOLOW for now assuming flushes cover all writes. Technically
// this is true for all non-coherent memory types.
}
}
state.mappedPtr = NULL;