Vulkan: Missing Compile Directives

MakesRNA uses WITH_VULKAN_BACKEND, but it wasn't included in the
CMakeLists.txt. Also added WITH_METAL_BACKEND. Metal is currently
included as a global compilation directive. We might want to sanitize
that according in a different patch.

This PR makes sure that Vulkan backend can be selected via the PythonAPI.
Note that the changes to user preference UI isn't added to this patch as
the Vulkan backend isn't usable to end users.

`bpy.context.preferences.system.gpu_backend = 'VULKAN' should now be
possible. After saving the user preference and restarting Blender it should
initialize the Vulkan backend.

Pull Request: https://projects.blender.org/blender/blender/pulls/108414
This commit is contained in:
Jeroen Bakker
2023-05-30 13:48:46 +02:00
parent 2cc0f94d68
commit e0ad6f1fd8

View File

@@ -379,6 +379,14 @@ if(WITH_XR_OPENXR)
add_definitions(-DWITH_XR_OPENXR)
endif()
if(WITH_VULKAN_METAL)
add_definitions(-DWITH_VULKAN_METAL)
endif()
if(WITH_VULKAN_BACKEND)
add_definitions(-DWITH_VULKAN_BACKEND)
endif()
if(WITH_GMP)
add_definitions(-DWITH_GMP)
endif()