Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_ContextCGL.mm
| Show First 20 Lines • Show All 523 Lines • ▼ Show 20 Lines | |||||
| void GHOST_ContextCGL::metalInit() | void GHOST_ContextCGL::metalInit() | ||||
| { | { | ||||
| /* clang-format off */ | /* clang-format off */ | ||||
| @autoreleasepool { | @autoreleasepool { | ||||
| /* clang-format on */ | /* clang-format on */ | ||||
| id<MTLDevice> device = m_metalLayer.device; | id<MTLDevice> device = m_metalLayer.device; | ||||
| /* Create a command queue for blit/present operation. */ | /* Create a command queue for blit/present operation. */ | ||||
| m_metalCmdQueue = (MTLCommandQueue *)[device newCommandQueue]; | m_metalCmdQueue = (MTLCommandQueue *)[device | ||||
| newCommandQueueWithMaxCommandBufferCount:GHOST_ContextCGL::max_command_buffer_count]; | |||||
| [m_metalCmdQueue retain]; | [m_metalCmdQueue retain]; | ||||
| /* Create shaders for blit operation. */ | /* Create shaders for blit operation. */ | ||||
| NSString *source = @R"msl( | NSString *source = @R"msl( | ||||
| using namespace metal; | using namespace metal; | ||||
| struct Vertex { | struct Vertex { | ||||
| float4 position [[position]]; | float4 position [[position]]; | ||||
| ▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines | |||||