2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-18 15:26:16 +00:00

add GLSL syntax highlighting test

This commit is contained in:
Daniel Wolbach 2020-10-07 17:11:26 +02:00 committed by David Peter
parent 09631ed119
commit 8832a96e82
2 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,42 @@
#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;
}

View File

@ -0,0 +1,42 @@
#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;
}