diff options
author | Paul Gofman <[email protected]> | 2019-11-04 15:31:10 +0300 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-11-04 13:24:31 -0500 |
commit | ecc31d032e5fd2af208bb7764958ab4a16e51147 (patch) | |
tree | ffa3af8bed635d653974438637635007062cdf22 | |
parent | b6d45e7f748e9ff7e198391f5ce5d1253101fedb (diff) |
state_tracker: Handle texture view min level in st_generate_mipmap()
Signed-off-by: Paul Gofman <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_gen_mipmap.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index b71a8ee57bb..9c7d955a45b 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -56,13 +56,16 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, struct st_context *st = st_context(ctx); struct st_texture_object *stObj = st_texture_object(texObj); struct pipe_resource *pt = st_get_texobj_resource(texObj); - const uint baseLevel = texObj->BaseLevel; + uint baseLevel = texObj->BaseLevel; enum pipe_format format; uint lastLevel, first_layer, last_layer; if (!pt) return; + if (texObj->Immutable) + baseLevel += texObj->MinLevel; + /* not sure if this ultimately actually should work, but we're not supporting multisampled textures yet. */ assert(pt->nr_samples < 2); @@ -70,6 +73,9 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, /* find expected last mipmap level to generate*/ lastLevel = _mesa_compute_num_levels(ctx, texObj, target) - 1; + if (texObj->Immutable) + lastLevel += texObj->MinLevel; + if (lastLevel == 0) return; |