diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index bf64d9e5e4..9618cbeb5e 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -108,10 +108,11 @@ static bool d3d_init_shader(void *data) static void d3d_deinit_chain(d3d_video_t *d3d) { - renderchain_deinit(d3d->chain); - d3d->chain = NULL; #ifdef _XBOX renderchain_free(d3d); +#else + renderchain_deinit(d3d->chain); + d3d->chain = NULL; #endif } @@ -893,23 +894,26 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) video_info->input_scale * RARCH_SCALE_BASE; #endif - d3d->chain = renderchain_new(); - - if (!d3d->chain) - return false; - #ifdef _XBOX if (!renderchain_init(d3d, video_info, NULL, NULL, NULL, video_info->rgb32 ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565)) + { + RARCH_ERR("[D3D]: Failed to init render chain.\n"); + return false; + } #else + d3d->chain = renderchain_new(); + + if (!d3d->chain) + return false; + if (!renderchain_init(d3d->chain, &d3d->video_info, d3dr, &d3d->final_viewport, &link_info, d3d->video_info.rgb32 ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565)) -#endif { - RARCH_ERR("[D3D]: Failed to init render chain.\n"); + RARCH_ERR("[D3D9]: Failed to init render chain.\n"); return false; }