I encountered the following error on Chromium stable 93.0.4577.63
> Mesa: User error: GL_INVALID_ENUM in glGetInteger64v(pname=GL_TIMESTAMP)
Digging into the code, I saw that glGetInteger64v with GL_TIMESTAMP is called in ui/gl/gpu_timing.cc if the timer type is kTimerTypeDisjoint or kTimerTypeARB.
> int64_t GPUTimingImpl::CalculateTimerOffset() {
> if (!offset_valid_) {
> if (timer_type_ == GPUTiming::kTimerTypeDisjoint ||
> timer_type_ == GPUTiming::kTimerTypeARB) {
> GLint64 gl_now = 0;
> glGetInteger64v(GL_TIMESTAMP, &gl_now);
The timer type is determined based on available GL extensions and there is a GL/GLES version check to ensure glGetInteger64v is available.
> if (context->HasExtension("GL_EXT_disjoint_timer_query")) {
> timer_type_ = GPUTiming::kTimerTypeDisjoint;
> } else if (context->HasExtension("GL_ARB_timer_query")) {
> timer_type_ = GPUTiming::kTimerTypeARB;
> } else if (context->HasExtension("GL_EXT_timer_query")) {
> timer_type_ = GPUTiming::kTimerTypeEXT;
> force_time_elapsed_query_ = true;
> timestamp_bit_count_gl_ = 0;
> }
> // The command glGetInteger64v is only supported under ES3 and GL3.2. Since it
> // is only used for timestamps, we workaround this by emulating timestamps
> // so WebGL 1.0 will still have access to the extension.
> if (!version_info->IsAtLeastGLES(3, 0) && !version_info->IsAtLeastGL(3, 2)) {
> force_time_elapsed_query_ = true;
> timestamp_bit_count_gl_ = 0;
> }
However, the GL_TIMESTAMP enum does not appear to be supported in GLES3 based on the reference page for glGet.
So it would appear to me that ui/gl/gpu_timing.cc incorrectly calls glGetInteger64v with GL_TIMESTAMP when using GLES3. I considered filing a bug, but due to my inexperience with chromium and GL I wanted to post this information here first to see if I am be overlooking something.
Thanks.