rsx: Implement dma abort in case of a reset after misprediction

This commit is contained in:
kd-11 2019-07-01 22:52:02 +03:00 committed by kd-11
parent 0f11939faf
commit 71e809a78b
2 changed files with 24 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "../rsx_cache.h"
#include "texture_cache_predictor.h"
@ -1114,6 +1114,9 @@ namespace rsx
invalidate_range();
}
virtual void dma_abort()
{}
public:
/**
* Dirty/Unreleased Flag
@ -1276,6 +1279,12 @@ namespace rsx
void reprotect(const utils::protection prot)
{
if (synchronized && !flushed)
{
// Abort enqueued transfer
dma_abort();
}
//Reset properties and protect again
flushed = false;
synchronized = false;
@ -1286,6 +1295,12 @@ namespace rsx
void reprotect(const utils::protection prot, const std::pair<u32, u32>& range)
{
if (synchronized && !flushed)
{
// Abort enqueued transfer
dma_abort();
}
//Reset properties and protect again
flushed = false;
synchronized = false;

View File

@ -96,6 +96,14 @@ namespace vk
}
}
void dma_abort() override
{
// Called if a reset occurs, usually via reprotect path after a bad prediction.
// Discard the sync event, the next sync, if any, will properly recreate this.
verify(HERE), synchronized, !flushed, dma_fence;
vk::get_resource_manager()->dispose(dma_fence);
}
void destroy()
{
if (!exists())