[gtk/wip/chergert/glproto: 235/493] get max_texture_size immediately on creation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 235/493] get max_texture_size immediately on creation
- Date: Fri, 19 Feb 2021 02:25:11 +0000 (UTC)
commit f89a3b46772652bb88a44042cbd8ee1cce0e040f
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 22 14:12:59 2021 -0800
get max_texture_size immediately on creation
gsk/next/gskglcommandqueue.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 765484ea70..c2653c8c46 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -260,12 +260,21 @@ GskGLCommandQueue *
gsk_gl_command_queue_new (GdkGLContext *context)
{
GskGLCommandQueue *self;
+ GdkGLContext *previous_context;
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
self = g_object_new (GSK_TYPE_GL_COMMAND_QUEUE, NULL);
self->context = g_object_ref (context);
+ previous_context = gdk_gl_context_get_current ();
+
+ gdk_gl_context_make_current (context);
+ glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size);
+
+ if (previous_context != NULL)
+ gdk_gl_context_make_current (previous_context);
+
return g_steal_pointer (&self);
}
@@ -875,9 +884,6 @@ gsk_gl_command_queue_begin_frame (GskGLCommandQueue *self)
g_return_if_fail (self->batches->len == 0);
self->tail_batch_index = -1;
-
- if G_UNLIKELY (self->max_texture_size == -1)
- glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]