Fix: OSX: Compilation on OSX 10.15 target platform
This was because some features requiring OSX 11 were not properly guarded by defines. Pull Request: https://projects.blender.org/blender/blender/pulls/111940
This commit is contained in:
committed by
Clément Foucault
parent
715eb4d88e
commit
bb1e8bde13
@@ -292,12 +292,16 @@ bool MTLShader::finalize(const shader::ShaderCreateInfo *info)
|
||||
options.languageVersion = MTLLanguageVersion2_2;
|
||||
options.fastMathEnabled = YES;
|
||||
|
||||
/* Raster order groups for tile data in struct require Metal 2.3.
|
||||
* Retianing Metal 2.2. for old shaders to maintain backwards
|
||||
* compatibility for existing features. */
|
||||
if (info->fragment_tile_inputs_.size() > 0) {
|
||||
options.languageVersion = MTLLanguageVersion2_3;
|
||||
#if defined(MAC_OS_X_VERSION_11_0) && __MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_11_0
|
||||
if (@available(macOS 11.00, *)) {
|
||||
/* Raster order groups for tile data in struct require Metal 2.3.
|
||||
* Retianing Metal 2.2. for old shaders to maintain backwards
|
||||
* compatibility for existing features. */
|
||||
if (info->fragment_tile_inputs_.size() > 0) {
|
||||
options.languageVersion = MTLLanguageVersion2_3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NSString *source_to_compile = shd_builder_->msl_source_vert_;
|
||||
|
||||
|
||||
@@ -2138,7 +2138,13 @@ void gpu::MTLTexture::ensure_baked()
|
||||
|
||||
/* Override storage mode if memoryless attachments are being used. */
|
||||
if (gpu_image_usage_flags_ & GPU_TEXTURE_USAGE_MEMORYLESS) {
|
||||
texture_descriptor_.storageMode = MTLStorageModeMemoryless;
|
||||
#if defined(MAC_OS_X_VERSION_11_0) && __MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_11_0
|
||||
if (@available(macOS 11.00, *)) {
|
||||
texture_descriptor_.storageMode = MTLStorageModeMemoryless;
|
||||
}
|
||||
#else
|
||||
BLI_assert_msg(0, "GPU_TEXTURE_USAGE_MEMORYLESS is not available on older MacOS versions");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Standard texture allocation. */
|
||||
|
||||
Reference in New Issue
Block a user