glGetActiveUniform failing with GL_INVALID_VALUE for no reason
System information
System: Host: Theseus Kernel: 5.15.10 x86_64 bits: 64 compiler: gcc v: 10.3.0 Desktop: KDE Plasma 5.23.4 wm: kwin_x11
dm: SDDM Distro: NixOS 22.05 (Quokka)
CPU: Info: Quad Core model: 11th Gen Intel Core i7-1185G7 bits: 64 type: MT MCP arch: Tiger Lake rev: 1 cache:
L2: 12 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 47923
Speed: 1888 MHz min/max: 400/4800 MHz Core speeds (MHz): 1: 1888 2: 1931 3: 2191 4: 2558 5: 1868 6: 1888 7: 2047
8: 2206
Graphics: Message: No device data found.
Display: x11 server: X.org 1.20.13 compositor: kwin_x11 driver: loaded: N/A resolution: <missing: xdpyinfo>
Message: Unable to show advanced data. Required tool glxinfo missing.
Describe the issue
When compiling a specific program under GLES-3.2, the linking succeeds, glGetActiveUniforms
returns 1, but querying the info about index 0 with glGetActiveUniform
fails with GL_INVALID_VALUE
. This is unexpected.
Repro steps:
# install Rust, Cargo, and Git
git clone https://github.com/kvark/gl-intel-active-uniforms
# current rev is d065d5596e7fb5d8f786247d36a9ffdf5bd0a682
cd gl-intel-active-uniforms
cargo run
Output on my machine:
Loading the shader
Active uniforms:
[0]: '' of 0x0
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `1281`,
right: `0`', src/main.rs:38:5
I reduced the shader to the minimum. It could be releated to dynamic indexing of a local array:
#version 320 es
precision highp float;
precision highp int;
layout(local_size_x = 16, local_size_y = 1, local_size_z = 1) in;
layout(std430, binding = 1) buffer OutputBuffer {
vec2 position;
} storage;
void main() {
int i = 0;
vec2 points[1] = vec2[1](vec2(0.0));
while(true) {
i += 1;
storage.position = points[i];
}
}
Log files as attachment
Dmesg: dmesg.log
Output with MESA_GLSL_CACHE_DISABLE=1
and INTEL_DEBUG=cs
: mesa-log.txt