From 99aa85936207020d6a98f56285b4a2440f37d508 Mon Sep 17 00:00:00 2001
From: Ethan Lee <[EMAIL REDACTED]>
Date: Tue, 27 May 2025 12:22:42 -0400
Subject: [PATCH] gpu: Xbox buildfix
---
src/gpu/d3d12/SDL_gpu_d3d12.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c
index 76146fe4f3229..96a33634dfacc 100644
--- a/src/gpu/d3d12/SDL_gpu_d3d12.c
+++ b/src/gpu/d3d12/SDL_gpu_d3d12.c
@@ -8821,6 +8821,12 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
// Initialize the D3D12 debug layer, if applicable
if (debugMode) {
bool hasD3d12Debug = D3D12_INTERNAL_TryInitializeD3D12Debug(renderer);
+#if (defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
+ if (hasD3d12Debug) {
+ SDL_LogInfo(
+ SDL_LOG_CATEGORY_GPU,
+ "Validation layers enabled, expect debug level performance!");
+#else
if (hasDxgiDebug && hasD3d12Debug) {
SDL_LogInfo(
SDL_LOG_CATEGORY_GPU,
@@ -8829,6 +8835,7 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
SDL_LogWarn(
SDL_LOG_CATEGORY_GPU,
"Validation layers partially enabled, some warnings may not be available");
+#endif
} else {
SDL_LogWarn(
SDL_LOG_CATEGORY_GPU,