summaryrefslogtreecommitdiff
path: root/src/glsl/builtins/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/builtins/tools')
-rw-r--r--src/glsl/builtins/tools/builtin_function.cpp39
-rwxr-xr-xsrc/glsl/builtins/tools/generate_builtins.py40
-rwxr-xr-xsrc/glsl/builtins/tools/texture_builtins.py267
3 files changed, 227 insertions, 119 deletions
diff --git a/src/glsl/builtins/tools/builtin_function.cpp b/src/glsl/builtins/tools/builtin_function.cpp
deleted file mode 100644
index c44804f2ef..0000000000
--- a/src/glsl/builtins/tools/builtin_function.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 "glsl_parser_extras.h"
-
-/* A dummy file. When compiling prototypes, we don't care about builtins.
- * We really don't want to half-compile builtin_functions.cpp and fail, though.
- */
-void
-_mesa_glsl_release_functions(void)
-{
-}
-
-void
-_mesa_glsl_initialize_functions(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
-}
diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index 5ea4b5c48f..edd3c70e00 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -1,16 +1,27 @@
#!/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'), '*')):
@@ -47,14 +58,13 @@ def write_function_definitions():
print stringify(v), ';'
def run_compiler(args):
- compiler_path = path.join(path.join(builtins_dir, '..'), 'glsl_compiler')
- command = [compiler_path, '--dump-lir'] + args
+ command = [compiler, '--dump-lir'] + args
p = Popen(command, 1, stdout=PIPE, shell=False)
output = p.communicate()[0]
# 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);
+ 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')
@@ -69,12 +79,12 @@ def write_profile(filename, profile):
return
# Kill any global variable declarations. We don't want them.
- kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE);
+ kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE)
proto_ir = kill_globals.sub('', proto_ir)
# Kill pointer addresses. They're not necessary in prototypes and just
# clutter the diff output.
- proto_ir = re.sub(r'@0x[0-9a-f]+', '', proto_ir);
+ proto_ir = re.sub(r'@0x[0-9a-f]+', '', proto_ir)
print 'static const char prototypes_for_' + profile + '[] ='
print stringify(proto_ir), ';'
@@ -142,6 +152,8 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
{
struct gl_context fakeCtx;
fakeCtx.API = API_OPENGL;
+ fakeCtx.Const.GLSLVersion = 130;
+ fakeCtx.Extensions.ARB_ES2_compatibility = true;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
@@ -168,7 +180,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
if (st->error) {
printf("error reading builtin: %.35s ...\\n", functions[i]);
printf("Info log:\\n%s\\n", st->info_log);
- talloc_free(sh);
+ ralloc_free(sh);
return NULL;
}
}
@@ -193,14 +205,13 @@ void *builtin_mem_ctx = NULL;
void
_mesa_glsl_release_functions(void)
{
- talloc_free(builtin_mem_ctx);
+ 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,
- exec_list *instructions,
int profile_index,
const char *prototypes,
const char **functions,
@@ -210,7 +221,7 @@ _mesa_read_profile(struct _mesa_glsl_parse_state *state,
if (sh == NULL) {
sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count);
- talloc_steal(builtin_mem_ctx, sh);
+ ralloc_steal(builtin_mem_ctx, sh);
builtin_profiles[profile_index] = sh;
}
@@ -219,18 +230,17 @@ _mesa_read_profile(struct _mesa_glsl_parse_state *state,
}
void
-_mesa_glsl_initialize_functions(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
+_mesa_glsl_initialize_functions(struct _mesa_glsl_parse_state *state)
{
if (builtin_mem_ctx == NULL) {
- builtin_mem_ctx = talloc_init("GLSL built-in functions");
+ builtin_mem_ctx = ralloc_context(NULL); // "GLSL built-in functions"
memset(&builtin_profiles, 0, sizeof(builtin_profiles));
}
state->num_builtins_to_link = 0;
"""
- i=0
+ i = 0
for (filename, profile) in profiles:
if profile.endswith('_vert'):
check = 'state->target == vertex_shader && '
@@ -244,7 +254,7 @@ _mesa_glsl_initialize_functions(exec_list *instructions,
check += 'state->' + version + '_enable'
print ' if (' + check + ') {'
- print ' _mesa_read_profile(state, instructions, %d,' % i
+ print ' _mesa_read_profile(state, %d,' % i
print ' prototypes_for_' + profile + ','
print ' functions_for_' + profile + ','
print ' Elements(functions_for_' + profile + '));'
diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py
index 8bf708b5aa..2fbe79010f 100755
--- a/src/glsl/builtins/tools/texture_builtins.py
+++ b/src/glsl/builtins/tools/texture_builtins.py
@@ -3,6 +3,11 @@
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":
@@ -12,16 +17,20 @@ def vec_type(g, size):
return "float"
return g + "vec" + str(size)
-# Get the base dimension - i.e. sampler3D gives 3
-# Array samplers also get +1 here since the layer is really an extra coordinate
-def get_coord_dim(sampler_type):
+# Get the sampler dimension - i.e. sampler3D gives 3
+def get_sampler_dim(sampler_type):
if sampler_type[0].isdigit():
- coord_dim = int(sampler_type[0])
+ sampler_dim = int(sampler_type[0])
elif sampler_type.startswith("Cube"):
- coord_dim = 3
+ sampler_dim = 3
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):
+ coord_dim = get_sampler_dim(sampler_type)
if sampler_type.find("Array") != -1:
coord_dim += 1
return coord_dim
@@ -35,18 +44,22 @@ def get_extra_dim(sampler_type, use_proj, unused_fields):
extra_dim += 1
return extra_dim
-def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0):
+def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
coord_dim = get_coord_dim(sampler_type)
- extra_dim = get_extra_dim(sampler_type, use_proj, unused_fields)
+ extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields)
+ offset_dim = get_sampler_dim(sampler_type)
+
+ if variant & Single:
+ return_type = "float"
+ else:
+ return_type = g + "vec4"
# Print parameters
- print " (signature " + g + "vec4"
+ print " (signature", return_type
print " (parameters"
print " (declare (in) " + g + "sampler" + sampler_type + " sampler)"
print " (declare (in) " + vec_type("i" if tex_inst == "txf" else "", coord_dim + extra_dim) + " P)",
- if tex_inst == "txb":
- print "\n (declare (in) float bias)",
- elif tex_inst == "txl":
+ if tex_inst == "txl":
print "\n (declare (in) float lod)",
elif tex_inst == "txf":
print "\n (declare (in) int lod)",
@@ -55,7 +68,12 @@ def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0
print "\n (declare (in) " + grad_type + " dPdx)",
print "\n (declare (in) " + grad_type + " dPdy)",
- print ")\n ((return (" + tex_inst + " (var_ref sampler)",
+ if variant & Offset:
+ print "\n (declare (const_in) " + vec_type("i", offset_dim) + " offset)",
+ if tex_inst == "txb":
+ print "\n (declare (in) float bias)",
+
+ print ")\n ((return (" + tex_inst, return_type, "(var_ref sampler)",
# Coordinate
if extra_dim > 0:
@@ -63,12 +81,14 @@ def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0
else:
print "(var_ref P)",
- # Offset
- print "(0 0 0)",
+ if variant & Offset:
+ print "(var_ref offset)",
+ else:
+ print "0",
if tex_inst != "txf":
# Projective divisor
- if use_proj:
+ if variant & Proj:
print "(swiz " + "xyzw"[coord_dim + extra_dim-1] + " (var_ref P))",
else:
print "1",
@@ -90,10 +110,10 @@ def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0
print "((var_ref dPdx) (var_ref dPdy))",
print "))))\n"
-def generate_fiu_sigs(tex_inst, sampler_type, use_proj = False, unused_fields = 0):
- generate_sigs("", tex_inst, sampler_type, use_proj, unused_fields)
- generate_sigs("i", tex_inst, sampler_type, use_proj, unused_fields)
- generate_sigs("u", tex_inst, sampler_type, use_proj, unused_fields)
+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()
@@ -117,6 +137,11 @@ def generate_texture_functions(fs):
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("txb", "1D")
generate_fiu_sigs("txb", "2D")
@@ -124,20 +149,29 @@ def generate_texture_functions(fs):
generate_fiu_sigs("txb", "Cube")
generate_fiu_sigs("txb", "1DArray")
generate_fiu_sigs("txb", "2DArray")
+ 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", True)
- generate_fiu_sigs("tex", "1D", True, 2)
- generate_fiu_sigs("tex", "2D", True)
- generate_fiu_sigs("tex", "2D", True, 1)
- generate_fiu_sigs("tex", "3D", True)
-
- generate_fiu_sigs("txb", "1D", True)
- generate_fiu_sigs("txb", "1D", True, 2)
- generate_fiu_sigs("txb", "2D", True)
- generate_fiu_sigs("txb", "2D", True, 1)
- generate_fiu_sigs("txb", "3D", True)
+ 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("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")
@@ -147,8 +181,42 @@ def generate_texture_functions(fs):
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);
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", "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")
@@ -157,14 +225,52 @@ def generate_texture_functions(fs):
generate_fiu_sigs("txf", "2DArray")
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", "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_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", True)
- generate_fiu_sigs("txl", "1D", True, 2)
- generate_fiu_sigs("txl", "2D", True)
- generate_fiu_sigs("txl", "2D", True, 1)
- generate_fiu_sigs("txl", "3D", True)
+ 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")
@@ -172,24 +278,55 @@ def generate_texture_functions(fs):
generate_fiu_sigs("txd", "Cube")
generate_fiu_sigs("txd", "1DArray")
generate_fiu_sigs("txd", "2DArray")
+ 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);
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", "Cube", Offset)
+ 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", True)
- generate_fiu_sigs("txd", "1D", True, 2)
- generate_fiu_sigs("txd", "2D", True)
- generate_fiu_sigs("txd", "2D", True, 1)
- generate_fiu_sigs("txd", "3D", True)
+ 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_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_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", True)
- generate_sigs("", "tex", "2DRect", True, 1)
+ generate_sigs("", "tex", "2DRect", Proj)
+ generate_sigs("", "tex", "2DRect", Proj, 1)
end_function(fs, "texture2DRectProj")
start_function("shadow2DRect")
@@ -197,7 +334,7 @@ def generate_texture_functions(fs):
end_function(fs, "shadow2DRect")
start_function("shadow2DRectProj")
- generate_sigs("", "tex", "2DRectShadow", True)
+ generate_sigs("", "tex", "2DRectShadow", Proj)
end_function(fs, "shadow2DRectProj")
# EXT_texture_array extension
@@ -243,15 +380,15 @@ def generate_texture_functions(fs):
end_function(fs, "texture1DLod")
start_function("texture1DProj")
- generate_sigs("", "tex", "1D", True)
- generate_sigs("", "tex", "1D", True, 2)
- generate_sigs("", "txb", "1D", True)
- generate_sigs("", "txb", "1D", True, 2)
+ 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", True)
- generate_sigs("", "txl", "1D", True, 2)
+ generate_sigs("", "txl", "1D", Proj)
+ generate_sigs("", "txl", "1D", Proj, 2)
end_function(fs, "texture1DProjLod")
start_function("texture2D")
@@ -264,15 +401,15 @@ def generate_texture_functions(fs):
end_function(fs, "texture2DLod")
start_function("texture2DProj")
- generate_sigs("", "tex", "2D", True)
- generate_sigs("", "tex", "2D", True, 1)
- generate_sigs("", "txb", "2D", True)
- generate_sigs("", "txb", "2D", True, 1)
+ generate_sigs("", "tex", "2D", Proj)
+ generate_sigs("", "tex", "2D", Proj, 1)
+ generate_sigs("", "txb", "2D", Proj)
+ generate_sigs("", "txb", "2D", Proj, 1)
end_function(fs, "texture2DProj")
start_function("texture2DProjLod")
- generate_sigs("", "txl", "2D", True)
- generate_sigs("", "txl", "2D", True, 1)
+ generate_sigs("", "txl", "2D", Proj)
+ generate_sigs("", "txl", "2D", Proj, 1)
end_function(fs, "texture2DProjLod")
start_function("texture3D")
@@ -285,12 +422,12 @@ def generate_texture_functions(fs):
end_function(fs, "texture3DLod")
start_function("texture3DProj")
- generate_sigs("", "tex", "3D", True)
- generate_sigs("", "txb", "3D", True)
+ generate_sigs("", "tex", "3D", Proj)
+ generate_sigs("", "txb", "3D", Proj)
end_function(fs, "texture3DProj")
start_function("texture3DProjLod")
- generate_sigs("", "txl", "3D", True)
+ generate_sigs("", "txl", "3D", Proj)
end_function(fs, "texture3DProjLod")
start_function("textureCube")
@@ -312,12 +449,12 @@ def generate_texture_functions(fs):
end_function(fs, "shadow1DLod")
start_function("shadow1DProj")
- generate_sigs("", "tex", "1DShadow", True, 1)
- generate_sigs("", "txb", "1DShadow", True, 1)
+ generate_sigs("", "tex", "1DShadow", Proj, 1)
+ generate_sigs("", "txb", "1DShadow", Proj, 1)
end_function(fs, "shadow1DProj")
start_function("shadow1DProjLod")
- generate_sigs("", "txl", "1DShadow", True, 1)
+ generate_sigs("", "txl", "1DShadow", Proj, 1)
end_function(fs, "shadow1DProjLod")
start_function("shadow2D")
@@ -330,12 +467,12 @@ def generate_texture_functions(fs):
end_function(fs, "shadow2DLod")
start_function("shadow2DProj")
- generate_sigs("", "tex", "2DShadow", True)
- generate_sigs("", "txb", "2DShadow", True)
+ generate_sigs("", "tex", "2DShadow", Proj)
+ generate_sigs("", "txb", "2DShadow", Proj)
end_function(fs, "shadow2DProj")
start_function("shadow2DProjLod")
- generate_sigs("", "txl", "2DShadow", True)
+ generate_sigs("", "txl", "2DShadow", Proj)
end_function(fs, "shadow2DProjLod")
sys.stdout = sys.__stdout__
@@ -346,4 +483,4 @@ if __name__ == "__main__":
fs = {}
generate_texture_functions(fs);
for k, v in fs.iteritems():
- print v
+ print v