mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-17 17:00:36 +02:00
iris: Update SURFACE_STATE addresses when setting sampler views
We may have replaced the backing storage for a texture buffer while it was unbound, at which point iris_rebind_buffer would not have caught it and updated it. We need to ensure that the current resource's address matches the one our SURFACE_STATE points at. If not, update addresses and re-upload the SURFACE_STATE. Shader images and buffers do not suffer from this problem because we re-stream the surface state on every set call, since there isn't a created CSO object for those with a saved SURFACE_STATE. Constant buffers are also currently re-streamed (we pitch the SURFACE_STATE on every set_constant_buffer call). Surfaces would need this treatment (as they're created CSOs) except that we never swap out their backing storage today (we only do it for buffers), so it's OK for now. Fixes misrendering in Unreal 4 demos (Elemental, Matinee Fight Scene). Huge thanks to Andrii Simiklit for tracking down the problem - it was quite difficult to find! Also fixes Andrii's new Piglit test for the bug, 'arb_texture_buffer_object-re-init'. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1365
This commit is contained in:
parent
060a2c52fa
commit
f6aa51103b
1 changed files with 3 additions and 0 deletions
|
|
@ -2790,6 +2790,9 @@ iris_set_sampler_views(struct pipe_context *ctx,
|
|||
view->res->bind_stages |= 1 << stage;
|
||||
|
||||
shs->bound_sampler_views |= 1 << (start + i);
|
||||
|
||||
update_surface_state_addrs(ice->state.surface_uploader,
|
||||
&view->surface_state, view->res->bo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue