From: Kenneth Graunke Date: Wed, 31 Jul 2019 01:49:47 +0000 (-0700) Subject: iris: Skip repeated depth buffer disables. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a22a8bf495c68ea76417888bf6a6b0e6f486f72;p=mesa.git iris: Skip repeated depth buffer disables. Often times, the depth buffer is entirely disabled, but color render targets change. For example, GenerateMipmaps will change the color render target for each miplevel, but there is no depth buffer. In the Civilization VI benchmark, this drops the median number of 3DSTATE_DEPTH_BUFFER etc. packets emitted per frame from 472 to 34. --- diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index d32dc4995f8..dddf50bf921 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2336,6 +2336,10 @@ iris_set_framebuffer_state(struct pipe_context *ctx, ice->state.dirty |= IRIS_DIRTY_SF_CL_VIEWPORT; } + if (cso->zsbuf || state->zsbuf) { + ice->state.dirty |= IRIS_DIRTY_DEPTH_BUFFER; + } + util_copy_framebuffer_state(cso, state); cso->samples = samples; cso->layers = layers; @@ -2401,8 +2405,6 @@ iris_set_framebuffer_state(struct pipe_context *ctx, ice->state.null_fb.offset += iris_bo_offset_from_base_address(iris_resource_bo(ice->state.null_fb.res)); - ice->state.dirty |= IRIS_DIRTY_DEPTH_BUFFER; - /* Render target change */ ice->state.dirty |= IRIS_DIRTY_BINDINGS_FS;