Mesa (7.10): glsl: Change default value of ast_type_specifier::precision
Ian Romanick
idr at kemper.freedesktop.org
Sat Feb 5 00:14:05 UTC 2011
Module: Mesa
Branch: 7.10
Commit: 9016ab24b8c69ef59c6fb9ae85d75571e943879b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9016ab24b8c69ef59c6fb9ae85d75571e943879b
Author: Chad Versace <chad.versace at intel.com>
Date: Fri Jan 14 09:50:55 2011 -0800
glsl: Change default value of ast_type_specifier::precision
Change default value to ast_precision_none, which denotes the absence of
a precision of a qualifier.
Previously, the default value was ast_precision_high. This made it
impossible to detect if a precision qualifier was present or not.
(cherry picked from commit aaa31bf8f44e1aab0e87160661196b0a16e1d015)
---
src/glsl/ast.h | 7 ++++---
src/glsl/ast_type.cpp | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index a77b522..6791734 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -318,7 +318,8 @@ public:
enum {
- ast_precision_high = 0, /**< Default precision. */
+ ast_precision_none = 0, /**< Absence of precision qualifier. */
+ ast_precision_high,
ast_precision_medium,
ast_precision_low
};
@@ -440,7 +441,7 @@ public:
/** Construct a type specifier from a type name */
ast_type_specifier(const char *name)
: type_specifier(ast_type_name), type_name(name), structure(NULL),
- is_array(false), array_size(NULL), precision(ast_precision_high)
+ is_array(false), array_size(NULL), precision(ast_precision_none)
{
/* empty */
}
@@ -448,7 +449,7 @@ public:
/** Construct a type specifier from a structure definition */
ast_type_specifier(ast_struct_specifier *s)
: type_specifier(ast_struct), type_name(s->name), structure(s),
- is_array(false), array_size(NULL), precision(ast_precision_high)
+ is_array(false), array_size(NULL), precision(ast_precision_none)
{
/* empty */
}
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index b7488cf..3b331c4 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -49,7 +49,7 @@ ast_type_specifier::print(void) const
ast_type_specifier::ast_type_specifier(int specifier)
: type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
- is_array(false), array_size(NULL), precision(ast_precision_high)
+ is_array(false), array_size(NULL), precision(ast_precision_none)
{
static const char *const names[] = {
"void",
More information about the mesa-commit
mailing list