After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763021 - glmemory: fix copy texture fail using glCopyTexImage2D()
glmemory: fix copy texture fail using glCopyTexImage2D()
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.6.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-03 05:39 UTC by Haihua Hu
Modified: 2016-09-22 07:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glmemory: fix copy texture fail using glCopyTexImage2D() (2.37 KB, patch)
2016-03-03 05:40 UTC, Haihua Hu
none Details | Review

Description Haihua Hu 2016-03-03 05:39:08 UTC
Should pass sized internal format to glCopyTexImage2D according to OpenGL API reference.
https://www.khronos.org/opengles/sdk/docs/man/xhtml/glCopyTexImage2D.xml
Comment 1 Haihua Hu 2016-03-03 05:40:32 UTC
Created attachment 322943 [details] [review]
glmemory: fix copy texture fail using glCopyTexImage2D()
Comment 2 Matthew Waters (ystreet00) 2016-03-03 08:04:23 UTC
Just curious as to what system/platforms you saw this on?

The only case I've seen this matter is on iOS where they implement a different rg texture extension to everyone else and seem to not conform to their own rg texture extension.

The internal format doesn't technically have to be sized everywhere, i.e. you can pass base internal formats on most systems and have things work.

That being said, we've done this for all the other texture operations, may as well do it for copy as well.
Comment 3 Matthew Waters (ystreet00) 2016-03-03 08:14:52 UTC
Note: this patch doesn't apply at all to current master.
Comment 4 Haihua Hu 2016-03-03 08:58:20 UTC
(In reply to Matthew Waters (ystreet00) from comment #2)
> Just curious as to what system/platforms you saw this on?
> 
> The only case I've seen this matter is on iOS where they implement a
> different rg texture extension to everyone else and seem to not conform to
> their own rg texture extension.
> 
> The internal format doesn't technically have to be sized everywhere, i.e.
> you can pass base internal formats on most systems and have things work.
> 
> That being said, we've done this for all the other texture operations, may
> as well do it for copy as well.
Hi Matthew,

I meet this case on i.Mx6Q for Linux. The GPU vendor is vivante GC2000. If I use texture format such as GL_RED, copy texture will fail. But change to use GL_R8, it works ok. I think we should call API according to the GL spec because some Embedded systems may have limitation.
Comment 5 Matthew Waters (ystreet00) 2016-03-03 09:36:40 UTC
The spec allows GL_RED/GL_RG as an internal format so your drivers are not compliant.

From the GLES 3.0.1 spec, section 3.8.3, page 125.

"If internalformat is specified as a base internal format, the GL stores the resulting texture with internal component resolutions of its own choosing."

GLES 2.0 doesn't contain RG textures so we rely on the GL_EXT_texture_rg extension from https://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_rg.txt which states:

"Accepted by the <internalformat> parameter of TexImage2D and CopyTexImage2D, and the <format> parameter of TexImage2D, TexSubImage2D, and ReadPixels:

RED_EXT 0x1903
RG_EXT  0x8227"

If by some weird reason there's GL_ARB_texture_rg support with your drivers, they also contain the exact same statement as GL_EXT_texture_rg (albeit with more formats).
Comment 6 Matthew Waters (ystreet00) 2016-09-22 07:44:15 UTC
Closing due to inactivity/cause being in the GL driver.