#1487

OpenGL ES: the 65,536-query pool exceeds an Adreno 663 driver's timestamp-query capacity

Openalasramopened 15d ago

Tracy 0.14.1 uses 65,536 query objects per OpenGL profiling context. On the Android driver below, timestamp result retrieval fails when the 4,097th distinct query object is used, even when each preceding query has completed and its result has been read.

Environment

  • Android, arm64, OpenGL ES 3.2.
  • GPU: Adreno (TM) 663.
  • GL_EXT_disjoint_timer_query advertised; GL_ARB_query_buffer_object absent.
  • Tracy client and profiler 0.14.1.

Reproduction

  1. Create a GLES context with a small EGL pbuffer and make it current.
  2. Generate 65,536 query names with glGenQueries.
  3. For each distinct name, issue glQueryCounterEXT(id, GL_TIMESTAMP_EXT), call glFlush() and glFinish(), then retrieve the result with glGetQueryObjectui64vEXT(id, GL_QUERY_RESULT_EXT, ...).
  4. Check glGetError() after each operation.

Generating the names succeeds. The first 4,096 distinct queries succeed; result retrieval for the next one reports:

FAIL result INDEX=4096 ID=4097 ERROR=0x502

0x502 is GL_INVALID_OPERATION. A separate sparse-name test successfully used names 4096, 4097, 65536, and 1 in a fresh context. This points to a limit on instantiated query objects rather than the numeric query name. The serial completion/readback procedure also rules out simply having too many pending results.

Reusing a pool of 4,096 objects passed 16,384 timestamp operations. With Tracy's pool reduced to 4,096, a 60-second application capture completed with 19,656 GPU zones and positive GPU durations. Separate surface recreation checks also passed. The application test ran with SELinux enforcing.

Expected behavior and proposed fix

Allow a smaller OpenGL query pool for drivers with this limitation, through a supported configuration option or an appropriate platform default. Our downstream Android patch changes QueryCount to 4 * 1024.

The smaller pool still needs to accommodate outstanding zone queries; configuration validation and clear exhaustion behavior would be preferable to assuming every Android workload fits. This is a driver compatibility report, not a claim that every Adreno or Android device has the same limit.

Activity

0

No activity yet.