<div><div dir="auto">Hello,</div></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 12, 2018 at 01:52 Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/11/2018 12:12 PM, Kenneth Graunke wrote:<br>
> On Thursday, October 11, 2018 11:58:40 AM PDT Kenneth Graunke wrote:<br>
>> On Tuesday, October 2, 2018 9:16:01 AM PDT <a href="mailto:asimiklit.work@gmail.com" target="_blank">asimiklit.work@gmail.com</a> wrote:<br>
>>> From: Andrii Simiklit <<a href="mailto:andrii.simiklit@globallogic.com" target="_blank">andrii.simiklit@globallogic.com</a>><br>
>>><br>
>>> I guess that when we calculating the width0, height0, depth0<br>
>>> to use for function 'intel_miptree_create' we need to consider<br>
>>> the 'base level' like it is done in the 'intel_miptree_create_for_teximage'<br>
>>> function.<br>
>>><br>
>>> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=107987" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=107987</a><br>
>>> Signed-off-by: Andrii Simiklit <<a href="mailto:andrii.simiklit@globallogic.com" target="_blank">andrii.simiklit@globallogic.com</a>><br>
>>> ---<br>
>>>  .../drivers/dri/i965/intel_tex_validate.c     | 26 ++++++++++++++++++-<br>
>>>  1 file changed, 25 insertions(+), 1 deletion(-)<br>
>><br>
>> I believe this patch is correct - we're assembling things into a new<br>
>> miptree, which we start at level 0 - so we need the sizes for level 0.<br>
>><br>
>> Alternatively, we might be able to pass validate_first_level instead<br>
>> of 0 when calling intel_miptree_create, to make one that's only good<br>
>> up until the new base...and have to re-assemble it the next time they<br>
>> change the base.  It would save memory potentially.  But more copies.<br>
>> I don't have a strong preference which is better.<br>
>><br>
>> Please do make a Piglit or dEQP test for this.<br>
>><br>
>> Reviewed-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>><br>
> <br>
> Sorry, withdrawing my review. :(  Chris Forbes pointed out on IRC that<br>
> your reproducer case is backwards:<br>
> <br>
> miplevel 0 - 1x1<br>
> miplevel 1 - 2x2<br>
> miplevel 2 - 4x4<br>
> <br>
> That's upside down.  A proper miptree would have the base be largest:<br>
<br>
It's upside down, but it's perfectly valid in two scenarios.<br>
<br>
1. You set the level selection (not the LOD clamps) to a single level.<br>
GL_TEXTURE_BASE_LEVEL == GL_TEXTURE_MAX_LEVEL.  Based on the Chromium<br>
bug that Tapani referenced in the fd.o bug, I suspect the original WebGL<br>
test is changing at least GL_TEXTURE_BASE_LEVEL.<br>
<br>
2. You're not using a mipmap min filter.  It looks like his test case<br>
uses GL_LINEAR, so it should be fine.<br>
<br>
It's a real corner case, but that's what most of the WebGL tests<br>
exercise. :(</blockquote><div dir="auto"><br></div><div dir="auto"><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"><span style="font-size:12pt">Thanks a lot for clarification and reviewing )</span></p></div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> miplevel 0 - 4x4<br>
> miplevel 1 - 2x2<br>
> miplevel 2 - 1x1<br>
> <br>
> So, yes, I could see this tripping an assert...but such a crazy texture<br>
> will never be mipmap complete.  If they're expecting mipmapping, then<br>
> it seems like they should get a fallback black texture (which normally<br>
> happens for incomplete textures).  If not, maybe they should get a<br>
> single miplevel?  Either way, seems like we should detect insanity and<br>
> bail, rather than change size calculations for the normal sane case.<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><br>
<br>
</blockquote></div></div><div dir="auto">Thanks,</div><div dir="auto">Andrii.</div>