Unlike OpenGL, which takes in GLSL (OpenGL Shading Language) human-readable files for shaders, Vulkan takes in shaders in binary or byte code format. All shaders, whether vertex, fragment, or compute, have to be in byte code format.
SPIR-V is also good for cross-compilation, making porting shader files a lot easier. If you have a Direct3D HLSL shader code, it can be compiled to SPIR-V format and can be used in a Vulkan application, making it very easy to port Direct3D games to Vulkan. The shader is initially written in GLSL, with some minor changes to how we wrote it for OpenGL. A compiler is provided, which compiles the code from GLSL to SPIR-V format. The compiler is included with the Vulkan SDK installation. The basic vertex-shader GLSL code is as follows:
#version 450 #extension GL_ARB_separate_shader_objects : enable layout (binding ...