On Wed, Feb 1, 2012 at 12:52 PM, Jose Fonseca <span dir="ltr">&lt;<a href="mailto:jfonseca@vmware.com">jfonseca@vmware.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5"><br>
<br>
----- Original Message -----<br>
&gt; On 01/28/2012 04:04 AM, Jose Fonseca wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ----- Original Message -----<br>
&gt; &gt;&gt; width, height parameter of glTexImage2D() includes: texture image<br>
&gt; &gt;&gt; width + 2 * border (if any). So when doing the texture size check<br>
&gt; &gt;&gt; in _mesa_test_proxy_teximage() width and height should not exceed<br>
&gt; &gt;&gt; maximum supported size for target texture type.<br>
&gt; &gt;&gt; i.e. 1&lt;&lt;  (ctx-&gt;Const.MaxTextureLevels - 1)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; This patch fixes Intel oglconform test case: max_values<br>
&gt; &gt;&gt; Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=44970" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=44970</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Note: This is a candidate for mesa 8.0 branch.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Signed-off-by: Anuj Phogat&lt;<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>&gt;<br>
&gt; &gt;&gt; ---<br>
&gt; &gt;&gt;   src/mesa/main/teximage.c |   22 +++++++++++-----------<br>
&gt; &gt;&gt;   1 files changed, 11 insertions(+), 11 deletions(-)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
&gt; &gt;&gt; index d11425d..018aca0 100644<br>
&gt; &gt;&gt; --- a/src/mesa/main/teximage.c<br>
&gt; &gt;&gt; +++ b/src/mesa/main/teximage.c<br>
&gt; &gt;&gt; @@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context<br>
&gt; &gt;&gt; *ctx, GLenum target, GLint level,<br>
&gt; &gt;&gt;      switch (target) {<br>
&gt; &gt;&gt;      case GL_PROXY_TEXTURE_1D:<br>
&gt; &gt;&gt;         maxSize = 1&lt;&lt;  (ctx-&gt;Const.MaxTextureLevels - 1);<br>
&gt; &gt;&gt; -      if (width&lt;  2 * border || width&gt;  2 + maxSize)<br>
&gt; &gt;&gt; +      if (width&lt;  2 * border || width&gt;  maxSize)<br>
&gt; &gt;<br>
&gt; &gt; Anuj,<br>
&gt; &gt;<br>
&gt; &gt; I may be missing something, but I&#39;m still unsure about this,<br>
&gt; &gt; because this will create problems for drivers that do support<br>
&gt; &gt; borders.<br>
&gt;<br>
&gt; AFAIK, the only desktop graphics hardware that ever supported borders<br>
&gt; is<br>
&gt; NVIDIA.  Their driver follows the convention (width + 2 * border) &lt;<br>
&gt; maxSize, and their driver advertises a maximum size of 2^n.  I tried<br>
&gt; creating a proxy texture that was the full 2^n plus a border on their<br>
&gt; closed-source Linux driver, and it was rejected.  A proxy texture<br>
&gt; 2^n-2<br>
&gt; plus a border was accepted.<br>
&gt;<br>
&gt; Based on that, I believe this patch is correct.<br>
<br>
</div></div>Fair enough. Sounds good to me then!</blockquote><div><br></div><div id="c5" class="bz_comment" style="margin-bottom:2em;background-color:rgb(255,255,255)"><pre class="bz_comment_text" id="comment_text_5" style="white-space:pre-wrap;width:50em">

<font class="Apple-style-span" face="&#39;arial narrow&#39;, sans-serif">This patch made the intel oglconform test to pass. But the errors reported in
oglconform failure stays unfixed. This is confirmed by a piglit test case I developed to reproduce the errors. Test case (validate-texture-size) is posted on piglit mailing list for review.</font></pre><pre class="bz_comment_text" id="comment_text_5" style="white-space:pre-wrap;width:50em">

<font class="Apple-style-span" face="&#39;arial narrow&#39;, sans-serif">Driver throws assertion failure or segfaults with large textures even much below the maximum supported size.</font></pre><pre class="bz_comment_text" id="comment_text_5" style="width:50em">

<span class="Apple-style-span" style="white-space:pre-wrap"><font class="Apple-style-span" face="&#39;arial narrow&#39;, sans-serif"><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44970">https://bugs.freedesktop.org/show_bug.cgi?id=44970</a></font></span></pre>

</div></div>