summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-11-01 22:57:26 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2008-11-01 22:57:26 +0000
commit81c862205e32b163a9f5ecf3f59e4cdcccee36c6 (patch)
tree50a5f45f1a0823758e72968d1f1dfd6e0d1098e0 /src/mesa/shader/slang/slang_compile.c
parent14e1505cce24ee294cb98683504cc4537c20f34a (diff)
parentbbffed0857634912c7a1f13882eba303ae2bf4e1 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 9cf0f8b81a..294e46235c 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -800,6 +800,7 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
#define OP_FIELD 59
#define OP_POSTINCREMENT 60
#define OP_POSTDECREMENT 61
+#define OP_PRECISION 62
/**
@@ -971,6 +972,16 @@ parse_statement(slang_parse_ctx * C, slang_output_ctx * O,
return 0;
}
break;
+ case OP_PRECISION:
+ {
+ /* set default precision for a type in this scope */
+ /* ignored at this time */
+ int prec_qual = *C->I++;
+ int datatype = *C->I++;
+ (void) prec_qual;
+ (void) datatype;
+ }
+ break;
default:
return 0;
}
@@ -1295,12 +1306,16 @@ static int
parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
slang_variable * param)
{
+ int param_qual, precision_qual;
+
/* parse and validate the parameter's type qualifiers (there can be
* two at most) because not all combinations are valid
*/
if (!parse_type_qualifier(C, &param->type.qualifier))
return 0;
- switch (*C->I++) {
+
+ param_qual = *C->I++;
+ switch (param_qual) {
case PARAM_QUALIFIER_IN:
if (param->type.qualifier != SLANG_QUAL_CONST
&& param->type.qualifier != SLANG_QUAL_NONE) {
@@ -1328,6 +1343,11 @@ parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
return 0;
}
+ /* parse precision qualifier (lowp, mediump, highp */
+ precision_qual = *C->I++;
+ /* ignored at this time */
+ (void) precision_qual;
+
/* parse parameter's type specifier and name */
if (!parse_type_specifier(C, O, &param->type.specifier))
return 0;