aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir.h
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2019-08-23 14:24:27 +0200
committerNeil Roberts <[email protected]>2019-09-04 12:41:20 +0200
commit95927c414fffaba64536f3b9389a4387007e9b32 (patch)
treed8da632beb381a6e0a1b7a2721c25b6a1950dfad /src/compiler/glsl/ir.h
parent3a7e92dac538e1ad76b42590beeaada28e79bb07 (diff)
glsl: Store the precision for a function return type
The precision for a function return type is now stored in ir_function_signature. This will later be useful to implement mediump to float16 lowering. In the meantime it is also useful to catch errors where a function is redeclared with a different precision. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir.h')
-rw-r--r--src/compiler/glsl/ir.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 441500ec31e..ba831f2c1ed 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -1222,7 +1222,7 @@ public:
/**
* Function return type.
*
- * \note This discards the optional precision qualifier.
+ * \note The precision qualifier is stored separately in return_precision.
*/
const struct glsl_type *return_type;
@@ -1237,6 +1237,13 @@ public:
/** Whether or not this function has a body (which may be empty). */
unsigned is_defined:1;
+ /*
+ * Precision qualifier for the return type.
+ *
+ * See the comment for ir_variable_data::precision for more details.
+ */
+ unsigned return_precision:2;
+
/** Whether or not this function signature is a built-in. */
bool is_builtin() const;