Check surface parent format matches surface format before creating it

This commit is contained in:
a.miles.nz@gmail.com 2019-02-01 18:38:23 +13:00
parent e463f473b9
commit 50554a9f9b
1 changed files with 4 additions and 1 deletions

View File

@ -4677,7 +4677,10 @@ void CreateHostResource(XTL::X_D3DResource *pResource, DWORD D3DUsage, int iText
case XTL::X_D3DRTYPE_SURFACE: {
XTL::X_D3DSurface *pXboxSurface = (XTL::X_D3DSurface *)pResource;
XTL::X_D3DTexture *pParentXboxTexture = (pXboxSurface) ? (XTL::X_D3DTexture *)pXboxSurface->Parent : xbnullptr;
if (pParentXboxTexture) {
// Don't init the Parent if the Surface and Surface Parent formats differ
// Happens in some Outrun 2006 SetRenderTarget calls
if (pParentXboxTexture && (pXboxSurface->Format == pParentXboxTexture->Format)) {
XTL::IDirect3DBaseTexture *pParentHostBaseTexture = GetHostBaseTexture(pParentXboxTexture, D3DUsage, iTextureStage);
switch (pParentHostBaseTexture->GetType()) {
case XTL::D3DRTYPE_VOLUMETEXTURE: {