[Mesa-stable] [Mesa-dev] [PATCH 2/2] i965: Torch public intel_batchbuffer_emit_dword/float helpers.

Jason Ekstrand jason at jlekstrand.net
Sat Jan 6 16:58:54 UTC 2018


Both are

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

There is a part of me that has been tempted for some time to try and make 
some sort of generic batch buffer structure and share it between GL and 
Vulkan.  Getting this stuff right is hard and a good set of unified helpers 
may help.  I'm not sure how good of an idea that would be but it's a 
thought.  Also, not all that applicable to this patch, it just got me 
thinking about it again. :-)


On January 5, 2018 20:04:47 Kenneth Graunke <kenneth at whitecape.org> wrote:

> intel_batchbuffer_emit_float is dead code, it should go.
>
> intel_batchbuffer_emit_dword only had one user, which had bungled using
> them by forgetting to call intel_batchbuffer_require_space first.  So it
> seems wise to delete these unsafe helpers.
>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c |  4 ++--
>  src/mesa/drivers/dri/i965/intel_batchbuffer.h | 13 -------------
>  2 files changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c 
> b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> index 3fd8e05d3dc..a17e1699254 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> @@ -692,9 +692,9 @@ brw_finish_batch(struct brw_context *brw)
>      * necessary by emitting an extra MI_NOOP after the end.
>      */
>     intel_batchbuffer_require_space(brw, 8, brw->batch.ring);
> -   intel_batchbuffer_emit_dword(&brw->batch, MI_BATCH_BUFFER_END);
> +   *brw->batch.map_next++ = MI_BATCH_BUFFER_END;
>     if (USED_BATCH(brw->batch) & 1) {
> -      intel_batchbuffer_emit_dword(&brw->batch, MI_NOOP);
> +      *brw->batch.map_next++ = MI_NOOP;
>     }
>
>     brw->batch.no_wrap = false;
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h 
> b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> index a927fe7e09e..a9a34600ad1 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
> @@ -78,19 +78,6 @@ static inline uint32_t float_as_int(float f)
>     return fi.d;
>  }
>
> -static inline void
> -intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword)
> -{
> -   *batch->map_next++ = dword;
> -   assert(batch->ring != UNKNOWN_RING);
> -}
> -
> -static inline void
> -intel_batchbuffer_emit_float(struct intel_batchbuffer *batch, float f)
> -{
> -   intel_batchbuffer_emit_dword(batch, float_as_int(f));
> -}
> -
>  static inline void
>  intel_batchbuffer_begin(struct brw_context *brw, int n, enum brw_gpu_ring ring)
>  {
> --
> 2.15.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-stable mailing list