diff options
| author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-09-14 17:00:45 -0300 |
|---|---|---|
| committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-09-14 17:00:45 -0300 |
| commit | b3af7aad9e37ee49feb9ff4e34ed4314f7ed644b (patch) | |
| tree | ac792d257440cf78d0c0bdf2e515da5fc4943bff /src/core/hle/service/gsp_gpu.cpp | |
| parent | d6e56b8c88b46f4f85f44b26bff00422e31a6e57 (diff) | |
| parent | 1ed7f3e0281de29fd99f7d4802fcc5a1906930f8 (diff) | |
Merge pull request #1123 from yuriks/gsp-flush
GSP: Implement command 0x05, used for flushing caches
Diffstat (limited to 'src/core/hle/service/gsp_gpu.cpp')
| -rw-r--r-- | src/core/hle/service/gsp_gpu.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index c3d0d28a5..481da0c9f 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -377,12 +377,16 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { command.dma_request.size); break; - // ctrulib homebrew sends all relevant command list data with this command, - // hence we do all "interesting" stuff here and do nothing in SET_COMMAND_LIST_FIRST. - // TODO: This will need some rework in the future. - case CommandId::SET_COMMAND_LIST_LAST: + // TODO: This will need some rework in the future. (why?) + case CommandId::SUBMIT_GPU_CMDLIST: { - auto& params = command.set_command_list_last; + auto& params = command.submit_gpu_cmdlist; + + if (params.do_flush) { + // This flag flushes the command list (params.address, params.size) from the cache. + // Command lists are not processed by the hardware renderer, so we don't need to + // actually flush them in Citra. + } WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.address)), Memory::VirtualToPhysicalAddress(params.address) >> 3); @@ -391,6 +395,8 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { // TODO: Not sure if we are supposed to always write this .. seems to trigger processing though WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.trigger)), 1); + // TODO(yuriks): Figure out the meaning of the `flags` field. + break; } @@ -434,7 +440,6 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { break; } - // TODO: Check if texture copies are implemented correctly.. case CommandId::SET_TEXTURE_COPY: { auto& params = command.texture_copy; @@ -456,10 +461,15 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { break; } - // TODO: Figure out what exactly SET_COMMAND_LIST_FIRST and SET_COMMAND_LIST_LAST - // are supposed to do. - case CommandId::SET_COMMAND_LIST_FIRST: + case CommandId::CACHE_FLUSH: { + for (auto& region : command.cache_flush.regions) { + if (region.size == 0) + break; + + VideoCore::g_renderer->hw_rasterizer->NotifyFlush( + Memory::VirtualToPhysicalAddress(region.address), region.size); + } break; } |
