summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_draw.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-04-14 11:31:11 -0700
committerEric Anholt <eric@anholt.net>2015-04-15 16:50:23 -0700
commit3a728d4dfbd727c30f36116772803674beffcbb6 (patch)
tree15dc62c115180bd428c4ad86f69f5af8de27c0f3 /src/gallium/drivers/vc4/vc4_draw.c
parentbd957b1b79124c5061af1eddf16932793e806d87 (diff)
downloadexternal_mesa3d-3a728d4dfbd727c30f36116772803674beffcbb6.zip
external_mesa3d-3a728d4dfbd727c30f36116772803674beffcbb6.tar.gz
external_mesa3d-3a728d4dfbd727c30f36116772803674beffcbb6.tar.bz2
vc4: Update the shadow texture for public textures on every draw.
We don't know who else has written to it, so we'd better update it every time. This makes the gears spin in X again.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_draw.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_draw.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index 717eb8a..16418bf 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -132,6 +132,20 @@ vc4_start_draw(struct vc4_context *vc4)
}
static void
+vc4_update_shadow_textures(struct pipe_context *pctx,
+ struct vc4_texture_stateobj *stage_tex)
+{
+ for (int i = 0; i < stage_tex->num_textures; i++) {
+ struct pipe_sampler_view *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);
+ }
+}
+
+static void
vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
{
struct vc4_context *vc4 = vc4_context(pctx);
@@ -145,6 +159,10 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
return;
}
+ /* Before setting up the draw, do any fixup blits necessary. */
+ vc4_update_shadow_textures(pctx, &vc4->verttex);
+ vc4_update_shadow_textures(pctx, &vc4->fragtex);
+
vc4_get_draw_cl_space(vc4);
struct vc4_vertex_stateobj *vtx = vc4->vtx;