[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] GL_MAX_TEXTURE_SIZE power of two ?



I agree. And may be we should update this test to manually check if MAX_TEXTURE_SIZE is a power of two, before testing if the automatic mipmap generating works. to prevent a double bug :
- getParameter(gl.MAX_TEXTURE_SIZE) returns now power of two
- mipmap working on non power of two textures

Thank you very much!

Guillaume.

On 2013-07-15, at 3:35 PM, Brandon Jones <bajones@google.com> wrote:

It seems to me that if that assumption is being made it should be specified in the ES 2.0 spec, but barring that could we at least make this behavior explicit in the WebGL spec?

--Brandon


On Mon, Jul 15, 2013 at 12:25 PM, Kenneth Russell <kbr@google.com> wrote:

While I agree from looking at the OpenGL ES 2.0 specification that
this isn't 100% clear, the assumption in OpenGL for a very long time
has been that GL_MAX_TEXTURE_SIZE is a power of two, and that textures
allocated at that size can have glGenerateMipmaps called against them
(even without NPOT texture support). I think that the test should
remain as is, and that the workaround in Gecko should be changed to
round down MAX_TEXTURE_SIZE to 4096 on GPUs that can't properly
support textures of width and/or height 8192.

-Ken



On Mon, Jul 15, 2013 at 11:34 AM, Guillaume Abadie
<guillaume.abadie@gmail.com> wrote:
>
> Hi all,
>
> Gecko is having a regression on the WebGL conformance test https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/limits/gl-max-texture-dimensions.html because it return a non power of two MAX_TEXTURE_SIZE = 8191 because of a driver bug work around on Mac OS X (that is having bugs with 8k textures). And we have chosen to set MAX_TEXTURE_SIZE = 8191 instead of 4096 to allow bigger textures even we can't have 8192.
>
> The problem is this WebGL test is assuming that MAX_TEXTURE_SIZE is a power of two because create a texture of size (MAX_TEXTURE_SIZE, 1) and try to generate its mipmap which fail because WebGL 1.0 is suppose to only support power of two texture mipmaps. But I can't see in any OpenGL (ES or not) specification that MAX_TEXTURE_SIZE have to be a power of 2. The only paragraph that is close and ambiguous to that issues is :
>
> http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf (paragraphe 3.7 - Texturing - p69)
> "The maximum allowable width and height of a two-dimensional texture image must be at least 2^(k-lod) for image arrays of level zero through k, where k is the log base 2 of MAX_TEXTURE_SIZE"
> We don't know if this given k is only an integer, or can be a real.
>
> Therefore, my question is : Does our WebGL API should always return a power of two value for MAX_TEXTURE_SIZE, or the test should handle this case ?
>
> Thanks you !
>
> Guillaume Abadie.
> -----------------------------------------------------------
> You are currently subscribed to public_webgl@khronos.org.
> To unsubscribe, send an email to majordomo@khronos.org with
> the following command in the body of your email:
> unsubscribe public_webgl
> -----------------------------------------------------------
>

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------