I’m sorry to bother you again, but I’m having trouble with the bindless texture extension. This is the (compute) shader code I’m trying to compile without success:
#version 450 core
#extension GL_ARB_bindless_texture : require
/// Density map
uniform DensityMapBuffer
{
layout(r32f) coherent image3D densityMap;
};
float test(coherent readonly image3D dmap)
{
return imageLoad(dmap, ivec3(0)).r;
}
layout(local_size_x = 36, local_size_y = 1, local_size_z = 36) in;
void main()
{
ivec3 index = ivec3(gl_GlobalInvocationID);
float val = test(densityMap);
}
The compiler complains about:
error C1115: unable to find compatible overloaded function "imageLoad(struct image3D_bindless, ivec3)
And this works fine if I get rid of the function:
void main()
{
ivec3 index = ivec3(gl_GlobalInvocationID);
float val = imageLoad(densityMap, ivec3(0)).r;
}
I also tried using a bindless texture as a function parameter and fetching its data with texture
and it works.
Since bindless images are essentially integer handles I assumed it should be possible to pass a bindless image to a function, shouldn’t it?