summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-04-08 13:11:01 -0700
committerEric Anholt <eric@anholt.net>2015-04-13 10:39:24 -0700
commitadae027260bedc7af73e5cc7a74af3cafa4ab460 (patch)
tree7c233b504a3b35a6b69d44e554130c102b5dcaef /src/gallium/drivers
parent39b6f7e76c909505df8590b6414e8f710121108a (diff)
downloadexternal_mesa3d-adae027260bedc7af73e5cc7a74af3cafa4ab460.zip
external_mesa3d-adae027260bedc7af73e5cc7a74af3cafa4ab460.tar.gz
external_mesa3d-adae027260bedc7af73e5cc7a74af3cafa4ab460.tar.bz2
vc4: Use the blit interface for updating shadow textures.
This lets us plug in a better blit implementation and have it impact the shadow update, too.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index cbb334f..10e1d6c 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -651,20 +651,38 @@ vc4_update_shadow_baselevel_texture(struct pipe_context *pctx,
return;
for (int i = 0; i <= shadow->base.b.last_level; i++) {
- struct pipe_box box = {
- .x = 0,
- .y = 0,
- .z = 0,
- .width = u_minify(shadow->base.b.width0, i),
- .height = u_minify(shadow->base.b.height0, i),
- .depth = 1,
+ unsigned width = u_minify(shadow->base.b.width0, i);
+ unsigned height = u_minify(shadow->base.b.height0, i);
+ struct pipe_blit_info info = {
+ .dst = {
+ .resource = &shadow->base.b,
+ .level = i,
+ .box = {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ .width = width,
+ .height = height,
+ .depth = 1,
+ },
+ .format = shadow->base.b.format,
+ },
+ .src = {
+ .resource = &orig->base.b,
+ .level = view->u.tex.first_level + i,
+ .box = {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ .width = width,
+ .height = height,
+ .depth = 1,
+ },
+ .format = orig->base.b.format,
+ },
+ .mask = ~0,
};
-
- util_resource_copy_region(pctx,
- &shadow->base.b, i, 0, 0, 0,
- &orig->base.b,
- view->u.tex.first_level + i,
- &box);
+ pctx->blit(pctx, &info);
}
shadow->writes = orig->writes;