Skip to content

Should enabling extensions raise errors ? #4179

@rcmz

Description

@rcmz

Enabling GL_EXT_mesh_shader in a non mesh / task shader raises an error. Should it ? it is the only extension that does it (trust me, I tested it !). Most extensions just do nothing, and a few raise a warning, which feels like the right behavior.

WARNING: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:11: '#extension' : extension not supported: GL_KHR_shader_subgroup
WARNING: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:30: '#extension' : extension not supported: GL_KHR_shader_subgroup
WARNING: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:42: '#extension' : extension not supported: GL_EXT_subgroupuniform_qualifier
WARNING: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:53: '#extension' : extension not supported: GL_EXT_shader_subgroup_extended_types
WARNING: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:61: '#extension' : extension not supported: GL_NV_primitive_shading_rate
WARNING: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:63: '#extension' : extension not supported: GL_HUAWEI_subpass_shading
ERROR: /home/rcmz/Projects/shaderV3demos/shaderV3/includeGLSL/extensions.comp:67: '#extension GL_EXT_mesh_shader' : not supported in this stage: compute

Citing (and abbreviating) the GLSL spec :
Directives to control the behavior of the compiler with respect to extensions are declared with the #extension directive
#extension extension_name : behavior
Behavior Effect :
require Give a compile-time error on the #extension if the extension extension_name is not supported.
enable Warn on the #extension if the extension extension_name is not supported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions