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

Re: [Public WebGL] WEBGL_compressed_texture_s3tc spec clarification



On Wed, Jul 3, 2013 at 4:44 AM, Benoit Jacob <bjacob@mozilla.com> wrote:
>
> On 13-07-02 08:03 PM, Brian Cornell wrote:
>> The WEBGL_compressed_texture_s3tc spec specifies:
>>
>> <<<
>>
>> The length of the ArrayBufferView, pixels, passed to either
>> compressedTexImage2D or compressedTexSubImage2D must match the
>> following equation:
>>
>> floor((width + 3) / 4) * floor((height + 3) / 4) * 8
>>
>> >>>
>>
>> However ArrayBufferView does not have a .length property. TypedArrays,
>> which implement ArrayBufferView, have a length. DataView, which also
>> implements ArrayBufferView, does not have a length. ArrayBufferView
>> does have byteLength.
>>
>> Is it intended that this restriction applies to the byteLength of the
>> array buffer view? If not, what is the expected behavior if you pass
>> in a typed array that is not a Uint8Array?
>>
>> Based on how it currently works in browsers and what actually makes
>> sense, I'm guessing this text is meant to refer to the byteLength
>> property as that is the only length that an array buffer view really
>> has. As such, I would propose changing this text to:
>>
>> <<<
>>
>> The length as given by pixels.byteLength of the ArrayBufferView,
>> pixels, passed to either compressedTexImage2D or
>> compressedTexSubImage2D must match the following equation:
>>
>> floor((width + 3) / 4) * floor((height + 3) / 4) * 8
>>
>> >>>
>
> I'm OK with the above phrasing (and generally agree to any change
> clearing ambiguity!)

Agree as well. Thanks for the suggestion. Updated the
WEBGL_compressed_texture_s3tc extension, the
WEBGL_compressed_texture_atc and WEBGL_compressed_texture_pvrtc
drafts, and WEBGL_compressed_texture_etc1 proposal.


>>
>> Alternatively, matching the restrictions on texImage2D and
>> texSubImage2D, a restriction could be imposed on this extension that
>> the ArrayBufferView must be a Uint8Array, and the following text added:
>>
>> <<<
>>
>> The supplied ArrayBufferView, pixels, must be a Uint8Array. If it is
>> not, an INVALID_OPERATION error is generated.
>>
>> >>>
>
> I would disagree with this change, out of fear that it would break valid
> content.

Yes, it might be premature to make such a restriction. Perhaps a
compressed texture format using unsigned 16-bit integers as its base
element type will come along.

-Ken


> Benoit
>
>
> -----------------------------------------------------------
> 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
-----------------------------------------------------------