From 509a1fa3866be4fb3ab9d413f600012688c89a7c Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sun, 12 Dec 2021 22:50:43 -0600 Subject: [PATCH] [GPU] Fix a crash when GetWindowTitleText is called before the texture cache is initialized --- src/xenia/gpu/d3d12/d3d12_command_processor.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/d3d12/d3d12_command_processor.cc b/src/xenia/gpu/d3d12/d3d12_command_processor.cc index c075618a5..5d9be3660 100644 --- a/src/xenia/gpu/d3d12/d3d12_command_processor.cc +++ b/src/xenia/gpu/d3d12/d3d12_command_processor.cc @@ -778,8 +778,10 @@ std::string D3D12CommandProcessor::GetWindowTitleText() const { default: break; } - uint32_t resolution_scale_x = texture_cache_->GetDrawResolutionScaleX(); - uint32_t resolution_scale_y = texture_cache_->GetDrawResolutionScaleY(); + uint32_t resolution_scale_x = + texture_cache_ ? texture_cache_->GetDrawResolutionScaleX() : 1; + uint32_t resolution_scale_y = + texture_cache_ ? texture_cache_->GetDrawResolutionScaleY() : 1; if (resolution_scale_x > 1 || resolution_scale_y > 1) { title << ' ' << resolution_scale_x << 'x' << resolution_scale_y; }