mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
cogl: Remove COGL_PRIVATE_FEATURE_QUADS
There's no real performance benefit to this, it's just a difference between GL and GLES for no reason. https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
This commit is contained in:
parent
c5bb2e3f56
commit
148cba3270
@ -276,6 +276,7 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
|
|||||||
gboolean allocated = FALSE;
|
gboolean allocated = FALSE;
|
||||||
CoglAttribute *attributes[2];
|
CoglAttribute *attributes[2];
|
||||||
CoglPrimitive *prim;
|
CoglPrimitive *prim;
|
||||||
|
CoglIndices *indices;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
n_verts = node->d.texture.rectangles->len * 4;
|
n_verts = node->d.texture.rectangles->len * 4;
|
||||||
@ -354,22 +355,11 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
|
|||||||
attributes,
|
attributes,
|
||||||
2 /* n_attributes */);
|
2 /* n_attributes */);
|
||||||
|
|
||||||
#ifdef CLUTTER_COGL_HAS_GL
|
indices =
|
||||||
if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUADS))
|
|
||||||
cogl_primitive_set_mode (prim, GL_QUADS);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* GLES doesn't support GL_QUADS so instead we use a VBO
|
|
||||||
with indexed vertices to generate GL_TRIANGLES from the
|
|
||||||
quads */
|
|
||||||
|
|
||||||
CoglIndices *indices =
|
|
||||||
cogl_get_rectangle_indices (ctx, node->d.texture.rectangles->len);
|
cogl_get_rectangle_indices (ctx, node->d.texture.rectangles->len);
|
||||||
|
|
||||||
cogl_primitive_set_indices (prim, indices,
|
cogl_primitive_set_indices (prim, indices,
|
||||||
node->d.texture.rectangles->len * 6);
|
node->d.texture.rectangles->len * 6);
|
||||||
}
|
|
||||||
|
|
||||||
node->d.texture.primitive = prim;
|
node->d.texture.primitive = prim;
|
||||||
|
|
||||||
|
@ -304,21 +304,6 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
|
|||||||
if (!_cogl_pipeline_get_real_blend_enabled (state->pipeline))
|
if (!_cogl_pipeline_get_real_blend_enabled (state->pipeline))
|
||||||
draw_flags |= COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE;
|
draw_flags |= COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE;
|
||||||
|
|
||||||
#ifdef HAVE_COGL_GL
|
|
||||||
if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUADS))
|
|
||||||
{
|
|
||||||
/* XXX: it's rather evil that we sneak in the GL_QUADS enum here... */
|
|
||||||
_cogl_framebuffer_draw_attributes (framebuffer,
|
|
||||||
state->pipeline,
|
|
||||||
GL_QUADS,
|
|
||||||
state->current_vertex, batch_len * 4,
|
|
||||||
attributes,
|
|
||||||
state->attributes->len,
|
|
||||||
draw_flags);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif /* HAVE_COGL_GL */
|
|
||||||
{
|
|
||||||
if (batch_len > 1)
|
if (batch_len > 1)
|
||||||
{
|
{
|
||||||
CoglVerticesMode mode = COGL_VERTICES_MODE_TRIANGLES;
|
CoglVerticesMode mode = COGL_VERTICES_MODE_TRIANGLES;
|
||||||
@ -343,7 +328,6 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
|
|||||||
state->attributes->len,
|
state->attributes->len,
|
||||||
draw_flags);
|
draw_flags);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* DEBUGGING CODE XXX: This path will cause all rectangles to be
|
/* DEBUGGING CODE XXX: This path will cause all rectangles to be
|
||||||
* drawn with a coloured outline. Each batch will be rendered with
|
* drawn with a coloured outline. Each batch will be rendered with
|
||||||
@ -636,7 +620,6 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
|
|||||||
4,
|
4,
|
||||||
COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE);
|
COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE);
|
||||||
|
|
||||||
if (!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_QUADS))
|
|
||||||
state->indices = cogl_get_rectangle_indices (ctx, batch_len);
|
state->indices = cogl_get_rectangle_indices (ctx, batch_len);
|
||||||
|
|
||||||
/* We only create new Attributes when the stride within the
|
/* We only create new Attributes when the stride within the
|
||||||
|
@ -54,7 +54,6 @@ typedef enum
|
|||||||
COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_FORMAT,
|
COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_FORMAT,
|
||||||
COGL_PRIVATE_FEATURE_ALPHA_TEST,
|
COGL_PRIVATE_FEATURE_ALPHA_TEST,
|
||||||
COGL_PRIVATE_FEATURE_FORMAT_CONVERSION,
|
COGL_PRIVATE_FEATURE_FORMAT_CONVERSION,
|
||||||
COGL_PRIVATE_FEATURE_QUADS,
|
|
||||||
COGL_PRIVATE_FEATURE_BLEND_CONSTANT,
|
COGL_PRIVATE_FEATURE_BLEND_CONSTANT,
|
||||||
COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS,
|
COGL_PRIVATE_FEATURE_QUERY_FRAMEBUFFER_BITS,
|
||||||
COGL_PRIVATE_FEATURE_BUILTIN_POINT_SIZE_UNIFORM,
|
COGL_PRIVATE_FEATURE_BUILTIN_POINT_SIZE_UNIFORM,
|
||||||
|
@ -484,7 +484,6 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||||||
/* Features which are not available in GL 3 */
|
/* Features which are not available in GL 3 */
|
||||||
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_GL_FIXED, TRUE);
|
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_GL_FIXED, TRUE);
|
||||||
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_ALPHA_TEST, TRUE);
|
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_ALPHA_TEST, TRUE);
|
||||||
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_QUADS, TRUE);
|
|
||||||
COGL_FLAGS_SET (private_features,
|
COGL_FLAGS_SET (private_features,
|
||||||
COGL_PRIVATE_FEATURE_ALPHA_TEXTURES, TRUE);
|
COGL_PRIVATE_FEATURE_ALPHA_TEXTURES, TRUE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user