Add support for extension GL_EXT_shader_implicit_conversions

Updated extension management in TIntermediate class.
This commit is contained in:
Pankaj Mistry
2020-04-26 17:52:31 -07:00
parent 97ee5c88de
commit 2a8ead2109
10 changed files with 182 additions and 17 deletions

View File

@@ -448,4 +448,40 @@ void devie()
{
gl_DeviceIndex;
gl_ViewIndex;
}
}
#extension GL_EXT_shader_implicit_conversions : enable
// Test function overloading
void func(uint a, uvec4 b)
{
}
int func(uint a, uvec4 b) // Error function overloading because of same signature and different return type
{
return 0;
}
int b;
void testimplicit() {
uint a = b; // int->uint
mediump vec4 col = vec4(1, 2, 3, 4); // ivec4 -> vec4
int b = a + 2; // ERROR: cannot convert from ' temp uint' to ' temp int'
// Test binary ops
uint c = b * 3;
uint d = b * 3u;
uint e = b%3;
uint f = (b > 3)? b : c;
func(b, ivec4(1,2,3,4));
}
#extension GL_EXT_shader_implicit_conversions : disable
void testimplicitFail() {
uint a = b; // Error GL_EXT_shader_implicit_conversions is disabled
}