From cf2e3c3163d9702588d71f130024128d59ca5c17 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 7 Oct 2016 17:04:10 -0700 Subject: [PATCH] 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 Reviewed-by: Topi Pohjolainen --- src/intel/blorp/blorp_genX_exec.h | 20 +++++--------------- 1 file 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; -- 2.30.2