[Mesa-dev] [PATCH 2/2] i965: Set pitch of pull constant buffers to 16.
Kenneth Graunke
kenneth at whitecape.org
Wed Jan 11 13:07:57 PST 2012
On 01/11/2012 12:06 PM, Paul Berry wrote:
> We always access pull constant buffers using the message types "OWord
> Block Read" or "OWord Dual Block Read". According to the Sandy Bridge
> PRM, Vol 4 Part 1, pages 214 and 218, when using these messages:
>
> "the surface pitch is ignored, the surface is treated as a
> 1-dimensional surface. An element size (pitch) of 16 bytes is
> used to determine the size of the buffer for out-of-bounds
> checking if using the surface state model."
>
> Previously we were setting the pitch for pull constant buffers to the
> size of the whole constant buffer--this made no sense and would have
> led to incorrect behavior if it were not for the fact that the pitch
> is ignored.
>
> For clarity, this patch sets the pitch for pull constant buffers to 16
> bytes, consistent with the hardware's behavior.
>
> No piglit regressions on Sandy Bridge or Ivy Bridge.
> ---
> src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +-
> src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
I find it hilarious that you've managed to justify why (16 - 1) is the
obviously correct value for an unused field. :) Consider me convinced.
Like Eric, I also prefer (16 - 1).
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
More information about the mesa-dev
mailing list