i965: Fix scratch overallocation if the original slot size was already a power of...
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 9 Jun 2016 00:53:24 +0000 (17:53 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 13 Jun 2016 22:55:58 +0000 (15:55 -0700)
commit013ae4a70aeb40dc74e53943824bff33dda109e1
treef8cac9d46764e422846d59b968811c6b7a13e7c9
parent2df8f4a2534e1e2258a719e7c5cbf342621fdf1f
i965: Fix scratch overallocation if the original slot size was already a power of two.

The bitwise arithmetic trick used in brw_get_scratch_size() to clamp
the scratch allocation to 1KB has the unintended side effect that it
will cause us to allocate 2x the required amount of scratch space if
the original per-thread scratch size happened to be already a power of
two.  Instead use the obvious MAX2 idiom to clamp the scratch
allocation to the expected range.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.h