mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-09 22:00:05 +00:00
Add tests for all geometry shader primitive types.
This commit is contained in:
parent
f3220833e8
commit
25c4467a10
26
reference/shaders/geom/lines-adjacency.geom
Normal file
26
reference/shaders/geom/lines-adjacency.geom
Normal file
@ -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();
|
||||
}
|
||||
|
23
reference/shaders/geom/lines.geom
Normal file
23
reference/shaders/geom/lines.geom
Normal file
@ -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();
|
||||
}
|
||||
|
26
reference/shaders/geom/points.geom
Normal file
26
reference/shaders/geom/points.geom
Normal file
@ -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();
|
||||
}
|
||||
|
26
reference/shaders/geom/triangles-adjacency.geom
Normal file
26
reference/shaders/geom/triangles-adjacency.geom
Normal file
@ -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();
|
||||
}
|
||||
|
26
reference/shaders/geom/triangles.geom
Normal file
26
reference/shaders/geom/triangles.geom
Normal file
@ -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();
|
||||
}
|
||||
|
28
shaders/geom/lines-adjacency.geom
Normal file
28
shaders/geom/lines-adjacency.geom
Normal file
@ -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();
|
||||
}
|
24
shaders/geom/lines.geom
Normal file
24
shaders/geom/lines.geom
Normal file
@ -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();
|
||||
}
|
28
shaders/geom/points.geom
Normal file
28
shaders/geom/points.geom
Normal file
@ -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();
|
||||
}
|
28
shaders/geom/triangles-adjacency.geom
Normal file
28
shaders/geom/triangles-adjacency.geom
Normal file
@ -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();
|
||||
}
|
28
shaders/geom/triangles.geom
Normal file
28
shaders/geom/triangles.geom
Normal file
@ -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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user