mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-13 14:21:08 +00:00
Cleanups
This commit is contained in:
parent
cb1c8df547
commit
f4ac760178
@ -1386,16 +1386,14 @@ fallback:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define gl_glsl_set_coord_array(attr, coord1, coord2, coords, size, multiplier) \
|
#define gl_glsl_set_coord_array(attr, coord1, coord2, coords, size, multiplier) \
|
||||||
{ \
|
unsigned y; \
|
||||||
unsigned y; \
|
attr->loc = coord1; \
|
||||||
attr->loc = coord1; \
|
attr->size = multiplier; \
|
||||||
attr->size = multiplier; \
|
attr->offset = size * sizeof(GLfloat); \
|
||||||
attr->offset = size * sizeof(GLfloat); \
|
attr++; \
|
||||||
attr++; \
|
for (y = 0; y < (multiplier * coords->vertices); y++) \
|
||||||
for (y = 0; y < (multiplier * coords->vertices); y++) \
|
buffer[y + size] = coord2[y]; \
|
||||||
buffer[y + size] = coord2[y]; \
|
size += multiplier * coords->vertices; \
|
||||||
size += multiplier * coords->vertices; \
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struct video_coords *coords)
|
static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struct video_coords *coords)
|
||||||
{
|
{
|
||||||
@ -1419,9 +1417,9 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struc
|
|||||||
if (coords->vertices > 4)
|
if (coords->vertices > 4)
|
||||||
{
|
{
|
||||||
size_t elems = 0;
|
size_t elems = 0;
|
||||||
elems += (uni->color >= 0) * 4;
|
elems += (uni->color >= 0) * 4;
|
||||||
elems += (uni->tex_coord >= 0) * 2;
|
elems += (uni->tex_coord >= 0) * 2;
|
||||||
elems += (uni->vertex_coord >= 0) * 2;
|
elems += (uni->vertex_coord >= 0) * 2;
|
||||||
elems += (uni->lut_tex_coord >= 0) * 2;
|
elems += (uni->lut_tex_coord >= 0) * 2;
|
||||||
|
|
||||||
elems *= coords->vertices * sizeof(GLfloat);
|
elems *= coords->vertices * sizeof(GLfloat);
|
||||||
@ -1434,25 +1432,29 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struc
|
|||||||
|
|
||||||
if (uni->tex_coord >= 0)
|
if (uni->tex_coord >= 0)
|
||||||
{
|
{
|
||||||
gl_glsl_set_coord_array(attr, uni->tex_coord, coords->tex_coord, coords, size, 2);
|
gl_glsl_set_coord_array(attr, uni->tex_coord,
|
||||||
|
coords->tex_coord, coords, size, 2);
|
||||||
attribs_size++;
|
attribs_size++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uni->vertex_coord >= 0)
|
if (uni->vertex_coord >= 0)
|
||||||
{
|
{
|
||||||
gl_glsl_set_coord_array(attr, uni->vertex_coord, coords->vertex, coords, size, 2);
|
gl_glsl_set_coord_array(attr, uni->vertex_coord,
|
||||||
|
coords->vertex, coords, size, 2);
|
||||||
attribs_size++;
|
attribs_size++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uni->color >= 0)
|
if (uni->color >= 0)
|
||||||
{
|
{
|
||||||
gl_glsl_set_coord_array(attr, uni->color, coords->color, coords, size, 4);
|
gl_glsl_set_coord_array(attr, uni->color,
|
||||||
|
coords->color, coords, size, 4);
|
||||||
attribs_size++;
|
attribs_size++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uni->lut_tex_coord >= 0)
|
if (uni->lut_tex_coord >= 0)
|
||||||
{
|
{
|
||||||
gl_glsl_set_coord_array(attr, uni->lut_tex_coord, coords->lut_tex_coord, coords, size, 2);
|
gl_glsl_set_coord_array(attr, uni->lut_tex_coord,
|
||||||
|
coords->lut_tex_coord, coords, size, 2);
|
||||||
attribs_size++;
|
attribs_size++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user