st/dri: make sure software color-buffers are linear
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 23 Sep 2019 19:56:36 +0000 (21:56 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 09:57:25 +0000 (09:57 +0000)
Otherwise, we might end up with a tiling-capable driver creating a
tiled resource here instead of linear. This is currently possible with
Zink, although we currently force all display-targets to be linear.

But that doesn't seem like a good idea in the long run, so let's loosen
this restriction.

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2678>

src/gallium/state_trackers/dri/drisw.c

index df364c47391b3c5590f8d04078218c8f53b6b868..1c0f56e042d3a2680b8b2476a11052ad56b2938d 100644 (file)
@@ -351,7 +351,7 @@ drisw_allocate_textures(struct dri_context *stctx,
 
       /* if we don't do any present, no need for display targets */
       if (statts[i] != ST_ATTACHMENT_DEPTH_STENCIL && !screen->swrast_no_present)
-         bind |= PIPE_BIND_DISPLAY_TARGET;
+         bind |= PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_LINEAR;
 
       if (format == PIPE_FORMAT_NONE)
          continue;