Add tests for all geometry shader primitive types.
This commit is contained in:
Родитель
f3220833e8
Коммит
25c4467a10
|
@ -0,0 +1,26 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
layout(lines_adjacency) in;
|
||||
layout(max_vertices = 3, line_strip) out;
|
||||
|
||||
out vec3 vNormal;
|
||||
in VertexData
|
||||
{
|
||||
vec3 normal;
|
||||
} vin[4];
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
vNormal = vin[2].normal;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
layout(lines) in;
|
||||
layout(max_vertices = 2, line_strip) out;
|
||||
|
||||
out vec3 vNormal;
|
||||
in VertexData
|
||||
{
|
||||
vec3 normal;
|
||||
} vin[2];
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
layout(points) in;
|
||||
layout(max_vertices = 3, points) out;
|
||||
|
||||
out vec3 vNormal;
|
||||
in VertexData
|
||||
{
|
||||
vec3 normal;
|
||||
} vin[1];
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
layout(triangles_adjacency) in;
|
||||
layout(max_vertices = 3, triangle_strip) out;
|
||||
|
||||
out vec3 vNormal;
|
||||
in VertexData
|
||||
{
|
||||
vec3 normal;
|
||||
} vin[6];
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
vNormal = vin[2].normal;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
layout(triangles) in;
|
||||
layout(max_vertices = 3, triangle_strip) out;
|
||||
|
||||
out vec3 vNormal;
|
||||
in VertexData
|
||||
{
|
||||
vec3 normal;
|
||||
} vin[3];
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
vNormal = vin[2].normal;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
|
||||
layout(lines_adjacency) in;
|
||||
layout(line_strip, max_vertices = 3) out;
|
||||
|
||||
in VertexData {
|
||||
vec3 normal;
|
||||
} vin[];
|
||||
|
||||
out vec3 vNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
vNormal = vin[2].normal;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
|
||||
layout(lines) in;
|
||||
layout(line_strip, max_vertices = 2) out;
|
||||
|
||||
in VertexData {
|
||||
vec3 normal;
|
||||
} vin[];
|
||||
|
||||
out vec3 vNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
|
||||
layout(points) in;
|
||||
layout(points, max_vertices = 3) out;
|
||||
|
||||
in VertexData {
|
||||
vec3 normal;
|
||||
} vin[];
|
||||
|
||||
out vec3 vNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
|
||||
layout(triangles_adjacency) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
in VertexData {
|
||||
vec3 normal;
|
||||
} vin[];
|
||||
|
||||
out vec3 vNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
vNormal = vin[2].normal;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_geometry_shader : require
|
||||
|
||||
layout(triangles) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
in VertexData {
|
||||
vec3 normal;
|
||||
} vin[];
|
||||
|
||||
out vec3 vNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
vNormal = vin[0].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
vNormal = vin[1].normal;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
vNormal = vin[2].normal;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
Загрузка…
Ссылка в новой задаче