diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/SymbolTable.h')
-rw-r--r-- | src/3rdparty/angle/src/compiler/SymbolTable.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/3rdparty/angle/src/compiler/SymbolTable.h b/src/3rdparty/angle/src/compiler/SymbolTable.h index a89499e4f4..d27aa332b7 100644 --- a/src/3rdparty/angle/src/compiler/SymbolTable.h +++ b/src/3rdparty/angle/src/compiler/SymbolTable.h @@ -169,8 +169,8 @@ public: void setDefined() { defined = true; } bool isDefined() { return defined; } - int getParamCount() const { return static_cast<int>(parameters.size()); } - const TParameter& getParam(int i) const { return parameters[i]; } + size_t getParamCount() const { return parameters.size(); } + const TParameter& getParam(size_t i) const { return parameters[i]; } virtual void dump(TInfoSink &infoSink) const; TFunction(const TFunction&, TStructureMap& remapper); @@ -323,10 +323,16 @@ public: void dump(TInfoSink &infoSink) const; void copyTable(const TSymbolTable& copyOf); - void setDefaultPrecision( TBasicType type, TPrecision prec ){ - if( type != EbtFloat && type != EbtInt ) return; // Only set default precision for int/float + bool setDefaultPrecision( const TPublicType& type, TPrecision prec ){ + if (IsSampler(type.type)) + return true; // Skip sampler types for the time being + if (type.type != EbtFloat && type.type != EbtInt) + return false; // Only set default precision for int/float + if (type.size != 1 || type.matrix || type.array) + return false; // Not allowed to set for aggregate types int indexOfLastElement = static_cast<int>(precisionStack.size()) - 1; - precisionStack[indexOfLastElement][type] = prec; // Uses map operator [], overwrites the current value + precisionStack[indexOfLastElement][type.type] = prec; // Uses map operator [], overwrites the current value + return true; } // Searches down the precisionStack for a precision qualifier for the specified TBasicType |