Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Fielder <jason_apple>2022-03-22 14:38:28 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-03-22 14:54:34 +0300
commit309ea314858a9b7892ea2c8a6fe55ab2a1028697 (patch)
treead153ceb5e7e90c5cac65b59b99bb2d708577dba /source/blender/gpu/opengl
parent913b6b9ec1b1f3cf83b21956b06e2f6d3341c78c (diff)
Metal: Initial Implementation of Metal Backend for GPU Module.
Adding WITH_METAL option to CMAKE to guard compilation for macOS only. Implemented stub METALBackend to mirror GPUBackend interface and added capabilities initialisation, along with API initialisation paths. Global rendering coordination commands added to backend with GPU_render_begin and GPU_render_end() commands globally wrapping GPU work. This is required for Metal to ensure temporary resources are generated within an NSAutoReleasePool and freed accordingly. Authored by Apple: Michael Parkin-White, Vil Harvey, Marco Giordano, Michael Jones, Morteza Mostajabodaveh, Jason Fielder Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14293
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r--source/blender/gpu/opengl/gl_backend.cc8
-rw-r--r--source/blender/gpu/opengl/gl_backend.hh5
2 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc
index 883f9403920..2c9cbdb99d8 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -140,7 +140,7 @@ void GLBackend::platform_init()
}
}
- GPG.init(device, os, driver, support_level, vendor, renderer, version);
+ GPG.init(device, os, driver, support_level, GPU_BACKEND_OPENGL, vendor, renderer, version);
}
void GLBackend::platform_exit()
@@ -418,6 +418,12 @@ static void detect_workarounds()
(strstr(renderer, "HD Graphics 4400") || strstr(renderer, "HD Graphics 4600"))) {
GCaps.shader_storage_buffer_objects_support = false;
}
+
+ /* Metal-related Workarounds. */
+
+ /* Minimum Per-Vertex stride is 1 byte for OpenGL. */
+ GCaps.minimum_per_vertex_stride = 1;
+
} // namespace blender::gpu
/** Internal capabilities. */
diff --git a/source/blender/gpu/opengl/gl_backend.hh b/source/blender/gpu/opengl/gl_backend.hh
index e72726d9c7b..29249111294 100644
--- a/source/blender/gpu/opengl/gl_backend.hh
+++ b/source/blender/gpu/opengl/gl_backend.hh
@@ -136,6 +136,11 @@ class GLBackend : public GPUBackend {
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0);
}
+ /* Render Frame Coordination */
+ void render_begin(void) override{};
+ void render_end(void) override{};
+ void render_step(void) override{};
+
private:
static void platform_init();
static void platform_exit();