Skip to content

Commit 1fb6d0e

Browse files
authored
Update util.h
1 parent 996eddf commit 1fb6d0e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/compiler/translator/util.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ bool atoi_clamp(const char *str, unsigned int *value);
2424
namespace sh
2525
{
2626

27+
// Keeps track of whether an implicit conversion from int/uint to float is possible.
28+
// These conversions are supported in desktop GLSL shaders only.
29+
// Also keeps track of which side of operation should be converted.
30+
enum class ImplicitTypeConversion
31+
{
32+
Same,
33+
Left,
34+
Right,
35+
Invalid,
36+
};
37+
2738
class TIntermBlock;
2839
class TIntermDeclaration;
2940
class TSymbolTable;
@@ -88,6 +99,11 @@ GLenum GetImageInternalFormatType(TLayoutImageInternalFormat iifq);
8899
// ESSL 1.00 shaders nest function body scope within function parameter scope
89100
bool IsSpecWithFunctionBodyNewScope(ShShaderSpec shaderSpec, int shaderVersion);
90101

102+
// Helper functions for implicit conversions
103+
ImplicitTypeConversion GetConversion(TBasicType t1, TBasicType t2);
104+
105+
bool IsValidImplicitConversion(ImplicitTypeConversion conversion, TOperator op);
106+
91107
// Whether the given basic type requires precision.
92108
bool IsPrecisionApplicableToType(TBasicType type);
93109

0 commit comments

Comments
 (0)