// Pre-baked Vulkan source for ShaderGen::GenerateScreenQuadVertexShader(). // // This file is the source of truth for the screen quad vertex shader used by // the Vulkan backend. The runtime equivalent of this shader is generated by // ShaderGen::GenerateScreenQuadVertexShader() in src/core/shadergen.cpp; that // function is still used by the OpenGL, OpenGL ES, D3D11 and D3D12 backends. // For Vulkan we ship a pre-compiled SPIR-V blob in // src/common/vulkan/embedded_spirv/screen_quad_vs.inc // generated from this file by tools/regen_vulkan_spirv.py. The build itself // has no glslangValidator dependency. #version 450 core layout(location = 0) out VertexData { vec2 v_tex0; }; void main() { v_tex0 = vec2(float((uint(gl_VertexIndex) << 1) & 2u), float(uint(gl_VertexIndex) & 2u)); gl_Position = vec4(v_tex0 * vec2(2.0, -2.0) + vec2(-1.0, 1.0), 0.0, 1.0); // Flip Y to match the convention of ShaderGen output for Vulkan. gl_Position.y = -gl_Position.y; }