shader with multidimensional array in shader storage buffer takes too long to compile
Describe the issue
I wanted a shader with a multidimensional array in a shader storage buffer (SSBO). It took too long to compile (over 10 minutes before I gave up waiting). Using a 1D array and doing index maths by hand worked ok (compiles in less than a second).
Excerpt:
layout(std430, binding = 2) buffer t
{
float tree[1][87381][2][2][3]; // BUG: this takes a very long time to compile
// float tree[1*87381*2*2*3]; // the 1D version works ok
};
Complete standalone test program: bug.c
A 2D array seems to work ok (used in a different buffer in the shader), but 5D is too powerful it seems.
System information
- Mesa version: (
glxinfo -B | grep "OpenGL version string"
)
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.6
with LIBGL_ALWAYS_SOFTWARE=1
:
OpenGL version string: 4.5 (Compatibility Profile) Mesa 22.3.6
- OS: (
cat /etc/os-release | grep "NAME"
)
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_CODENAME=bookworm
- GPU: (
lspci -nn | grep VGA
orlshw -C display -numeric
)
1d:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev e7)
(issue also occurs with LIBGL_ALWAYS_SOFTWARE=1
on another machine)
- Kernel version: (run
uname -a
)
Linux eiskaffee 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
- Xserver version (if applicable): (
sudo X -version
)
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
Current Operating System: Linux eiskaffee 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-20-amd64 root=UUID=65fa0822-69e0-4c98-86fa-d674dd12936f ro amdgpu.dc=1 hugepagesz=1GB default_hugepagesz=1GB hugepages=4
xorg-server 2:21.1.7-3+deb12u7 (https://www.debian.org/support)
Current version of pixman: 0.42.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
- Desktop manager and compositor:
XFCE4