[Mesa-dev] [PATCH] slang: if precision qualifiers are allowed, always use default

Jesse Barnes jbarnes at virtuousgeek.org
Thu May 13 11:43:39 PDT 2010


Rather than erroring out, allow precision qualifiers.  Use the default
type since we don't support anything else.  Since many (most?) GLES2
shaders use precision qualifiers, doing something reasonable is
important if our GLES2 builds are to be useful.
---
 src/mesa/shader/slang/slang_compile.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index ad86676..5f2f3bc 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -1006,11 +1006,9 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
    */
 
    if (O->allow_precision) {
-      if (type->precision == SLANG_PREC_DEFAULT) {
-         assert(type->specifier.type < TYPE_SPECIFIER_COUNT);
-         /* use the default precision for this datatype */
-         type->precision = O->default_precision[type->specifier.type];
-      }
+      assert(type->specifier.type < TYPE_SPECIFIER_COUNT);
+      /* use the default precision for this datatype */
+      type->precision = O->default_precision[type->specifier.type];
    }
    else {
       /* only default is allowed */
-- 
1.6.1.3



More information about the mesa-dev mailing list