OSDN Git Service

i965/gen7: fix encoding of (huge) surface size for BRW_SURFACE_BUFFER
authorChia-I Wu <olvaffe@gmail.com>
Wed, 10 Apr 2013 13:32:30 +0000 (21:32 +0800)
committerEric Anholt <eric@anholt.net>
Wed, 24 Apr 2013 19:56:17 +0000 (12:56 -0700)
commit9d0ad4c2f2eb89bab82194478180df570cc7aa4e
tree5f960dd6a6153756e09f5dd796fb56d8ff88a943
parent75d402b2118c55b0131025016a859a35733746b5
i965/gen7: fix encoding of (huge) surface size for BRW_SURFACE_BUFFER

Unlike GEN6, the bits of entry count are distributed like this

  width  = (entry_count & 0x0000007f);       /* bits [6:0] */
  height = (entry_count & 0x001fff80) >> 7;  /* bits [20:7] */
  depth  = (entry_count & 0x7fe00000) >> 21; /* bits [30:21] */

The maximum entry count is still limited to 2^27.

This was noted while going over the PRM.  No test is impacted, because
1<<20 (the bit that moved) is much larger than GL_UNIFORM_BLOCK_MAX_SIZE,
GL_MAX_TEXTURE_BUFFER_SIZE, or MAX_*_UNIFORM_COMPONENTS.

v2: Explain more in the commit message (by anholt)

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c