From 5056f97b8f4d78e0bca9b659ed2326f5213968e2 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Tue, 24 Jul 2018 23:31:19 +0100 Subject: [PATCH] Unset DepthStencil flag on ARGB conversion: ARGB isn't a valid stencil format --- src/CxbxKrnl/EmuD3D8.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/CxbxKrnl/EmuD3D8.cpp index c36a315d9..c4e10b239 100644 --- a/src/CxbxKrnl/EmuD3D8.cpp +++ b/src/CxbxKrnl/EmuD3D8.cpp @@ -4877,6 +4877,10 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText if (EmuXBFormatRequiresConversionToARGB(X_Format)) { bConvertToARGB = true; PCFormat = XTL::D3DFMT_A8R8G8B8; + + // Unset D3DUSAGE_DEPTHSTENCIL: It's not possible for ARGB textures to be depth stencils + // Fixes CreateTexture error in Virtua Cop 3 (Chihiro) + D3DUsage &= ~D3DUSAGE_DEPTHSTENCIL; } else { // TODO : Nuance the following, because the Direct3D 8 docs states