[Bf-blender-cvs] [62419975b78] master: macOS: fix warning about unkown GPU with Apple M1 chip

Brecht Van Lommel noreply at git.blender.org
Tue Feb 2 12:20:21 CET 2021


Commit: 62419975b78b3d65634ba17b5dccc93491e8ce6d
Author: Brecht Van Lommel
Date:   Mon Feb 1 23:33:20 2021 +0100
Branches: master
https://developer.blender.org/rB62419975b78b3d65634ba17b5dccc93491e8ce6d

macOS: fix warning about unkown GPU with Apple M1 chip

===================================================================

M	source/blender/gpu/GPU_platform.h
M	source/blender/gpu/opengl/gl_backend.cc

===================================================================

diff --git a/source/blender/gpu/GPU_platform.h b/source/blender/gpu/GPU_platform.h
index bb7e1d58041..c457b829bf7 100644
--- a/source/blender/gpu/GPU_platform.h
+++ b/source/blender/gpu/GPU_platform.h
@@ -34,6 +34,7 @@ typedef enum eGPUDeviceType {
   GPU_DEVICE_ATI = (1 << 1),
   GPU_DEVICE_INTEL = (1 << 2),
   GPU_DEVICE_INTEL_UHD = (1 << 3),
+  GPU_DEVICE_APPLE = (1 << 3),
   GPU_DEVICE_SOFTWARE = (1 << 4),
   GPU_DEVICE_UNKNOWN = (1 << 5),
   GPU_DEVICE_ANY = (0xff),
diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc
index c49158176c6..573ae654af4 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -96,6 +96,11 @@ void GLBackend::platform_init()
     GPG.device = GPU_DEVICE_SOFTWARE;
     GPG.driver = GPU_DRIVER_SOFTWARE;
   }
+  else if (strstr(vendor, "Apple")) {
+    /* Apple Silicon. */
+    GPG.device = GPU_DEVICE_APPLE;
+    GPG.driver = GPU_DRIVER_OFFICIAL;
+  }
   else if (strstr(renderer, "Apple Software Renderer")) {
     GPG.device = GPU_DEVICE_SOFTWARE;
     GPG.driver = GPU_DRIVER_SOFTWARE;



More information about the Bf-blender-cvs mailing list