[Mesa-dev] [PATCH] Mesa: Return GL error INVALID_OPERATION in case invalid format/type
Xu, Randy
randy.xu at intel.com
Fri Dec 16 01:04:50 UTC 2016
Thanks, Emil & Ilia
I will revise the patch per your suggestion below.
1. Refer 19f13b2096a9fdd986e5a12d4e9d8b0d6a4632f3 to update comment
2. s/can fix/fixes/
3. s/failure//
4. s/Bug/Bugzilla/
5. Cc: "13.0" <mesa-stable at lists.freedesktop.org>
As for "Matt pointed out that desktop GL actually has similar text.", it's true, but the _mesa_error_check_format_and_type function under change
is not only used by glTexImage3D, but also glReadPixel. Per GL spec https://www.opengl.org/registry/doc/glspec45.core.pdf in page 510
An INVALID_ENUM error is generated if format is DEPTH_STENCIL and type is not UNSIGNED_INT_24_8 or FLOAT_32_UNSIGNED_INT_24_8_- REV
So I limit the impact of this patch to GLES, which can generate GL_INVALID_OPERATION because glReadPixels cannot be used to read depth or stencil in that API.
Thanks
Randy
-----Original Message-----
From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On Behalf Of Ilia Mirkin
Sent: Thursday, December 15, 2016 10:01 PM
To: Emil Velikov <emil.l.velikov at gmail.com>
Cc: ML mesa-dev <mesa-dev at lists.freedesktop.org>; Xu, Randy <randy.xu at intel.com>; Xu at freedesktop.org
Subject: Re: [Mesa-dev] [PATCH] Mesa: Return GL error INVALID_OPERATION in case invalid format/type
On Thu, Dec 15, 2016 at 6:45 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 15 December 2016 at 01:10, Randy Xu <randy.xu at intel.com> wrote:
>> From: "Xu,Randy" <randy.xu at intel.com>
>>
>> Refer to GLES3.2 spec in 8.5
>> Textures with a base internal format of DEPTH_COMPONENT, DEPTH_-
>> STENCIL or STENCIL_INDEX are supported by texture image specification
>> commands only if target is TEXTURE_2D, TEXTURE_2D_MULTISAMPLE,
>> TEXTURE_2D_ARRAY, TEXTURE_2D_MULTISAMPLE_ARRAY, TEXTURE_CUBE_- MAP or
>> TEXTURE_CUBE_MAP_ARRAY. Using these formats in conjunction with any
>> other target will result in an INVALID_OPERATION error.
>> This patch can fix
>> dEQP-GLES3.functional.negative_api.texture.teximage3d
s/can fix/fixes/
>> failure.
s/failure//
>>
> I think others have alluded it with referencing other commits, but it
> might have been too subtle.
> - please use the cannonical format [1] to add a spec quote in the
> code
> - your commit message should explain why rather than a simple spec quote.
> You can draw some inspirations from
> 19f13b2096a9fdd986e5a12d4e9d8b0d6a4632f3
And #3 - Matt pointed out that desktop GL actually has similar text.
So the condition needs to be different (and will require some trudging through specs to figure out what happened). [Unless I misunderstood what he was saying, in which case, disregard.]
-ilia
_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list