[GPU] Unified clear_memory_page_state to be used in D3D12 & Vulkan
This commit is contained in:
committed by
Radosław Gliński
parent
91f976e524
commit
2a4d7feaae
@@ -45,9 +45,22 @@ DEFINE_bool(
|
||||
"of the guest thread that wrote the new read position.",
|
||||
"GPU");
|
||||
|
||||
DEFINE_bool(clear_memory_page_state, false,
|
||||
"Refresh state of memory pages to enable gpu written data. (Use "
|
||||
"for 'Team Ninja' Games to fix missing character models)",
|
||||
"GPU");
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
|
||||
void CommonSaveGPUSetting(CommonGPUSetting setting, uint64_t value) {
|
||||
switch (setting) {
|
||||
case CommonGPUSetting::ClearMemoryPageState:
|
||||
OVERRIDE_bool(clear_memory_page_state, (bool)value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
using namespace xe::gpu::xenos;
|
||||
|
||||
CommandProcessor::CommandProcessor(GraphicsSystem* graphics_system,
|
||||
|
||||
@@ -33,6 +33,12 @@ class ByteStream;
|
||||
|
||||
namespace gpu {
|
||||
|
||||
enum class CommonGPUSetting {
|
||||
ClearMemoryPageState,
|
||||
};
|
||||
|
||||
void CommonSaveGPUSetting(CommonGPUSetting setting, uint64_t value);
|
||||
|
||||
class GraphicsSystem;
|
||||
class Shader;
|
||||
|
||||
|
||||
@@ -49,19 +49,14 @@ DEFINE_bool(d3d12_submit_on_primary_buffer_end, true,
|
||||
"Submit the command list when a PM4 primary buffer ends if it's "
|
||||
"possible to submit immediately to try to reduce frame latency.",
|
||||
"D3D12");
|
||||
DEFINE_bool(d3d12_clear_memory_page_state, false,
|
||||
"Refresh state of memory pages to enable gpu written data. (Use "
|
||||
"for 'Team Ninja' Games to fix missing character models)",
|
||||
"D3D12");
|
||||
|
||||
DECLARE_bool(clear_memory_page_state);
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
|
||||
void D3D12SaveGPUSetting(D3D12GPUSetting setting, uint64_t value) {
|
||||
switch (setting) {
|
||||
case D3D12GPUSetting::ClearMemoryPageState:
|
||||
OVERRIDE_bool(d3d12_clear_memory_page_state, (bool)value);
|
||||
break;
|
||||
case D3D12GPUSetting::ReadbackResolve:
|
||||
OVERRIDE_bool(d3d12_readback_resolve, (bool)value);
|
||||
break;
|
||||
@@ -3564,7 +3559,7 @@ bool D3D12CommandProcessor::EndSubmission(bool is_swap) {
|
||||
}
|
||||
|
||||
if (is_closing_frame) {
|
||||
if (cvars::d3d12_clear_memory_page_state) {
|
||||
if (cvars::clear_memory_page_state) {
|
||||
shared_memory_->SetSystemPageBlocksValidWithGpuDataWritten();
|
||||
}
|
||||
// Close the capture after submitting.
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace gpu {
|
||||
|
||||
enum class D3D12GPUSetting {
|
||||
ReadbackResolve,
|
||||
ClearMemoryPageState,
|
||||
};
|
||||
|
||||
void D3D12SaveGPUSetting(D3D12GPUSetting setting, uint64_t value);
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
#include "xenia/ui/vulkan/vulkan_presenter.h"
|
||||
#include "xenia/ui/vulkan/vulkan_provider.h"
|
||||
#include "xenia/ui/vulkan/vulkan_util.h"
|
||||
|
||||
DECLARE_bool(clear_memory_page_state);
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
namespace vulkan {
|
||||
@@ -3125,6 +3128,10 @@ bool VulkanCommandProcessor::EndSubmission(bool is_swap) {
|
||||
}
|
||||
|
||||
if (is_closing_frame) {
|
||||
if (cvars::clear_memory_page_state) {
|
||||
shared_memory_->SetSystemPageBlocksValidWithGpuDataWritten();
|
||||
}
|
||||
|
||||
frame_open_ = false;
|
||||
// Submission already closed now, so minus 1.
|
||||
closed_frame_submissions_[(frame_current_++) % kMaxFramesInFlight] =
|
||||
|
||||
Reference in New Issue
Block a user