You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bat/tests/syntax-tests/highlighted/GLSL/test.glsl

43 lines
4.1 KiB
GLSL

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

#version 330 core
#ifdef TEST
layout (location = 0) in vec4 vertex;
#else
layout (location = 6) in vec4 vertex;
#endif
out vec2 p_textureVertex;
/*
 * This stores offsets
 */
struct Data
{
 double offsetX;
 double offsetY;
}
uniform mat4 projectionMatrix;
uniform bool test;
uniform Data data;
double calc()
{
 if (test)
 {
 return 1.0;
 }
 else
 {
 return 0.0;
 }
}
void main()
{
 // This GLSL code serves the purpose of bat syntax highlighting tests
 double x = data.offsetX + calc();
 gl_Position = projectionMatrix * vec4(vertex.xy, data.offsetX, data.offsetY);
 p_textureVertex = vertex.zw;
}