Skip to content
Commit 8ad62264 authored by Kenneth Graunke's avatar Kenneth Graunke Committed by Juan A. Suarez Romero
Browse files

iris: Fix broken aux.possible/sampler_usages bitmask handling



For renderable surfaces, we allocate SURFACE_STATEs for each bit in
res->aux.possible_usages.  Sampler views use res->aux.sampler_usages.

When pinning buffers, we call surf_state_offset_for_aux() to calculate
the offset to the desired surface state.  surf_state_offset_for_aux()
took an aux_modes parameter, which should be one of those two fields.
However...it was not using that parameter.  It always used the broader
res->aux.possible_usages field directly.

One of the callers, update_clear_value(), was passing incorrect masks
for this parameter.  It iterated through the bits in order, using
u_bit_scan(), which destructively modifies the mask.  So each time we
called it, the count of bits before our selected mode was 0, which would
cause us to always update the SURFACE_STATE for ISL_AUX_USAGE_NONE,
rather than updating each in turn.  This was hidden by the earlier bug
where surf_state_offset_for_aux() ignored the parameter.

Fixes: 7339660e ("iris: Add aux.sampler_usages.")
Reviewed-by: default avatarRafael Antognolli <rafael.antognolli@intel.com>
(cherry picked from commit 117a0368)
[Juan A. Suarez: resolve trivial conflicts]
Signed-off-by: default avatarJuan A. Suarez Romero <jasuarez@igalia.com>

Conflicts:
	src/gallium/drivers/iris/iris_state.c
parent c5a3f783
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment