From 784e7998c1d66dbe40650baf360ce02fd211f144 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 5 Apr 2015 03:42:15 +0200 Subject: [PATCH] (D3D) Rewrite renderchain_set_mvp --- gfx/d3d/render_chain.cpp | 2 +- gfx/d3d/render_chain.h | 2 +- gfx/d3d/render_chain_cg.h | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gfx/d3d/render_chain.cpp b/gfx/d3d/render_chain.cpp index 61f92ba36f..aa80aaa5ce 100644 --- a/gfx/d3d/render_chain.cpp +++ b/gfx/d3d/render_chain.cpp @@ -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( diff --git a/gfx/d3d/render_chain.h b/gfx/d3d/render_chain.h index 09fc0aac3a..58e2b71d9c 100644 --- a/gfx/d3d/render_chain.h +++ b/gfx/d3d/render_chain.h @@ -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, diff --git a/gfx/d3d/render_chain_cg.h b/gfx/d3d/render_chain_cg.h index 1e80445fc4..9e978ae8d6 100644 --- a/gfx/d3d/render_chain_cg.h +++ b/gfx/d3d/render_chain_cg.h @@ -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 { \