[Mesa-dev] [PATCH 2/2] i965: Set pitch of pull constant buffers to 16.

Eric Anholt eric at anholt.net
Wed Jan 11 12:23:42 PST 2012


On Wed, 11 Jan 2012 12:06:37 -0800, Paul Berry <stereotype441 at gmail.com> 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.

I'd prefer to see the 15 written as (16 - 1) just to clarify that it's a
value-minus-one field, similarly to how we do the
OUT_BATCH(_3DSTATE_CONSTANT_PS << 16 | (7 - 2)); for the length field of
packets.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120111/cf6a9da4/attachment.pgp>


More information about the mesa-dev mailing list