(D3D) Cleanups
This commit is contained in:
parent
3f118245a6
commit
162ffd9586
|
@ -710,11 +710,12 @@ static const gfx_ctx_driver_t *d3d_get_context(void *data)
|
||||||
/* Default to Direct3D9 for now.
|
/* Default to Direct3D9 for now.
|
||||||
TODO: GL core contexts through ANGLE? */
|
TODO: GL core contexts through ANGLE? */
|
||||||
enum gfx_ctx_api api = GFX_CTX_DIRECT3D9_API;
|
enum gfx_ctx_api api = GFX_CTX_DIRECT3D9_API;
|
||||||
unsigned major = 9, minor = 0;
|
unsigned major = 9;
|
||||||
|
unsigned minor = 0;
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
#if defined(_XBOX1)
|
#if defined(HAVE_D3D8)
|
||||||
api = GFX_CTX_DIRECT3D8_API;
|
api = GFX_CTX_DIRECT3D8_API;
|
||||||
major = 8;
|
major = 8;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1081,11 +1082,8 @@ static void d3d_reinit_renderchain(void *data,
|
||||||
if (!d3d)
|
if (!d3d)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
d3d->pixel_size = video->rgb32 ?
|
d3d->pixel_size = video->rgb32 ? sizeof(uint32_t) : sizeof(uint16_t);
|
||||||
sizeof(uint32_t) : sizeof(uint16_t);
|
d3d->tex_w = d3d->tex_h = RARCH_SCALE_BASE * video->input_scale;
|
||||||
d3d->tex_w = d3d->tex_h =
|
|
||||||
RARCH_SCALE_BASE * video->input_scale;
|
|
||||||
|
|
||||||
RARCH_LOG(
|
RARCH_LOG(
|
||||||
"Reinitializing renderchain - and textures (%u x %u @ %u bpp)\n",
|
"Reinitializing renderchain - and textures (%u x %u @ %u bpp)\n",
|
||||||
d3d->tex_w, d3d->tex_h, d3d->pixel_size * CHAR_BIT);
|
d3d->tex_w, d3d->tex_h, d3d->pixel_size * CHAR_BIT);
|
||||||
|
@ -1105,19 +1103,17 @@ static bool texture_image_render(d3d_video_t *d3d,
|
||||||
struct texture_image *out_img,
|
struct texture_image *out_img,
|
||||||
int x, int y, int w, int h, bool force_fullscreen)
|
int x, int y, int w, int h, bool force_fullscreen)
|
||||||
{
|
{
|
||||||
float fX, fY;
|
|
||||||
void *verts = NULL;
|
void *verts = NULL;
|
||||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||||
|
float fX = (float)(x);
|
||||||
|
float fY = (float)(y);
|
||||||
|
|
||||||
if (!d3d)
|
if (!d3d)
|
||||||
return false;
|
return false;
|
||||||
if (!out_img->pixels || !out_img->vertex_buf)
|
if (!out_img->pixels || !out_img->vertex_buf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
fX = (float)(x);
|
/* Create the new vertices. */
|
||||||
fY = (float)(y);
|
|
||||||
|
|
||||||
// create the new vertices
|
|
||||||
Vertex newVerts[] =
|
Vertex newVerts[] =
|
||||||
{
|
{
|
||||||
// x, y, z, color, u ,v
|
// x, y, z, color, u ,v
|
||||||
|
@ -1228,9 +1224,9 @@ static bool d3d_init_multipass(d3d_video_t *d3d)
|
||||||
if (d3d->shader.pass[i].fbo.valid)
|
if (d3d->shader.pass[i].fbo.valid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
d3d->shader.pass[i].fbo.scale_x =
|
|
||||||
d3d->shader.pass[i].fbo.scale_y = 1.0f;
|
d3d->shader.pass[i].fbo.scale_y = 1.0f;
|
||||||
d3d->shader.pass[i].fbo.type_x =
|
d3d->shader.pass[i].fbo.scale_x = 1.0f;
|
||||||
|
d3d->shader.pass[i].fbo.type_x = RARCH_SCALE_INPUT;
|
||||||
d3d->shader.pass[i].fbo.type_y = RARCH_SCALE_INPUT;
|
d3d->shader.pass[i].fbo.type_y = RARCH_SCALE_INPUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1305,11 +1301,14 @@ static bool d3d_init_singlepass(d3d_video_t *d3d)
|
||||||
|
|
||||||
memset(&d3d->shader, 0, sizeof(d3d->shader));
|
memset(&d3d->shader, 0, sizeof(d3d->shader));
|
||||||
d3d->shader.passes = 1;
|
d3d->shader.passes = 1;
|
||||||
|
|
||||||
pass = (video_shader_pass*)&d3d->shader.pass[0];
|
pass = (video_shader_pass*)&d3d->shader.pass[0];
|
||||||
|
|
||||||
pass->fbo.valid = true;
|
pass->fbo.valid = true;
|
||||||
pass->fbo.scale_x = pass->fbo.scale_y = 1.0;
|
pass->fbo.scale_y = 1.0;
|
||||||
pass->fbo.type_x = pass->fbo.type_y = RARCH_SCALE_VIEWPORT;
|
pass->fbo.type_y = RARCH_SCALE_VIEWPORT;
|
||||||
|
pass->fbo.scale_x = pass->fbo.scale_y;
|
||||||
|
pass->fbo.type_x = pass->fbo.type_y;
|
||||||
strlcpy(pass->source.path, d3d->cg_shader.c_str(),
|
strlcpy(pass->source.path, d3d->cg_shader.c_str(),
|
||||||
sizeof(pass->source.path));
|
sizeof(pass->source.path));
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue