mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
(D3D) Turn renderchain_set_mvp static
This commit is contained in:
parent
2066396913
commit
d14751a649
@ -1097,6 +1097,30 @@ void renderchain_end_render(void *data)
|
||||
chain->prev.ptr = (chain->prev.ptr + 1) & TEXTURESMASK;
|
||||
}
|
||||
|
||||
static void renderchain_set_mvp(void *data, void *vertex_program,
|
||||
unsigned vp_width, unsigned vp_height,
|
||||
unsigned rotation)
|
||||
{
|
||||
D3DXMATRIX proj, ortho, rot, tmp;
|
||||
CGprogram vPrg = (CGprogram)vertex_program;
|
||||
renderchain_t *chain = (renderchain_t*)data;
|
||||
|
||||
if (!chain)
|
||||
return;
|
||||
|
||||
D3DXMatrixOrthoOffCenterLH(&ortho, 0, vp_width, 0, vp_height, 0, 1);
|
||||
|
||||
if (rotation)
|
||||
D3DXMatrixRotationZ(&rot, rotation * (M_PI / 2.0));
|
||||
else
|
||||
D3DXMatrixIdentity(&rot);
|
||||
|
||||
D3DXMatrixMultiply(&proj, &ortho, &rot);
|
||||
D3DXMatrixTranspose(&tmp, &proj);
|
||||
|
||||
renderchain_set_shader_mvp(chain, &vPrg, &tmp);
|
||||
}
|
||||
|
||||
static void renderchain_set_vertices(
|
||||
void *data, void *pass_data,
|
||||
unsigned width, unsigned height,
|
||||
@ -1347,29 +1371,6 @@ void renderchain_set_viewport(void *data, void *viewport_data)
|
||||
d3d_set_viewport(d3dr, vp);
|
||||
}
|
||||
|
||||
void renderchain_set_mvp(void *data, void *vertex_program,
|
||||
unsigned vp_width, unsigned vp_height,
|
||||
unsigned rotation)
|
||||
{
|
||||
D3DXMATRIX proj, ortho, rot, tmp;
|
||||
CGprogram vPrg = (CGprogram)vertex_program;
|
||||
renderchain_t *chain = (renderchain_t*)data;
|
||||
|
||||
if (!chain)
|
||||
return;
|
||||
|
||||
D3DXMatrixOrthoOffCenterLH(&ortho, 0, vp_width, 0, vp_height, 0, 1);
|
||||
|
||||
if (rotation)
|
||||
D3DXMatrixRotationZ(&rot, rotation * (M_PI / 2.0));
|
||||
else
|
||||
D3DXMatrixIdentity(&rot);
|
||||
|
||||
D3DXMatrixMultiply(&proj, &ortho, &rot);
|
||||
D3DXMatrixTranspose(&tmp, &proj);
|
||||
|
||||
renderchain_set_shader_mvp(chain, &vPrg, &tmp);
|
||||
}
|
||||
|
||||
void renderchain_convert_geometry(
|
||||
void *data, const void *info_data,
|
||||
|
@ -80,10 +80,6 @@ bool renderchain_create_first_pass(void *data,
|
||||
|
||||
void renderchain_set_viewport(void *data, void *viewport_data);
|
||||
|
||||
void renderchain_set_mvp(void *data, void *vertex_program,
|
||||
unsigned vp_width, unsigned vp_height,
|
||||
unsigned rotation);
|
||||
|
||||
void renderchain_convert_geometry(void *data, const void *info_data,
|
||||
unsigned *out_width, unsigned *out_height,
|
||||
unsigned width, unsigned height,
|
||||
|
Loading…
x
Reference in New Issue
Block a user