mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 19:47:08 +02:00
The renderer gives each frame 131,072 shader-visible descriptors past a persistent 120,000, in heaps of 333,333. Dense custom maps (the Los Santos City sublevels, San Andreas) draw more than that in a frame, and the renderer wrote past the end of the heap: shaders read garbage descriptors, which faulted or hung the GPU (page faults at nonsense addresses, in draws, texture fetches and ray tracing alike). ReSkate now patches the device setup at boot so each heap is D3D12's 1,000,000 and a frame may use 524,288; heaps are 644,288 descriptors. LS-B2, LS-B3 and San Andreas (210,000 a frame at its peak) now hold. Also in this change: - Memory: perf memory owners/heap/gpu/report, a ledger of who commits the game's RAM; the render-resource pool no longer allocates its 115 MB twice; the EadpErrorsData arena is capped at 32 MiB (EA's error reporting is blocked anyway). - Crash reports: tagged with the map, destination, graphics card and driver version (protocol v3), so Sentry can group GPU hangs by map and card. - GPU diagnostics (--gpu-diagnostics): a fuller DRED report, the device-removal and video memory watches, a large-draw watch, a record of which game code made and freed each GPU heap and resource, checks of every GPU address bound, and a meter of each descriptor heap's use. - World pools: peak use of entity pages, render instances and spatial blocks in the log. - dingosdk_mod_mesh_check: checks every MeshSet a mod ships against its geometry; the MeshSet reader now knows static meshes' layout.
41 lines
1.8 KiB
C++
41 lines
1.8 KiB
C++
#pragma once
|
|
#include <Windows.h>
|
|
#include <array>
|
|
#include <string>
|
|
|
|
namespace dingosdk::crash_report {
|
|
inline constexpr DWORD protocol_version = 3;
|
|
inline constexpr DWORD capture_timeout_ms = 15000;
|
|
struct SharedReport {
|
|
DWORD version{protocol_version};
|
|
DWORD thread_id{};
|
|
EXCEPTION_POINTERS* exception{}; // Address in the parent; MiniDumpWriteDump uses ClientPointers=TRUE.
|
|
std::array<wchar_t, 4096> url{};
|
|
std::array<wchar_t, 32768> directory{};
|
|
std::array<wchar_t, 260> application{};
|
|
std::array<wchar_t, 32768> native_directory{};
|
|
// What the game was doing, for the report's tags: the level it loaded last, and the graphics
|
|
// card it renders on with its driver's version. Written by the game as they change, read by
|
|
// the helper after a crash (a torn read only spoils a tag).
|
|
std::array<wchar_t, 512> destination{};
|
|
std::array<wchar_t, 128> gpu_name{};
|
|
std::array<wchar_t, 32> gpu_driver{};
|
|
};
|
|
// Explicitly inherited unnamed handles; no token or paths on the command line.
|
|
enum HandleIndex : std::size_t { mapping, requested, captured, stopping, ready, parent, handle_count };
|
|
struct Handle {
|
|
HANDLE value{};
|
|
Handle() = default;
|
|
explicit Handle(HANDLE handle) : value(handle) {}
|
|
~Handle() { if (value && value != INVALID_HANDLE_VALUE) CloseHandle(value); }
|
|
Handle(const Handle&) = delete;
|
|
Handle& operator=(const Handle&) = delete;
|
|
HANDLE release() { const auto result = value; value = nullptr; return result; }
|
|
};
|
|
inline std::wstring environment(const wchar_t* name) {
|
|
std::array<wchar_t, 32768> buffer{};
|
|
const auto size = GetEnvironmentVariableW(name, buffer.data(), static_cast<DWORD>(buffer.size()));
|
|
return size && size < buffer.size() ? std::wstring(buffer.data(), size) : std::wstring{};
|
|
}
|
|
}
|