i965: Move buffer texture size calculation into a common helper function.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 16 Mar 2018 20:06:26 +0000 (13:06 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 23 May 2018 23:21:09 +0000 (16:21 -0700)
commit156d2c6e621d836c4d45c636b87669e1de3d4464
treebbf27610aa13485c881897312c5f21a32bbe05ae
parent5a6814780322988a7adee525899bca8a83907ab7
i965: Move buffer texture size calculation into a common helper function.

The buffer texture size calculations (should be easy enough, right?)
are repeated in three different places, each of them subtly broken in
a different way.  E.g. the image load/store path was never fixed to
clamp to MaxTextureBufferSize, and none of them are taking into
account the buffer offset correctly.  It's easier to fix it all in one
place.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106481
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c