summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-10-07 17:04:10 -0700
committerJason Ekstrand <[email protected]>2016-10-14 15:39:41 -0700
commitcf2e3c3163d9702588d71f130024128d59ca5c17 (patch)
tree176e6979ab36f88a4c35c082aa93f64442a28cc8 /src
parent0414aaa1339f26bffef3852ea1030c339dded314 (diff)
intel/blorp: Simplify depth/stencil config
The newly reworked depth/stencil config code can properly handle having depth, stencil, both, or neither. We no longer need to predicate it on having depth or stencil. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/blorp/blorp_genX_exec.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
index 889e74c9ca1..40387067f3f 100644
--- a/src/intel/blorp/blorp_genX_exec.h
+++ b/src/intel/blorp/blorp_genX_exec.h
@@ -787,13 +787,10 @@ blorp_emit_depth_stencil_config(struct blorp_batch *batch,
db.SurfaceBaseAddress = params->depth.addr;
db.DepthBufferMOCS = mocs;
- } else {
+ } else if (params->stencil.addr.buffer) {
db.SurfaceFormat = D32_FLOAT;
db.SurfaceType = isl_to_gen_ds_surftype[params->stencil.surf.dim];
- /* If we don't have a depth buffer, pull dimensions from stencil */
- assert(params->stencil.addr.buffer != NULL);
-
db.Width = params->stencil.surf.logical_level0_px.width - 1;
db.Height = params->stencil.surf.logical_level0_px.height - 1;
db.RenderTargetViewExtent = db.Depth =
@@ -801,6 +798,9 @@ blorp_emit_depth_stencil_config(struct blorp_batch *batch,
db.LOD = params->stencil.view.base_level;
db.MinimumArrayElement = params->stencil.view.base_array_layer;
+ } else {
+ db.SurfaceType = SURFTYPE_NULL;
+ db.SurfaceFormat = D32_FLOAT;
}
}
@@ -1261,17 +1261,7 @@ blorp_exec(struct blorp_batch *batch, const struct blorp_params *params)
blorp_emit_viewport_state(batch, params);
- if (params->depth.addr.buffer || params->stencil.addr.buffer) {
- blorp_emit_depth_stencil_config(batch, params);
- } else {
- blorp_emit(batch, GENX(3DSTATE_DEPTH_BUFFER), db) {
- db.SurfaceType = SURFTYPE_NULL;
- db.SurfaceFormat = D32_FLOAT;
- }
- blorp_emit(batch, GENX(3DSTATE_HIER_DEPTH_BUFFER), hiz);
- blorp_emit(batch, GENX(3DSTATE_STENCIL_BUFFER), sb);
- blorp_emit(batch, GENX(3DSTATE_CLEAR_PARAMS), clear);
- }
+ blorp_emit_depth_stencil_config(batch, params);
blorp_emit(batch, GENX(3DPRIMITIVE), prim) {
prim.VertexAccessType = SEQUENTIAL;