summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/builtins/tools')
-rwxr-xr-xsrc/glsl/builtins/tools/generate_builtins.py306
-rwxr-xr-xsrc/glsl/builtins/tools/generate_matrixCompMultGLSL.py28
-rwxr-xr-xsrc/glsl/builtins/tools/generate_outerProductGLSL.py23
-rwxr-xr-xsrc/glsl/builtins/tools/generate_transposeGLSL.py28
-rwxr-xr-xsrc/glsl/builtins/tools/texture_builtins.py664
5 files changed, 0 insertions, 1049 deletions
diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
deleted file mode 100755
index 70e9d75b2ea..00000000000
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ /dev/null
@@ -1,306 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-from __future__ import with_statement
-
-import re
-import sys
-from glob import glob
-from os import path
-from subprocess import Popen, PIPE
-from sys import argv
-
-# Local module: generator for texture lookup builtins
-from texture_builtins import generate_texture_functions
-
-builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..")
-
-# Get the path to the standalone GLSL compiler
-if len(argv) != 2:
- print "Usage:", argv[0], "<path to compiler>"
- sys.exit(1)
-
-compiler = argv[1]
-
-# Read the files in builtins/ir/*...add them to the supplied dictionary.
-def read_ir_files(fs):
- for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*.ir')):
- function_name = path.basename(filename).split('.')[0]
- with open(filename) as f:
- fs[function_name] = f.read()
-
-def read_glsl_files(fs):
- for filename in glob(path.join(path.join(builtins_dir, 'glsl'), '*.glsl')):
- function_name = path.basename(filename).split('.')[0]
- (output, returncode) = run_compiler([filename])
- if (returncode):
- sys.stderr.write("Failed to compile builtin: " + filename + "\n")
- sys.stderr.write("Result:\n")
- sys.stderr.write(output)
- else:
- fs[function_name] = output;
-
-# Return a dictionary containing all builtin definitions (even generated)
-def get_builtin_definitions():
- fs = {}
- generate_texture_functions(fs)
- read_ir_files(fs)
- read_glsl_files(fs)
- return fs
-
-def stringify(s):
- # Work around MSVC's 65535 byte limit by outputting an array of characters
- # rather than actual string literals.
- if len(s) >= 65535:
- #t = "/* Warning: length " + repr(len(s)) + " too large */\n"
- t = ""
- for c in re.sub('\s\s+', ' ', s):
- if c == '\n':
- t += '\n'
- else:
- t += "'" + c + "',"
- return '{' + t[:-1] + '}'
-
- t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "')
- return ' "' + t + '"\n'
-
-def write_function_definitions():
- fs = get_builtin_definitions()
- for k, v in sorted(fs.iteritems()):
- print 'static const char builtin_' + k + '[] ='
- print stringify(v), ';'
-
-def run_compiler(args):
- command = [compiler, '--dump-hir'] + args
- p = Popen(command, 1, stdout=PIPE, shell=False)
- output = p.communicate()[0]
-
- if (p.returncode):
- sys.stderr.write("Failed to compile builtins with command:\n")
- for arg in command:
- sys.stderr.write(arg + " ")
- sys.stderr.write("\n")
- sys.stderr.write("Result:\n")
- sys.stderr.write(output)
-
- # Clean up output a bit by killing whitespace before a closing paren.
- kill_paren_whitespace = re.compile(r'[ \n]*\)', re.MULTILINE)
- output = kill_paren_whitespace.sub(')', output)
-
- # Also toss any duplicate newlines
- output = output.replace('\n\n', '\n')
-
- # Kill any global variable declarations. We don't want them.
- kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE)
- output = kill_globals.sub('', output)
-
- return (output, p.returncode)
-
-def write_profile(filename, profile):
- (proto_ir, returncode) = run_compiler([filename])
-
- if returncode != 0:
- print '#error builtins profile', profile, 'failed to compile'
- return
-
- print 'static const char prototypes_for_' + profile + '[] ='
- print stringify(proto_ir), ';'
-
- # Print a table of all the functions (not signatures) referenced.
- # This is done so we can avoid bothering with a hash table in the C++ code.
-
- function_names = set()
- for func in re.finditer(r'\(function (.+)\n', proto_ir):
- function_names.add(func.group(1))
-
- print 'static const char *functions_for_' + profile + ' [] = {'
- for func in sorted(function_names):
- print ' builtin_' + func + ','
- print '};'
-
-def write_profiles():
- profiles = get_profile_list()
- for (filename, profile) in profiles:
- write_profile(filename, profile)
-
-def get_profile_list():
- profile_files = []
- for extension in ['glsl', 'frag', 'vert', 'geom']:
- path_glob = path.join(
- path.join(builtins_dir, 'profiles'), '*.' + extension)
- profile_files.extend(glob(path_glob))
- profiles = []
- for pfile in sorted(profile_files):
- profiles.append((pfile, path.basename(pfile).replace('.', '_')))
- return profiles
-
-if __name__ == "__main__":
- print """/* DO NOT MODIFY - automatically generated by generate_builtins.py */
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include "main/core.h" /* for struct gl_shader */
-#include "glsl_parser_extras.h"
-#include "ir_reader.h"
-#include "program.h"
-#include "ast.h"
-
-extern "C" struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
-
-gl_shader *
-read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
-{
- struct gl_context fakeCtx;
- fakeCtx.API = API_OPENGL_COMPAT;
- fakeCtx.Const.GLSLVersion = 330;
- fakeCtx.Extensions.ARB_ES2_compatibility = true;
- fakeCtx.Extensions.ARB_ES3_compatibility = true;
- fakeCtx.Const.ForceGLSLExtensionsWarn = false;
- gl_shader *sh = _mesa_new_shader(NULL, 0, target);
- struct _mesa_glsl_parse_state *st =
- new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
-
- st->language_version = 330;
- st->symbols->separate_function_namespace = false;
- st->ARB_texture_rectangle_enable = true;
- st->EXT_texture_array_enable = true;
- st->OES_EGL_image_external_enable = true;
- st->ARB_shader_bit_encoding_enable = true;
- st->ARB_texture_cube_map_array_enable = true;
- st->ARB_shading_language_packing_enable = true;
- st->ARB_texture_multisample_enable = true;
- st->ARB_texture_query_lod_enable = true;
- st->ARB_gpu_shader5_enable = true;
- _mesa_glsl_initialize_types(st);
-
- sh->ir = new(sh) exec_list;
- sh->symbols = st->symbols;
-
- /* Read the IR containing the prototypes */
- _mesa_glsl_read_ir(st, sh->ir, protos, true);
-
- /* Read ALL the function bodies, telling the IR reader not to scan for
- * prototypes (we've already created them). The IR reader will skip any
- * signature that does not already exist as a prototype.
- */
- for (unsigned i = 0; i < count; i++) {
- _mesa_glsl_read_ir(st, sh->ir, functions[i], false);
-
- if (st->error) {
- printf("error reading builtin: %.35s ...\\n", functions[i]);
- printf("Info log:\\n%s\\n", st->info_log);
- ralloc_free(sh);
- return NULL;
- }
- }
-
- reparent_ir(sh->ir, sh);
- delete st;
-
- return sh;
-}
-"""
-
- write_function_definitions()
- write_profiles()
-
- profiles = get_profile_list()
-
- print 'static gl_shader *builtin_profiles[%d];' % len(profiles)
-
- print """
-static void *builtin_mem_ctx = NULL;
-
-void
-_mesa_glsl_release_functions(void)
-{
- ralloc_free(builtin_mem_ctx);
- builtin_mem_ctx = NULL;
- memset(builtin_profiles, 0, sizeof(builtin_profiles));
-}
-
-static void
-_mesa_read_profile(struct _mesa_glsl_parse_state *state,
- int profile_index,
- const char *prototypes,
- const char **functions,
- int count)
-{
- gl_shader *sh = builtin_profiles[profile_index];
-
- if (sh == NULL) {
- sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count);
- ralloc_steal(builtin_mem_ctx, sh);
- builtin_profiles[profile_index] = sh;
- }
-
- state->builtins_to_link[state->num_builtins_to_link] = sh;
- state->num_builtins_to_link++;
-}
-
-void
-_mesa_glsl_initialize_functions(struct _mesa_glsl_parse_state *state)
-{
- /* If we've already initialized the built-ins, bail early. */
- if (state->num_builtins_to_link > 0)
- return;
-
- if (builtin_mem_ctx == NULL) {
- builtin_mem_ctx = ralloc_context(NULL); // "GLSL built-in functions"
- memset(&builtin_profiles, 0, sizeof(builtin_profiles));
- }
-"""
-
- i = 0
- for (filename, profile) in profiles:
- if profile.endswith('_vert'):
- 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|geom)$', '', profile)
- if version[0].isdigit():
- is_es = version.endswith('es')
- if is_es:
- version = version[:-2]
- check += 'state->language_version == ' + version
- check += ' && {0}state->es_shader'.format('' if is_es else '!')
- else: # an extension name
- check += 'state->' + version + '_enable'
-
- print ' if (' + check + ') {'
- print ' _mesa_read_profile(state, %d,' % i
- print ' prototypes_for_' + profile + ','
- print ' functions_for_' + profile + ','
- print ' Elements(functions_for_' + profile + '));'
- print ' }'
- print
- i = i + 1
- print '}'
-
diff --git a/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py b/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py
deleted file mode 100755
index 391ad110d37..00000000000
--- a/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-def gen_matrix(x, y = 0):
- if y == 0:
- y = x
- type = "mat" + str(x)
- if x != y:
- type = type + "x" + str(y)
- print type + " matrixCompMult(" + type + " x, " + type + " y)\n{"
- print " " + type + " z;"
-
- for i in range(x):
- print " z[" + str(i) + "] = x[" + str(i) + "] * y[" + str(i) + "];"
- print " return z;\n}"
-
-print "#version 120"
-# 1.10
-gen_matrix(2)
-gen_matrix(3)
-gen_matrix(4)
-
-# 1.20
-gen_matrix(2,3) # mat2x3 means 2 columns, 3 rows
-gen_matrix(3,2)
-gen_matrix(2,4)
-gen_matrix(4,2)
-gen_matrix(3,4)
-gen_matrix(4,3)
diff --git a/src/glsl/builtins/tools/generate_outerProductGLSL.py b/src/glsl/builtins/tools/generate_outerProductGLSL.py
deleted file mode 100755
index c561cc3ba14..00000000000
--- a/src/glsl/builtins/tools/generate_outerProductGLSL.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/python
-
-def gen(x, y):
- type = "mat" + str(x)
- if x != y:
- type = type + "x" + str(y)
- print type + " outerProduct(vec" + str(y) + " u, vec" + str(x) + " v)\n{"
- print " " + type + " m;"
-
- for i in range(x):
- print " m[" + str(i) + "] = u * v[" + str(i) + "];"
- print " return m;\n}"
-
-print "#version 120"
-gen(2,2)
-gen(2,3) # mat2x3 means 2 columns, 3 rows
-gen(2,4)
-gen(3,2)
-gen(3,3)
-gen(3,4)
-gen(4,2)
-gen(4,3)
-gen(4,4)
diff --git a/src/glsl/builtins/tools/generate_transposeGLSL.py b/src/glsl/builtins/tools/generate_transposeGLSL.py
deleted file mode 100755
index 8f669ce9839..00000000000
--- a/src/glsl/builtins/tools/generate_transposeGLSL.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-def gen(x, y):
- origtype = "mat" + str(x)
- trantype = "mat" + str(y)
- if x != y:
- origtype = origtype + "x" + str(y)
- trantype = trantype + "x" + str(x)
- print trantype + " transpose(" + origtype + " m)\n{"
- print " " + trantype + " t;"
-
- # The obvious implementation of transpose
- for i in range(x):
- for j in range(y):
- print " t[" + str(j) + "][" + str(i) + "] =",
- print "m[" + str(i) + "][" + str(j) + "];"
- print " return t;\n}"
-
-print "#version 120"
-gen(2,2)
-gen(2,3) # mat2x3 means 2 columns, 3 rows
-gen(2,4)
-gen(3,2)
-gen(3,3)
-gen(3,4)
-gen(4,2)
-gen(4,3)
-gen(4,4)
diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py
deleted file mode 100755
index 6ef20d5561b..00000000000
--- a/src/glsl/builtins/tools/texture_builtins.py
+++ /dev/null
@@ -1,664 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import StringIO
-
-# Bitfield constants for the 'variant' argument to generate_sigs
-Proj = 1
-Offset = 2
-Single = 4
-
-def vec_type(g, size):
- if size == 1:
- if g == "i":
- return "int"
- elif g == "u":
- return "uint"
- return "float"
- return g + "vec" + str(size)
-
-# Get the sampler dimension - i.e. sampler3D gives 3
-def get_sampler_dim(sampler_type):
- if sampler_type[0].isdigit():
- sampler_dim = int(sampler_type[0])
- elif sampler_type.startswith("Cube"):
- sampler_dim = 3
- elif sampler_type == "ExternalOES":
- sampler_dim = 2
- elif sampler_type == "Buffer":
- sampler_dim = 1
- else:
- assert False ("coord_dim: invalid sampler_type: " + sampler_type)
- return sampler_dim
-
-# Get the coordinate dimension for a given sampler type.
-# Array samplers also get +1 here since the layer is really an extra coordinate
-def get_coord_dim(sampler_type, tex_inst):
- coord_dim = get_sampler_dim(sampler_type)
- if sampler_type.find("Array") != -1 and tex_inst != "lod":
- coord_dim += 1
- return coord_dim
-
-# Get the number of extra vector components (i.e. shadow comparitor)
-def get_extra_dim(sampler_type, use_proj, unused_fields, tex_inst):
- extra_dim = unused_fields
- if sampler_type == "CubeArrayShadow":
- return 0
- if sampler_type.find("Shadow") != -1 and tex_inst != "lod":
- extra_dim += 1
- if use_proj:
- extra_dim += 1
- return extra_dim
-
-def get_txs_dim(sampler_type, tex_inst):
- if sampler_type.startswith("CubeArray"):
- return 3
- if sampler_type.startswith("Cube"):
- return 2
- return get_coord_dim(sampler_type, tex_inst)
-
-def has_lod(sampler_type):
- if 'Buffer' in sampler_type: return False
- if 'Rect' in sampler_type: return False
- if 'MS' in sampler_type: return False
- return True
-
-def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
- coord_dim = get_coord_dim(sampler_type, tex_inst)
- extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields, tex_inst)
- sampler_dim = get_sampler_dim(sampler_type)
-
- if variant & Single:
- return_type = "float"
- elif tex_inst == "txs":
- return_type = vec_type("i", get_txs_dim(sampler_type, tex_inst))
- elif tex_inst == "lod":
- return_type = "vec2"
- else:
- return_type = g + "vec4"
-
- # Print parameters
- print " (signature", return_type
- print " (parameters"
- print " (declare (in) " + g + "sampler" + sampler_type + " sampler)",
- if tex_inst != "txs":
- print "\n (declare (in) " + vec_type("i" if tex_inst in ['txf','txf_ms'] else "", coord_dim + extra_dim) + " P)",
- if tex_inst == "txl":
- print "\n (declare (in) float lod)",
- elif tex_inst in ['txf', 'txs'] and has_lod(sampler_type):
- print "\n (declare (in) int lod)",
- elif tex_inst == "txf_ms":
- print "\n (declare (in) int sample)",
- elif tex_inst == "txd":
- grad_type = vec_type("", sampler_dim)
- print "\n (declare (in) " + grad_type + " dPdx)",
- print "\n (declare (in) " + grad_type + " dPdy)",
- if sampler_type == "CubeArrayShadow" and tex_inst == "tex":
- print "\n (declare (in) float compare)",
-
- if variant & Offset:
- print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)",
- if tex_inst == "txb":
- print "\n (declare (in) float bias)",
-
- print ")\n ((return (" + tex_inst, return_type, "(var_ref sampler)",
-
- if tex_inst != "txs":
- # Coordinate
- if extra_dim > 0:
- print "(swiz " + "xyzw"[:coord_dim] + " (var_ref P))",
- else:
- print "(var_ref P)",
-
- if tex_inst not in ['txf_ms', 'txs', 'lod']:
- # Coordinate offset
- if variant & Offset:
- print "(var_ref offset)",
- else:
- print "0",
-
- if tex_inst not in ['txf', 'txf_ms', 'txs', 'lod']:
- # Projective divisor
- if variant & Proj:
- print "(swiz " + "xyzw"[coord_dim + extra_dim-1] + " (var_ref P))",
- else:
- print "1",
-
- # Shadow comparitor
- if sampler_type == "CubeArrayShadow": # a special case
- print "(var_ref compare)",
- elif sampler_type == "2DArrayShadow" or sampler_type == "CubeShadow": # a special case:
- print "(swiz w (var_ref P))", # ...array layer is z; shadow is w
- elif sampler_type.endswith("Shadow"):
- print "(swiz z (var_ref P))",
- else:
- print "()",
-
- # Bias/explicit LOD/gradient:
- if tex_inst == "txb":
- print "(var_ref bias)",
- elif tex_inst in ['txs', 'txf', 'txf_ms']:
- if has_lod(sampler_type):
- print "(var_ref lod)",
- elif tex_inst == 'txf_ms':
- print "(var_ref sample)",
- else:
- print "(constant int (0))",
- elif tex_inst == "txl":
- print "(var_ref lod)",
- elif tex_inst == "txd":
- print "((var_ref dPdx) (var_ref dPdy))",
- print "))))\n"
-
-def generate_fiu_sigs(tex_inst, sampler_type, variant = 0, unused_fields = 0):
- generate_sigs("", tex_inst, sampler_type, variant, unused_fields)
- generate_sigs("i", tex_inst, sampler_type, variant, unused_fields)
- generate_sigs("u", tex_inst, sampler_type, variant, unused_fields)
-
-def start_function(name):
- sys.stdout = StringIO.StringIO()
- print "((function " + name
-
-def end_function(fs, name):
- print "))"
- fs[name] = sys.stdout.getvalue();
- sys.stdout.close()
-
-# Generate all the functions and store them in the supplied dictionary.
-# This is better than writing them to actual files since they should never be
-# edited; it'd also be easy to confuse them with the many hand-generated files.
-#
-# Takes a dictionary as an argument.
-def generate_texture_functions(fs):
- start_function("textureSize")
- generate_fiu_sigs("txs", "1D")
- generate_fiu_sigs("txs", "2D")
- generate_fiu_sigs("txs", "3D")
- generate_fiu_sigs("txs", "Cube")
- generate_fiu_sigs("txs", "1DArray")
- generate_fiu_sigs("txs", "2DArray")
- generate_sigs("", "txs", "1DShadow")
- generate_sigs("", "txs", "2DShadow")
- generate_sigs("", "txs", "CubeShadow")
- generate_sigs("", "txs", "1DArrayShadow")
- generate_sigs("", "txs", "2DArrayShadow")
- generate_fiu_sigs("txs", "2DRect")
- generate_sigs("", "txs", "2DRectShadow")
- generate_fiu_sigs("txs", "Buffer")
- generate_fiu_sigs("txs", "CubeArray")
- generate_sigs("", "txs", "CubeArrayShadow")
- generate_fiu_sigs("txs", "2DMS")
- generate_fiu_sigs("txs", "2DMSArray")
- end_function(fs, "textureSize")
-
- start_function("texture")
- generate_fiu_sigs("tex", "1D")
- generate_fiu_sigs("tex", "2D")
- generate_fiu_sigs("tex", "3D")
- generate_fiu_sigs("tex", "Cube")
- generate_fiu_sigs("tex", "1DArray")
- generate_fiu_sigs("tex", "2DArray")
- generate_sigs("", "tex", "1DShadow", Single, 1);
- generate_sigs("", "tex", "2DShadow", Single);
- generate_sigs("", "tex", "CubeShadow", Single);
- generate_sigs("", "tex", "1DArrayShadow", Single);
- generate_sigs("", "tex", "2DArrayShadow", Single);
- generate_fiu_sigs("tex", "2DRect")
- generate_sigs("", "tex", "2DRectShadow", Single);
- # ARB_texture_cube_map_array extension
- generate_fiu_sigs("tex", "CubeArray")
- generate_sigs("", "tex", "CubeArrayShadow", Single);
-
- generate_fiu_sigs("txb", "1D")
- generate_fiu_sigs("txb", "2D")
- generate_fiu_sigs("txb", "3D")
- generate_fiu_sigs("txb", "Cube")
- generate_fiu_sigs("txb", "1DArray")
- generate_fiu_sigs("txb", "2DArray")
- generate_fiu_sigs("txb", "CubeArray")
- generate_sigs("", "txb", "1DShadow", Single, 1);
- generate_sigs("", "txb", "2DShadow", Single);
- generate_sigs("", "txb", "CubeShadow", Single);
- generate_sigs("", "txb", "1DArrayShadow", Single);
- generate_sigs("", "txb", "2DArrayShadow", Single);
- end_function(fs, "texture")
-
- start_function("textureProj")
- generate_fiu_sigs("tex", "1D", Proj)
- generate_fiu_sigs("tex", "1D", Proj, 2)
- generate_fiu_sigs("tex", "2D", Proj)
- generate_fiu_sigs("tex", "2D", Proj, 1)
- generate_fiu_sigs("tex", "3D", Proj)
- generate_sigs("", "tex", "1DShadow", Proj | Single, 1);
- generate_sigs("", "tex", "2DShadow", Proj | Single);
- generate_fiu_sigs("tex", "2DRect", Proj)
- generate_fiu_sigs("tex", "2DRect", Proj, 1)
- generate_sigs("", "tex", "2DRectShadow", Proj | Single);
-
- generate_fiu_sigs("txb", "1D", Proj)
- generate_fiu_sigs("txb", "1D", Proj, 2)
- generate_fiu_sigs("txb", "2D", Proj)
- generate_fiu_sigs("txb", "2D", Proj, 1)
- generate_fiu_sigs("txb", "3D", Proj)
- generate_sigs("", "txb", "1DShadow", Proj | Single, 1);
- generate_sigs("", "txb", "2DShadow", Proj | Single);
- end_function(fs, "textureProj")
-
- start_function("textureLod")
- generate_fiu_sigs("txl", "1D")
- generate_fiu_sigs("txl", "2D")
- generate_fiu_sigs("txl", "3D")
- generate_fiu_sigs("txl", "Cube")
- generate_fiu_sigs("txl", "1DArray")
- generate_fiu_sigs("txl", "2DArray")
- generate_sigs("", "txl", "1DShadow", Single, 1);
- generate_sigs("", "txl", "2DShadow", Single);
- generate_sigs("", "txl", "1DArrayShadow", Single);
- # ARB_texture_cube_map_array extension
- generate_fiu_sigs("txl", "CubeArray")
- end_function(fs, "textureLod")
-
- start_function("textureLodOffset")
- generate_fiu_sigs("txl", "1D", Offset)
- generate_fiu_sigs("txl", "2D", Offset)
- generate_fiu_sigs("txl", "3D", Offset)
- generate_fiu_sigs("txl", "1DArray", Offset)
- generate_fiu_sigs("txl", "2DArray", Offset)
- generate_sigs("", "txl", "1DShadow", Offset | Single, 1);
- generate_sigs("", "txl", "2DShadow", Offset | Single);
- generate_sigs("", "txl", "1DArrayShadow", Offset | Single);
- end_function(fs, "textureLodOffset")
-
- start_function("textureOffset")
- generate_fiu_sigs("tex", "1D", Offset)
- generate_fiu_sigs("tex", "2D", Offset)
- generate_fiu_sigs("tex", "3D", Offset)
- generate_fiu_sigs("tex", "2DRect", Offset)
- generate_sigs("", "tex", "2DRectShadow", Offset | Single);
- generate_fiu_sigs("tex", "1DArray", Offset)
- generate_fiu_sigs("tex", "2DArray", Offset)
- generate_sigs("", "tex", "1DShadow", Offset | Single, 1);
- generate_sigs("", "tex", "2DShadow", Offset | Single);
- generate_sigs("", "tex", "1DArrayShadow", Offset | Single);
-
- generate_fiu_sigs("txb", "1D", Offset)
- generate_fiu_sigs("txb", "2D", Offset)
- generate_fiu_sigs("txb", "3D", Offset)
- generate_fiu_sigs("txb", "1DArray", Offset)
- generate_fiu_sigs("txb", "2DArray", Offset)
- generate_sigs("", "txb", "1DShadow", Offset | Single, 1);
- generate_sigs("", "txb", "2DShadow", Offset | Single);
- generate_sigs("", "txb", "1DArrayShadow", Offset | Single);
- end_function(fs, "textureOffset")
-
- start_function("texelFetch")
- generate_fiu_sigs("txf", "1D")
- generate_fiu_sigs("txf", "2D")
- generate_fiu_sigs("txf", "3D")
- generate_fiu_sigs("txf", "2DRect")
- generate_fiu_sigs("txf", "1DArray")
- generate_fiu_sigs("txf", "2DArray")
- generate_fiu_sigs("txf", "Buffer")
- generate_fiu_sigs("txf_ms", "2DMS")
- generate_fiu_sigs("txf_ms", "2DMSArray")
- end_function(fs, "texelFetch")
-
- start_function("texelFetchOffset")
- generate_fiu_sigs("txf", "1D", Offset)
- generate_fiu_sigs("txf", "2D", Offset)
- generate_fiu_sigs("txf", "3D", Offset)
- generate_fiu_sigs("txf", "2DRect", Offset)
- generate_fiu_sigs("txf", "1DArray", Offset)
- generate_fiu_sigs("txf", "2DArray", Offset)
- end_function(fs, "texelFetchOffset")
-
- start_function("textureProjOffset")
- generate_fiu_sigs("tex", "1D", Proj | Offset)
- generate_fiu_sigs("tex", "1D", Proj | Offset, 2)
- generate_fiu_sigs("tex", "2D", Proj | Offset)
- generate_fiu_sigs("tex", "2D", Proj | Offset, 1)
- generate_fiu_sigs("tex", "3D", Proj | Offset)
- generate_fiu_sigs("tex", "2DRect", Proj | Offset)
- generate_fiu_sigs("tex", "2DRect", Proj | Offset, 1)
- generate_sigs("", "tex", "2DRectShadow", Proj | Offset | Single);
- generate_sigs("", "tex", "1DShadow", Proj | Offset | Single, 1);
- generate_sigs("", "tex", "2DShadow", Proj | Offset | Single);
-
- generate_fiu_sigs("txb", "1D", Proj | Offset)
- generate_fiu_sigs("txb", "1D", Proj | Offset, 2)
- generate_fiu_sigs("txb", "2D", Proj | Offset)
- generate_fiu_sigs("txb", "2D", Proj | Offset, 1)
- generate_fiu_sigs("txb", "3D", Proj | Offset)
- generate_sigs("", "txb", "1DShadow", Proj | Offset | Single, 1);
- generate_sigs("", "txb", "2DShadow", Proj | Offset | Single);
- end_function(fs, "textureProjOffset")
-
- start_function("textureProjLod")
- generate_fiu_sigs("txl", "1D", Proj)
- generate_fiu_sigs("txl", "1D", Proj, 2)
- generate_fiu_sigs("txl", "2D", Proj)
- generate_fiu_sigs("txl", "2D", Proj, 1)
- generate_fiu_sigs("txl", "3D", Proj)
- generate_sigs("", "txl", "1DShadow", Proj | Single, 1);
- generate_sigs("", "txl", "2DShadow", Proj | Single);
- end_function(fs, "textureProjLod")
-
- start_function("textureProjLodOffset")
- generate_fiu_sigs("txl", "1D", Proj | Offset)
- generate_fiu_sigs("txl", "1D", Proj | Offset, 2)
- generate_fiu_sigs("txl", "2D", Proj | Offset)
- generate_fiu_sigs("txl", "2D", Proj | Offset, 1)
- generate_fiu_sigs("txl", "3D", Proj | Offset)
- generate_sigs("", "txl", "1DShadow", Proj | Offset | Single, 1);
- generate_sigs("", "txl", "2DShadow", Proj | Offset | Single);
- end_function(fs, "textureProjLodOffset")
-
- start_function("textureGrad")
- generate_fiu_sigs("txd", "1D")
- generate_fiu_sigs("txd", "2D")
- generate_fiu_sigs("txd", "3D")
- generate_fiu_sigs("txd", "Cube")
- generate_fiu_sigs("txd", "1DArray")
- generate_fiu_sigs("txd", "2DArray")
- generate_fiu_sigs("txd", "2DRect")
- generate_sigs("", "txd", "2DRectShadow", Single);
- generate_sigs("", "txd", "1DShadow", Single, 1);
- generate_sigs("", "txd", "2DShadow", Single);
- generate_sigs("", "txd", "CubeShadow", Single);
- generate_sigs("", "txd", "1DArrayShadow", Single);
- generate_sigs("", "txd", "2DArrayShadow", Single);
- # ARB_texture_cube_map_array extension
- generate_fiu_sigs("txd", "CubeArray")
- end_function(fs, "textureGrad")
-
- start_function("textureGradOffset")
- generate_fiu_sigs("txd", "1D", Offset)
- generate_fiu_sigs("txd", "2D", Offset)
- generate_fiu_sigs("txd", "3D", Offset)
- generate_fiu_sigs("txd", "2DRect", Offset)
- generate_sigs("", "txd", "2DRectShadow", Offset | Single);
- generate_fiu_sigs("txd", "1DArray", Offset)
- generate_fiu_sigs("txd", "2DArray", Offset)
- generate_sigs("", "txd", "1DShadow", Offset | Single, 1);
- generate_sigs("", "txd", "2DShadow", Offset | Single);
- generate_sigs("", "txd", "1DArrayShadow", Offset | Single);
- generate_sigs("", "txd", "2DArrayShadow", Offset | Single);
- end_function(fs, "textureGradOffset")
-
- start_function("textureProjGrad")
- generate_fiu_sigs("txd", "1D", Proj)
- generate_fiu_sigs("txd", "1D", Proj, 2)
- generate_fiu_sigs("txd", "2D", Proj)
- generate_fiu_sigs("txd", "2D", Proj, 1)
- generate_fiu_sigs("txd", "3D", Proj)
- generate_fiu_sigs("txd", "2DRect", Proj)
- generate_fiu_sigs("txd", "2DRect", Proj, 1)
- generate_sigs("", "txd", "2DRectShadow", Proj | Single);
- generate_sigs("", "txd", "1DShadow", Proj | Single, 1);
- generate_sigs("", "txd", "2DShadow", Proj | Single);
- end_function(fs, "textureProjGrad")
-
- start_function("textureProjGradOffset")
- generate_fiu_sigs("txd", "1D", Proj | Offset)
- generate_fiu_sigs("txd", "1D", Proj | Offset, 2)
- generate_fiu_sigs("txd", "2D", Proj | Offset)
- generate_fiu_sigs("txd", "2D", Proj | Offset, 1)
- generate_fiu_sigs("txd", "3D", Proj | Offset)
- generate_fiu_sigs("txd", "2DRect", Proj | Offset)
- generate_fiu_sigs("txd", "2DRect", Proj | Offset, 1)
- generate_sigs("", "txd", "2DRectShadow", Proj | Offset | Single);
- generate_sigs("", "txd", "1DShadow", Proj | Offset | Single, 1);
- generate_sigs("", "txd", "2DShadow", Proj | Offset | Single);
- end_function(fs, "textureProjGradOffset")
-
-
- # ARB_texture_rectangle extension
- start_function("texture2DRect")
- generate_sigs("", "tex", "2DRect")
- end_function(fs, "texture2DRect")
-
- start_function("texture2DRectProj")
- generate_sigs("", "tex", "2DRect", Proj)
- generate_sigs("", "tex", "2DRect", Proj, 1)
- end_function(fs, "texture2DRectProj")
-
- start_function("shadow2DRect")
- generate_sigs("", "tex", "2DRectShadow")
- end_function(fs, "shadow2DRect")
-
- start_function("shadow2DRectProj")
- generate_sigs("", "tex", "2DRectShadow", Proj)
- end_function(fs, "shadow2DRectProj")
-
- # EXT_texture_array extension
- start_function("texture1DArray")
- generate_sigs("", "tex", "1DArray")
- generate_sigs("", "txb", "1DArray")
- end_function(fs, "texture1DArray")
-
- start_function("texture1DArrayLod")
- generate_sigs("", "txl", "1DArray")
- end_function(fs, "texture1DArrayLod")
-
- start_function("texture2DArray")
- generate_sigs("", "tex", "2DArray")
- generate_sigs("", "txb", "2DArray")
- end_function(fs, "texture2DArray")
-
- start_function("texture2DArrayLod")
- generate_sigs("", "txl", "2DArray")
- end_function(fs, "texture2DArrayLod")
-
- start_function("shadow1DArray")
- generate_sigs("", "tex", "1DArrayShadow")
- generate_sigs("", "txb", "1DArrayShadow")
- end_function(fs, "shadow1DArray")
-
- start_function("shadow1DArrayLod")
- generate_sigs("", "txl", "1DArrayShadow")
- end_function(fs, "shadow1DArrayLod")
-
- start_function("shadow2DArray")
- generate_sigs("", "tex", "2DArrayShadow")
- end_function(fs, "shadow2DArray")
-
- # ARB_shader_texture_lod extension
- start_function("texture1DGradARB")
- generate_fiu_sigs("txd", "1D")
- end_function(fs, "texture1DGradARB")
-
- start_function("texture2DGradARB")
- generate_fiu_sigs("txd", "2D")
- end_function(fs, "texture2DGradARB")
-
- start_function("texture3DGradARB")
- generate_fiu_sigs("txd", "3D")
- end_function(fs, "texture3DGradARB")
-
- start_function("textureCubeGradARB")
- generate_fiu_sigs("txd", "Cube")
- end_function(fs, "textureCubeGradARB")
-
- start_function("texture1DProjGradARB")
- generate_fiu_sigs("txd", "1D", True)
- generate_fiu_sigs("txd", "1D", True, 2)
- end_function(fs, "texture1DProjGradARB")
-
- start_function("texture2DProjGradARB")
- generate_fiu_sigs("txd", "2D", True)
- generate_fiu_sigs("txd", "2D", True, 1)
- end_function(fs, "texture2DProjGradARB")
-
- start_function("texture3DProjGradARB")
- generate_fiu_sigs("txd", "3D", True)
- end_function(fs, "texture3DProjGradARB")
-
- start_function("shadow1DGradARB")
- generate_sigs("", "txd", "1DShadow", False, 1)
- end_function(fs, "shadow1DGradARB")
-
- start_function("shadow1DProjGradARB")
- generate_sigs("", "txd", "1DShadow", True, 1)
- end_function(fs, "shadow1DProjGradARB")
-
- start_function("shadow2DGradARB")
- generate_sigs("", "txd", "2DShadow", False)
- end_function(fs, "shadow2DGradARB")
-
- start_function("shadow2DProjGradARB")
- generate_sigs("", "txd", "2DShadow", True)
- end_function(fs, "shadow2DProjGradARB")
-
- start_function("texture2DRectGradARB")
- generate_sigs("", "txd", "2DRect")
- end_function(fs, "texture2DRectGradARB")
-
- start_function("texture2DRectProjGradARB")
- generate_sigs("", "txd", "2DRect", True)
- generate_sigs("", "txd", "2DRect", True, 1)
- end_function(fs, "texture2DRectProjGradARB")
-
- start_function("shadow2DRectGradARB")
- generate_sigs("", "txd", "2DRectShadow", False)
- end_function(fs, "shadow2DRectGradARB")
-
- start_function("shadow2DRectProjGradARB")
- generate_sigs("", "txd", "2DRectShadow", True)
- end_function(fs, "shadow2DRectProjGradARB")
-
- # Deprecated (110/120 style) functions with silly names:
- start_function("texture1D")
- generate_sigs("", "tex", "1D")
- generate_sigs("", "txb", "1D")
- end_function(fs, "texture1D")
-
- start_function("texture1DLod")
- generate_sigs("", "txl", "1D")
- end_function(fs, "texture1DLod")
-
- start_function("texture1DProj")
- generate_sigs("", "tex", "1D", Proj)
- generate_sigs("", "tex", "1D", Proj, 2)
- generate_sigs("", "txb", "1D", Proj)
- generate_sigs("", "txb", "1D", Proj, 2)
- end_function(fs, "texture1DProj")
-
- start_function("texture1DProjLod")
- generate_sigs("", "txl", "1D", Proj)
- generate_sigs("", "txl", "1D", Proj, 2)
- end_function(fs, "texture1DProjLod")
-
- start_function("texture2D")
- generate_sigs("", "tex", "2D")
- generate_sigs("", "txb", "2D")
- # OES_EGL_image_external
- generate_sigs("", "tex", "ExternalOES")
- end_function(fs, "texture2D")
-
- start_function("texture2DLod")
- generate_sigs("", "txl", "2D")
- end_function(fs, "texture2DLod")
-
- start_function("texture2DProj")
- generate_sigs("", "tex", "2D", Proj)
- generate_sigs("", "tex", "2D", Proj, 1)
- generate_sigs("", "txb", "2D", Proj)
- generate_sigs("", "txb", "2D", Proj, 1)
- # OES_EGL_image_external
- generate_sigs("", "tex", "ExternalOES", Proj)
- generate_sigs("", "tex", "ExternalOES", Proj, 1)
- end_function(fs, "texture2DProj")
-
- start_function("texture2DProjLod")
- generate_sigs("", "txl", "2D", Proj)
- generate_sigs("", "txl", "2D", Proj, 1)
- end_function(fs, "texture2DProjLod")
-
- start_function("texture3D")
- generate_sigs("", "tex", "3D")
- generate_sigs("", "txb", "3D")
- end_function(fs, "texture3D")
-
- start_function("texture3DLod")
- generate_sigs("", "txl", "3D")
- end_function(fs, "texture3DLod")
-
- start_function("texture3DProj")
- generate_sigs("", "tex", "3D", Proj)
- generate_sigs("", "txb", "3D", Proj)
- end_function(fs, "texture3DProj")
-
- start_function("texture3DProjLod")
- generate_sigs("", "txl", "3D", Proj)
- end_function(fs, "texture3DProjLod")
-
- start_function("textureCube")
- generate_sigs("", "tex", "Cube")
- generate_sigs("", "txb", "Cube")
- end_function(fs, "textureCube")
-
- start_function("textureCubeLod")
- generate_sigs("", "txl", "Cube")
- end_function(fs, "textureCubeLod")
-
- start_function("shadow1D")
- generate_sigs("", "tex", "1DShadow", False, 1)
- generate_sigs("", "txb", "1DShadow", False, 1)
- end_function(fs, "shadow1D")
-
- start_function("shadow1DLod")
- generate_sigs("", "txl", "1DShadow", False, 1)
- end_function(fs, "shadow1DLod")
-
- start_function("shadow1DProj")
- generate_sigs("", "tex", "1DShadow", Proj, 1)
- generate_sigs("", "txb", "1DShadow", Proj, 1)
- end_function(fs, "shadow1DProj")
-
- start_function("shadow1DProjLod")
- generate_sigs("", "txl", "1DShadow", Proj, 1)
- end_function(fs, "shadow1DProjLod")
-
- start_function("shadow2D")
- generate_sigs("", "tex", "2DShadow")
- generate_sigs("", "txb", "2DShadow")
- end_function(fs, "shadow2D")
-
- start_function("shadow2DLod")
- generate_sigs("", "txl", "2DShadow")
- end_function(fs, "shadow2DLod")
-
- start_function("shadow2DProj")
- generate_sigs("", "tex", "2DShadow", Proj)
- generate_sigs("", "txb", "2DShadow", Proj)
- end_function(fs, "shadow2DProj")
-
- start_function("shadow2DProjLod")
- generate_sigs("", "txl", "2DShadow", Proj)
- end_function(fs, "shadow2DProjLod")
-
- start_function("textureQueryLOD")
- generate_fiu_sigs("lod", "1D")
- generate_fiu_sigs("lod", "2D")
- generate_fiu_sigs("lod", "3D")
- generate_fiu_sigs("lod", "Cube")
- generate_fiu_sigs("lod", "1DArray")
- generate_fiu_sigs("lod", "2DArray")
- generate_fiu_sigs("lod", "CubeArray")
- generate_sigs("", "lod", "1DShadow")
- generate_sigs("", "lod", "2DShadow")
- generate_sigs("", "lod", "CubeShadow")
- generate_sigs("", "lod", "1DArrayShadow")
- generate_sigs("", "lod", "2DArrayShadow")
- generate_sigs("", "lod", "CubeArrayShadow")
- end_function(fs, "textureQueryLOD")
-
- sys.stdout = sys.__stdout__
- return fs
-
-# If you actually run this script, it'll print out all the functions.
-if __name__ == "__main__":
- fs = {}
- generate_texture_functions(fs);
- for k, v in fs.iteritems():
- print v