From 5e65c1ccaefe8b47bb4df93251aa5a737621af75 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 8 Jun 2010 16:03:46 -0700 Subject: [PATCH] texture_builtins.py: Support the EXT_texture_array extension. --- builtins/tools/texture_builtins.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/builtins/tools/texture_builtins.py b/builtins/tools/texture_builtins.py index d4648a2..be0bc6f 100755 --- a/builtins/tools/texture_builtins.py +++ b/builtins/tools/texture_builtins.py @@ -74,7 +74,9 @@ def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0 print "1", # Shadow comparitor - if sampler_type.endswith("Shadow"): + if sampler_type == "2DArrayShadow": # 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 "()", @@ -189,6 +191,33 @@ with open(path.join(builtins_dir, "ARB_texture_rectangle", "textures"), 'w') as generate_sigs("", "tex", "2DRectShadow") print "))" +# EXT_texture_array extension +with open(path.join(builtins_dir, "EXT_texture_array", "textures"), 'w') as sys.stdout: + print "((function texture1DArray" + generate_sigs("", "tex", "1DArray") + print ")\n (function texture1DArrayLod" + generate_sigs("", "txl", "1DArray") + print ")\n (function texture2DArray" + generate_sigs("", "tex", "2DArray") + print ")\n (function texture2DArrayLod" + generate_sigs("", "txl", "2DArray") + print ")\n (function shadow1DArray" + generate_sigs("", "tex", "1DArrayShadow") + print ")\n (function shadow1DArrayLod" + generate_sigs("", "txl", "1DArrayShadow") + print ")\n (function shadow2DArray" + generate_sigs("", "tex", "2DArrayShadow") + print "))" + +with open(path.join(builtins_dir, "EXT_texture_array_fs", "textures"), 'w') as sys.stdout: + print "((function texture1DArray" + generate_sigs("", "txb", "1DArray") # MOVE TO _fs + print ")\n (function texture2DArray" + generate_sigs("", "txb", "2DArray") # MOVE TO _fs + print ")\n (function shadow1DArray" + generate_sigs("", "txb", "1DArrayShadow") + print "))" + # Deprecated (110/120 style) functions with silly names: with open(path.join(builtins_dir, "110", "textures"), 'w') as sys.stdout: print "((function texture1D" -- 2.7.4