On Fri, Jan 27, 2012 at 10:42 AM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>></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="im">On 01/27/2012 12:57 AM, Jose Fonseca wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This doesn't make sense from a mathematical POV.<br>
<br>
If the allowable size is<br>
<br>
2^floor(log2(MAX_XX_TEXTURE_<u></u>SIZE)) + 2*bt<br>
<br>
then it doesn't matter whether MAX_XX_TEXTURE_SIZE has or not the<br>
border with, as the allowable size is still the same for all common<br>
values of MAX_XX_TEXTURE_SIZE.<br>
<br>
It would be very odd to define MAX_XX_TEXTURE_SIZE in terms of<br>
itself, as there would be a singularity for MAX_XX_TEXTURE_SIZE< 4 :<br>
no value of MAX_XX_TEXTURE_SIZE under four will satisfy the<br>
equation:<br>
<br>
MAX_XX_TEXTURE_SIZE = 2^floor(log2(MAX_XX_TEXTURE_<u></u>SIZE)) + 2<br></blockquote></div></blockquote><div><br></div><div>yes, this equation looks confusing.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If hypothetically one day the spec allowed higher maximum border sizes, it would be even worse.<br>
</blockquote>
<br></div>
Which it won't: borders are removed in OpenGL ES and in OpenGL 3.1+ Core profile.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My take is that the border does not need to be implicitly added to<br>
MAX_XX_TEXTURE_SIZE query, and the test/driver is wrong.<br>
<br>
Also it doesn't match what NVIDIA produces:<br>
</blockquote>
<br></div>
Thanks for checking this. I was going to check it, but I kept getting distracted.<br>
<br>
I think the proxy check needs to change. If the maximum texture size is 2048, then a texture with border should be limited to 2046+2. That is, when doing the size check, add the border size in first. I just tried the test on AMD and NVIDIA, and this appears to be what they both do. </blockquote>
<div>I initially made the changes in proxy check to fix the test failure. But changed my mind after looking at the GL 3.0 specification. Thanks for verifying on Nvidia and AMD. I'll post a new patch with suggested changes.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My recollection is also that the test just produces a warning in this case.</blockquote><div> Yes, test produces a warning for mismatch of returned values by glGetIntegerv() and proxy texture. Currently texture_error_check() in glTexImage2D() doesn't complain if the texture width/height <= 2050. This later causes an OUT_OF_MEMORY error and assertion failure when using texture with width/height > 2048.</div>
<div> </div><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>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
$ glxinfo -l | grep SIZE<br>
GL_MAX_TEXTURE_SIZE = 16384<br>
GL_MAX_3D_TEXTURE_SIZE = 2048<br>
GL_ALIASED_POINT_SIZE_RANGE = 1, 63<br>
GL_SMOOTH_POINT_SIZE_RANGE = 1, 63<br>
GL_MAX_CUBE_MAP_TEXTURE_SIZE_<u></u>ARB = 16384<br>
GL_MAX_RECTANGLE_TEXTURE_SIZE_<u></u>NV = 16384<br>
<br>
Jose<br>
<br>
<br>
----- Original Message -----<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As per OpenGL 3.0 specification section 3.9, page 187 in pdf the<br>
maximum<br>
allowable width, height, or depth of a texel array must be at least<br>
2^(k−lod) + 2*bt for image arrays of level-of-detail (lod) 0 through<br>
k,<br>
where k is the log base 2 of MAX_3D_TEXTURE_SIZE, and bt is the<br>
maximum<br>
border width<br>
<br>
Currently different values for maximum allowable texture size are<br>
returned<br>
by glGetIntegrv() and proxy textures. glGetIntegrv returns 2048 and<br>
proxy<br>
texture returns (2048 + 2)<br>
<br>
This patch fixes Intel oglconform test case: max_values<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=44970" target="_blank">https://bugs.freedesktop.org/<u></u>show_bug.cgi?id=44970</a><br>
<br>
Note: This is a candidate for mesa 8.0 branch.<br>
<br>
Signed-off-by: Anuj Phogat<<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>><br>
---<br>
src/mesa/main/get.c | 3 ++-<br>
1 files changed, 2 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c<br>
index 5ad6012..4a70109 100644<br>
--- a/src/mesa/main/get.c<br>
+++ b/src/mesa/main/get.c<br>
@@ -1507,7 +1507,8 @@ find_custom_value(struct gl_context *ctx, const<br>
struct value_desc *d, union valu<br>
case GL_MAX_3D_TEXTURE_SIZE:<br>
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_<u></u>ARB:<br>
p = (GLuint *) ((char *) ctx + d->offset);<br>
- v->value_int = 1<< (*p - 1);<br>
+ /* GL 3.0: Add 2 pixels to accmodate border */<br>
+ v->value_int = 1<< (*p - 1) + 2;<br>
break;<br>
<br>
case GL_SCISSOR_BOX:<br>
--<br>
1.7.7.4<br>
</blockquote>
______________________________<u></u>_________________<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="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/mesa-dev</a><br>
</blockquote>
<br>
</div></div></blockquote></div><br>