summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/apps/compile.c4
-rw-r--r--src/glsl/cl/sl_cl_parse.c35
2 files changed, 20 insertions, 19 deletions
diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c
index 21c2b7617e9..5073b0da827 100644
--- a/src/glsl/apps/compile.c
+++ b/src/glsl/apps/compile.c
@@ -37,7 +37,7 @@ static void
usage(void)
{
printf("Usage:\n");
- printf(" compile fragment|vertex <source> <output>\n");
+ printf(" compile fragment|vertex|geometry <source> <output>\n");
}
int
@@ -65,6 +65,8 @@ main(int argc,
shader_type = 1;
} else if (!strcmp(argv[1], "vertex")) {
shader_type = 2;
+ } else if (!strcmp(argv[1], "geometry")) {
+ shader_type = 3;
} else {
usage();
return 1;
diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c
index 663436dde99..65df6c38ae7 100644
--- a/src/glsl/cl/sl_cl_parse.c
+++ b/src/glsl/cl/sl_cl_parse.c
@@ -246,6 +246,7 @@
#define PARAM_QUALIFIER_IN 0
#define PARAM_QUALIFIER_OUT 1
#define PARAM_QUALIFIER_INOUT 2
+#define PARAM_QUALIFIER_NONE 3
/* function parameter */
#define PARAMETER_NONE 0
@@ -836,7 +837,6 @@ _parse_storage_qualifier(struct parse_context *ctx,
return 0;
}
-
static int
_parse_struct_declarator(struct parse_context *ctx,
struct parse_state *ps)
@@ -1114,6 +1114,21 @@ _parse_type_specifier(struct parse_context *ctx,
return 0;
}
+static int
+_parse_parameter_qualifier(struct parse_context *ctx,
+ struct parse_state *ps)
+{
+ unsigned int e = _emit(ctx, &ps->out, PARAM_QUALIFIER_NONE);
+
+ if (_parse_id(ctx, ctx->dict.in, ps) == 0) {
+ _update(ctx, e, PARAM_QUALIFIER_IN);
+ } else if (_parse_id(ctx, ctx->dict.out, ps) == 0) {
+ _update(ctx, e, PARAM_QUALIFIER_OUT);
+ } else if (_parse_id(ctx, ctx->dict.inout, ps) == 0) {
+ _update(ctx, e, PARAM_QUALIFIER_INOUT);
+ }
+ return 0;
+}
static int
_parse_fully_specified_type(struct parse_context *ctx,
@@ -1136,6 +1151,7 @@ _parse_fully_specified_type(struct parse_context *ctx,
if (_parse_storage_qualifier(ctx, &p)) {
_emit(ctx, &p.out, TYPE_QUALIFIER_NONE);
}
+ _parse_parameter_qualifier(ctx, &p);
if (_parse_precision(ctx, &p)) {
_emit(ctx, &p.out, PRECISION_DEFAULT);
}
@@ -1168,23 +1184,6 @@ _parse_function_header(struct parse_context *ctx,
static int
-_parse_parameter_qualifier(struct parse_context *ctx,
- struct parse_state *ps)
-{
- unsigned int e = _emit(ctx, &ps->out, PARAM_QUALIFIER_IN);
-
- if (_parse_id(ctx, ctx->dict.out, ps) == 0) {
- _update(ctx, e, PARAM_QUALIFIER_OUT);
- } else if (_parse_id(ctx, ctx->dict.inout, ps) == 0) {
- _update(ctx, e, PARAM_QUALIFIER_INOUT);
- } else {
- _parse_id(ctx, ctx->dict.in, ps);
- }
- return 0;
-}
-
-
-static int
_parse_function_identifier(struct parse_context *ctx,
struct parse_state *ps)
{