st/dri: make swrast_no_present member of dri_screen
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 24 Aug 2018 13:06:00 +0000 (14:06 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 3 Oct 2018 12:38:05 +0000 (13:38 +0100)
Just like the dri2 options, this is better suited in the dri_screen
struct.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/state_trackers/dri/dri_screen.h
src/gallium/state_trackers/dri/drisw.c

index e410aa9c2f263bdc3ef9a35507f700e976be3782..8d2d9c02892c21acb78bb9eac95ec72fa9bea22e 100644 (file)
@@ -78,6 +78,8 @@ struct dri_screen
    boolean has_reset_status_query;
    enum pipe_texture_target target;
 
+   boolean swrast_no_present;
+
    /* hooks filled in by dri2 & drisw */
    __DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle);
 
index e24fcba3869a455d59c018f19c903acf00ceba33..1fba71bdd9737687cc75c4b22feb1fdd96dbe514 100644 (file)
@@ -42,7 +42,6 @@
 #include "dri_query_renderer.h"
 
 DEBUG_GET_ONCE_BOOL_OPTION(swrast_no_present, "SWRAST_NO_PRESENT", FALSE);
-static boolean swrast_no_present = FALSE;
 
 static inline void
 get_drawable_info(__DRIdrawable *dPriv, int *x, int *y, int *w, int *h)
@@ -195,7 +194,7 @@ drisw_present_texture(__DRIdrawable *dPriv,
    struct dri_drawable *drawable = dri_drawable(dPriv);
    struct dri_screen *screen = dri_screen(drawable->sPriv);
 
-   if (swrast_no_present)
+   if (screen->swrast_no_present)
       return;
 
    screen->base.screen->flush_frontbuffer(screen->base.screen, ptex, 0, 0, drawable, sub_box);
@@ -338,7 +337,7 @@ drisw_allocate_textures(struct dri_context *stctx,
       dri_drawable_get_format(drawable, statts[i], &format, &bind);
 
       /* if we don't do any present, no need for display targets */
-      if (statts[i] != ST_ATTACHMENT_DEPTH_STENCIL && !swrast_no_present)
+      if (statts[i] != ST_ATTACHMENT_DEPTH_STENCIL && !screen->swrast_no_present)
          bind |= PIPE_BIND_DISPLAY_TARGET;
 
       if (format == PIPE_FORMAT_NONE)
@@ -443,7 +442,7 @@ drisw_init_screen(__DRIscreen * sPriv)
    screen->sPriv = sPriv;
    screen->fd = -1;
 
-   swrast_no_present = debug_get_option_swrast_no_present();
+   screen->swrast_no_present = debug_get_option_swrast_no_present();
 
    sPriv->driverPrivate = (void *)screen;
    sPriv->extensions = drisw_screen_extensions;