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




commit 6f1742970d788880b4e16073289d8c3e636de45e
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.
    
    For now, we use 32F here for the deep format,
    since using 16F causes small rounding errors
    that break the memorytexture roundtrip tests.

 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..eea48b6e6d 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_RGBA32F : 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]