Simplify gl_glsl_set_coords
This commit is contained in:
parent
7db6e58273
commit
cb1c8df547
|
@ -1391,7 +1391,6 @@ fallback:
|
||||||
attr->loc = coord1; \
|
attr->loc = coord1; \
|
||||||
attr->size = multiplier; \
|
attr->size = multiplier; \
|
||||||
attr->offset = size * sizeof(GLfloat); \
|
attr->offset = size * sizeof(GLfloat); \
|
||||||
attribs_size++; \
|
|
||||||
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]; \
|
||||||
|
@ -1413,9 +1412,9 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struc
|
||||||
if (!glsl || !glsl->shader->modern || !coords)
|
if (!glsl || !glsl->shader->modern || !coords)
|
||||||
goto fallback;
|
goto fallback;
|
||||||
|
|
||||||
attr = attribs;
|
attr = attribs;
|
||||||
uni = &glsl->uniforms[glsl->active_idx];
|
uni = &glsl->uniforms[glsl->active_idx];
|
||||||
buffer = short_buffer;
|
buffer = short_buffer;
|
||||||
|
|
||||||
if (coords->vertices > 4)
|
if (coords->vertices > 4)
|
||||||
{
|
{
|
||||||
|
@ -1434,16 +1433,28 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struc
|
||||||
goto fallback;
|
goto fallback;
|
||||||
|
|
||||||
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++;
|
||||||
|
}
|
||||||
|
|
||||||
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++;
|
||||||
|
}
|
||||||
|
|
||||||
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++;
|
||||||
|
}
|
||||||
|
|
||||||
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++;
|
||||||
|
}
|
||||||
|
|
||||||
if (size)
|
if (size)
|
||||||
gl_glsl_set_attribs(glsl,
|
gl_glsl_set_attribs(glsl,
|
||||||
|
|
Loading…
Reference in New Issue