[gtk/wip/matthiasc/gsk-hdr: 5/5] ngl: Make render_texture high depth aware




commit 61411220d2d5d8249dc651d1b83fd04fe2f1c4a9
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 6 18:31:09 2021 -0400

    ngl: Make render_texture high depth aware
    
    Make a deep texture, if the render nodes have
    high depth content.

 gsk/ngl/gsknglrenderer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gsk/ngl/gsknglrenderer.c b/gsk/ngl/gsknglrenderer.c
index e5aaebd0a4..c75d82230e 100644
--- a/gsk/ngl/gsknglrenderer.c
+++ b/gsk/ngl/gsknglrenderer.c
@@ -241,6 +241,7 @@ gsk_ngl_renderer_render_texture (GskRenderer           *renderer,
   guint texture_id;
   int width;
   int height;
+  int format;
 
   g_assert (GSK_IS_NGL_RENDERER (renderer));
   g_assert (root != NULL);
@@ -248,9 +249,11 @@ gsk_ngl_renderer_render_texture (GskRenderer           *renderer,
   width = ceilf (viewport->size.width);
   height = ceilf (viewport->size.height);
 
+  format = gsk_render_node_prefers_high_depth (root) ? GL_RGBA16F : GL_RGBA8;
+
   if (gsk_ngl_driver_create_render_target (self->driver,
                                            width, height,
-                                           GL_RGBA8,
+                                           format,
                                            GL_NEAREST, GL_NEAREST,
                                            &render_target))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]