(D3D) Cleanups
This commit is contained in:
parent
ee8f2e7d89
commit
10c7eded36
|
@ -15,8 +15,7 @@ static bool d3d_init_chain(d3d_video_t *d3d,
|
||||||
const video_info_t *video_info);
|
const video_info_t *video_info);
|
||||||
|
|
||||||
static void renderchain_free(void *data);
|
static void renderchain_free(void *data);
|
||||||
void d3d_deinit_shader(void *data);
|
|
||||||
bool d3d_init_shader(void *data);
|
|
||||||
|
|
||||||
void d3d_make_d3dpp(void *data, const video_info_t *info,
|
void d3d_make_d3dpp(void *data, const video_info_t *info,
|
||||||
D3DPRESENT_PARAMETERS *d3dpp);
|
D3DPRESENT_PARAMETERS *d3dpp);
|
||||||
|
@ -30,6 +29,44 @@ extern LRESULT CALLBACK WindowProc(HWND hWnd, UINT message,
|
||||||
static RECT d3d_monitor_rect(d3d_video_t *d3d);
|
static RECT d3d_monitor_rect(d3d_video_t *d3d);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void d3d_deinit_shader(void *data)
|
||||||
|
{
|
||||||
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
|
(void)d3d;
|
||||||
|
(void)data;
|
||||||
|
|
||||||
|
#ifdef HAVE_CG
|
||||||
|
if (!d3d->cgCtx)
|
||||||
|
return;
|
||||||
|
|
||||||
|
cgD3D9UnloadAllPrograms();
|
||||||
|
cgD3D9SetDevice(NULL);
|
||||||
|
cgDestroyContext(d3d->cgCtx);
|
||||||
|
d3d->cgCtx = NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool d3d_init_shader(void *data)
|
||||||
|
{
|
||||||
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
|
(void)d3d;
|
||||||
|
(void)data;
|
||||||
|
#if defined(_XBOX)
|
||||||
|
return false;
|
||||||
|
#elif defined(HAVE_CG)
|
||||||
|
d3d->cgCtx = cgCreateContext();
|
||||||
|
if (!d3d->cgCtx)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
RARCH_LOG("[D3D]: Created shader context.\n");
|
||||||
|
|
||||||
|
HRESULT ret = cgD3D9SetDevice(d3d->dev);
|
||||||
|
if (FAILED(ret))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void d3d_deinit_chain(d3d_video_t *d3d)
|
static void d3d_deinit_chain(d3d_video_t *d3d)
|
||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
|
|
|
@ -569,33 +569,4 @@ void renderchain_bind_pass(void *data, Pass &pass, unsigned pass_index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool d3d_init_shader(void *data)
|
|
||||||
{
|
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
|
||||||
d3d->cgCtx = cgCreateContext();
|
|
||||||
if (!d3d->cgCtx)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
RARCH_LOG("[D3D]: Created shader context.\n");
|
|
||||||
|
|
||||||
HRESULT ret = cgD3D9SetDevice(d3d->dev);
|
|
||||||
if (FAILED(ret))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void d3d_deinit_shader(void *data)
|
|
||||||
{
|
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
|
||||||
if (!d3d->cgCtx)
|
|
||||||
return;
|
|
||||||
|
|
||||||
cgD3D9UnloadAllPrograms();
|
|
||||||
cgD3D9SetDevice(NULL);
|
|
||||||
cgDestroyContext(d3d->cgCtx);
|
|
||||||
d3d->cgCtx = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,17 +34,6 @@
|
||||||
|
|
||||||
#include "render_chain_xdk.h"
|
#include "render_chain_xdk.h"
|
||||||
|
|
||||||
static void d3d_deinit_shader(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool d3d_init_shader(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void d3d_free(void *data)
|
static void d3d_free(void *data)
|
||||||
{
|
{
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
|
|
Loading…
Reference in New Issue