Create d3d8_renderchain.cpp and d3d9_hlsl_renderchain.cpp

This commit is contained in:
twinaphex 2017-09-05 00:00:17 +02:00
parent c96b843330
commit b46c4b4db5
5 changed files with 110 additions and 127 deletions

View File

@ -25,7 +25,7 @@
#include "../../configuration.h"
#include "../../verbosity.h"
typedef struct xdk_renderchain
typedef struct d3d8_renderchain
{
unsigned pixel_size;
LPDIRECT3DDEVICE dev;
@ -38,7 +38,7 @@ typedef struct xdk_renderchain
unsigned tex_w;
unsigned tex_h;
uint64_t frame_count;
} xdk_renderchain_t;
} d3d8_renderchain_t;
static void renderchain_set_mvp(void *data, unsigned vp_width,
unsigned vp_height, unsigned rotation)
@ -56,9 +56,9 @@ static void renderchain_set_mvp(void *data, unsigned vp_width,
d3d_set_transform(d3dr, D3DTS_PROJECTION, &p_out);
}
static void xdk_renderchain_clear(void *data)
static void d3d8_renderchain_clear(void *data)
{
xdk_renderchain_t *chain = (xdk_renderchain_t*)data;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)data;
d3d_texture_free(chain->tex);
d3d_vertex_buffer_free(chain->vertex_buf, chain->vertex_decl);
@ -67,9 +67,9 @@ static void xdk_renderchain_clear(void *data)
static bool renderchain_create_first_pass(void *data,
const video_info_t *info)
{
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
chain->vertex_buf = d3d_vertex_buffer_new(d3dr, 4 * sizeof(Vertex),
D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED,
@ -102,7 +102,7 @@ static void renderchain_set_vertices(void *data, unsigned pass,
{
unsigned width, height;
d3d_video_t *d3d = (d3d_video_t*)data;
xdk_renderchain_t *chain = d3d ? (xdk_renderchain_t*)d3d->renderchain_data : NULL;
d3d8_renderchain_t *chain = d3d ? (d3d8_renderchain_t*)d3d->renderchain_data : NULL;
video_driver_get_size(&width, &height);
@ -167,8 +167,8 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
unsigned width, unsigned height, unsigned pitch)
{
D3DLOCKED_RECT d3dlr;
xdk_renderchain_t *chain = (xdk_renderchain_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)chain->dev;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)chain->dev;
d3d_frame_postprocess(chain);
@ -186,39 +186,39 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
&d3dlr, frame, width, height, pitch);
}
static void xdk_renderchain_deinit(void *data)
static void d3d8_renderchain_deinit(void *data)
{
xdk_renderchain_t *renderchain = (xdk_renderchain_t*)data;
d3d8_renderchain_t *renderchain = (d3d8_renderchain_t*)data;
if (renderchain)
free(renderchain);
}
static void xdk_renderchain_free(void *data)
static void d3d8_renderchain_free(void *data)
{
d3d_video_t *chain = (d3d_video_t*)data;
if (!chain)
return;
xdk_renderchain_deinit(chain->renderchain_data);
xdk_renderchain_clear(chain->renderchain_data);
d3d8_renderchain_deinit(chain->renderchain_data);
d3d8_renderchain_clear(chain->renderchain_data);
if (chain->tracker)
state_tracker_free(chain->tracker);
}
void *xdk_renderchain_new(void)
void *d3d8_renderchain_new(void)
{
xdk_renderchain_t *renderchain = (xdk_renderchain_t*)calloc(1, sizeof(*renderchain));
d3d8_renderchain_t *renderchain = (d3d8_renderchain_t*)calloc(1, sizeof(*renderchain));
if (!renderchain)
return NULL;
return renderchain;
}
static bool xdk_renderchain_init(void *data,
static bool d3d8_renderchain_init(void *data,
const void *_video_info,
void *dev_data,
const void *final_viewport_data,
@ -227,12 +227,12 @@ static bool xdk_renderchain_init(void *data,
)
{
unsigned width, height;
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
const video_info_t *video_info = (const video_info_t*)_video_info;
const LinkInfo *link_info = (const LinkInfo*)info_data;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
unsigned fmt = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;
const LinkInfo *link_info = (const LinkInfo*)info_data;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
unsigned fmt = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;
struct video_viewport *custom_vp = video_viewport_get_custom();
(void)final_viewport_data;
@ -257,7 +257,7 @@ static bool xdk_renderchain_init(void *data,
return true;
}
static void xdk_renderchain_set_final_viewport(void *data,
static void d3d8_renderchain_set_final_viewport(void *data,
void *renderchain_data, const void *viewport_data)
{
(void)data;
@ -267,7 +267,7 @@ static void xdk_renderchain_set_final_viewport(void *data,
/* stub */
}
static bool xdk_renderchain_render(void *data, const void *frame,
static bool d3d8_renderchain_render(void *data, const void *frame,
unsigned frame_width, unsigned frame_height,
unsigned pitch, unsigned rotation)
{
@ -276,7 +276,7 @@ static bool xdk_renderchain_render(void *data, const void *frame,
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
settings_t *settings = config_get_ptr();
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
chain->frame_count++;
@ -302,7 +302,7 @@ static bool xdk_renderchain_render(void *data, const void *frame,
return true;
}
static bool xdk_renderchain_add_pass(void *data, const void *info_data)
static bool d3d8_renderchain_add_pass(void *data, const void *info_data)
{
(void)data;
(void)info_data;
@ -311,7 +311,7 @@ static bool xdk_renderchain_add_pass(void *data, const void *info_data)
return true;
}
static void xdk_renderchain_add_state_tracker(void *data, void *tracker_data)
static void d3d8_renderchain_add_state_tracker(void *data, void *tracker_data)
{
(void)data;
(void)tracker_data;
@ -319,7 +319,7 @@ static void xdk_renderchain_add_state_tracker(void *data, void *tracker_data)
/* stub */
}
static void xdk_renderchain_convert_geometry(
static void d3d8_renderchain_convert_geometry(
void *data, const void *info_data,
unsigned *out_width, unsigned *out_height,
unsigned width, unsigned height,
@ -336,12 +336,12 @@ static void xdk_renderchain_convert_geometry(
/* stub */
}
static bool xdk_renderchain_reinit(void *data,
static bool d3d8_renderchain_reinit(void *data,
const void *video_data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
const video_info_t *video = (const video_info_t*)video_data;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
d3d_video_t *d3d = (d3d_video_t*)data;
const video_info_t *video = (const video_info_t*)video_data;
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
if (!d3d)
return false;
@ -355,7 +355,7 @@ static bool xdk_renderchain_reinit(void *data,
return true;
}
static void xdk_renderchain_viewport_info(void *data, struct video_viewport *vp)
static void d3d8_renderchain_viewport_info(void *data, struct video_viewport *vp)
{
unsigned width, height;
d3d_video_t *d3d = (d3d_video_t*)data;
@ -374,19 +374,19 @@ static void xdk_renderchain_viewport_info(void *data, struct video_viewport *vp)
vp->full_height = height;
}
renderchain_driver_t xdk_d3d_renderchain = {
xdk_renderchain_free,
xdk_renderchain_new,
xdk_renderchain_reinit,
xdk_renderchain_init,
xdk_renderchain_set_final_viewport,
xdk_renderchain_add_pass,
renderchain_driver_t d3d8_d3d_renderchain = {
d3d8_renderchain_free,
d3d8_renderchain_new,
d3d8_renderchain_reinit,
d3d8_renderchain_init,
d3d8_renderchain_set_final_viewport,
d3d8_renderchain_add_pass,
NULL,
xdk_renderchain_add_state_tracker,
xdk_renderchain_render,
xdk_renderchain_convert_geometry,
d3d8_renderchain_add_state_tracker,
d3d8_renderchain_render,
d3d8_renderchain_convert_geometry,
NULL,
NULL,
xdk_renderchain_viewport_info,
"xdk",
d3d8_renderchain_viewport_info,
"d3d8",
};

View File

@ -25,7 +25,7 @@
#include "../../configuration.h"
#include "../../verbosity.h"
typedef struct xdk_renderchain
typedef struct hlsl_d3d9_renderchain
{
unsigned pixel_size;
LPDIRECT3DDEVICE dev;
@ -34,58 +34,41 @@ typedef struct xdk_renderchain
LPDIRECT3DVERTEXBUFFER vertex_buf;
unsigned last_width;
unsigned last_height;
#ifdef HAVE_D3D9
LPDIRECT3DVERTEXDECLARATION vertex_decl;
#else
void *vertex_decl;
#endif
unsigned tex_w;
unsigned tex_h;
uint64_t frame_count;
} xdk_renderchain_t;
} hlsl_d3d9_renderchain_t;
static void renderchain_set_mvp(void *data, unsigned vp_width,
unsigned vp_height, unsigned rotation)
{
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
video_shader_ctx_mvp_t mvp;
#endif
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
#if defined(_XBOX360) && defined(HAVE_HLSL)
hlsl_set_proj_matrix(XMMatrixRotationZ(rotation * (M_PI / 2.0)));
mvp.data = d3d;
mvp.matrix = NULL;
video_shader_driver_set_mvp(mvp);
#elif defined(HAVE_D3D8)
D3DXMATRIX p_out, p_rotate, mat;
D3DXMatrixOrthoOffCenterLH(&mat, 0, vp_width, vp_height, 0, 0.0f, 1.0f);
D3DXMatrixIdentity(&p_out);
D3DXMatrixRotationZ(&p_rotate, rotation * (M_PI / 2.0));
d3d_set_transform(d3dr, D3DTS_WORLD, &p_rotate);
d3d_set_transform(d3dr, D3DTS_VIEW, &p_out);
d3d_set_transform(d3dr, D3DTS_PROJECTION, &p_out);
#endif
}
static void xdk_renderchain_clear(void *data)
static void hlsl_d3d9_renderchain_clear(void *data)
{
xdk_renderchain_t *chain = (xdk_renderchain_t*)data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)data;
d3d_texture_free(chain->tex);
d3d_vertex_buffer_free(chain->vertex_buf, chain->vertex_decl);
}
static bool xdk_renderchain_init_shader_fvf(void *data, void *pass_data)
static bool hlsl_d3d9_renderchain_init_shader_fvf(void *data, void *pass_data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_video_t *pass = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)d3d->renderchain_data;
(void)pass_data;
@ -109,7 +92,7 @@ static bool renderchain_create_first_pass(void *data,
{
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)d3d->renderchain_data;
chain->vertex_buf = d3d_vertex_buffer_new(d3dr, 4 * sizeof(Vertex),
D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED,
@ -134,7 +117,7 @@ static bool renderchain_create_first_pass(void *data,
d3d_set_render_state(d3dr, D3DRS_CULLMODE, D3DCULL_NONE);
d3d_set_render_state(d3dr, D3DRS_ZENABLE, FALSE);
if (!xdk_renderchain_init_shader_fvf(chain, chain))
if (!hlsl_d3d9_renderchain_init_shader_fvf(chain, chain))
return false;
return true;
@ -143,15 +126,11 @@ static bool renderchain_create_first_pass(void *data,
static void renderchain_set_vertices(void *data, unsigned pass,
unsigned vert_width, unsigned vert_height, uint64_t frame_count)
{
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
#ifdef _XBOX
video_shader_ctx_params_t params;
video_shader_ctx_info_t shader_info;
#endif
#endif
unsigned width, height;
d3d_video_t *d3d = (d3d_video_t*)data;
xdk_renderchain_t *chain = d3d ? (xdk_renderchain_t*)d3d->renderchain_data : NULL;
hlsl_d3d9_renderchain_t *chain = d3d ? (hlsl_d3d9_renderchain_t*)d3d->renderchain_data : NULL;
video_driver_get_size(&width, &height);
@ -227,8 +206,6 @@ static void renderchain_set_vertices(void *data, unsigned pass,
d3d_vertex_buffer_unlock(chain->vertex_buf);
}
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
#ifdef _XBOX
renderchain_set_mvp(d3d, width, height, d3d->dev_rotation);
shader_info.data = d3d;
@ -252,15 +229,13 @@ static void renderchain_set_vertices(void *data, unsigned pass,
params.fbo_info_cnt = 0;
video_shader_driver_set_parameters(params);
#endif
#endif
}
static void renderchain_blit_to_texture(void *data, const void *frame,
unsigned width, unsigned height, unsigned pitch)
{
D3DLOCKED_RECT d3dlr;
xdk_renderchain_t *chain = (xdk_renderchain_t*)data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)chain->dev;
d3d_frame_postprocess(chain);
@ -279,30 +254,30 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
&d3dlr, frame, width, height, pitch);
}
static void xdk_renderchain_deinit(void *data)
static void hlsl_d3d9_renderchain_deinit(void *data)
{
xdk_renderchain_t *renderchain = (xdk_renderchain_t*)data;
hlsl_d3d9_renderchain_t *renderchain = (hlsl_d3d9_renderchain_t*)data;
if (renderchain)
free(renderchain);
}
static void xdk_renderchain_deinit_shader(void *data)
static void hlsl_d3d9_renderchain_deinit_shader(void *data)
{
(void)data;
/* stub */
}
static void xdk_renderchain_free(void *data)
static void hlsl_d3d9_renderchain_free(void *data)
{
d3d_video_t *chain = (d3d_video_t*)data;
if (!chain)
return;
xdk_renderchain_deinit_shader(chain);
xdk_renderchain_deinit(chain->renderchain_data);
xdk_renderchain_clear(chain->renderchain_data);
hlsl_d3d9_renderchain_deinit_shader(chain);
hlsl_d3d9_renderchain_deinit(chain->renderchain_data);
hlsl_d3d9_renderchain_clear(chain->renderchain_data);
#ifndef _XBOX
if (chain->tracker)
@ -311,39 +286,35 @@ static void xdk_renderchain_free(void *data)
}
void *xdk_renderchain_new(void)
void *hlsl_d3d9_renderchain_new(void)
{
xdk_renderchain_t *renderchain = (xdk_renderchain_t*)calloc(1, sizeof(*renderchain));
hlsl_d3d9_renderchain_t *renderchain =
(hlsl_d3d9_renderchain_t*)calloc(1, sizeof(*renderchain));
if (!renderchain)
return NULL;
return renderchain;
}
static bool xdk_renderchain_init_shader(void *data, void *renderchain_data)
static bool hlsl_d3d9_renderchain_init_shader(void *data,
void *renderchain_data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
#if defined(HAVE_HLSL)
const char *shader_path = NULL;
settings_t *settings = config_get_ptr();
#endif
(void)renderchain_data;
if (!d3d)
return false;
#if defined(HAVE_HLSL)
RARCH_LOG("D3D]: Using HLSL shader backend.\n");
shader_path = settings->path.shader;
const shader_backend_t *shader = &hlsl_backend;
return video_shader_driver_init(hlsl_backend, d3d, shader_path);
#endif
return true;
}
static bool xdk_renderchain_init(void *data,
static bool hlsl_d3d9_renderchain_init(void *data,
const void *_video_info,
void *dev_data,
const void *final_viewport_data,
@ -356,12 +327,12 @@ static bool xdk_renderchain_init(void *data,
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
const video_info_t *video_info = (const video_info_t*)_video_info;
const LinkInfo *link_info = (const LinkInfo*)info_data;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)d3d->renderchain_data;
unsigned fmt = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;
struct video_viewport *custom_vp = video_viewport_get_custom();
(void)final_viewport_data;
if (!xdk_renderchain_init_shader(d3d, NULL))
if (!hlsl_d3d9_renderchain_init_shader(d3d, NULL))
return false;
video_driver_get_size(&width, &height);
@ -385,7 +356,7 @@ static bool xdk_renderchain_init(void *data,
return true;
}
static void xdk_renderchain_set_final_viewport(void *data,
static void hlsl_d3d9_renderchain_set_final_viewport(void *data,
void *renderchain_data, const void *viewport_data)
{
(void)data;
@ -395,7 +366,7 @@ static void xdk_renderchain_set_final_viewport(void *data,
/* stub */
}
static bool xdk_renderchain_render(void *data, const void *frame,
static bool hlsl_d3d9_renderchain_render(void *data, const void *frame,
unsigned frame_width, unsigned frame_height,
unsigned pitch, unsigned rotation)
{
@ -404,7 +375,7 @@ static bool xdk_renderchain_render(void *data, const void *frame,
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
settings_t *settings = config_get_ptr();
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)d3d->renderchain_data;
chain->frame_count++;
@ -430,7 +401,7 @@ static bool xdk_renderchain_render(void *data, const void *frame,
return true;
}
static bool xdk_renderchain_add_pass(void *data, const void *info_data)
static bool hlsl_d3d9_renderchain_add_pass(void *data, const void *info_data)
{
(void)data;
(void)info_data;
@ -439,7 +410,7 @@ static bool xdk_renderchain_add_pass(void *data, const void *info_data)
return true;
}
static void xdk_renderchain_add_state_tracker(void *data, void *tracker_data)
static void hlsl_d3d9_renderchain_add_state_tracker(void *data, void *tracker_data)
{
(void)data;
(void)tracker_data;
@ -447,7 +418,7 @@ static void xdk_renderchain_add_state_tracker(void *data, void *tracker_data)
/* stub */
}
static void xdk_renderchain_convert_geometry(
static void hlsl_d3d9_renderchain_convert_geometry(
void *data, const void *info_data,
unsigned *out_width, unsigned *out_height,
unsigned width, unsigned height,
@ -464,12 +435,12 @@ static void xdk_renderchain_convert_geometry(
/* stub */
}
static bool xdk_renderchain_reinit(void *data,
static bool hlsl_d3d9_renderchain_reinit(void *data,
const void *video_data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
const video_info_t *video = (const video_info_t*)video_data;
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)d3d->renderchain_data;
if (!d3d)
return false;
@ -483,7 +454,7 @@ static bool xdk_renderchain_reinit(void *data,
return true;
}
static void xdk_renderchain_viewport_info(void *data, struct video_viewport *vp)
static void hlsl_d3d9_renderchain_viewport_info(void *data, struct video_viewport *vp)
{
unsigned width, height;
d3d_video_t *d3d = (d3d_video_t*)data;
@ -502,19 +473,19 @@ static void xdk_renderchain_viewport_info(void *data, struct video_viewport *vp)
vp->full_height = height;
}
renderchain_driver_t xdk_d3d_renderchain = {
xdk_renderchain_free,
xdk_renderchain_new,
xdk_renderchain_reinit,
xdk_renderchain_init,
xdk_renderchain_set_final_viewport,
xdk_renderchain_add_pass,
renderchain_driver_t hlsl_d3d9_renderchain = {
hlsl_d3d9_renderchain_free,
hlsl_d3d9_renderchain_new,
hlsl_d3d9_renderchain_reinit,
hlsl_d3d9_renderchain_init,
hlsl_d3d9_renderchain_set_final_viewport,
hlsl_d3d9_renderchain_add_pass,
NULL,
xdk_renderchain_add_state_tracker,
xdk_renderchain_render,
xdk_renderchain_convert_geometry,
hlsl_d3d9_renderchain_add_state_tracker,
hlsl_d3d9_renderchain_render,
hlsl_d3d9_renderchain_convert_geometry,
NULL,
NULL,
xdk_renderchain_viewport_info,
"xdk",
hlsl_d3d9_renderchain_viewport_info,
"hlsl_d3d9",
};

View File

@ -395,8 +395,10 @@ static const renderchain_driver_t *renderchain_drivers[] = {
#if defined(_WIN32) && defined(HAVE_D3D9) && defined(HAVE_CG)
&cg_d3d9_renderchain,
#endif
#ifdef _XBOX
&xdk_d3d_renderchain,
#if defined(_WIN32) && defined(HAVE_D3D9) && defined(HAVE_HLSL)
&hlsl_d3d9_renderchain,
#if defined(_WIN32) && defined(HAVE_D3D8)
&d3d8_renderchain,
#endif
&null_renderchain,
NULL

View File

@ -1252,7 +1252,6 @@ extern video_driver_t video_gx;
extern video_driver_t video_wiiu;
extern video_driver_t video_xenon360;
extern video_driver_t video_xvideo;
extern video_driver_t video_xdk_d3d;
extern video_driver_t video_sdl;
extern video_driver_t video_sdl2;
extern video_driver_t video_vg;
@ -1295,8 +1294,9 @@ extern const shader_backend_t hlsl_backend;
extern const shader_backend_t gl_cg_backend;
extern const shader_backend_t shader_null_backend;
extern renderchain_driver_t d3d8_renderchain;
extern renderchain_driver_t cg_d3d9_renderchain;
extern renderchain_driver_t xdk_d3d_renderchain;
extern renderchain_driver_t hlsl_d3d9_renderchain;
extern renderchain_driver_t null_renderchain;
RETRO_END_DECLS

View File

@ -147,12 +147,22 @@ VIDEO DRIVER
#if defined(HAVE_D3D)
#include "../gfx/common/d3d_common.cpp"
#include "../gfx/drivers/d3d.cpp"
#ifdef _XBOX
#include "../gfx/drivers_renderchain/xdk_renderchain.cpp"
#if defined(HAVE_D3D8)
#include "../gfx/drivers_renderchain/d3d8_renderchain.cpp"
#elif defined(HAVE_D3D9)
#ifdef HAVE_HLSL
#include "../gfx/drivers_renderchain/d3d9_hlsl_renderchain.cpp"
#endif
#ifdef HAVE_CG
#include "../gfx/drivers_renderchain/d3d9_cg_renderchain.cpp"
#endif
#endif
#endif
#ifdef HAVE_VULKAN