glsl: Add precision information to ir_variable
We will need this later on when we implement proper support for precision qualifiers in the drivers and also to do link time checks for uniforms as indicated by the spec. This patch also adds compile-time checks for variables without precision information (currently, Mesa only checks that a default precision is set for floats in fragment shaders). As indicated by Ian, the addition of the precision information to ir_variable has been done using a bitfield and pahole to identify an available hole so that memory requirements for ir_variable stay the same. v2 (Ian): - Avoid if-ladders by defining arrays of supported sampler names and indexing into them with type->sampler_array + 2 * type->sampler_shadow - Make the code that selects the precision qualifier to use an utility function - Fix a typo v3 (Tapani): - rebased - squashed in "Precision qualifiers are not allowed on structs" - fixed select_gles_precision for sampler arrays - fixed precision_qualifier_allowed for arrays of structs v4 (Tapani): - add atomic_uint handling - do not allow precision qualifier on images (issues reported by Marta) v5 (Tapani): - support precision qualifier on image types v6 (Tapani): - set precision qualifier on interface block members Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:

committed by
Tapani Pälli

parent
9a00e1a69d
commit
f84bc57d7d
@@ -770,6 +770,19 @@ public:
|
||||
*/
|
||||
unsigned index:1;
|
||||
|
||||
/**
|
||||
* Precision qualifier.
|
||||
*
|
||||
* In desktop GLSL we do not care about precision qualifiers at all, in
|
||||
* fact, the spec says that precision qualifiers are ignored.
|
||||
*
|
||||
* To make things easy, we make it so that this field is always
|
||||
* GLSL_PRECISION_NONE on desktop shaders. This way all the variables
|
||||
* have the same precision value and the checks we add in the compiler
|
||||
* for this field will never break a desktop shader compile.
|
||||
*/
|
||||
unsigned precision:2;
|
||||
|
||||
/**
|
||||
* \brief Layout qualifier for gl_FragDepth.
|
||||
*
|
||||
|
Reference in New Issue
Block a user