summaryrefslogtreecommitdiff
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/apps/compile.c1
-rw-r--r--src/glsl/apps/process.c1
-rw-r--r--src/glsl/apps/purify.c2
-rw-r--r--src/glsl/apps/tokenise.c1
-rw-r--r--src/glsl/apps/version.c1
-rw-r--r--src/glsl/cl/sl_cl_parse.c31
6 files changed, 37 insertions, 0 deletions
diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c
index 3b3c083c2e..21c2b7617e 100644
--- a/src/glsl/apps/compile.c
+++ b/src/glsl/apps/compile.c
@@ -79,6 +79,7 @@ main(int argc,
fseek(in, 0, SEEK_END);
size = ftell(in);
+ assert(size != -1);
fseek(in, 0, SEEK_SET);
out = fopen(argv[3], "w");
diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c
index e65f35cc00..c8a1a1868c 100644
--- a/src/glsl/apps/process.c
+++ b/src/glsl/apps/process.c
@@ -58,6 +58,7 @@ main(int argc,
fseek(in, 0, SEEK_END);
size = ftell(in);
+ assert(size != -1);
fseek(in, 0, SEEK_SET);
out = fopen(argv[2], "wb");
diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c
index 3019e8b220..5ab6bae96d 100644
--- a/src/glsl/apps/purify.c
+++ b/src/glsl/apps/purify.c
@@ -25,6 +25,7 @@
*
**************************************************************************/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -56,6 +57,7 @@ main(int argc,
fseek(in, 0, SEEK_END);
size = ftell(in);
+ assert(size != -1);
fseek(in, 0, SEEK_SET);
out = fopen(argv[2], "wb");
diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c
index c70c3ccbb1..b4c6d60930 100644
--- a/src/glsl/apps/tokenise.c
+++ b/src/glsl/apps/tokenise.c
@@ -57,6 +57,7 @@ main(int argc,
fseek(in, 0, SEEK_END);
size = ftell(in);
+ assert(size != -1);
fseek(in, 0, SEEK_SET);
out = fopen(argv[2], "wb");
diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c
index 0420f97294..9820ad94dc 100644
--- a/src/glsl/apps/version.c
+++ b/src/glsl/apps/version.c
@@ -56,6 +56,7 @@ main(int argc,
fseek(in, 0, SEEK_END);
size = ftell(in);
+ assert(size != -1);
fseek(in, 0, SEEK_SET);
out = fopen(argv[2], "wb");
diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c
index 9a20509fc6..771bdfd082 100644
--- a/src/glsl/cl/sl_cl_parse.c
+++ b/src/glsl/cl/sl_cl_parse.c
@@ -161,6 +161,12 @@
#define TYPE_SPECIFIER_MAT34 30
#define TYPE_SPECIFIER_MAT43 31
+/* GL_EXT_texture_array */
+#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
+
/* type specifier array */
#define TYPE_SPECIFIER_NONARRAY 0
#define TYPE_SPECIFIER_ARRAY 1
@@ -281,6 +287,10 @@ struct parse_dict {
int sampler2DShadow;
int sampler2DRect;
int sampler2DRectShadow;
+ int sampler1DArray;
+ int sampler2DArray;
+ int sampler1DArrayShadow;
+ int sampler2DArrayShadow;
int invariant;
@@ -1028,6 +1038,15 @@ _parse_type_specifier_nonarray(struct parse_context *ctx,
_update(ctx, e, TYPE_SPECIFIER_SAMPLER2DRECT);
} else if (id == ctx->dict.sampler2DRectShadow) {
_update(ctx, e, TYPE_SPECIFIER_SAMPLER2DRECTSHADOW);
+ } else if (id == ctx->dict.sampler1DArray) {
+ _update(ctx, e, TYPE_SPECIFIER_SAMPLER_1D_ARRAY);
+ } else if (id == ctx->dict.sampler2DArray) {
+ /* XXX check for GL_EXT_texture_array */
+ _update(ctx, e, TYPE_SPECIFIER_SAMPLER_2D_ARRAY);
+ } else if (id == ctx->dict.sampler1DArrayShadow) {
+ _update(ctx, e, TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW);
+ } else if (id == ctx->dict.sampler2DArrayShadow) {
+ _update(ctx, e, TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW);
} else if (_parse_identifier(ctx, &p) == 0) {
_update(ctx, e, TYPE_SPECIFIER_TYPENAME);
*ps = p;
@@ -1944,6 +1963,14 @@ _parse_prectype(struct parse_context *ctx,
type = TYPE_SPECIFIER_SAMPLER2DRECT;
} else if (id == ctx->dict.sampler2DRectShadow) {
type = TYPE_SPECIFIER_SAMPLER2DRECTSHADOW;
+ } else if (id == ctx->dict.sampler1DArray) {
+ type = TYPE_SPECIFIER_SAMPLER_1D_ARRAY;
+ } else if (id == ctx->dict.sampler2DArray) {
+ type = TYPE_SPECIFIER_SAMPLER_2D_ARRAY;
+ } else if (id == ctx->dict.sampler1DArrayShadow) {
+ type = TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW;
+ } else if (id == ctx->dict.sampler2DArrayShadow) {
+ type = TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW;
} else {
return -1;
}
@@ -2886,6 +2913,10 @@ sl_cl_compile(struct sl_pp_context *context,
ADD_NAME(ctx, sampler2DShadow);
ADD_NAME(ctx, sampler2DRect);
ADD_NAME(ctx, sampler2DRectShadow);
+ ADD_NAME(ctx, sampler1DArray);
+ ADD_NAME(ctx, sampler2DArray);
+ ADD_NAME(ctx, sampler1DArrayShadow);
+ ADD_NAME(ctx, sampler2DArrayShadow);
ADD_NAME(ctx, invariant);