Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_backend.mm
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| Context *MTLBackend::context_alloc(void *ghost_window, void *ghost_context) | Context *MTLBackend::context_alloc(void *ghost_window, void *ghost_context) | ||||
| { | { | ||||
| return new MTLContext(ghost_window, ghost_context); | return new MTLContext(ghost_window, ghost_context); | ||||
| }; | }; | ||||
| Batch *MTLBackend::batch_alloc() | Batch *MTLBackend::batch_alloc() | ||||
| { | { | ||||
| /* TODO(Metal): Full MTLBatch implementation. */ | |||||
| return new MTLBatch(); | return new MTLBatch(); | ||||
| }; | }; | ||||
| DrawList *MTLBackend::drawlist_alloc(int list_length) | DrawList *MTLBackend::drawlist_alloc(int list_length) | ||||
| { | { | ||||
| /* TODO(Metal): Full MTLDrawList implementation. */ | |||||
| return new MTLDrawList(list_length); | 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 350 Lines • ▼ Show 20 Lines | void MTLBackend::capabilities_init(MTLContext *ctx) | ||||
| /* OPENGL Related workarounds -- none needed for Metal. */ | /* OPENGL Related workarounds -- none needed for Metal. */ | ||||
| GCaps.extensions_len = 0; | GCaps.extensions_len = 0; | ||||
| GCaps.extension_get = mtl_extensions_get_null; | GCaps.extension_get = mtl_extensions_get_null; | ||||
| GCaps.mip_render_workaround = false; | GCaps.mip_render_workaround = false; | ||||
| GCaps.depth_blitting_workaround = false; | GCaps.depth_blitting_workaround = false; | ||||
| GCaps.use_main_context_workaround = false; | GCaps.use_main_context_workaround = false; | ||||
| GCaps.broken_amd_driver = false; | GCaps.broken_amd_driver = false; | ||||
| GCaps.clear_viewport_workaround = true; | |||||
| /* Metal related workarounds. */ | /* Metal related workarounds. */ | ||||
| /* Minimum per-vertex stride is 4 bytes in Metal. | /* Minimum per-vertex stride is 4 bytes in Metal. | ||||
| * A bound vertex buffer must contribute at least 4 bytes per vertex. */ | * A bound vertex buffer must contribute at least 4 bytes per vertex. */ | ||||
| GCaps.minimum_per_vertex_stride = 4; | GCaps.minimum_per_vertex_stride = 4; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| } // blender::gpu | } // blender::gpu | ||||