Merge branch 'avoid-batch-size-overflow' into 'master'

Revert "gsk: Respect max element vertices limitation"

See merge request GNOME/gtk!3704
This commit is contained in:
Matthias Clasen 2021-06-28 21:35:15 +00:00
commit dc50c7539a
2 changed files with 2 additions and 11 deletions

View File

@ -444,12 +444,9 @@ gsk_ngl_command_queue_new (GdkGLContext *context,
else else
self->uniforms = gsk_ngl_uniform_state_new (); self->uniforms = gsk_ngl_uniform_state_new ();
/* Determine max texture size and other limitations immediately /* Determine max texture size immediately and restore context */
* and restore context
*/
gdk_gl_context_make_current (context); gdk_gl_context_make_current (context);
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size); glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size);
glGetIntegerv (GL_MAX_ELEMENTS_VERTICES, &self->max_elements_vertices);
return g_steal_pointer (&self); return g_steal_pointer (&self);
} }
@ -620,7 +617,7 @@ gsk_ngl_command_queue_end_draw (GskNglCommandQueue *self)
last_batch->any.viewport.height == batch->any.viewport.height && last_batch->any.viewport.height == batch->any.viewport.height &&
last_batch->draw.framebuffer == batch->draw.framebuffer && last_batch->draw.framebuffer == batch->draw.framebuffer &&
last_batch->draw.vbo_offset + last_batch->draw.vbo_count == batch->draw.vbo_offset && last_batch->draw.vbo_offset + last_batch->draw.vbo_count == batch->draw.vbo_offset &&
last_batch->draw.vbo_count + batch->draw.vbo_count <= self->max_elements_vertices && last_batch->draw.vbo_count + batch->draw.vbo_count < G_MAXINT16 &&
snapshots_equal (self, last_batch, batch)) snapshots_equal (self, last_batch, batch))
{ {
last_batch->draw.vbo_count += batch->draw.vbo_count; last_batch->draw.vbo_count += batch->draw.vbo_count;

View File

@ -231,12 +231,6 @@ struct _GskNglCommandQueue
*/ */
int max_texture_size; int max_texture_size;
/* Discovered max element count. We must not create batches that contain
* more vertices than this number.
*/
int max_elements_vertices;
/* The index of the last batch in @batches, which may not be the element /* The index of the last batch in @batches, which may not be the element
* at the end of the array, as batches can be reordered. This is used to * at the end of the array, as batches can be reordered. This is used to
* update the "next" index when adding a new batch. * update the "next" index when adding a new batch.