st/mesa: remove the sampler min_lod/max_lod value swap
It might not be needed at all. v2: fix v3d assertion failure Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11428>
This commit is contained in:
@@ -177,7 +177,8 @@ emit_one_texture(struct v3d_context *v3d, struct v3d_texture_stateobj *stage_tex
|
||||
MAX2(psampler->min_lod, 0),
|
||||
psview->u.tex.last_level),
|
||||
.max_level_of_detail = MIN2(psview->u.tex.first_level +
|
||||
psampler->max_lod,
|
||||
MAX2(psampler->max_lod,
|
||||
psampler->min_lod),
|
||||
psview->u.tex.last_level),
|
||||
|
||||
.texture_base_pointer = cl_address(rsc->bo,
|
||||
|
@@ -550,7 +550,8 @@ v3d_upload_sampler_state_variant(void *map,
|
||||
|
||||
sampler.min_level_of_detail = MIN2(MAX2(0, cso->min_lod),
|
||||
15);
|
||||
sampler.max_level_of_detail = MIN2(cso->max_lod, 15);
|
||||
sampler.max_level_of_detail = MIN2(MAX2(cso->max_lod,
|
||||
cso->min_lod), 15);
|
||||
|
||||
/* If we're not doing inter-miplevel filtering, we need to
|
||||
* clamp the LOD so that we only sample from baselevel.
|
||||
|
@@ -169,15 +169,6 @@ st_convert_sampler(const struct st_context *st,
|
||||
|
||||
sampler->min_lod = MAX2(msamp->Attrib.MinLod, 0.0f);
|
||||
sampler->max_lod = msamp->Attrib.MaxLod;
|
||||
if (sampler->max_lod < sampler->min_lod) {
|
||||
/* The GL spec doesn't seem to specify what to do in this case.
|
||||
* Swap the values.
|
||||
*/
|
||||
float tmp = sampler->max_lod;
|
||||
sampler->max_lod = sampler->min_lod;
|
||||
sampler->min_lod = tmp;
|
||||
assert(sampler->min_lod <= sampler->max_lod);
|
||||
}
|
||||
|
||||
/* Check that only wrap modes using the border color have the first bit
|
||||
* set.
|
||||
|
Reference in New Issue
Block a user