summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-12 02:03:57 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit3c45d03049452bb1f8fd9d095054793807ed5f98 (patch)
treeab95add207f02af31c22fa7b7050bd385bc9393a /src
parent3a938a4b2328499e0713495ae78125b4020d89f7 (diff)
iris: only mark depth/stencil as writable if writes are actually enabled
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_state.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index a2fef71241d..c3d80bbedf1 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -3822,11 +3822,14 @@ iris_restore_render_saved_bos(struct iris_context *ice,
struct iris_resource *zres, *sres;
iris_get_depth_stencil_resources(cso_fb->zsbuf->texture,
&zres, &sres);
- // XXX: might not be writable...
- if (zres)
- iris_use_pinned_bo(batch, zres->bo, true);
- if (sres)
- iris_use_pinned_bo(batch, sres->bo, true);
+ if (zres) {
+ iris_use_pinned_bo(batch, zres->bo,
+ ice->state.depth_writes_enabled);
+ }
+ if (sres) {
+ iris_use_pinned_bo(batch, sres->bo,
+ ice->state.stencil_writes_enabled);
+ }
}
}
@@ -4376,11 +4379,15 @@ iris_upload_dirty_render_state(struct iris_context *ice,
struct iris_resource *zres, *sres;
iris_get_depth_stencil_resources(cso_fb->zsbuf->texture,
&zres, &sres);
- // XXX: might not be writable...
- if (zres)
- iris_use_pinned_bo(batch, zres->bo, true);
- if (sres)
- iris_use_pinned_bo(batch, sres->bo, true);
+ if (zres) {
+ iris_use_pinned_bo(batch, zres->bo,
+ ice->state.depth_writes_enabled);
+ }
+
+ if (sres) {
+ iris_use_pinned_bo(batch, sres->bo,
+ ice->state.stencil_writes_enabled);
+ }
}
}