i965/vs: Fix unit mismatch in scratch base_offset parameter.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 1 Oct 2012 22:28:55 +0000 (15:28 -0700)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Sun, 20 Jan 2013 14:08:26 +0000 (15:08 +0100)
commitcb415d4df644a8caffe861626dec5f7aa4cefa49
treeecca53b541b761153b551cd4e7581614da2ffae0
parent3703e9920c2a4d1a022871624bd0d7bd16073867
i965/vs: Fix unit mismatch in scratch base_offset parameter.

move_grf_array_access_to_scratch() calculates scratch buffer offsets in
bytes.  However, emit_scratch_read/write() expects the base_offset
parameter to be measured in OWords.

As a result, a shader using a scratch read/write offset greater than
zero (in practice, a shader containing more than one variable in
scratch) would use too large an offset, frequently exceeding the
available scratch space.

This patch corrects the mismatch by removing spurious conversion from
OWords to bytes in move_grf_array_access_to_scratch().

This is based on a patch by Paul Berry.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 46e529672bb124b78eb454cbf55c72074ef6d35c)
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_vs.h