KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.91k stars 816 forks source link

Missing GL_ARB_bindless_texture support #3051

Open cameni opened 1 year ago

cameni commented 1 year ago

The following example glsl code

#extension GL_ARB_bindless_texture : enable
void fn(out samplerBuffer bufs[4]) {}

Will produce ERROR: 'samplerBuffer' : samplers and atomic_uints cannot be output parameters

from here: https://github.com/KhronosGroup/glslang/blob/980ac50813fb567b6af6b89282eae850b328c967/glslang/MachineIndependent/ParseHelper.cpp#L4172

However, specs for ARB_bindless_texture says that

Samplers may be declared as shader inputs and outputs, as uniform variables, as temporary variables, and as function parameters. Samplers aggregated into arrays within a shader (using square brackets []) can be indexed with arbitrary integer expressions. Samplers can be used as l-values, so can be assigned into and used as "out" and "inout" function parameters.

I assume this means ARB_bindless_textures extension is not supported yet? In their recent drivers AMD started using the reference GLSL parser and hence this issue appeared.

greg-lunarg commented 1 year ago

With t.frag as

version 460 core

extension GL_ARB_bindless_texture : enable

void fn(out samplerBuffer bufs[4]) {}

glslangValidator.exe t.frag gives:

t.frag WARNING: 0:2: '#extension' : extension not supported: GL_ARB_bindless_texture ERROR: 0:3: 'samplerBuffer' : samplers and atomic_uints cannot be output parameters ERROR: 0:3: '' : compilation terminated ERROR: 2 compilation errors. No code generated.

So, unfortunately, it appears that glslang does not currently support this extension.

zopsicle commented 1 year ago

Was this fixed in https://github.com/KhronosGroup/glslang/pull/3066?

greg-lunarg commented 1 year ago

@arcady-lunarg Can you please confirm?

arcady-lunarg commented 1 year ago

Running glslangValidator on the sample code still produces the same error. This is somewhat surprising, given that it looks like #3066 added code that seems like it should have allowed it to work.

UltraEngine commented 5 months ago

What is the current status of this?

arcady-lunarg commented 5 months ago

This has not been fixed yet.

UltraEngine commented 5 months ago

This has not been fixed yet.

Thank you for the response. We definitely will make immediate use of this if it becomes available.