Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
ed948c8e
Unverified
Commit
ed948c8e
authored
Apr 16, 2021
by
Greg Fischer
Committed by
GitHub
Apr 16, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2612 from greg-lunarg/explicit0
Fix builtins for GL_EXT_shader_explicit_arithmetic_types for es
parents
b3859343
100457e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
244 additions
and
21 deletions
+244
-21
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+239
-19
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-2
No files found.
glslang/MachineIndependent/Initialize.cpp
View file @
ed948c8e
...
@@ -931,7 +931,203 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -931,7 +931,203 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"
\n
"
);
"
\n
"
);
}
}
if
(
profile
!=
EEsProfile
&&
version
>=
450
)
{
if
(
profile
==
EEsProfile
&&
version
>=
310
)
{
// Explicit Types
commonBuiltins
.
append
(
"float64_t sqrt(float64_t);"
"f64vec2 sqrt(f64vec2);"
"f64vec3 sqrt(f64vec3);"
"f64vec4 sqrt(f64vec4);"
"float64_t inversesqrt(float64_t);"
"f64vec2 inversesqrt(f64vec2);"
"f64vec3 inversesqrt(f64vec3);"
"f64vec4 inversesqrt(f64vec4);"
"float64_t abs(float64_t);"
"f64vec2 abs(f64vec2);"
"f64vec3 abs(f64vec3);"
"f64vec4 abs(f64vec4);"
"float64_t sign(float64_t);"
"f64vec2 sign(f64vec2);"
"f64vec3 sign(f64vec3);"
"f64vec4 sign(f64vec4);"
"float64_t floor(float64_t);"
"f64vec2 floor(f64vec2);"
"f64vec3 floor(f64vec3);"
"f64vec4 floor(f64vec4);"
"float64_t trunc(float64_t);"
"f64vec2 trunc(f64vec2);"
"f64vec3 trunc(f64vec3);"
"f64vec4 trunc(f64vec4);"
"float64_t round(float64_t);"
"f64vec2 round(f64vec2);"
"f64vec3 round(f64vec3);"
"f64vec4 round(f64vec4);"
"float64_t roundEven(float64_t);"
"f64vec2 roundEven(f64vec2);"
"f64vec3 roundEven(f64vec3);"
"f64vec4 roundEven(f64vec4);"
"float64_t ceil(float64_t);"
"f64vec2 ceil(f64vec2);"
"f64vec3 ceil(f64vec3);"
"f64vec4 ceil(f64vec4);"
"float64_t fract(float64_t);"
"f64vec2 fract(f64vec2);"
"f64vec3 fract(f64vec3);"
"f64vec4 fract(f64vec4);"
"float64_t mod(float64_t, float64_t);"
"f64vec2 mod(f64vec2 , float64_t);"
"f64vec3 mod(f64vec3 , float64_t);"
"f64vec4 mod(f64vec4 , float64_t);"
"f64vec2 mod(f64vec2 , f64vec2);"
"f64vec3 mod(f64vec3 , f64vec3);"
"f64vec4 mod(f64vec4 , f64vec4);"
"float64_t modf(float64_t, out float64_t);"
"f64vec2 modf(f64vec2, out f64vec2);"
"f64vec3 modf(f64vec3, out f64vec3);"
"f64vec4 modf(f64vec4, out f64vec4);"
"float64_t min(float64_t, float64_t);"
"f64vec2 min(f64vec2, float64_t);"
"f64vec3 min(f64vec3, float64_t);"
"f64vec4 min(f64vec4, float64_t);"
"f64vec2 min(f64vec2, f64vec2);"
"f64vec3 min(f64vec3, f64vec3);"
"f64vec4 min(f64vec4, f64vec4);"
"float64_t max(float64_t, float64_t);"
"f64vec2 max(f64vec2 , float64_t);"
"f64vec3 max(f64vec3 , float64_t);"
"f64vec4 max(f64vec4 , float64_t);"
"f64vec2 max(f64vec2 , f64vec2);"
"f64vec3 max(f64vec3 , f64vec3);"
"f64vec4 max(f64vec4 , f64vec4);"
"float64_t clamp(float64_t, float64_t, float64_t);"
"f64vec2 clamp(f64vec2 , float64_t, float64_t);"
"f64vec3 clamp(f64vec3 , float64_t, float64_t);"
"f64vec4 clamp(f64vec4 , float64_t, float64_t);"
"f64vec2 clamp(f64vec2 , f64vec2 , f64vec2);"
"f64vec3 clamp(f64vec3 , f64vec3 , f64vec3);"
"f64vec4 clamp(f64vec4 , f64vec4 , f64vec4);"
"float64_t mix(float64_t, float64_t, float64_t);"
"f64vec2 mix(f64vec2, f64vec2, float64_t);"
"f64vec3 mix(f64vec3, f64vec3, float64_t);"
"f64vec4 mix(f64vec4, f64vec4, float64_t);"
"f64vec2 mix(f64vec2, f64vec2, f64vec2);"
"f64vec3 mix(f64vec3, f64vec3, f64vec3);"
"f64vec4 mix(f64vec4, f64vec4, f64vec4);"
"float64_t mix(float64_t, float64_t, bool);"
"f64vec2 mix(f64vec2, f64vec2, bvec2);"
"f64vec3 mix(f64vec3, f64vec3, bvec3);"
"f64vec4 mix(f64vec4, f64vec4, bvec4);"
"float64_t step(float64_t, float64_t);"
"f64vec2 step(f64vec2 , f64vec2);"
"f64vec3 step(f64vec3 , f64vec3);"
"f64vec4 step(f64vec4 , f64vec4);"
"f64vec2 step(float64_t, f64vec2);"
"f64vec3 step(float64_t, f64vec3);"
"f64vec4 step(float64_t, f64vec4);"
"float64_t smoothstep(float64_t, float64_t, float64_t);"
"f64vec2 smoothstep(f64vec2 , f64vec2 , f64vec2);"
"f64vec3 smoothstep(f64vec3 , f64vec3 , f64vec3);"
"f64vec4 smoothstep(f64vec4 , f64vec4 , f64vec4);"
"f64vec2 smoothstep(float64_t, float64_t, f64vec2);"
"f64vec3 smoothstep(float64_t, float64_t, f64vec3);"
"f64vec4 smoothstep(float64_t, float64_t, f64vec4);"
"float64_t length(float64_t);"
"float64_t length(f64vec2);"
"float64_t length(f64vec3);"
"float64_t length(f64vec4);"
"float64_t distance(float64_t, float64_t);"
"float64_t distance(f64vec2 , f64vec2);"
"float64_t distance(f64vec3 , f64vec3);"
"float64_t distance(f64vec4 , f64vec4);"
"float64_t dot(float64_t, float64_t);"
"float64_t dot(f64vec2 , f64vec2);"
"float64_t dot(f64vec3 , f64vec3);"
"float64_t dot(f64vec4 , f64vec4);"
"f64vec3 cross(f64vec3, f64vec3);"
"float64_t normalize(float64_t);"
"f64vec2 normalize(f64vec2);"
"f64vec3 normalize(f64vec3);"
"f64vec4 normalize(f64vec4);"
"float64_t faceforward(float64_t, float64_t, float64_t);"
"f64vec2 faceforward(f64vec2, f64vec2, f64vec2);"
"f64vec3 faceforward(f64vec3, f64vec3, f64vec3);"
"f64vec4 faceforward(f64vec4, f64vec4, f64vec4);"
"float64_t reflect(float64_t, float64_t);"
"f64vec2 reflect(f64vec2 , f64vec2 );"
"f64vec3 reflect(f64vec3 , f64vec3 );"
"f64vec4 reflect(f64vec4 , f64vec4 );"
"float64_t refract(float64_t, float64_t, float64_t);"
"f64vec2 refract(f64vec2 , f64vec2 , float64_t);"
"f64vec3 refract(f64vec3 , f64vec3 , float64_t);"
"f64vec4 refract(f64vec4 , f64vec4 , float64_t);"
"f64mat2 matrixCompMult(f64mat2, f64mat2);"
"f64mat3 matrixCompMult(f64mat3, f64mat3);"
"f64mat4 matrixCompMult(f64mat4, f64mat4);"
"f64mat2x3 matrixCompMult(f64mat2x3, f64mat2x3);"
"f64mat2x4 matrixCompMult(f64mat2x4, f64mat2x4);"
"f64mat3x2 matrixCompMult(f64mat3x2, f64mat3x2);"
"f64mat3x4 matrixCompMult(f64mat3x4, f64mat3x4);"
"f64mat4x2 matrixCompMult(f64mat4x2, f64mat4x2);"
"f64mat4x3 matrixCompMult(f64mat4x3, f64mat4x3);"
"f64mat2 outerProduct(f64vec2, f64vec2);"
"f64mat3 outerProduct(f64vec3, f64vec3);"
"f64mat4 outerProduct(f64vec4, f64vec4);"
"f64mat2x3 outerProduct(f64vec3, f64vec2);"
"f64mat3x2 outerProduct(f64vec2, f64vec3);"
"f64mat2x4 outerProduct(f64vec4, f64vec2);"
"f64mat4x2 outerProduct(f64vec2, f64vec4);"
"f64mat3x4 outerProduct(f64vec4, f64vec3);"
"f64mat4x3 outerProduct(f64vec3, f64vec4);"
"f64mat2 transpose(f64mat2);"
"f64mat3 transpose(f64mat3);"
"f64mat4 transpose(f64mat4);"
"f64mat2x3 transpose(f64mat3x2);"
"f64mat3x2 transpose(f64mat2x3);"
"f64mat2x4 transpose(f64mat4x2);"
"f64mat4x2 transpose(f64mat2x4);"
"f64mat3x4 transpose(f64mat4x3);"
"f64mat4x3 transpose(f64mat3x4);"
"float64_t determinant(f64mat2);"
"float64_t determinant(f64mat3);"
"float64_t determinant(f64mat4);"
"f64mat2 inverse(f64mat2);"
"f64mat3 inverse(f64mat3);"
"f64mat4 inverse(f64mat4);"
"
\n
"
);
}
if
((
profile
!=
EEsProfile
&&
version
>=
450
)
||
(
profile
==
EEsProfile
&&
version
>=
310
))
{
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"int64_t abs(int64_t);"
"int64_t abs(int64_t);"
...
@@ -998,25 +1194,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -998,25 +1194,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"u64vec3 mix(u64vec3, u64vec3, bvec3);"
"u64vec3 mix(u64vec3, u64vec3, bvec3);"
"u64vec4 mix(u64vec4, u64vec4, bvec4);"
"u64vec4 mix(u64vec4, u64vec4, bvec4);"
"int64_t doubleBitsToInt64(
double
);"
"int64_t doubleBitsToInt64(
float64_t
);"
"i64vec2 doubleBitsToInt64(
d
vec2);"
"i64vec2 doubleBitsToInt64(
f64
vec2);"
"i64vec3 doubleBitsToInt64(
d
vec3);"
"i64vec3 doubleBitsToInt64(
f64
vec3);"
"i64vec4 doubleBitsToInt64(
d
vec4);"
"i64vec4 doubleBitsToInt64(
f64
vec4);"
"uint64_t doubleBitsToUint64(
double
);"
"uint64_t doubleBitsToUint64(
float64_t
);"
"u64vec2 doubleBitsToUint64(
d
vec2);"
"u64vec2 doubleBitsToUint64(
f64
vec2);"
"u64vec3 doubleBitsToUint64(
d
vec3);"
"u64vec3 doubleBitsToUint64(
f64
vec3);"
"u64vec4 doubleBitsToUint64(
d
vec4);"
"u64vec4 doubleBitsToUint64(
f64
vec4);"
"
double
int64BitsToDouble(int64_t);"
"
float64_t
int64BitsToDouble(int64_t);"
"
d
vec2 int64BitsToDouble(i64vec2);"
"
f64
vec2 int64BitsToDouble(i64vec2);"
"
d
vec3 int64BitsToDouble(i64vec3);"
"
f64
vec3 int64BitsToDouble(i64vec3);"
"
d
vec4 int64BitsToDouble(i64vec4);"
"
f64
vec4 int64BitsToDouble(i64vec4);"
"
double
uint64BitsToDouble(uint64_t);"
"
float64_t
uint64BitsToDouble(uint64_t);"
"
d
vec2 uint64BitsToDouble(u64vec2);"
"
f64
vec2 uint64BitsToDouble(u64vec2);"
"
d
vec3 uint64BitsToDouble(u64vec3);"
"
f64
vec3 uint64BitsToDouble(u64vec3);"
"
d
vec4 uint64BitsToDouble(u64vec4);"
"
f64
vec4 uint64BitsToDouble(u64vec4);"
"int64_t packInt2x32(ivec2);"
"int64_t packInt2x32(ivec2);"
"uint64_t packUint2x32(uvec2);"
"uint64_t packUint2x32(uvec2);"
...
@@ -1335,6 +1531,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -1335,6 +1531,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"dvec4 fma(dvec4, dvec4, dvec4 );"
"dvec4 fma(dvec4, dvec4, dvec4 );"
"
\n
"
);
"
\n
"
);
}
}
if
(
profile
==
EEsProfile
&&
version
>=
310
)
{
// ARB_gpu_shader_fp64
commonBuiltins
.
append
(
"float64_t fma(float64_t, float64_t, float64_t);"
"f64vec2 fma(f64vec2, f64vec2, f64vec2 );"
"f64vec3 fma(f64vec3, f64vec3, f64vec3 );"
"f64vec4 fma(f64vec4, f64vec4, f64vec4 );"
"
\n
"
);
}
#endif
#endif
if
((
profile
==
EEsProfile
&&
version
>=
310
)
||
if
((
profile
==
EEsProfile
&&
version
>=
310
)
||
...
@@ -1371,6 +1576,21 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -1371,6 +1576,21 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"
\n
"
);
"
\n
"
);
}
}
if
(
profile
==
EEsProfile
&&
version
>=
310
)
{
// ARB_gpu_shader_fp64
commonBuiltins
.
append
(
"float64_t frexp(float64_t, out int);"
"f64vec2 frexp( f64vec2, out ivec2);"
"f64vec3 frexp( f64vec3, out ivec3);"
"f64vec4 frexp( f64vec4, out ivec4);"
"float64_t ldexp(float64_t, int);"
"f64vec2 ldexp( f64vec2, ivec2);"
"f64vec3 ldexp( f64vec3, ivec3);"
"f64vec4 ldexp( f64vec4, ivec4);"
"
\n
"
);
}
#endif
#endif
#endif
#endif
...
@@ -3146,7 +3366,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -3146,7 +3366,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
#ifndef GLSLANG_ANGLE
#ifndef GLSLANG_ANGLE
// GL_AMD_gpu_shader_half_float/Explicit types
// GL_AMD_gpu_shader_half_float/Explicit types
if
(
profile
!=
EEsProfile
&&
version
>=
450
)
{
if
(
(
profile
!=
EEsProfile
&&
version
>=
450
)
||
(
profile
==
EEsProfile
&&
version
>=
310
)
)
{
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"float16_t radians(float16_t);"
"float16_t radians(float16_t);"
"f16vec2 radians(f16vec2);"
"f16vec2 radians(f16vec2);"
...
@@ -3494,7 +3714,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -3494,7 +3714,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
}
}
// Explicit types
// Explicit types
if
(
profile
!=
EEsProfile
&&
version
>=
450
)
{
if
(
(
profile
!=
EEsProfile
&&
version
>=
450
)
||
(
profile
==
EEsProfile
&&
version
>=
310
)
)
{
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"int8_t abs(int8_t);"
"int8_t abs(int8_t);"
"i8vec2 abs(i8vec2);"
"i8vec2 abs(i8vec2);"
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
ed948c8e
...
@@ -6424,8 +6424,11 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
...
@@ -6424,8 +6424,11 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
extensionTurnedOn
(
E_GL_EXT_shader_explicit_arithmetic_types_float64
);
extensionTurnedOn
(
E_GL_EXT_shader_explicit_arithmetic_types_float64
);
if
(
isEsProfile
())
if
(
isEsProfile
())
function
=
(
extensionTurnedOn
(
E_GL_EXT_shader_implicit_conversions
)
&&
version
>=
310
)
?
function
=
(
explicitTypesEnabled
&&
version
>=
310
)
findFunction120
(
loc
,
call
,
builtIn
)
:
findFunctionExact
(
loc
,
call
,
builtIn
);
?
findFunctionExplicitTypes
(
loc
,
call
,
builtIn
)
:
((
extensionTurnedOn
(
E_GL_EXT_shader_implicit_conversions
)
&&
version
>=
310
)
?
findFunction120
(
loc
,
call
,
builtIn
)
:
findFunctionExact
(
loc
,
call
,
builtIn
));
else
if
(
version
<
120
)
else
if
(
version
<
120
)
function
=
findFunctionExact
(
loc
,
call
,
builtIn
);
function
=
findFunctionExact
(
loc
,
call
,
builtIn
);
else
if
(
version
<
400
)
else
if
(
version
<
400
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment