# Get a warning about extension when compile GLSL code with glslc compiler shipped with vulkan SDK

Trying to compile my pixel shader,and a warning generated:

D:\CS\ComputerGraphics\vulkan\WindowsProject1>D:\ProgrammingTools\vulkan\Bin\glslc shader.frag -o frag.spv shader.frag:3: warning: '#extension' : extension not supported: GL_KHR_vulkan_glsl 1 warning generated.

The following is my pixel shade code:

#version 460
#extension GL_KHR_vulkan_glsl : enable
#extension GL_EXT_debug_printf : enable
//Input
layout(location = 0) in vec3 fragColor;
layout(location = 1) in vec2 fragTexCoord;
//Output
layout(location = 0) out vec4 outColor;
//uniform
layout(set = 0,binding = 2) uniform sampler2D texSampler;
void main() {
outColor = texture(texSampler, fragTexCoord);
}


how do I fix this?

It's just a warning!(ummm...it's good to see someone care about those) and doesn't cause any issues in rendering, it just makes sure the shader adhers that glsl is being used to produce spir-v and any shader without this will be rejected by the glsl compiler, moreover glslc has many built-in features to detect such incompatible shaders so I don't think this is necessary. The following below text is from the official docs, you can read more about this extension and probably glslc documentation to see why this is being caused, for now you can safely remove #extension GL_KHR_vulkan_glsl : enable and compile with 0 warnings.

This extension is not enabled with a #extension as other extensions are.
It is also not enabled through use of a profile or #version.  The intended
level of GLSL/ESSL features, independent from Vulkan-specific usage, comes
from the traditional use of #version, profile, and #extension.

Instead, use of this extension is an effect of using a GLSL front-end in a
mode that has it generate SPIR-V for Vulkan.  Such tool use is outside the
scope of using the Vulkan API and outside the definition of GLSL and this
extension. See the documentation of the compiler to see how to request
generation of SPIR-V for Vulkan.

When a front-end is used to accept this extension, it must error check and