[Mesa-dev] [PATCH] intel/blorp: Inline get_vs_entry_size into emit_urb_config

Pohjolainen, Topi topi.pohjolainen at gmail.com
Tue Aug 30 06:39:11 UTC 2016


On Mon, Aug 29, 2016 at 09:00:33AM -0700, Jason Ekstrand wrote:
> Topi asked to have the prefix removed because there's nothing gen7 about
> it.  However, now that everything is in a single file, there is no good
> reason to have it split out into a helper function anyway.  Let's just put
> the contents in emit_urb_config and call it a day.

Thanks!

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

> ---
>  src/intel/blorp/blorp_genX_exec.h | 41 +++++++++++++++++----------------------
>  1 file changed, 18 insertions(+), 23 deletions(-)
> 
> diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
> index f44076e..a39c1ae 100644
> --- a/src/intel/blorp/blorp_genX_exec.h
> +++ b/src/intel/blorp/blorp_genX_exec.h
> @@ -113,28 +113,6 @@ __gen_combine_address(struct blorp_batch *batch, void *location,
>        _dw + 1; /* Array starts at dw[1] */               \
>     })
>  
> -/* Once vertex fetcher has written full VUE entries with complete
> - * header the space requirement is as follows per vertex (in bytes):
> - *
> - *     Header    Position    Program constants
> - *   +--------+------------+-------------------+
> - *   |   16   |     16     |      n x 16       |
> - *   +--------+------------+-------------------+
> - *
> - * where 'n' stands for number of varying inputs expressed as vec4s.
> - *
> - * The URB size is in turn expressed in 64 bytes (512 bits).
> - */
> -static inline unsigned
> -gen7_blorp_get_vs_entry_size(const struct blorp_params *params)
> -{
> -    const unsigned num_varyings =
> -       params->wm_prog_data ? params->wm_prog_data->num_varying_inputs : 0;
> -    const unsigned total_needed = 16 + 16 + num_varyings * 16;
> -
> -   return DIV_ROUND_UP(total_needed, 64);
> -}
> -
>  /* 3DSTATE_URB
>   * 3DSTATE_URB_VS
>   * 3DSTATE_URB_HS
> @@ -166,7 +144,24 @@ static void
>  emit_urb_config(struct blorp_batch *batch,
>                  const struct blorp_params *params)
>  {
> -   blorp_emit_urb_config(batch, gen7_blorp_get_vs_entry_size(params));
> +   /* Once vertex fetcher has written full VUE entries with complete
> +    * header the space requirement is as follows per vertex (in bytes):
> +    *
> +    *     Header    Position    Program constants
> +    *   +--------+------------+-------------------+
> +    *   |   16   |     16     |      n x 16       |
> +    *   +--------+------------+-------------------+
> +    *
> +    * where 'n' stands for number of varying inputs expressed as vec4s.
> +    */
> +    const unsigned num_varyings =
> +       params->wm_prog_data ? params->wm_prog_data->num_varying_inputs : 0;
> +    const unsigned total_needed = 16 + 16 + num_varyings * 16;
> +
> +   /* The URB size is expressed in units of 64 bytes (512 bits) */
> +   const unsigned vs_entry_size = DIV_ROUND_UP(total_needed, 64)
> +
> +   blorp_emit_urb_config(batch, vs_entry_size);
>  }
>  
>  static void
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list