GPU: Remove uneeded and incorrect os version check

Theses added checks are not working correctly and
are never true even on supported hardware with correct
target version.
This commit is contained in:
Clément Foucault
2023-09-06 14:14:18 +02:00
parent ddf881ad9b
commit c1e11df732
3 changed files with 3 additions and 8 deletions

View File

@@ -1562,7 +1562,6 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c
framebuffer_descriptor_[descriptor_config] = [[MTLRenderPassDescriptor alloc] init];
}
#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, *)) {
/* Optimization: Use smaller tile size on Apple Silicon if exceeding a certain bpp limit. */
bool is_tile_based_gpu = [metal_ctx->device hasUnifiedMemory];
@@ -1576,7 +1575,6 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c
}
}
}
#endif
/* Configure multilayered rendering. */
if (use_multilayered_rendering_) {

View File

@@ -292,7 +292,6 @@ bool MTLShader::finalize(const shader::ShaderCreateInfo *info)
options.languageVersion = MTLLanguageVersion2_2;
options.fastMathEnabled = YES;
#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.
* Retaining Metal 2.2. for old shaders to maintain backwards
@@ -301,7 +300,6 @@ bool MTLShader::finalize(const shader::ShaderCreateInfo *info)
options.languageVersion = MTLLanguageVersion2_3;
}
}
#endif
NSString *source_to_compile = shd_builder_->msl_source_vert_;

View File

@@ -2138,13 +2138,12 @@ void gpu::MTLTexture::ensure_baked()
/* Override storage mode if memoryless attachments are being used. */
if (gpu_image_usage_flags_ & GPU_TEXTURE_USAGE_MEMORYLESS) {
#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
else {
BLI_assert_msg(0, "GPU_TEXTURE_USAGE_MEMORYLESS is not available on older MacOS versions");
}
}
/* Standard texture allocation. */