(D3D) Rewrite renderchain_set_mvp

This commit is contained in:
twinaphex 2015-04-05 03:42:15 +02:00
parent 4a41dbcda7
commit 784e7998c1
3 changed files with 6 additions and 4 deletions

View File

@ -556,7 +556,7 @@ void renderchain_set_mvp(void *data, void *vertex_program,
D3DXMatrixMultiply(&proj, &ortho, &rot);
D3DXMatrixTranspose(&tmp, &proj);
renderchain_set_shader_mvp(chain, &vPrg, tmp);
renderchain_set_shader_mvp(chain, &vPrg, &tmp);
}
void renderchain_convert_geometry(

View File

@ -178,7 +178,7 @@ void renderchain_destroy_stock_shader(void *data);
void renderchain_destroy_shader(void *data, int i);
void renderchain_set_shader_mvp(void *data, CGprogram *vPrg, D3DXMATRIX &tmp);
void renderchain_set_shader_mvp(void *data, void *data, void *matrix_data);
void renderchain_set_shader_params(void *data, void *pass_data,
unsigned video_w, unsigned video_h,

View File

@ -181,11 +181,13 @@ void renderchain_destroy_shader(void *data, int i)
#endif
}
void renderchain_set_shader_mvp(void *data, CGprogram *vPrg, D3DXMATRIX &tmp)
void renderchain_set_shader_mvp(void *data, void *shader_data, void *matrix_data)
{
CGprogram *vPrg = (CGprogram*)shader_data;
const D3DXMATRIX *matrix = (const D3DXMATRIX*)matrix_data;
CGparameter cgpModelViewProj = cgGetNamedParameter(*vPrg, "modelViewProj");
if (cgpModelViewProj)
cgD3D9SetUniformMatrix(cgpModelViewProj, &tmp);
cgD3D9SetUniformMatrix(cgpModelViewProj, matrix);
}
#define set_cg_param(prog, param, val) do { \