@@ -762,7 +762,8 @@ bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExte
762
762
// Use when there are no profile/version to check, it's just an error if one of the
763
763
// extensions is not present.
764
764
//
765
- void TParseVersions::requireExtensions (const TSourceLoc& loc, int numExtensions, const char * const extensions[], const char * featureDesc)
765
+ void TParseVersions::requireExtensions (const TSourceLoc& loc, int numExtensions, const char * const extensions[],
766
+ const char * featureDesc)
766
767
{
767
768
if (checkExtensionsRequested (loc, numExtensions, extensions, featureDesc))
768
769
return ;
@@ -781,7 +782,8 @@ void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions,
781
782
// Use by preprocessor when there are no profile/version to check, it's just an error if one of the
782
783
// extensions is not present.
783
784
//
784
- void TParseVersions::ppRequireExtensions (const TSourceLoc& loc, int numExtensions, const char * const extensions[], const char * featureDesc)
785
+ void TParseVersions::ppRequireExtensions (const TSourceLoc& loc, int numExtensions, const char * const extensions[],
786
+ const char * featureDesc)
785
787
{
786
788
if (checkExtensionsRequested (loc, numExtensions, extensions, featureDesc))
787
789
return ;
@@ -847,6 +849,7 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
847
849
error (getCurrentLoc (), " behavior not supported:" , " #extension" , behaviorString);
848
850
return ;
849
851
}
852
+ bool on = behavior != EBhDisable;
850
853
851
854
// check if extension is used with correct shader stage
852
855
checkExtensionStage (getCurrentLoc (), extension);
@@ -916,6 +919,32 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
916
919
updateExtensionBehavior (line, " GL_EXT_shader_explicit_arithmetic_types_int64" , behaviorString);
917
920
else if (strcmp (extension, " GL_EXT_shader_subgroup_extended_types_float16" ) == 0 )
918
921
updateExtensionBehavior (line, " GL_EXT_shader_explicit_arithmetic_types_float16" , behaviorString);
922
+
923
+ // see if we need to update the numeric features
924
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types" ) == 0 )
925
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types, on);
926
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_int8" ) == 0 )
927
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_int8, on);
928
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_int16" ) == 0 )
929
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_int16, on);
930
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_int32" ) == 0 )
931
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_int32, on);
932
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_int64" ) == 0 )
933
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_int64, on);
934
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_float16" ) == 0 )
935
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_float16, on);
936
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_float32" ) == 0 )
937
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_float32, on);
938
+ else if (strcmp (extension, " GL_EXT_shader_explicit_arithmetic_types_float64" ) == 0 )
939
+ intermediate.updateNumericFeature (TNumericFeatures::shader_explicit_arithmetic_types_float64, on);
940
+ else if (strcmp (extension, " GL_EXT_shader_implicit_conversions" ) == 0 )
941
+ intermediate.updateNumericFeature (TNumericFeatures::shader_implicit_conversions, on);
942
+ else if (strcmp (extension, " GL_ARB_gpu_shader_fp64" ) == 0 )
943
+ intermediate.updateNumericFeature (TNumericFeatures::gpu_shader_fp64, on);
944
+ else if (strcmp (extension, " GL_AMD_gpu_shader_int16" ) == 0 )
945
+ intermediate.updateNumericFeature (TNumericFeatures::gpu_shader_int16, on);
946
+ else if (strcmp (extension, " GL_AMD_gpu_shader_half_float" ) == 0 )
947
+ intermediate.updateNumericFeature (TNumericFeatures::gpu_shader_half_float, on);
919
948
}
920
949
921
950
void TParseVersions::updateExtensionBehavior (const char * extension, TExtensionBehavior behavior)
@@ -951,8 +980,8 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe
951
980
} else {
952
981
if (iter->second == EBhDisablePartial)
953
982
warn (getCurrentLoc (), " extension is only partially supported:" , " #extension" , extension);
954
- if (behavior == EBhEnable || behavior == EBhRequire || behavior = = EBhDisable)
955
- intermediate.updateRequestedExtension (extension, behavior );
983
+ if (behavior ! = EBhDisable)
984
+ intermediate.addRequestedExtension (extension);
956
985
iter->second = behavior;
957
986
}
958
987
}
0 commit comments