Viewport Compositor: Platform support message.

In the previous situation the message was shown for Apple devices.
But this is not correct and confusing.

- Apple with Metal backend are supported, OpenGL on Apple isn't
- Legacy devices on Windows or Linux are also not supported.

This change will check that the capabilities of the GPU match the
requirements to use Viewport compositor. Based on those capabilities
a message is shown and the panel is activated.
This commit is contained in:
Jeroen Bakker 2023-02-02 07:43:18 +01:00
parent e2c3bff78b
commit 99520a79b6
Notes: blender-bot 2023-02-21 17:59:30 +01:00
Referenced by issue #104236, MacOS Metal & real time compositor: Options are greyed out on Mac even though they are supported
1 changed files with 6 additions and 5 deletions

View File

@ -6195,14 +6195,15 @@ class VIEW3D_PT_shading_compositor(Panel):
def draw(self, context):
shading = context.space_data.shading
import sys
is_macos = sys.platform == "darwin"
import gpu
is_supported = (gpu.capabilities.compute_shader_support_get()
and gpu.capabilities.shader_image_load_store_support_get())
row = self.layout.row()
row.active = not is_macos
row.active = is_supported
row.prop(shading, "use_compositor", expand=True)
if is_macos and shading.use_compositor != "DISABLED":
self.layout.label(text="Compositor not supported on MacOS", icon='ERROR')
if shading.use_compositor != "DISABLED" and not is_supported:
self.layout.label(text="Compositor not supported on this platform", icon='ERROR')
class VIEW3D_PT_gizmo_display(Panel):