aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-01-22 12:20:31 -0800
committerKenneth Graunke <[email protected]>2013-12-02 13:25:52 -0800
commit8ed9f69b361a5d6f013d0d8a7f87dba65bfff24a (patch)
treeb7c3621367fad1d9b486f21bdb717d1568de14f3 /src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
parentbc9d3a02540e11b863a1f7e7cf755764a02233fe (diff)
i965: Fix texture border color on Broadwell.
The Gen7 sampler state code still works. Increasing the alignment to 64 bytes makes bit 5 zero, which is good because it's now reserved. Since we don't use the new filter bits, we can leave those as zero too, which means we don't need to update the code to update the pointer. (We probably should anyway, for clarity, but alas, another day.) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_sampler_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index ab83419114a..bacc769ffb0 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -143,7 +143,17 @@ upload_default_color(struct brw_context *brw,
if (firstImage->_BaseFormat == GL_RGB)
color[3] = 1.0;
- if (brw->gen == 5 || brw->gen == 6) {
+ if (brw->gen >= 8) {
+ /* On Broadwell, the border color is represented as four 32-bit floats,
+ * integers, or unsigned values, interpreted according to the surface
+ * format. This matches the sampler->BorderColor union exactly. Since
+ * we use floats both here and in the above reswizzling code, we preserve
+ * the original bit pattern. So we actually handle all three formats.
+ */
+ float *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
+ 4 * 4, 64, sdc_offset);
+ COPY_4FV(sdc, color);
+ } else if (brw->gen == 5 || brw->gen == 6) {
struct gen5_sampler_default_color *sdc;
sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,