summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-25 19:45:45 -0700
committerBrian Paul <brianp@vmware.com>2010-02-25 20:11:55 -0700
commit1f2b495b5567897acbd236f302a1e2b9b5faec65 (patch)
tree5ed40e51c53eabfd2163bd771d60f28063c15e5b /src/mesa/shader/slang/slang_compile.c
parent1edd444c2e9afadb56df55682ae606b5cefd811c (diff)
glsl: implement support for GL_EXT_texture_array
GL_EXT_texture_array is different from the existing GL_MESA_texture_array support in that the former is only supported for GLSL, not fixed-function. The shadow compare versions of the sampler functions haven't been tested yet. The non-shadow versions have been tested with a new piglit test.
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 4280698cc9..b95c15fea6 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -55,7 +55,7 @@
/** re-defined below, should be the same though */
-#define TYPE_SPECIFIER_COUNT 32
+#define TYPE_SPECIFIER_COUNT 36
/**
@@ -742,13 +742,18 @@ parse_type_qualifier(slang_parse_ctx * C, slang_type_qualifier * qual)
#define TYPE_SPECIFIER_MAT42 29
#define TYPE_SPECIFIER_MAT34 30
#define TYPE_SPECIFIER_MAT43 31
-#define TYPE_SPECIFIER_COUNT 32
+#define TYPE_SPECIFIER_SAMPLER_1D_ARRAY 32
+#define TYPE_SPECIFIER_SAMPLER_2D_ARRAY 33
+#define TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW 34
+#define TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW 35
+#define TYPE_SPECIFIER_COUNT 36
static int
parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O,
slang_type_specifier * spec)
{
- switch (*C->I++) {
+ int type = *C->I++;
+ switch (type) {
case TYPE_SPECIFIER_VOID:
spec->type = SLANG_SPEC_VOID;
break;
@@ -816,28 +821,40 @@ parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O,
spec->type = SLANG_SPEC_MAT43;
break;
case TYPE_SPECIFIER_SAMPLER1D:
- spec->type = SLANG_SPEC_SAMPLER1D;
+ spec->type = SLANG_SPEC_SAMPLER_1D;
break;
case TYPE_SPECIFIER_SAMPLER2D:
- spec->type = SLANG_SPEC_SAMPLER2D;
+ spec->type = SLANG_SPEC_SAMPLER_2D;
break;
case TYPE_SPECIFIER_SAMPLER3D:
- spec->type = SLANG_SPEC_SAMPLER3D;
+ spec->type = SLANG_SPEC_SAMPLER_3D;
break;
case TYPE_SPECIFIER_SAMPLERCUBE:
- spec->type = SLANG_SPEC_SAMPLERCUBE;
+ spec->type = SLANG_SPEC_SAMPLER_CUBE;
break;
case TYPE_SPECIFIER_SAMPLER2DRECT:
- spec->type = SLANG_SPEC_SAMPLER2DRECT;
+ spec->type = SLANG_SPEC_SAMPLER_RECT;
break;
case TYPE_SPECIFIER_SAMPLER1DSHADOW:
- spec->type = SLANG_SPEC_SAMPLER1DSHADOW;
+ spec->type = SLANG_SPEC_SAMPLER_1D_SHADOW;
break;
case TYPE_SPECIFIER_SAMPLER2DSHADOW:
- spec->type = SLANG_SPEC_SAMPLER2DSHADOW;
+ spec->type = SLANG_SPEC_SAMPLER_2D_SHADOW;
break;
case TYPE_SPECIFIER_SAMPLER2DRECTSHADOW:
- spec->type = SLANG_SPEC_SAMPLER2DRECTSHADOW;
+ spec->type = SLANG_SPEC_SAMPLER_RECT_SHADOW;
+ break;
+ case TYPE_SPECIFIER_SAMPLER_1D_ARRAY:
+ spec->type = SLANG_SPEC_SAMPLER_1D_ARRAY;
+ break;
+ case TYPE_SPECIFIER_SAMPLER_2D_ARRAY:
+ spec->type = SLANG_SPEC_SAMPLER_2D_ARRAY;
+ break;
+ case TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW:
+ spec->type = SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW;
+ break;
+ case TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW:
+ spec->type = SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW;
break;
case TYPE_SPECIFIER_STRUCT:
spec->type = SLANG_SPEC_STRUCT;
@@ -2133,6 +2150,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
var->type.qualifier = type->qualifier;
var->type.centroid = type->centroid;
var->type.precision = type->precision;
+ var->type.specifier = type->specifier;/*new*/
var->type.variant = type->variant;
var->type.layout = type->layout;
var->type.array_len = type->array_len;
@@ -2441,6 +2459,10 @@ parse_default_precision(slang_parse_ctx * C, slang_output_ctx * O)
case TYPE_SPECIFIER_SAMPLER2DSHADOW:
case TYPE_SPECIFIER_SAMPLER2DRECT:
case TYPE_SPECIFIER_SAMPLER2DRECTSHADOW:
+ case TYPE_SPECIFIER_SAMPLER_1D_ARRAY:
+ case TYPE_SPECIFIER_SAMPLER_2D_ARRAY:
+ case TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW:
+ case TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW:
/* OK */
break;
default: