summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2013-02-15 08:53:20 -0600
committerPaul Berry <[email protected]>2013-08-01 20:20:36 -0700
commitff523771833cf2cfb6d69d61e86a28c26b8400be (patch)
tree8c5bbbcfa2552eed7a4d74ff34f174c623453d0d /src/glsl/builtins
parentae6eba3e32a142665d2ae6e15c9122d3201c0b5d (diff)
glsl: add builtins for geometry shaders.
v2 (Paul Berry <[email protected]>): Account for rework of builtin_variables.cpp. Use INTERP_QUALIFIER_FLAT for gl_PrimitiveID so that it will obey provoking vertex conventions. Convert to GLSL 1.50 style geometry shaders. Reviewed-by: Ian Romanick <[email protected]> v3 (Paul Berry <[email protected]>): Be less obscure about setting interpolation field of gl_Primitive variables. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/builtins')
-rw-r--r--src/glsl/builtins/ir/EmitVertex.ir5
-rw-r--r--src/glsl/builtins/ir/EndPrimitive.ir5
-rw-r--r--src/glsl/builtins/profiles/150.geom3
-rwxr-xr-xsrc/glsl/builtins/tools/generate_builtins.py6
4 files changed, 17 insertions, 2 deletions
diff --git a/src/glsl/builtins/ir/EmitVertex.ir b/src/glsl/builtins/ir/EmitVertex.ir
new file mode 100644
index 00000000000..8ffb6c4df11
--- /dev/null
+++ b/src/glsl/builtins/ir/EmitVertex.ir
@@ -0,0 +1,5 @@
+((function EmitVertex
+ (signature void
+ (parameters)
+ ((emit-vertex)))
+))
diff --git a/src/glsl/builtins/ir/EndPrimitive.ir b/src/glsl/builtins/ir/EndPrimitive.ir
new file mode 100644
index 00000000000..ed7e12ab450
--- /dev/null
+++ b/src/glsl/builtins/ir/EndPrimitive.ir
@@ -0,0 +1,5 @@
+((function EndPrimitive
+ (signature void
+ (parameters)
+ ((end-primitive)))
+))
diff --git a/src/glsl/builtins/profiles/150.geom b/src/glsl/builtins/profiles/150.geom
new file mode 100644
index 00000000000..d2ab89113c4
--- /dev/null
+++ b/src/glsl/builtins/profiles/150.geom
@@ -0,0 +1,3 @@
+#version 150
+void EmitVertex();
+void EndPrimitive();
diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index 85bd5dddc73..54c5a49fb23 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -125,7 +125,7 @@ def write_profiles():
def get_profile_list():
profile_files = []
- for extension in ['glsl', 'frag', 'vert']:
+ for extension in ['glsl', 'frag', 'vert', 'geom']:
path_glob = path.join(
path.join(builtins_dir, 'profiles'), '*.' + extension)
profile_files.extend(glob(path_glob))
@@ -279,10 +279,12 @@ _mesa_glsl_initialize_functions(struct _mesa_glsl_parse_state *state)
check = 'state->target == vertex_shader && '
elif profile.endswith('_frag'):
check = 'state->target == fragment_shader && '
+ elif profile.endswith('_geom'):
+ check = 'state->target == geometry_shader && '
else:
check = ''
- version = re.sub(r'_(glsl|vert|frag)$', '', profile)
+ version = re.sub(r'_(glsl|vert|frag|geom)$', '', profile)
if version[0].isdigit():
is_es = version.endswith('es')
if is_es: