mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 09:30:20 +01:00
svga: fix min/max lod clamping
The interaction between the mipmap lod min/max limits and the texture
base/max level limits is kind of tricky. Changing the base level
didn't work as expected before.
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit fd890873b2)
This commit is contained in:
parent
fc7d43ee9a
commit
21d77c51c1
1 changed files with 6 additions and 4 deletions
|
|
@ -82,12 +82,14 @@ update_tss_binding(struct svga_context *svga,
|
|||
const struct svga_sampler_state *s = svga->curr.sampler[i];
|
||||
struct svga_hw_view_state *view = &svga->state.hw_draw.views[i];
|
||||
struct pipe_resource *texture = NULL;
|
||||
struct pipe_sampler_view *sv = svga->curr.sampler_views[i];
|
||||
|
||||
/* get min max lod */
|
||||
if (svga->curr.sampler_views[i]) {
|
||||
min_lod = MAX2(s->view_min_lod, 0);
|
||||
max_lod = MIN2(s->view_max_lod, svga->curr.sampler_views[i]->texture->last_level);
|
||||
texture = svga->curr.sampler_views[i]->texture;
|
||||
if (sv) {
|
||||
min_lod = MAX2(0, (s->view_min_lod + sv->u.tex.first_level));
|
||||
max_lod = MIN2(s->view_max_lod, sv->texture->last_level);
|
||||
max_lod += sv->u.tex.first_level;
|
||||
texture = sv->texture;
|
||||
} else {
|
||||
min_lod = 0;
|
||||
max_lod = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue