Merge pull request #1217 from billhollings/shaderInt64

Advertise support for shaderInt64 feature.
This commit is contained in:
Bill Hollings 2021-01-25 22:05:43 -05:00 committed by GitHub
commit 6c74fbf1b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -18,6 +18,7 @@ MoltenVK 1.1.2
Released TBD
- Advertise support for `shaderInt64` feature.
- Support fast math on MSL compiler via `MVKConfiguration::fastMathEnabled` configuration
setting and `MVK_CONFIG_FAST_MATH_ENABLED` environment variable (both disabled by default).
- Support _GitHub Actions_ for CI builds on pull requests.

View File

@ -322,6 +322,10 @@ public:
}
}
/** Returns whether the MSL version is supported on this device. */
inline bool mslVersionIsAtLeast(MTLLanguageVersion minVer) { return _metalFeatures.mslVersionEnum >= minVer; }
#pragma mark Construction
/** Constructs an instance wrapping the specified Vulkan instance and Metal device. */

View File

@ -1587,6 +1587,7 @@ void MVKPhysicalDevice::initFeatures() {
#if MVK_TVOS
_features.textureCompressionETC2 = true;
_features.textureCompressionASTC_LDR = true;
_features.shaderInt64 = mslVersionIsAtLeast(MTLLanguageVersion2_3) && supportsMTLGPUFamily(Apple3);
if (supportsMTLFeatureSet(tvOS_GPUFamily1_v3)) {
_features.dualSrcBlend = true;
@ -1603,6 +1604,7 @@ void MVKPhysicalDevice::initFeatures() {
#if MVK_IOS
_features.textureCompressionETC2 = true;
_features.shaderInt64 = mslVersionIsAtLeast(MTLLanguageVersion2_3) && supportsMTLGPUFamily(Apple3);
if (supportsMTLFeatureSet(iOS_GPUFamily2_v1)) {
_features.textureCompressionASTC_LDR = true;
@ -1645,6 +1647,7 @@ void MVKPhysicalDevice::initFeatures() {
_features.depthClamp = true;
_features.vertexPipelineStoresAndAtomics = true;
_features.fragmentStoresAndAtomics = true;
_features.shaderInt64 = mslVersionIsAtLeast(MTLLanguageVersion2_3);
_features.shaderStorageImageArrayDynamicIndexing = _metalFeatures.arrayOfTextures;
@ -1719,7 +1722,7 @@ void MVKPhysicalDevice::initFeatures() {
// VkBool32 shaderClipDistance; // done
// VkBool32 shaderCullDistance;
// VkBool32 shaderFloat64;
// VkBool32 shaderInt64;
// VkBool32 shaderInt64; // done
// VkBool32 shaderInt16; // done
// VkBool32 shaderResourceResidency;
// VkBool32 shaderResourceMinLod; // done

View File

@ -71,7 +71,11 @@ bool mvk::compile(const string& mslSourceCode,
#define mslVer(MJ, MN, PT) mslVersionMajor == MJ && mslVersionMinor == MN && mslVersionPoint == PT
MTLLanguageVersion mslVerEnum = (MTLLanguageVersion)0;
if (mslVer(2, 1, 0)) {
if (mslVer(2, 3, 0)) {
mslVerEnum = MTLLanguageVersion2_3;
} else if (mslVer(2, 2, 0)) {
mslVerEnum = MTLLanguageVersion2_2;
} else if (mslVer(2, 1, 0)) {
mslVerEnum = MTLLanguageVersion2_1;
} else if (mslVer(2, 0, 0)) {
mslVerEnum = MTLLanguageVersion2_0;