summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-05-06 09:46:29 -0600
committerBrian Paul <[email protected]>2016-05-17 19:20:36 -0600
commit877a8026c7e1d729356eb6b6dfadfe358bbe23d1 (patch)
treeea6d8dcb50390bed20103e68e0dc457fc94f8a4a
parentfe430b0310ed0f2f52d45b149e72b7802a6f2cad (diff)
svga: null out all sampler views if start=num=0
Because the CSO module handles sampler views for fragment shaders differently than vertex/geom shaders, VS/GS shader sampler views aren't explicitly unbound like for FS sampler vers. This code checks for the case of start=num=0 and nulls out the sampler views. Fixes a assert regression in piglit's arb_texture_multisample- sample-position test. Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_pipe_sampler.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 845eebbd014..63771ac8892 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -433,6 +433,18 @@ svga_set_sampler_views(struct pipe_context *pipe,
if (!svga_have_vgpu10(svga) && shader != PIPE_SHADER_FRAGMENT)
return;
+ /* This bit of code works around a quirk in the CSO module.
+ * If start=num=0 it means all sampler views should be released.
+ * Note that the CSO module treats sampler views for fragment shaders
+ * differently than other shader types.
+ */
+ if (start == 0 && num == 0 && svga->curr.num_sampler_views[shader] > 0) {
+ for (i = 0; i < svga->curr.num_sampler_views[shader]; i++) {
+ pipe_sampler_view_release(pipe, &svga->curr.sampler_views[shader][i]);
+ }
+ any_change = TRUE;
+ }
+
for (i = 0; i < num; i++) {
enum pipe_texture_target target;