Skip to content

Instantly share code, notes, and snippets.

@BoyBaykiller
Last active March 9, 2025 05:29
Show Gist options
  • Select an option

  • Save BoyBaykiller/02f2c4a2950660c0783b5522fc1dc2f5 to your computer and use it in GitHub Desktop.

Select an option

Save BoyBaykiller/02f2c4a2950660c0783b5522fc1dc2f5 to your computer and use it in GitHub Desktop.
OpenGL Mesh shader compile error when enabling GL_ARB_bindless_texture

First, I want to thank you for making the effort of implementing Mesh Shaders in OpenGL!

When compiling a mesh or task shader that enables GL_ARB_bindless_texture I get this compiler output:

ERROR: 0:3: 'GL_ARB_bindless_texture' : not allowed when using generating SPIR-V codes
ERROR: 0:3: '#extension' : extra tokens -- expected newline
ERROR: 0:3: '' : compilation terminated
ERROR: 3 compilation errors.  No code generated.

Reproducible:

const char* code = R"(
#version 460 core
#extension GL_NV_mesh_shader : require
#extension GL_ARB_bindless_texture : require

layout(local_size_x = 32) in;
layout(triangles, max_vertices = 3, max_primitives = 1) out;

void main()
{
                
})";

unsigned CompileShader(GLenum shaderType, const char* srcCode)
{
    unsigned shader = glCreateShader(shaderType);
    glShaderSource(shader, 1, &srcCode, 0);
    glCompileShader(shader);

    char infoLogBuffer[4096]{ '\0' };
    glGetShaderInfoLog(shader, 4096, nullptr, infoLogBuffer);
    printf(infoLogBuffer); // 'GL_ARB_bindless_texture' : not allowed when using generating SPIR-V codes

    return shader;
}

#define MESH_SHADER_NV 0x9559
CompileShader(MESH_SHADER_NV, code);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment