mirror of
https://github.com/libretro/RetroArch
synced 2025-03-17 10:21:26 +00:00
(Cg) Cleanups
This commit is contained in:
parent
9ff8a3c8e2
commit
01a9185a2d
@ -120,12 +120,12 @@ struct uniform_cg_data
|
||||
CGparameter loc;
|
||||
};
|
||||
|
||||
#define cg_gl_set_coord(cg_data, name, coords_name, len) do { \
|
||||
if (cg_data->prg[cg_data->active_idx].name) \
|
||||
#define cg_gl_set_coord(param, cg_data, ptr, len) do { \
|
||||
if (param) \
|
||||
{ \
|
||||
cgGLSetParameterPointer(cg_data->prg[cg_data->active_idx].name, len, GL_FLOAT, 0, coords->coords_name); \
|
||||
cgGLEnableClientState(cg_data->prg[cg_data->active_idx].name); \
|
||||
cg_data->attribs.elems[cg_data->attribs.index++] = cg_data->prg[cg_data->active_idx].name; \
|
||||
cgGLSetParameterPointer(param, len, GL_FLOAT, 0, ptr); \
|
||||
cgGLEnableClientState(param); \
|
||||
cg_data->attribs.elems[cg_data->attribs.index++] = param; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
@ -269,10 +269,10 @@ static bool gl_cg_set_coords(void *handle_data, void *shader_data, const struct
|
||||
if (!cg_data || !coords)
|
||||
goto fallback;
|
||||
|
||||
cg_gl_set_coord(cg_data, vertex, vertex, 2);
|
||||
cg_gl_set_coord(cg_data, tex, tex_coord, 2);
|
||||
cg_gl_set_coord(cg_data, lut_tex, lut_tex_coord, 2);
|
||||
cg_gl_set_coord(cg_data, color, color, 4);
|
||||
cg_gl_set_coord(cg_data->prg[cg_data->active_idx].vertex, cg_data, coords->vertex, 2);
|
||||
cg_gl_set_coord(cg_data->prg[cg_data->active_idx].tex, cg_data, coords->tex_coord, 2);
|
||||
cg_gl_set_coord(cg_data->prg[cg_data->active_idx].lut_tex, cg_data, coords->lut_tex_coord, 2);
|
||||
cg_gl_set_coord(cg_data->prg[cg_data->active_idx].color, cg_data, coords->color, 4);
|
||||
|
||||
return true;
|
||||
|
||||
@ -325,13 +325,7 @@ static void gl_cg_set_texture_info(
|
||||
for (i = 0; i < 4; i++)
|
||||
gl_cg_set_uniform_parameter(cg_data, &uniform_params[i], &uniform_data[i]);
|
||||
|
||||
if (params->coord)
|
||||
{
|
||||
cgGLSetParameterPointer(params->coord, 2,
|
||||
GL_FLOAT, 0, info->coord);
|
||||
cgGLEnableClientState(params->coord);
|
||||
cg_data->attribs.elems[cg_data->attribs.index++] = params->coord;
|
||||
}
|
||||
cg_gl_set_coord(params->coord, cg_data, info->coord, 2);
|
||||
}
|
||||
|
||||
static void gl_cg_set_params(void *data, void *shader_data,
|
||||
|
Loading…
x
Reference in New Issue
Block a user