iris: Fix fast-clearing of depth via glClearTex(Sub)Image

If we clear depth only texture via glClearTex(Sub)Image it may cause:
../src/intel/blorp/blorp_genX_exec.h:1554: blorp_emit_surface_states: Assertion `params->depth.enabled || params->stencil.enabled' failed.

due to clear_depth_stencil calling blorp_clear_depth_stencil when
depth is already fast-cleared and there is no stencil.

Fixes piglit test: arb_clear_texture-depth

Fixes: 51638cf18a
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5770>
This commit is contained in:
Danylo Piliaiev 2020-07-02 11:39:25 +03:00 committed by Marge Bot
parent 026615c0f9
commit 77844690be

View file

@ -583,7 +583,7 @@ clear_depth_stencil(struct iris_context *ice,
/* At this point, we might have fast cleared the depth buffer. So if there's
* no stencil clear pending, return early.
*/
if (!(clear_depth || clear_stencil)) {
if (!(clear_depth || (clear_stencil && stencil_res))) {
return;
}