0
$\begingroup$

When I have an array of samplers, for example:

uniform sampler3D RHToBounceGridR[MULTI_BOUNCES_NUM];

where MULTI_BOUNCES_NUM is bigger than GL_MAX_TEXTURE_IMAGE_UNITS value, I get INVALID_OPERATION when dispatching the shader.

If I use Uniform block with bindless textures (handles)

layout (std140, binding = 0) uniform SamplersBuffer
{
    sampler3D samplers[MULTI_BOUNCES_NUM];
};

Or just uniforms

layout(bindless_sampler) uniform sampler3D RHToBounceGridR[MULTI_BOUNCES_NUM];

Does it overcome this limitation?

$\endgroup$
0

1 Answer 1

1
$\begingroup$

The specification defines GL_MAX_TEXTURE_IMAGE_UNITS as:

The maximum number of texture image units available to [the fragment shader]

Texture image units are locations in the OpenGL context to which you bind textures for use by shaders.

Bindless texture, as the name suggests, does not involve binding textures to texture image units. As such, they do not count against this limit:

Sampler uniforms specified using handles do not count as using any texture image unit, even if a texture referred to by a handle is currently bound to one or more texture image units.

$\endgroup$
2
  • $\begingroup$ What confused me is that in case of uniform block this is as expected but in the case of uniform array of samplers and setting uniform handles using glUniformHandleui64ARB the same error results. $\endgroup$
    – mdkdy
    Nov 28, 2022 at 15:37
  • $\begingroup$ I assume this is driver issue. $\endgroup$
    – mdkdy
    Nov 29, 2022 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.