|
|
|
@ -5,10 +5,14 @@
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
|
#include "core/memory.h"
|
|
|
|
|
#include "video_core/engines/kepler_memory.h"
|
|
|
|
|
#include "video_core/rasterizer_interface.h"
|
|
|
|
|
|
|
|
|
|
namespace Tegra::Engines {
|
|
|
|
|
|
|
|
|
|
KeplerMemory::KeplerMemory(MemoryManager& memory_manager) : memory_manager(memory_manager) {}
|
|
|
|
|
KeplerMemory::KeplerMemory(VideoCore::RasterizerInterface& rasterizer,
|
|
|
|
|
MemoryManager& memory_manager)
|
|
|
|
|
: memory_manager(memory_manager), rasterizer{rasterizer} {}
|
|
|
|
|
|
|
|
|
|
KeplerMemory::~KeplerMemory() = default;
|
|
|
|
|
|
|
|
|
|
void KeplerMemory::WriteReg(u32 method, u32 value) {
|
|
|
|
@ -37,6 +41,11 @@ void KeplerMemory::ProcessData(u32 data) {
|
|
|
|
|
VAddr dest_address =
|
|
|
|
|
*memory_manager.GpuToCpuAddress(address + state.write_offset * sizeof(u32));
|
|
|
|
|
|
|
|
|
|
// We have to invalidate the destination region to evict any outdated surfaces from the cache.
|
|
|
|
|
// We do this before actually writing the new data because the destination address might contain
|
|
|
|
|
// a dirty surface that will have to be written back to memory.
|
|
|
|
|
rasterizer.InvalidateRegion(dest_address, sizeof(u32));
|
|
|
|
|
|
|
|
|
|
Memory::Write32(dest_address, data);
|
|
|
|
|
|
|
|
|
|
state.write_offset++;
|
|
|
|
|