Bug 89312 - [regression, bisected] main: Added entry points for CopyTextureSubImage*D. (d6b7c40cecfe01)
Summary: [regression, bisected] main: Added entry points for CopyTextureSubImage*D. (d...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other Linux (All)
: medium normal
Assignee: Laura Ekstrand
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-25 07:28 UTC by Samuel Iglesias
Modified: 2015-03-02 10:14 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Iglesias 2015-02-25 07:28:59 UTC
The following two dEQP tests start to fail after commit d6b7c40cecfe01 landed in master branch:

   dEQP-GLES3.functional.negative_api.texture.copytexsubimage2d_invalid_target
   dEQP-GLES3.functional.negative_api.texture.copytexsubimage3d

This is the commit log:

commit d6b7c40cecfe01ec8545974b01cca16da2856ac2
Author: Laura Ekstrand <laura@jlekstrand.net>
Date:   Tue Jan 6 10:05:40 2015 -0800

    main: Added entry points for CopyTextureSubImage*D.
    
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Comment 1 Samuel Iglesias 2015-02-25 07:36:59 UTC
Steps to reproduce:

$ cd <deqp-home>
$ cd modules/gles3
$ ./deqp-gles3 -n dEQP-GLES3.functional.negative_api.texture.copytexsubimage2d_invalid_target
$ ./deqp-gles3 -n dEQP-GLES3.functional.negative_api.texture.copytexsubimage3d
Comment 2 Samuel Iglesias 2015-02-25 15:23:19 UTC
After looking into it, I found that the test is expecting to receive a GL_INVALID_ENUM error when calling glCopyTexSubImage2D() with target different than GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP_*.

By looking at OpenGL ES 3.0 spec, it says in section 3.8.3 "Texture Image Specification"
   
   "The target arguments of TexSubImage2D and CopyTexSubImage2D must be one of TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z,"

Also from the same spec, section 2.5 "GL Errors"

"If a command that requires an enumerated value is passed a symbolic constant that is not one of those specified as allowable for that command, the error INVALID_ENUM is generated."

This is a snip of the test output:

 <Section Name="" Description="GL_INVALID_ENUM is generated if target is invalid.">
  <Text>glCopyTexSubImage2D(0x00000000, 0, 0, 0, 0, 0, 4, 4);</Text>
  <Text>glGetError();</Text>
  <Text>// GL_NO_ERROR returned</Text>
  <Text>// ERROR: expected GL_INVALID_ENUM</Text>
</Section>

Similarly for glCopyTexSubImage3D()'s test case:

OpenGL ES 3.0 spec, it says in section 3.8.3 "Texture Image Specification"
   "[...] the target arguments of TexSubImage3D and CopyTexSubImage3D must be TEXTURE_3D or TEXTURE_2D_ARRAY."

This is a snip of dEQP-GLES3.functional.negative_api.texture.copytexsubimage3d test output:

 <Section Name="" Description="GL_INVALID_ENUM is generated if target is invalid.">
  <Text>glCopyTexSubImage3D(0x00000000, 0, 0, 0, 0, 0, 0, 4, 4);</Text>
  <Text>glGetError();</Text>
  <Text>// GL_NO_ERROR returned</Text>
  <Text>// ERROR: expected GL_INVALID_ENUM</Text>
</Section>

Hope this helps,

Sam
Comment 3 Jason Ekstrand 2015-02-25 19:25:09 UTC
I think we intentionally changed that behavior.  Aparently, it changes in 3.1 and in 4.2 so we just updated to the new behavior.  Laura will know more about that.  Reassigning...
Comment 4 Ian Romanick 2015-02-25 23:44:44 UTC
OpenGL ES 3.1 still specifies GL_INVALID_ENUM.  See the "Errors" box on page 157 (page 174 of the PDF).

OpenGL 4.4 and GL_ARB_direct_state_access change the error to GL_INVALID_VALUE, but I believe this is a mistake.  I have submitted a spec bug.  Let's wait to hear back from Khronos before changing anything.  Since next week is GDC, it probably won't be until the following week.
Comment 5 Laura Ekstrand 2015-02-26 00:13:42 UTC
Like 89311, the root cause was that target checking must take place prior to calling _mesa_get_current_texture_object, and this necessitated splitting target checking out of the main error-checking function for copy subtextures.  I'm currently testing my patch for this and will send it soon.

Again, like 89311, the spec change in errors thrown by *TexSubImage* is a separate issue.
Comment 6 Samuel Iglesias 2015-03-02 10:14:31 UTC
I confirm that they are fixed in master branch.

I was about to tell that the fixes should be in mesa-10.5 branch but you already forward them :-)

Closing the bug report, thanks!


bug/show.html.tmpl processed on Jan 16, 2017 at 19:23:05.
(provided by the Example extension).