mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
svga: no-op sampler view referencing if no change
Just to be safe with ref counting and avoid atomic operations.
This commit is contained in:
parent
0fffaa512c
commit
810584270d
1 changed files with 8 additions and 6 deletions
|
|
@ -225,12 +225,14 @@ svga_set_fragment_sampler_views(struct pipe_context *pipe,
|
|||
}
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
/* Note: we're using pipe_sampler_view_release() here to work around
|
||||
* a possible crash when the old view belongs to another context that
|
||||
* was already destroyed.
|
||||
*/
|
||||
pipe_sampler_view_release(pipe, &svga->curr.sampler_views[i]);
|
||||
pipe_sampler_view_reference(&svga->curr.sampler_views[i], views[i]);
|
||||
if (svga->curr.sampler_views[i] != views[i]) {
|
||||
/* Note: we're using pipe_sampler_view_release() here to work around
|
||||
* a possible crash when the old view belongs to another context that
|
||||
* was already destroyed.
|
||||
*/
|
||||
pipe_sampler_view_release(pipe, &svga->curr.sampler_views[i]);
|
||||
pipe_sampler_view_reference(&svga->curr.sampler_views[i], views[i]);
|
||||
}
|
||||
|
||||
if (!views[i])
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue