[Mesa-dev] [PATCH 2/2] mesa: rearrange texture error checking order
imirkin at alum.mit.edu
Thu Jul 23 15:24:38 PDT 2015
On Wed, Jul 22, 2015 at 1:44 PM, Brian Paul <brianp at vmware.com> wrote:
> On 07/22/2015 11:29 AM, Ilia Mirkin wrote:
>> On Wed, Jul 22, 2015 at 1:20 PM, Brian Paul <brianp at vmware.com> wrote:
>>> On 07/22/2015 11:02 AM, Ilia Mirkin wrote:
>>>> This moves the width/height/depth == 0 check to the front and avoids
>>>> doing any other checking when that is the case.
>>>> Also moves the dimensions check after the format/type checks so that we
>>>> don't bail out with success on a width/height/depth == 0 request when
>>>> the format/type don't match.
>>>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>>> I suspect this isn't really needed in light of my patch to
>>> I believe the test was in error, or at least sloppy, in that it was
>>> glGetTexImage to test format/type validation when there wasn't even a
>>> texture image to return. The OpenGL spec doesn't specify an order for
>>> checking multiple things, so if there's multiple errors, you can't be
>>> which one will be reported first. My patch to the test removes that
>> Well, irrespective of the piglit test, the current code is a little
>> suspect -- it does the width/height/depth == 0 checks after it ensures
>> that height == 1 for 1d and depth == 1 for 2d. Any thoughts on that?
> Yeah, that makes sense. I guess we don't have any tests that exercise
> getting a 0 x 0 texture image.
> Reviewed-by: Brian Paul <brianp at vmware.com>
Ugh, so Dylan points out that this breaks
(which I didn't notice, because I guess it got recently enabled on mesa)
It has this check:
/* No Storage
* The spec doesn't say what should happen in this case. This is
* addressed by Khronos Bug 13223.
glCreateTextures(GL_TEXTURE_CUBE_MAP, 1, &name);
glGetTextureImage(name, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, data);
pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
But my width == 0 || ... check at the top of dimensions_error_check
short-circuits all that.
Brian, what situation is the "width == 0 || height == 0 || depth == 0"
supposed to account for?
More information about the mesa-dev