[GPU] Added config option to enable/disable invalid memory uploads

This commit is contained in:
Gliniak
2025-11-30 13:10:53 +01:00
committed by Radosław Gliński
parent dd29365970
commit 78e753ef52
2 changed files with 10 additions and 4 deletions

View File

@@ -25,6 +25,8 @@ DEFINE_bool(d3d12_tiled_shared_memory, true,
"to work.",
"D3D12");
DECLARE_bool(gpu_allow_invalid_upload_range);
namespace xe {
namespace gpu {
namespace d3d12 {
@@ -419,15 +421,15 @@ bool D3D12SharedMemory::UploadRanges(
trace_writer_.WriteMemoryRead(upload_range_start << page_size_log2(),
upload_range_length << page_size_log2());
if (upload_range_length > 0) {
if (upload_range_length > 0 && !cvars::gpu_allow_invalid_upload_range) {
const uint32_t upload_range_last_page =
upload_range_start + upload_range_length - 1;
memory::PageAccess page_access =
const memory::PageAccess page_access =
memory().GetPhysicalHeap()->QueryRangeAccess(
upload_range_last_page << page_size_log2(),
(upload_range_last_page
<< page_size_log2())); // Check only last page
upload_range_last_page
<< page_size_log2()); // Check only last page
if (page_access == xe::memory::PageAccess::kNoAccess) {
XELOGE("Invalid upload range for GPU: {:08X}", upload_range_start);

View File

@@ -33,6 +33,10 @@ DEFINE_bool(
"may be used to bypass fetch constant type errors in certain games until "
"the real reason why they're invalid is found.",
"GPU");
DEFINE_bool(
gpu_allow_invalid_upload_range, false,
"Allows games to read data from pages that are marked as no access.",
"GPU");
DEFINE_bool(
non_seamless_cube_map, true,