[Mesa-dev] [PATCH 2/2] i965: Use a variable for the push constant size in kB.
Paul Berry
stereotype441 at gmail.com
Thu Apr 4 07:01:06 PDT 2013
On 2 April 2013 21:11, Kenneth Graunke <kenneth at whitecape.org> wrote:
> This clarifies that the offset of 2 is actually 16 kB / 8kB units.
> It also keys both computations off of a single variable, which should
> make it easier to change in the future.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>
This series is:
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
> ---
> src/mesa/drivers/dri/i965/gen7_urb.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/gen7_urb.c
> b/src/mesa/drivers/dri/i965/gen7_urb.c
> index dafe1ad..5ac3885 100644
> --- a/src/mesa/drivers/dri/i965/gen7_urb.c
> +++ b/src/mesa/drivers/dri/i965/gen7_urb.c
> @@ -78,8 +78,9 @@ static void
> gen7_upload_urb(struct brw_context *brw)
> {
> struct intel_context *intel = &brw->intel;
> + const int push_size_kB = 16;
> /* Total space for entries is URB size - 16kB for push constants */
> - int handle_region_size = (brw->urb.size - 16) * 1024; /* bytes */
> + int handle_region_size = (brw->urb.size - push_size_kB) * 1024; /*
> bytes */
>
> /* CACHE_NEW_VS_PROG */
> unsigned vs_size = MAX2(brw->vs.prog_data->urb_entry_size, 1);
> @@ -92,7 +93,7 @@ gen7_upload_urb(struct brw_context *brw)
> brw->urb.nr_vs_entries = ROUND_DOWN_TO(nr_vs_entries, 8);
>
> /* URB Starting Addresses are specified in multiples of 8kB. */
> - brw->urb.vs_start = 2; /* skip over push constants */
> + brw->urb.vs_start = push_size_kB / 8; /* skip over push constants */
>
> assert(brw->urb.nr_vs_entries % 8 == 0);
> assert(brw->urb.nr_gs_entries % 8 == 0);
> --
> 1.8.1.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130404/f32366aa/attachment.html>
More information about the mesa-dev
mailing list