summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-07-27 18:11:19 -0700
committerEric Anholt <[email protected]>2017-09-26 14:49:43 -0700
commit68c91a87d73cfcd947e09803ceb800b50bf9e399 (patch)
treed69de616cf379a03bd166c4167aa17e1d390a7e5 /src/gallium/drivers/vc4/vc4_draw.c
parent4b407a62c757c8344736caa200e706d2bd66fb2c (diff)
broadcom/vc4: Keep pipe_sampler_view->texture matching the original texture.
I was overwriting view->texture with the shadow resource when we need to do shadow copies (retiling or baselevel rebase), but that tripped up some critical new sanity checking in state_tracker (making sure that stObj->pt hasn't changed from view->texture through TexImage-related paths). To avoid that, move the shadow resource to the vc4_sampler_view struct. Fixes: f0ecd36ef8e1 ("st/mesa: add an entirely separate codepath for setting up buffer views")
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_draw.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_draw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index da748cdc14d..1370867293f 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -116,12 +116,13 @@ vc4_predraw_check_textures(struct pipe_context *pctx,
struct vc4_context *vc4 = vc4_context(pctx);
for (int i = 0; i < stage_tex->num_textures; i++) {
- struct pipe_sampler_view *view = stage_tex->textures[i];
+ struct vc4_sampler_view *view =
+ vc4_sampler_view(stage_tex->textures[i]);
if (!view)
continue;
- struct vc4_resource *rsc = vc4_resource(view->texture);
- if (rsc->shadow_parent)
- vc4_update_shadow_baselevel_texture(pctx, view);
+
+ if (view->texture != view->base.texture)
+ vc4_update_shadow_baselevel_texture(pctx, &view->base);
vc4_flush_jobs_writing_resource(vc4, view->texture);
}