aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/blorp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-10-07 17:20:00 -0700
committerJason Ekstrand <[email protected]>2016-10-14 15:39:41 -0700
commitd80c0307eaa91a609f71651fb52122849d35b5ac (patch)
treeb8045a5b524c6c9427033d8bc28722488559cc4d /src/intel/blorp
parent0cabf93b80d03ea923cf507218024953b9d0254c (diff)
intel/blorp: Add a flag to make blorp not re-emit dept/stencil buffers
In Vulkan, we want to be able to use blorp to perform clears inside of a render pass. If blorp stomps the depth/stencil buffers packets then we'll have to re-emit them. This gets tricky when secondary command buffers get involved. Instead, we'll simply guarantee that the depth and stencil buffers we pass to blorp (if any) match those already set in the hardware. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/blorp')
-rw-r--r--src/intel/blorp/blorp.c4
-rw-r--r--src/intel/blorp/blorp.h13
-rw-r--r--src/intel/blorp/blorp_genX_exec.h3
3 files changed, 17 insertions, 3 deletions
diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
index 91513a0413a..08afffe06d1 100644
--- a/src/intel/blorp/blorp.c
+++ b/src/intel/blorp/blorp.c
@@ -45,10 +45,12 @@ blorp_finish(struct blorp_context *blorp)
void
blorp_batch_init(struct blorp_context *blorp,
- struct blorp_batch *batch, void *driver_batch)
+ struct blorp_batch *batch, void *driver_batch,
+ enum blorp_batch_flags flags)
{
batch->blorp = blorp;
batch->driver_batch = driver_batch;
+ batch->flags = flags;
}
void
diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h
index b178ae374d6..0c64d13371b 100644
--- a/src/intel/blorp/blorp.h
+++ b/src/intel/blorp/blorp.h
@@ -67,13 +67,24 @@ void blorp_init(struct blorp_context *blorp, void *driver_ctx,
struct isl_device *isl_dev);
void blorp_finish(struct blorp_context *blorp);
+enum blorp_batch_flags {
+ /**
+ * This flag indicates that blorp should *not* re-emit the depth and
+ * stencil buffer packets. Instead, the driver guarantees that all depth
+ * and stencil images passed in will match what is currently set in the
+ * hardware.
+ */
+ BLORP_BATCH_NO_EMIT_DEPTH_STENCIL = (1 << 0),
+};
+
struct blorp_batch {
struct blorp_context *blorp;
void *driver_batch;
+ enum blorp_batch_flags flags;
};
void blorp_batch_init(struct blorp_context *blorp, struct blorp_batch *batch,
- void *driver_batch);
+ void *driver_batch, enum blorp_batch_flags flags);
void blorp_batch_finish(struct blorp_batch *batch);
struct blorp_address {
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
index fa5cebf8242..ec0d0223ad3 100644
--- a/src/intel/blorp/blorp_genX_exec.h
+++ b/src/intel/blorp/blorp_genX_exec.h
@@ -1343,7 +1343,8 @@ blorp_exec(struct blorp_batch *batch, const struct blorp_params *params)
blorp_emit_viewport_state(batch, params);
- blorp_emit_depth_stencil_config(batch, params);
+ if (!(batch->flags & BLORP_BATCH_NO_EMIT_DEPTH_STENCIL))
+ blorp_emit_depth_stencil_config(batch, params);
blorp_emit(batch, GENX(3DPRIMITIVE), prim) {
prim.VertexAccessType = SEQUENTIAL;