[gtk/wip/chergert/glproto: 613/920] ensure we've loaded max texture size
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 613/920] ensure we've loaded max texture size
- Date: Mon, 8 Feb 2021 19:15:32 +0000 (UTC)
commit c16ff6220369c64353fab12ab10998c766e32f6c
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 30 16:32:30 2020 -0800
ensure we've loaded max texture size
gsk/next/gskglcommandqueue.c | 5 ++++-
gsk/next/gskglrenderer.c | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index b06c832889..57bc7fe3b9 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -1156,10 +1156,13 @@ gsk_gl_command_queue_create_texture (GskGLCommandQueue *self,
int min_filter,
int mag_filter)
{
- GLuint texture_id;
+ GLuint texture_id = 0;
g_return_val_if_fail (GSK_IS_GL_COMMAND_QUEUE (self), -1);
+ if G_UNLIKELY (self->max_texture_size == -1)
+ glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size);
+
if (width > self->max_texture_size || height > self->max_texture_size)
return -1;
diff --git a/gsk/next/gskglrenderer.c b/gsk/next/gskglrenderer.c
index e9a36f376a..73827d6031 100644
--- a/gsk/next/gskglrenderer.c
+++ b/gsk/next/gskglrenderer.c
@@ -259,6 +259,8 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
width = ceilf (viewport->size.width);
height = ceilf (viewport->size.height);
+ gdk_gl_context_make_current (context);
+
if (!gsk_next_driver_create_render_target (self->driver,
width,
height,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]