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

Re: [Public WebGL] MAX_VIEWPORT_DIMS <= MAX_TEXTURE_SIZE



MAX_TEXTURE_SIZE isn't actually the maximum size of a texture. (Thanks, GL!)
The maximum width and height of a texture's level 0 are each at least MAX_TEXTURE_SIZE.
TexImage2D generates INVALID_VALUE if the width or height of a texture is greater than the maximum allowed value. (Which may be larger than MAX_TEXTURE_SIZE!)
Basically, MAX_TEXTURE_SIZE is just the guarantee than any (level 0!) texture with width and height less than it will not generate INVALID_VALUE because of width and/or height alone. However, this does not guarantee than the combination of format, width, and height combine to cause the specified texture to be "too large to be stored under any conditions", at which time, it should generate INVALID_VALUE anyways. It's possible for a texture of the given width and height to be supported, but for the same-sized texture with a larger format (RGBA8, or even RGBA32f) to be too large to ever be allocated, which can still give INVALID_VALUE for width and height less than MAX_TEXTURE_SIZE.

It's worth noting that GL_OOM might happen at any time, though INVALID_VALUE should prevent attempts at allocation which would never succeed under any conditions.

By comparison, MAX_VIEWPORT_DIMS is set of hard (clamping) limits on the width and height of the viewport. I believe the only restriction on it is that it must be at least the visible size of the default framebuffer. ("The maximum viewport dimensions must be greater than or equal to the visible dimensions of the display being rendered to.")
Also, MAX_RENDERBUFFER_SIZE is a hard limit on the width and height of renderbuffers.

-Jeff

----- Original Message -----
From: "Guillaume Abadie" <guillaume.abadie@gmail.com>
To: "Jeff Gilbert" <jgilbert@mozilla.com>
Cc: "public webgl" <public_webgl@khronos.org>
Sent: Thursday, July 25, 2013 1:51:14 PM
Subject: Re: [Public WebGL] MAX_VIEWPORT_DIMS <= MAX_TEXTURE_SIZE

I'm not sure to understand how a driver could manage a 6k*1k default framebuffer if MAX_TEXTURE_SIZE (defined as "Maximum 2D/1D texture image dimension" p152)  would be 4k and MAX_RENDERBUFFER_SIZE (defined as "Maximum renderbuffer size" p 154) would be 4k.

In my mind, having the possibility to have MAX_VIEWPORT_DIMS > max(MAX_TEXTURE_SIZE, MAX_RENDERBUFFER_SIZE) has no sense, because we don't need a such big viewport dimension while the driver would not be able to allocate as big texture or renderbuffer as MAX_VIEWPORT_DIMS. All samples outside of the texture/renderbuffer would be ignored anyway.

Guillaume.

On 2013-07-25, at 4:18 PM, Jeff Gilbert <jgilbert@mozilla.com> wrote:

> I'm not sure how that disagrees. In that case, MAX_VIEWPORT_DIMS[0] would have to be at least 6k, which would cause that assertion to fail for 4k-max-texture-size contexts.
> 
> What's the reason for wanting to add an assertion between these values?
> 
> -Jeff
> 
> ----- Original Message -----
> From: "Guillaume Abadie" <guillaume.abadie@gmail.com>
> To: "Jeff Gilbert" <jgilbert@mozilla.com>
> Cc: "public webgl" <public_webgl@khronos.org>
> Sent: Thursday, July 25, 2013 10:31:48 AM
> Subject: Re: [Public WebGL] MAX_VIEWPORT_DIMS <= MAX_TEXTURE_SIZE
> 
> I disagree, because the OpenGL ES 2 specification say : "The maximum viewport dimensions must be greater than or equal to the visible dimensions of the display being rendered to." (chapter 2.12.1: Controlling the Viewport - p45).
> 
> Guillaume.
> 
> On 2013-07-25, at 3:09 AM, Jeff Gilbert <jgilbert@mozilla.com> wrote:
> 
>> I don't believe this is in the spec anywhere.
>> 
>> This assumption would fail, for instance, on a machine with a 6k*1k default framebuffer, if the max square texture size the driver can guarantee it handles correctly is only 4k*4k.
>> 
>> -Jeff
>> 
>> ----- Original Message -----
>> From: "Guillaume Abadie" <guillaume.abadie@gmail.com>
>> To: "public webgl" <public_webgl@khronos.org>
>> Sent: Wednesday, July 24, 2013 2:51:36 PM
>> Subject: [Public WebGL] MAX_VIEWPORT_DIMS <= MAX_TEXTURE_SIZE
>> 
>> 
>> Hi every one.
>> 
>> Where I can't find an answer in specs, I would like to know if the followed assertion is true in WebGL :
>> 	MAX_VIEWPORT_DIMS <= max(MAX_TEXTURE_SIZE, MAX_RENDERBUFFER_SIZE)
>> 
>> 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
-----------------------------------------------------------