[gtk/wip/matthiasc/vao-in-place] gl: Drop buffer_size
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/vao-in-place] gl: Drop buffer_size
- Date: Fri, 11 Oct 2019 18:11:44 +0000 (UTC)
commit f284da1735418323d33daa2f22e7721526ec5e77
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 11 14:10:56 2019 -0400
gl: Drop buffer_size
No need to maintain buffer_size separately.
It is always vertices->len * sizeof (GskQuadVertex).
gsk/gl/gskglrenderer.c | 8 +++-----
gsk/gl/gskglrenderops.c | 6 +-----
gsk/gl/gskglrenderopsprivate.h | 2 --
3 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 4380622aea..cb36f8c245 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -2988,10 +2988,10 @@ add_offscreen_ops (GskGLRenderer *self,
}
static void
-gsk_gl_renderer_render_ops (GskGLRenderer *self,
- gsize vertex_data_size)
+gsk_gl_renderer_render_ops (GskGLRenderer *self)
{
const Program *program = NULL;
+ gsize vertex_data_size = self->op_builder.vertices->len * sizeof (GskQuadVertex);
float *vertex_data = (float*)self->op_builder.vertices->data;
OpBufferIter iter;
OpKind kind;
@@ -3189,7 +3189,6 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
{
GskGLRenderer *self = GSK_GL_RENDERER (renderer);
graphene_matrix_t projection;
- gsize buffer_size;
#ifdef G_ENABLE_DEBUG
GskProfiler *profiler;
gint64 gpu_time, cpu_time, start_time;
@@ -3266,7 +3265,6 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
g_assert_cmpint (self->op_builder.current_render_target, ==, fbo_id);
ops_pop_modelview (&self->op_builder);
ops_pop_clip (&self->op_builder);
- buffer_size = self->op_builder.buffer_size;
ops_finish (&self->op_builder);
/*g_message ("Ops: %u", self->render_ops->len);*/
@@ -3294,7 +3292,7 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
glBlendEquation (GL_FUNC_ADD);
gdk_gl_context_push_debug_group (self->gl_context, "Rendering ops");
- gsk_gl_renderer_render_ops (self, buffer_size);
+ gsk_gl_renderer_render_ops (self);
gdk_gl_context_pop_debug_group (self->gl_context);
#ifdef G_ENABLE_DEBUG
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index 724aacfa42..4c6e2a7b35 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -28,7 +28,6 @@ ops_finish (RenderOpBuilder *builder)
g_array_free (builder->clip_stack, TRUE);
builder->clip_stack = NULL;
- builder->buffer_size = 0;
builder->dx = 0;
builder->dy = 0;
builder->current_modelview = NULL;
@@ -690,15 +689,12 @@ ops_draw (RenderOpBuilder *builder,
}
else
{
- gsize offset = builder->buffer_size / sizeof (GskQuadVertex);
-
op = op_buffer_add (&builder->render_ops, OP_DRAW);
- op->vao_offset = offset;
+ op->vao_offset = builder->vertices->len;
op->vao_size = GL_N_VERTICES;
}
g_array_append_vals (builder->vertices, vertex_data, GL_N_VERTICES);
- builder->buffer_size += sizeof (GskQuadVertex) * GL_N_VERTICES;
}
/* The offset is only valid for the current modelview.
diff --git a/gsk/gl/gskglrenderopsprivate.h b/gsk/gl/gskglrenderopsprivate.h
index f01097b65f..e555653617 100644
--- a/gsk/gl/gskglrenderopsprivate.h
+++ b/gsk/gl/gskglrenderopsprivate.h
@@ -153,8 +153,6 @@ typedef struct
float current_opacity;
float dx, dy;
- gsize buffer_size;
-
OpBuffer render_ops;
GArray *vertices;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]