Advertise support for shaderInt64 feature.

Add MVKDevice::mslVersionIsAtLeast() to support tests for MSL version.
Also bump MSL support level of standalone MoltenVKShaderConverter tool.
This commit is contained in:
Bill Hollings 2021-01-25 13:08:41 -05:00
parent c757f3012c
commit 57763529b1
4 changed files with 12 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

@ -1575,6 +1575,7 @@ void MVKPhysicalDevice::initFeatures() {
_features.shaderStorageBufferArrayDynamicIndexing = true;
_features.shaderClipDistance = true;
_features.shaderInt16 = true;
_features.shaderInt64 = mslVersionIsAtLeast(MTLLanguageVersion2_2);
_features.multiDrawIndirect = true;
_features.inheritedQueries = true;
@ -1719,7 +1720,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_1;
} else if (mslVer(2, 2, 0)) {
mslVerEnum = MTLLanguageVersion2_1;
} else if (mslVer(2, 1, 0)) {
mslVerEnum = MTLLanguageVersion2_1;
} else if (mslVer(2, 0, 0)) {
mslVerEnum = MTLLanguageVersion2_0;