<div dir="ltr"><div>I've pushed this patch. Thanks!</div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 7:31 AM Paul Gofman <<a href="mailto:gofmanp@gmail.com">gofmanp@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Paul Gofman <<a href="mailto:gofmanp@gmail.com" target="_blank">gofmanp@gmail.com</a>><br>
---<br>
Corresponding piglit test patch: <a href="https://patchwork.freedesktop.org/patch/338798/" rel="noreferrer" target="_blank">https://patchwork.freedesktop.org/patch/338798/</a><br>
<br>
src/mesa/state_tracker/st_gen_mipmap.c | 8 +++++++-<br>
1 file changed, 7 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c<br>
index b71a8ee57bb..9c7d955a45b 100644<br>
--- a/src/mesa/state_tracker/st_gen_mipmap.c<br>
+++ b/src/mesa/state_tracker/st_gen_mipmap.c<br>
@@ -56,13 +56,16 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,<br>
struct st_context *st = st_context(ctx);<br>
struct st_texture_object *stObj = st_texture_object(texObj);<br>
struct pipe_resource *pt = st_get_texobj_resource(texObj);<br>
- const uint baseLevel = texObj->BaseLevel;<br>
+ uint baseLevel = texObj->BaseLevel;<br>
enum pipe_format format;<br>
uint lastLevel, first_layer, last_layer;<br>
<br>
if (!pt)<br>
return;<br>
<br>
+ if (texObj->Immutable)<br>
+ baseLevel += texObj->MinLevel;<br>
+<br>
/* not sure if this ultimately actually should work,<br>
but we're not supporting multisampled textures yet. */<br>
assert(pt->nr_samples < 2);<br>
@@ -70,6 +73,9 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,<br>
/* find expected last mipmap level to generate*/<br>
lastLevel = _mesa_compute_num_levels(ctx, texObj, target) - 1;<br>
<br>
+ if (texObj->Immutable)<br>
+ lastLevel += texObj->MinLevel;<br>
+<br>
if (lastLevel == 0)<br>
return;<br>
<br>
-- <br>
2.23.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>