mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(HLSL) Cleanups
This commit is contained in:
parent
d03ff06cf3
commit
d7fa70927c
@ -526,15 +526,21 @@ static void hlsl_use(void *data, void *shader_data,
|
||||
{
|
||||
hlsl_shader_data_t *hlsl = (hlsl_shader_data_t*)shader_data;
|
||||
LPDIRECT3DDEVICE9 d3dr = hlsl ? (LPDIRECT3DDEVICE9)hlsl->dev : NULL;
|
||||
struct shader_program_hlsl_data *program = NULL;
|
||||
|
||||
if (!hlsl || !hlsl->prg[idx].vprg || !hlsl->prg[idx].fprg)
|
||||
if (!hlsl)
|
||||
return;
|
||||
|
||||
program = &hlsl->prg[idx];
|
||||
|
||||
if (!program || !program->vprg || !program->fprg)
|
||||
return;
|
||||
|
||||
if (set_active)
|
||||
hlsl->active_idx = idx;
|
||||
|
||||
d3d9_set_vertex_shader(d3dr, idx, hlsl->prg[idx].vprg);
|
||||
d3d9_set_pixel_shader(d3dr, hlsl->prg[idx].fprg);
|
||||
d3d9_set_vertex_shader(d3dr, idx, program->vprg);
|
||||
d3d9_set_pixel_shader(d3dr, program->fprg);
|
||||
}
|
||||
|
||||
static unsigned hlsl_num(void *data)
|
||||
@ -574,13 +580,18 @@ static bool hlsl_set_mvp(void *data, void *shader_data, const void *mat_data)
|
||||
LPDIRECT3DDEVICE9 d3dr = hlsl ?
|
||||
(LPDIRECT3DDEVICE9)hlsl->dev : NULL;
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)mat_data;
|
||||
struct shader_program_hlsl_data *program = NULL;
|
||||
|
||||
if (!hlsl || !hlsl->prg[hlsl->active_idx].mvp)
|
||||
if (!hlsl)
|
||||
return false;
|
||||
|
||||
ID3DXConstantTable_SetMatrix(hlsl->prg[hlsl->active_idx].v_ctable, d3dr,
|
||||
hlsl->prg[hlsl->active_idx].mvp,
|
||||
&hlsl->prg[hlsl->active_idx].mvp_val);
|
||||
program = &hlsl->prg[hlsl->active_idx];
|
||||
|
||||
if (!program || !program->mvp)
|
||||
return false;
|
||||
|
||||
ID3DXConstantTable_SetMatrix(program->v_ctable, d3dr,
|
||||
program->mvp, &program->mvp_val);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user