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 <tarceri@itsqueeze.com>
This commit is contained in:
Neil Roberts
2019-08-23 14:24:27 +02:00
parent 3a7e92dac5
commit 95927c414f
3 changed files with 30 additions and 1 deletions

View File

@@ -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;