Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_backend.mm
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| /** \file | /** \file | ||||
| * \ingroup gpu | * \ingroup gpu | ||||
| */ | */ | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "gpu_backend.hh" | #include "gpu_backend.hh" | ||||
| #include "mtl_backend.hh" | #include "mtl_backend.hh" | ||||
| #include "mtl_batch.hh" | |||||
| #include "mtl_context.hh" | #include "mtl_context.hh" | ||||
| #include "mtl_drawlist.hh" | |||||
| #include "mtl_framebuffer.hh" | #include "mtl_framebuffer.hh" | ||||
| #include "mtl_immediate.hh" | |||||
| #include "mtl_index_buffer.hh" | #include "mtl_index_buffer.hh" | ||||
| #include "mtl_query.hh" | #include "mtl_query.hh" | ||||
| #include "mtl_shader.hh" | #include "mtl_shader.hh" | ||||
| #include "mtl_uniform_buffer.hh" | #include "mtl_uniform_buffer.hh" | ||||
| #include "mtl_vertex_buffer.hh" | #include "mtl_vertex_buffer.hh" | ||||
| #include "gpu_capabilities_private.hh" | #include "gpu_capabilities_private.hh" | ||||
| #include "gpu_platform_private.hh" | #include "gpu_platform_private.hh" | ||||
| Show All 11 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Metal Backend | /** \name Metal Backend | ||||
| * \{ */ | * \{ */ | ||||
| void MTLBackend::samplers_update(){ | void MTLBackend::samplers_update(){ | ||||
| /* Placeholder -- Handled in MTLContext. */ | /* Placeholder -- Handled in MTLContext. */ | ||||
| }; | }; | ||||
| Context *MTLBackend::context_alloc(void *ghost_window) | Context *MTLBackend::context_alloc(void *ghost_window, void *ghost_context) | ||||
| { | { | ||||
| return new MTLContext(ghost_window); | return new MTLContext(ghost_window, ghost_context); | ||||
| }; | }; | ||||
| Batch *MTLBackend::batch_alloc() | Batch *MTLBackend::batch_alloc() | ||||
| { | { | ||||
| /* TODO(Metal): Implement MTLBatch. */ | /* TODO(Metal): Full MTLBatch implementation. */ | ||||
| return nullptr; | return new MTLBatch(); | ||||
| }; | }; | ||||
| DrawList *MTLBackend::drawlist_alloc(int list_length) | DrawList *MTLBackend::drawlist_alloc(int list_length) | ||||
| { | { | ||||
| /* TODO(Metal): Implement MTLDrawList. */ | /* TODO(Metal): Full MTLDrawList implementation. */ | ||||
| return nullptr; | return new MTLDrawList(list_length); | ||||
| }; | }; | ||||
| FrameBuffer *MTLBackend::framebuffer_alloc(const char *name) | FrameBuffer *MTLBackend::framebuffer_alloc(const char *name) | ||||
| { | { | ||||
| MTLContext *mtl_context = static_cast<MTLContext *>( | MTLContext *mtl_context = static_cast<MTLContext *>( | ||||
| reinterpret_cast<Context *>(GPU_context_active_get())); | reinterpret_cast<Context *>(GPU_context_active_get())); | ||||
| return new MTLFrameBuffer(mtl_context, name); | return new MTLFrameBuffer(mtl_context, name); | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 367 Lines • Show Last 20 Lines | |||||