Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

glTexSubImage2D() using GLES2.0 hangs

Mon Sep 04, 2017 2:01 am

I am running into a problem, where glTexSubImage2D() seems to hang the very first time it's called.
My code will first create a MIP map cascade for a texture, using NULL arguments to glTexImage2D() to allocate the RAM without filling it in.
Then, it will actually attempt to put the data in, using glTexSubImage2D() for each MIP level. This is the call that hangs.
There are no GL errors before this point in the code.

To reproduce, you can download and run this program:

You can reproduce the bug by doing

Code: Select all

gdb ./pilot
br glesgui.cpp:514
(If you're morbidly curious about the entire program, it lives in https://github.com/jwatte/donkey_racing/ but that version may or may not compile at any point in time.)

Configuration: Raspbian jessie, latest update, on a Pi 3B.

Code: Select all

[email protected]:~/pilot $ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 8.0 (jessie)
Release:	8.0
Codename:	jessie

[email protected]:~/pilot $ cat /proc/cpuinfo | tail -3
Hardware	: BCM2835
Revision	: a22082
Serial		: 000000003bf0e166

Additional information:
The same hang happens when I call glTexImage2D() to upload data to an already-allocated texture (i e, previously I called glTexImage2D() with same dimensions/formats and NULL data pointer.)

I can't find any example that uses glTexSubImage2D() in the hello_ / userland source directory.

The examples I find that use glTexImage2D() all pass NULL in, and then use various extensions to play video/camera data onto the geometry, rather than just providing a plain MIP mapped bitmap texture.

More information: If I don't define all the MIP levels, but instead just allocate and fill in the top-level MIP map (level 0,) then the program doesn't hang.

Return to “Troubleshooting”