user3677630
user3677630

Reputation: 667

The size limitation of the resources per shader in OpenGL 4.5

I have encountered a weird problem: I have a fragment shader containing several uniform variables (mat4, vec4), a single sampler2D and a gigantic SSBO (1GB-2GB). For each type of variables, it does not exceed the size limitation of the hardware. Without the SSBO, the shader works fine. With the SSBO, if the resolution of the texture image is low (768x768x4 float), the shader works fine too. However, if the resolution goes to 1024+ x 1024+, the program instantly crashes inside NVIDIA driver. I have tested it on GTX980 Ti and Quadro P5000. This problem all happened.

I wonder if there are any limitations on the usage of shader resources.

Upvotes: 1

Views: 438

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473352

According to this database of OpenGL implementations, there is no implementation that permits an SSBO to be being more than 2GB in size. That is, no implementation has GL_MAX_SHADER_STORAGE_BLOCK_SIZE greater than 2GB.

Note that Vulkan implementations are not much different. AMD implementations offer 4GB SSBOs, but they still have limitations that are separate from the amount of storage they have.

Upvotes: 1

Related Questions