@@ -1162,18 +1162,18 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
1162
1162
// - at the time of this writing (14-Aug-2020), no test results are changed by this.
1163
1163
switch (op) {
1164
1164
case EOpConstructFloat16:
1165
- canPromoteConstant = extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types ) ||
1166
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_float16 );
1165
+ canPromoteConstant = numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types ) ||
1166
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_float16 );
1167
1167
break ;
1168
1168
case EOpConstructInt8:
1169
1169
case EOpConstructUint8:
1170
- canPromoteConstant = extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types ) ||
1171
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_int8 );
1170
+ canPromoteConstant = numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types ) ||
1171
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_int8 );
1172
1172
break ;
1173
1173
case EOpConstructInt16:
1174
1174
case EOpConstructUint16:
1175
- canPromoteConstant = extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types ) ||
1176
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_int16 );
1175
+ canPromoteConstant = numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types ) ||
1176
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_int16 );
1177
1177
break ;
1178
1178
}
1179
1179
#endif
@@ -1665,14 +1665,14 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1665
1665
isFPConversion (from, to) ||
1666
1666
isFPIntegralConversion (from, to)) {
1667
1667
1668
- if (extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types ) ||
1669
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_int8 ) ||
1670
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_int16 ) ||
1671
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_int32 ) ||
1672
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_int64 ) ||
1673
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_float16 ) ||
1674
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_float32 ) ||
1675
- extensionRequested (E_GL_EXT_shader_explicit_arithmetic_types_float64 )) {
1668
+ if (numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types ) ||
1669
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_int8 ) ||
1670
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_int16 ) ||
1671
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_int32 ) ||
1672
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_int64 ) ||
1673
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_float16 ) ||
1674
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_float32 ) ||
1675
+ numericFeatures. contains (TNumericFeatures::shader_explicit_arithmetic_types_float64 )) {
1676
1676
return true ;
1677
1677
}
1678
1678
}
@@ -1684,14 +1684,14 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1684
1684
switch (from) {
1685
1685
case EbtInt:
1686
1686
case EbtUint:
1687
- return extensionRequested (E_GL_EXT_shader_implicit_conversions );
1687
+ return numericFeatures. contains (TNumericFeatures::shader_implicit_conversions );
1688
1688
default :
1689
1689
return false ;
1690
1690
}
1691
1691
case EbtUint:
1692
1692
switch (from) {
1693
1693
case EbtInt:
1694
- return extensionRequested (E_GL_EXT_shader_implicit_conversions );
1694
+ return numericFeatures. contains (TNumericFeatures::shader_implicit_conversions );
1695
1695
default :
1696
1696
return false ;
1697
1697
}
@@ -1707,14 +1707,14 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1707
1707
case EbtInt64:
1708
1708
case EbtUint64:
1709
1709
case EbtFloat:
1710
- return version >= 400 || extensionRequested (E_GL_ARB_gpu_shader_fp64 );
1710
+ return version >= 400 || numericFeatures. contains (TNumericFeatures::gpu_shader_fp64 );
1711
1711
case EbtInt16:
1712
1712
case EbtUint16:
1713
- return (version >= 400 || extensionRequested (E_GL_ARB_gpu_shader_fp64 )) &&
1714
- extensionRequested (E_GL_AMD_gpu_shader_int16 );
1713
+ return (version >= 400 || numericFeatures. contains (TNumericFeatures::gpu_shader_fp64 )) &&
1714
+ numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1715
1715
case EbtFloat16:
1716
- return (version >= 400 || extensionRequested (E_GL_ARB_gpu_shader_fp64 )) &&
1717
- extensionRequested (E_GL_AMD_gpu_shader_half_float );
1716
+ return (version >= 400 || numericFeatures. contains (TNumericFeatures::gpu_shader_fp64 )) &&
1717
+ numericFeatures. contains (TNumericFeatures::gpu_shader_half_float );
1718
1718
default :
1719
1719
return false ;
1720
1720
}
@@ -1727,10 +1727,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1727
1727
return getSource () == EShSourceHlsl;
1728
1728
case EbtInt16:
1729
1729
case EbtUint16:
1730
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1730
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1731
1731
case EbtFloat16:
1732
- return
1733
- extensionRequested (E_GL_AMD_gpu_shader_half_float) || getSource () == EShSourceHlsl;
1732
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_half_float) ||
1733
+ getSource () == EShSourceHlsl;
1734
1734
default :
1735
1735
return false ;
1736
1736
}
@@ -1742,7 +1742,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1742
1742
return getSource () == EShSourceHlsl;
1743
1743
case EbtInt16:
1744
1744
case EbtUint16:
1745
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1745
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1746
1746
default :
1747
1747
return false ;
1748
1748
}
@@ -1751,7 +1751,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1751
1751
case EbtBool:
1752
1752
return getSource () == EShSourceHlsl;
1753
1753
case EbtInt16:
1754
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1754
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1755
1755
default :
1756
1756
return false ;
1757
1757
}
@@ -1763,7 +1763,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1763
1763
return true ;
1764
1764
case EbtInt16:
1765
1765
case EbtUint16:
1766
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1766
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1767
1767
default :
1768
1768
return false ;
1769
1769
}
@@ -1772,23 +1772,23 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
1772
1772
case EbtInt:
1773
1773
return true ;
1774
1774
case EbtInt16:
1775
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1775
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1776
1776
default :
1777
1777
return false ;
1778
1778
}
1779
1779
case EbtFloat16:
1780
1780
switch (from) {
1781
1781
case EbtInt16:
1782
1782
case EbtUint16:
1783
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1783
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1784
1784
default :
1785
1785
break ;
1786
1786
}
1787
1787
return false ;
1788
1788
case EbtUint16:
1789
1789
switch (from) {
1790
1790
case EbtInt16:
1791
- return extensionRequested (E_GL_AMD_gpu_shader_int16 );
1791
+ return numericFeatures. contains (TNumericFeatures::gpu_shader_int16 );
1792
1792
default :
1793
1793
break ;
1794
1794
}
@@ -1921,7 +1921,7 @@ std::tuple<TBasicType, TBasicType> TIntermediate::getConversionDestinationType(T
1921
1921
TBasicType res1 = EbtNumTypes;
1922
1922
1923
1923
if ((isEsProfile () &&
1924
- (version < 310 || !extensionRequested (E_GL_EXT_shader_implicit_conversions ))) ||
1924
+ (version < 310 || !numericFeatures. contains (TNumericFeatures::shader_implicit_conversions ))) ||
1925
1925
version == 110 )
1926
1926
return std::make_tuple (res0, res1);
1927
1927
0 commit comments