OSDN Git Service

i965: Set pitch of pull constant buffers to 16.
authorPaul Berry <stereotype441@gmail.com>
Mon, 9 Jan 2012 23:36:27 +0000 (15:36 -0800)
committerPaul Berry <stereotype441@gmail.com>
Thu, 12 Jan 2012 23:12:10 +0000 (15:12 -0800)
commitfcd5af4a916b4ba7860ba27eb47404934bde0d08
treeabf7630a4b847e9ad020eddc12c5ac9aacf23a85
parentf6f43bd5a276990c58c021bc047e60f9763df479
i965: Set pitch of pull constant buffers to 16.

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.

v2: Clarify the meaning of the ignored values by writing them as (16 - 1).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c