diff options
author | Brian Paul <[email protected]> | 2008-08-07 10:26:35 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-08-07 13:32:43 -0600 |
commit | a78f295f7ca0a93fdaeda559668fda013c2a03b0 (patch) | |
tree | 6cf6006bc61e18f122560f9af9b3ad4131113371 /src/mesa/shader/slang/slang_compile.c | |
parent | 1ffd6908d4153d647f8a3bf1ba9fe9d33c206185 (diff) |
mesa: glsl: finish up support for precision qualifiers
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 2a1af39ee07..64c0dad611d 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -707,20 +707,33 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O, precision = *C->I++; if (!parse_type_specifier(C, O, &type->specifier)) return 0; + switch (precision) { case PRECISION_DEFAULT: - /* TODO: Grab the default precision for the given type specifier. - */ + assert(type->specifier.type < TYPE_SPECIFIER_COUNT); + if (type->specifier.type < TYPE_SPECIFIER_COUNT) + type->precision = O->default_precision[type->specifier.type]; break; case PRECISION_LOW: + type->precision = SLANG_PREC_LOW; + break; case PRECISION_MEDIUM: + type->precision = SLANG_PREC_MEDIUM; + break; case PRECISION_HIGH: - /* TODO: Translate to mesa representation. - */ + type->precision = SLANG_PREC_HIGH; break; default: return 0; } + +#if !FEATURE_es2_glsl + if (precision != PRECISION_DEFAULT) { + slang_info_log_error(C->L, "precision qualifiers not allowed"); + return 0; + } +#endif + return 1; } |