svga: use pipe_sampler_view::target in svga_set_sampler_views()
authorBrian Paul <brianp@vmware.com>
Fri, 3 Aug 2018 12:28:34 +0000 (06:28 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 8 Aug 2018 14:20:10 +0000 (08:20 -0600)
instead of the underlying texture's target.  This fixes an issue
where the TGSI sampler type was not agreeing with the sampler view
target/type.  In particular, this fixes a Mint 19 XFCE desktop
scaling issue because the TGSI code was using a RECT sampler but
the sampler view's underlying texture was PIPE_TEXTURE_2D.

We want to use the sampler view's type rather than the underlying
resource, as we do for the view's surface format.

No piglit regressions.

VMware issue 2156696.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_pipe_sampler.c

index e9d1d6f4527a5bf0646d62cd5b3795703f5bca2b..4c38092078c6179ffd30b996681d7974da29ae31 100644 (file)
@@ -492,7 +492,7 @@ svga_set_sampler_views(struct pipe_context *pipe,
       if (util_format_is_srgb(views[i]->format))
          flag_srgb |= 1 << (start + i);
 
-      target = views[i]->texture->target;
+      target = views[i]->target;
       if (target == PIPE_TEXTURE_1D)
          flag_1d |= 1 << (start + i);
       else if (target == PIPE_TEXTURE_RECT)