[Mesa-dev] [PATCH 3/3] intel/blorp: Stop setting 3DSTATE_DRAWING_RECTANGLE

Anuj Phogat anuj.phogat at gmail.com
Tue Sep 13 18:01:24 UTC 2016


On Mon, Sep 12, 2016 at 3:50 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> The Vulkan driver sets 3DSTATE_DRAWING_RECTANGLE once to MAX_INT x MAX_INT
> at the GPU initialization time and never sets it again.  The GL driver sets
> it every time the framebuffer changes.  Originally, blorp set it to the
> size of the drawing area but meant we had to set it back in the Vulkan
> driver.  Instead, we can easily just do that in the GL driver's blorp_exec
> implementation and not set it in blorp core.
>
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/intel/blorp/blorp_genX_exec.h           |  5 -----
>  src/intel/vulkan/genX_blorp_exec.c          | 15 ---------------
>  src/mesa/drivers/dri/i965/genX_blorp_exec.c |  5 +++++
>  3 files changed, 5 insertions(+), 20 deletions(-)
>
> diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
> index aff59e1..eb4a5b9 100644
> --- a/src/intel/blorp/blorp_genX_exec.h
> +++ b/src/intel/blorp/blorp_genX_exec.h
> @@ -1216,11 +1216,6 @@ blorp_exec(struct blorp_batch *batch, const struct blorp_params *params)
>        clear.DepthClearValue = params->depth.clear_color.u32[0];
>     }
>
> -   blorp_emit(batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) {
> -      rect.ClippedDrawingRectangleXMax = MAX2(params->x1, params->x0) - 1;
> -      rect.ClippedDrawingRectangleYMax = MAX2(params->y1, params->y0) - 1;
> -   }
> -
>     blorp_emit(batch, GENX(3DPRIMITIVE), prim) {
>        prim.VertexAccessType = SEQUENTIAL;
>        prim.PrimitiveTopologyType = _3DPRIM_RECTLIST;
> diff --git a/src/intel/vulkan/genX_blorp_exec.c b/src/intel/vulkan/genX_blorp_exec.c
> index a3ad97a..5ddbb7d 100644
> --- a/src/intel/vulkan/genX_blorp_exec.c
> +++ b/src/intel/vulkan/genX_blorp_exec.c
> @@ -203,21 +203,6 @@ genX(blorp_exec)(struct blorp_batch *batch,
>
>     blorp_exec(batch, params);
>
> -   /* BLORP sets DRAWING_RECTANGLE but we always want it set to the maximum.
> -    * Since we set it once at driver init and never again, we have to set it
> -    * back after invoking blorp.
> -    *
> -    * TODO: BLORP should assume a max drawing rectangle
> -    */
> -   blorp_emit(batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) {
> -      rect.ClippedDrawingRectangleYMin = 0;
> -      rect.ClippedDrawingRectangleXMin = 0;
> -      rect.ClippedDrawingRectangleYMax = UINT16_MAX;
> -      rect.ClippedDrawingRectangleXMax = UINT16_MAX;
> -      rect.DrawingRectangleOriginY = 0;
> -      rect.DrawingRectangleOriginX = 0;
> -   }
> -
>     cmd_buffer->state.vb_dirty = ~0;
>     cmd_buffer->state.dirty = ~0;
>     cmd_buffer->state.push_constants_dirty = ~0;
> diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> index 8cd5a62..edcd896 100644
> --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> @@ -206,6 +206,11 @@ retry:
>
>     brw_emit_depth_stall_flushes(brw);
>
> +   blorp_emit(batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) {
> +      rect.ClippedDrawingRectangleXMax = MAX2(params->x1, params->x0) - 1;
> +      rect.ClippedDrawingRectangleYMax = MAX2(params->y1, params->y0) - 1;
> +   }
> +
>     blorp_exec(batch, params);
>
>     /* Make sure we didn't wrap the batch unintentionally, and make sure we
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list