|
Blender V5.0
|
#include <GHOST_ContextMTL.hh>
Inherits GHOST_Context.
Static Public Attributes | |
| static const int | max_command_buffer_count = 64 |
Additional Inherited Members | |
| Static Public Member Functions inherited from GHOST_Context | |
| static GHOST_Context * | getActiveDrawingContext () |
| Static Public Member Functions inherited from GHOST_IContext | |
| static GHOST_IContext * | getActiveDrawingContext () |
| Protected Attributes inherited from GHOST_Context | |
| GHOST_ContextParams | context_params_ |
| void * | user_data_ = nullptr |
| Static Protected Attributes inherited from GHOST_Context | |
| static GHOST_Context * | active_context_ |
Definition at line 24 of file GHOST_ContextMTL.hh.
| GHOST_ContextMTL::GHOST_ContextMTL | ( | const GHOST_ContextParams & | context_params, |
| NSView * | metalView, | ||
| CAMetalLayer * | metalLayer ) |
Constructor.
Definition at line 49 of file GHOST_ContextMTL.mm.
References GHOST_Context::context_params_, GHOST_Context::getVSync(), GHOST_Context::GHOST_Context(), ghost_fatal_error_dialog(), GHOST_kVSyncModeOff, GHOST_kVSyncModeUnset, i, init(), METAL_FRAMEBUFFERPIXEL_FORMAT_EDR, metalDevice(), name, and printf.
|
override |
|
overridevirtual |
Activates the drawing context of this window.
Implements GHOST_Context.
Definition at line 161 of file GHOST_ContextMTL.mm.
References GHOST_Context::active_context_, and GHOST_kSuccess.
|
overridevirtual |
Gets the OpenGL frame-buffer associated with the OpenGL context
Reimplemented from GHOST_Context.
Definition at line 173 of file GHOST_ContextMTL.mm.
|
overridevirtual |
Gets the current swap interval for #swapBuffers.
| interval_out | Variable to store the swap interval if it can be read. |
Reimplemented from GHOST_Context.
Definition at line 155 of file GHOST_ContextMTL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Call immediately after new to initialize. If this fails then immediately delete the object.
Implements GHOST_Context.
Definition at line 216 of file GHOST_ContextMTL.mm.
References GHOST_Context::active_context_, and GHOST_kSuccess.
| MTLCommandQueue * GHOST_ContextMTL::metalCommandQueue | ( | ) |
Return a pointer to the Metal command queue used by this context.
Definition at line 200 of file GHOST_ContextMTL.mm.
| MTLDevice * GHOST_ContextMTL::metalDevice | ( | ) |
Return a pointer to the Metal device associated with this context.
Definition at line 204 of file GHOST_ContextMTL.mm.
Referenced by GHOST_ContextMTL().
| id< MTLTexture > GHOST_ContextMTL::metalOverlayTexture | ( | ) |
Returns a texture that Metal code can use as a render target. The current contents of this texture will be composited on top of the frame-buffer each time swapBuffers is called.
Definition at line 188 of file GHOST_ContextMTL.mm.
References updateDrawingContext().
| void GHOST_ContextMTL::metalRegisterPresentCallback | ( | void(* | callback )(MTLRenderPassDescriptor *, id< MTLRenderPipelineState >, id< MTLTexture >, id< CAMetalDrawable >) | ) |
Register present callback
Definition at line 210 of file GHOST_ContextMTL.mm.
|
overridevirtual |
Release the drawing context of the calling thread.
Implements GHOST_Context.
Definition at line 167 of file GHOST_ContextMTL.mm.
References GHOST_Context::active_context_, and GHOST_kSuccess.
|
overridevirtual |
Removes references to native handles from this context and then returns
Implements GHOST_Context.
Definition at line 227 of file GHOST_ContextMTL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Sets the swap interval for #swapBuffers.
| interval | The swap interval to use. |
Reimplemented from GHOST_Context.
Definition at line 149 of file GHOST_ContextMTL.mm.
References GHOST_kSuccess.
|
inlineoverridevirtual |
Implements GHOST_Context.
Definition at line 54 of file GHOST_ContextMTL.hh.
References GHOST_kSuccess.
|
overridevirtual |
Swaps front and back buffers of a window.
Implements GHOST_Context.
Definition at line 141 of file GHOST_ContextMTL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Updates the drawing context of this window. Needed whenever the window is changed.
Reimplemented from GHOST_Context.
Definition at line 179 of file GHOST_ContextMTL.mm.
References GHOST_kFailure, and GHOST_kSuccess.
Referenced by metalOverlayTexture().
|
static |
Definition at line 38 of file GHOST_ContextMTL.hh.
Referenced by blender::gpu::MTLCommandBufferManager::submit().