Create and manage OpenGL rendering contexts for use in macOS, and perform operations on drawable objects.

OpenGL Documentation

Posts under OpenGL tag

20 Posts
Sort by:
Post not yet marked as solved
0 Replies
89 Views
If I purchase a MacBook Pro M1 Max, MacBook Air M1, MacBook Air M2, MacBook Pro M1 Pro...-any Apple Silicon MacBook, will OpenGL be supported? I'm currently developing an application with the following software versions and libs: JDK 17.0.2 IntelliJ Ultimate (this isn't very relevant though, but I got it for free from school) LWJGL 3.2.3 (includes OpenGL) JOML 1.9.23 I have not been able to run the application on my MacBook Air, which contains an Intel processor. It did not occur to me until hours of research that OpenGL (Java) has been deprecated since MacOS Mojave. However, I heard that it does work on Apple Silicon/ARM based computers. I don't see how this would work, since both Intel and Apple Silicon run computers still run MacOS where OpenGL is deprecated. Therefore, I would like to double check whether OpenGL (running the previous software specifications) would indeed be compatible with any of the Apple Silicon MacBooks listed above (despite OpenGL being deprecated). Alternatively, I have had to run Windows 10 on Boot Camp in order to test my games and run them abroad, which does not run at desirable speeds... If there are any alternatives that allow OpenGL support on my Intel processor based MacBook Air, please let me know. Otherwise, if anyone could point me towards a discount or deal I could strike for a Apple Silicon MacBook discount for High School students, it would be greatly appreciated (yes, I'm still in High School so I'm trying to do anything possible to avoid buying a new MacBook or at the very least not one at full price).
Posted
by L0raxeo.
Last updated
.
Post not yet marked as solved
0 Replies
51 Views
Hi, I have different displayLists (dL) to create, 8 lists have a own name, the work fine. Then I have a dynamic structure of dLs, they are stored in c-arrays. After i noticed that they are not shown, I made 2 dLs which differ in color and vertices. drawRect: glCallLists(2,GL_UNSIGNED_INT, test); This is my list-array: if(contentState[0] == 1) {       glCallLists(contentCount,GL_FLOAT, curveList);   } contentCount = 8 and the declaration is GLfloat curveList[20]  curveList has 8 display indices. I hope I made a mistake and you find it :) Uwe
Posted Last updated
.
Post not yet marked as solved
0 Replies
135 Views
I am currently trying to use EC2 mac instances to run a CI/CD pipeline which involves running tests with electron/selenium. In order to run these tests openGL needs to be available. Im currently getting there error on line 49 of https://chromium.googlesource.com/chromium/src/+/8f066ff5113bd9d348f0aaf7ac6adc1ca1d1cd31/ui/gl/init/gl_initializer_mac.cc. With the output on the instance giving: 2022-06-09 19:38:25.937 Electron[52243:188559] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted [52245:0609/193826.555969:ERROR:gl_initializer_mac.cc(65)] Error choosing pixel format. [52245:0609/193826.556035:ERROR:gl_initializer_mac.cc(193)] GLSurfaceCGL::InitializeOneOff failed. [52245:0609/193826.664827:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization The root cause of this is there is no display connected to the mac mini. Using vnc to screen share with the host (which creates a display) fixes allows openGL to work as expected. Unfortunately this is not a solution/workaround for my use case as I will need to restart/reboot these instances after each run. I have tested this multiple times and after rebooting the instance the display is no longer present. (I have verified the displays being recognized / not being recognized with displayplacer list) Is there any way to make the mac mini host think that it has a display without relying on physical workarounds (I dont have physical access to the machine) or use software like BetterDummy that I can't run in a script.
Posted
by Kaspesi.
Last updated
.
Post marked as solved
3 Replies
3.8k Views
Both standard mp4 files and streaming HLS files are experiencing substantial playback and rendering issues on iOS 15. This includes: Safari immediately crashes Video displays only black (occasional audio can be heard) Video is frozen on 1st frame despite time updating Substantial load times (10+ seconds). Should be immediate. GPU Process:Media has been disabled yet issues persist. Safari immediately crashes with GPU Process: WebGL enabled. These videos are being rendered via WebGL (threejs) None of these issues were present on iOS 14. I’m on an iPad Pro 12.9 2020.
Posted
by VILLMER.
Last updated
.
Post not yet marked as solved
0 Replies
196 Views
I used to have a project that used Quartz Composer and OpenGL, but Xcode 13 has deprecated these two components, which caused me to fail to get off-screen images during video production. The previous code to create the OpenGLContext is as follows: (id) initOffScreenOpenGLPixelsWide:(unsigned)width pixelsHigh:(unsigned)height { //Check parameters - Rendering at sizes smaller than 16x16 will likely produce garbage if((width < 16) || (height < 16)) { [self release]; return nil; } self = [super init]; if(self != nil) {         NSOpenGLPixelFormatAttribute pixattributes[] = {             NSOpenGLPFADoubleBuffer,             NSOpenGLPFANoRecovery,             NSOpenGLPFAAccelerated,             NSOpenGLPFADepthSize, 24,             (NSOpenGLPixelFormatAttribute) 0         };         _pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixattributes]; //Create the OpenGL context to render with (with color and depth buffers) _openGLContext = [[NSOpenGLContext alloc] initWithFormat:_pixelFormat shareContext:nil]; if(_openGLContext == nil) { DDLogInfo(@"Cannot create OpenGL context"); [self release]; return nil; }                  //Create the OpenGL pixel buffer to render into         NSOpenGLPixelBuffer* glPixelBuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT    textureInternalFormat:GL_RGBA textureMaxMipMapLevel:0 pixelsWide:width pixelsHigh:height];         if(glPixelBuffer == nil) {             DDLogInfo(@"Cannot create OpenGL pixel buffer");             [self release];             return nil;         }         [_openGLContext setPixelBuffer:glPixelBuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:[_openGLContext currentVirtualScreen]];                  //Destroy the OpenGL pixel buffer         [glPixelBuffer release];          NSMutableDictionary* attributes = [NSMutableDictionary dictionary];         [attributes setObject:[NSNumber numberWithUnsignedInt:k32BGRAPixelFormat] forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey]; [attributes setObject:[NSNumber numberWithUnsignedInt:width] forKey:(NSString*)kCVPixelBufferWidthKey]; [attributes setObject:[NSNumber numberWithUnsignedInt:height] forKey:(NSString*)kCVPixelBufferHeightKey]; //Create buffer pool to hold our frames OSErr theError = CVPixelBufferPoolCreate(kCFAllocatorDefault, NULL, (CFDictionaryRef)attributes, &_bufferPool); if(theError != kCVReturnSuccess)  { DDLogInfo(@"CVPixelBufferPoolCreate() failed with error %i", theError); [self release]; return nil; } }     /*      *A context is current on a per-thread basis. Multiple threads must serialize calls into the same context object.      */     [self.openGLContext makeCurrentContext]; return self; } By creating an NSOpenGLPixelBuffer object, and then setting the pixelbuffer of NSOpenGLContext, but in Xcode13, NSOpenGLPixelBuffer cannot be created successfully. Looking at the help documentation, it is recommended to use GL_EXT_framebuffer_object instead. So I tried the following code::         //RGBA8 RenderBuffer, 24 bit depth RenderBuffer, 256x256         glGenFramebuffersEXT(1, &fb);         glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);         //Create and attach a color buffer                  glGenRenderbuffersEXT(1, &color_rb);         //We must bind color_rb before we call glRenderbufferStorageEXT         glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, color_rb);         //The storage format is RGBA8         glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA, width, height);         //Attach color buffer to FBO         glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, color_rb);         //-------------------------                  glGenRenderbuffersEXT(1, &depth_rb);         glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb);         glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, width, height);         //-------------------------         //Attach depth buffer to FBO         glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb);         //-------------------------         //Does the GPU support current FBO configuration?         GLenum status;         status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);         switch(status)         {             case GL_FRAMEBUFFER_COMPLETE_EXT:                 DDLogInfo(@"gl no problem");                 break;             default:                 DDLogInfo(@"error");                 break;         }                  //-------------------------         //and now you can render to the FBO (also called RenderBuffer)         glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb); When running the program we can get the 'gl no problem' log. However, when reading off-screen image data, although glGetError does not return an error code, I can only read a black image. In previous versions, a QCRenderer rendered image could be successfully obtained. Reading off-screen images is implemented as follows: (CVPixelBufferRef) readPixelBuffer {     // Create pixel buffer from pixel buffer pool     CVPixelBufferRef bufferRef;     OSErr theError = CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, _bufferPool, &bufferRef);     if(theError) {         DDLogInfo(@"CVPixelBufferPoolCreatePixelBuffer() failed with error %i", theError);         return nil;     }     theError = CVPixelBufferLockBaseAddress(bufferRef, 0); if(theError) { DDLogInfo(@"CVPixelBufferLockBaseAddress() failed with error %i", theError); return nil; } void* bufferPtr = CVPixelBufferGetBaseAddress(bufferRef);     size_t width = CVPixelBufferGetWidth(bufferRef);     size_t height = CVPixelBufferGetHeight(bufferRef); size_t bufferRowBytes = CVPixelBufferGetBytesPerRow(bufferRef);     CGLContextObj cgl_ctx = [_openGLContext CGLContextObj]; CGLLockContext(cgl_ctx);     //Read pixels back from the OpenGL pixel buffer in ARGB 32 bits format - For extra safety, we save / restore the OpenGL states we change     GLint save; glGetIntegerv(GL_PACK_ROW_LENGTH, &save); glPixelStorei(GL_PACK_ROW_LENGTH, (int)bufferRowBytes / 4); glReadPixels(0, 0, (GLsizei)width, (GLsizei)height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, bufferPtr);     flipImage(bufferPtr, width, height, bufferRowBytes);     glPixelStorei(GL_PACK_ROW_LENGTH, save); CGLUnlockContext(cgl_ctx);     GLenum code = glGetError(); if(code) return nil; CVPixelBufferUnlockBaseAddress(bufferRef, 0);     return bufferRef; } Ask an expert how to solve this problem.
Posted Last updated
.
Post not yet marked as solved
0 Replies
214 Views
Hi! I'm looking to create a system utility to apply an openGL shader (or Metal?) to the window that the user is focused on (or the screen), ideally with a keyboard shortcut. From what I can tell, applying OpenGL shaders or pixel level modifications to the whole screens at a time is possible (e.g. BlackLight by Michel Fortin). Any pointers to this kind of thing would be great. Combining Automator workflows with some system-level code seems like it would do the trick but I'm not sure where to start. Update: It looks like CGColorSpace might be helpful for applying color transforms to windows. Perhaps there's a way to make a swift app similar to Rectangle that could modify these CoreGraphics elements instead of the coordinates / transform ones? Thanks for the help, Jack
Posted Last updated
.
Post not yet marked as solved
0 Replies
250 Views
I am working on compiling a simple openGL program in Xcode on my M1 Mac running Monterey 12.2.1. The build succeeds, but I get this nasty error 2022-04-05 09:54:18.959203-0500 opengl[24908:835152] [default] error finding potential wrapper bundle for node <FSNode 0x100a09910> { isDir = ?, path = '/Users/liamwhite/Library/Developer/Xcode/DerivedData/opengl-awawpgevgzpjofbrfmzvucbfrzpp/Build/Products/Debug' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode} 2022-04-05 09:54:18.959276-0500 opengl[24908:835152] [default] error finding potential wrapper bundle for node <FSNode 0x100a09910> { isDir = ?, path = '/Users/liamwhite/Library/Developer/Xcode/DerivedData/opengl-awawpgevgzpjofbrfmzvucbfrzpp/Build/Products/Debug' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode} 2022-04-05 09:54:18.959308-0500 opengl[24908:835152] [default] error finding potential wrapper bundle for node <FSNode 0x100a09910> { isDir = ?, path = '/Users/liamwhite/Library/Developer/Xcode/DerivedData/opengl-awawpgevgzpjofbrfmzvucbfrzpp/Build/Products/Debug' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode} 2022-04-05 09:54:19.019242-0500 opengl[24908:835152] [default] error finding potential wrapper bundle for node <FSNode 0x100a09910> { isDir = ?, path = '/Users/liamwhite/Library/Developer/Xcode/DerivedData/opengl-awawpgevgzpjofbrfmzvucbfrzpp/Build/Products/Debug' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode} 2022-04-05 09:54:19.054172-0500 opengl[24908:835152] Metal API Validation Enabled Program ended with exit code: 0 A potential fix is proposed in this SO post, but I am new to Xcode and the answer is too vague for me. I expect a window to pop up and display a simple triangle. Instead I see my system attempt to open a window (for a fraction of a second) before quitting the window and giving me the above error. Below is my code, if it is of any consequence: #include <iostream> #include <string> #define GLEW_STATIC #include <GL/glew.h> #include <GLFW/glfw3.h> static unsigned int CompileShader(unsigned int type, const std::string& source) {   unsigned int id = glCreateShader(type);   const char* src = source.c_str();   glShaderSource(id, 1, &src, nullptr);   glCompileShader(id);       int result;   glGetShaderiv(id, GL_COMPILE_STATUS, &result);   if(!result)   {     int length;     glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length);     char* message = static_cast<char*>(alloca(length * sizeof(char))); // alloca is from C. it allows dynamic stack allocation!     glGetShaderInfoLog(id, length, &length, message);     std::cout << "Failed to compile " << (type == GL_VERTEX_SHADER ? "vertex" : "fragment") << " shader" << std::endl;     std::cout << message << std::endl;           return 0;   }       return id; } static unsigned int CreateShader(const std::string& vertexShader, const std::string& fragmentShader) {   unsigned int program = glCreateProgram();   unsigned int vs = CompileShader(GL_VERTEX_SHADER, vertexShader);   unsigned int fs = CompileShader(GL_FRAGMENT_SHADER, fragmentShader);       glAttachShader(program, vs);   glAttachShader(program, fs);   glLinkProgram(program);   glValidateProgram(program);       glDeleteShader(vs);   glDeleteShader(fs);       return program; } int main() {   GLFWwindow* window;   /* Initialize the library */   if (!glfwInit())     return -1;      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);   glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);   glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);   glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);   /* Create a windowed mode window and its OpenGL context */   window = glfwCreateWindow(640, 480, "", NULL, NULL);   if (!window)   {     glfwTerminate();     return -1;   }   /* Make the window's context current */   glfwMakeContextCurrent(window);       if(!glewInit())     return 0;           float positions[6] = {     -0.5f, -0.5f,      0.0f, 0.5f,      0.5f, -0.5f   };       unsigned int vao;   glGenVertexArrays(1, &vao);   glBindVertexArray(vao);       unsigned int buffer;   glGenBuffers(1, &buffer);   glBindBuffer(GL_ARRAY_BUFFER, buffer);       glBufferData(GL_ARRAY_BUFFER, 6 * sizeof(float), positions, GL_STATIC_DRAW);       // Below is specifying the layout of our buffer (positions, above)   glEnableVertexAttribArray(0);   glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 2, 0);       std::string vertexShader =     "#version 330 core\n"     "layout(location = 0) in vec4 position;\n"     "void main()\n"     "{\n"     "gl_Position = position;\n"     "}\n";       std::string fragmentShader =     "#version 330 core\n"     "layout(location = 0) out vec4 color;\n"     "void main()\n"     "{\n"     "color = vec4(1.0, 0.0, 0.0, 0.0, 1.0);\n"     "}\n";       unsigned int shader = CreateShader(vertexShader, fragmentShader);       glUseProgram(shader);       /* Loop until the user closes the window */   while (!glfwWindowShouldClose(window))   {     /* Render here */     glClear(GL_COLOR_BUFFER_BIT);           glDrawArrays(GL_TRIANGLES, 0, 3);           /* Swap front and back buffers */     glfwSwapBuffers(window);     /* Poll for and process events */     glfwPollEvents();   }   glfwTerminate();   return 0; }
Posted
by wliam.
Last updated
.
Post not yet marked as solved
1 Replies
1.9k Views
Hello, I am doing a cross-platform project that uses C++ and OpenGL ( I know I should be using MoltenVK or Metal, but OpenGL is nice and simple for starting out and is cross platform). I am also doing most of my development on a M1 Macbook Pro, which supports up to OpenGL 4.1. The M1 also only supports up to 16 active fragment shader samplers ( maximum number of supported image units) I am currently working on a batch rendering system that uses an array of textures thats uploaded to the GPU and the shader can switch based off of the index into a sampler array. Heres the shader that I am using ( the vertex and fragment shaders are combined, but the program parses them separately) : #type vertex #version 410 core layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 2) in vec2 a_TexCoord; layout(location = 3) in float a_TexIndex; layout(location = 4) in float a_TilingFactor; uniform mat4 u_ViewProjection; out vec4 v_Color; out vec2 v_TexCoord; out float v_TexIndex; out float v_TilingFactor; void main() { v_Color = a_Color; v_TexCoord = a_TexCoord; v_TexIndex = a_TexIndex; v_TilingFactor = a_TilingFactor; gl_Position = u_ViewProjection * vec4(a_Position, 1.0); } #type fragment #version 410 core layout(location = 0) out vec4 color; in vec4 v_Color; in vec2 v_TexCoord; in float v_TexIndex; in float v_TilingFactor; uniform sampler2D u_Textures[16]; void main() { color = texture(u_Textures[int(v_TexIndex)], v_TexCoord * v_TilingFactor) * v_Color; } However, when the program runs I get this message: UNSUPPORTED (log once): POSSIBLE ISSUE: unit 2 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable I double and triple checked my code and im binding everything correctly to the shader (if im not feel free to point it out :), and the only thing I found on the web relating to this error was saying that it was an error within the GLSL compiler on the new M1s. Is this true? Or is it a code issue? Thanks side note: I am using EMACS to run Cmake and do C++ development, so if you try and test my project on Xcode and it doesnt include the shaders its most likely a Cmake/Xcode copy issue.
Posted
by trzroy.
Last updated
.
Post not yet marked as solved
0 Replies
228 Views
We are developing a graphics app that uses OpenGL extensively. We've developed a crash issue since we switched to CALayer-based OpenGL rendering per Apple sample code CALayerEssentials. When certain of our OpenGL layer-containing windows are moved between two screens, the app crashes (on Catalina). I replicated the issue in a pared-down, updated version of CALayerEssentials. In our version, because we will have multiple OpenGL views sharing resources, we use a shared context. Is there something we can do differently to avoid the crash while still sharing OpenGL resources? // You would typically override this method if you needed to specify a share context to share OpenGL resources. // This is also an ideal location to do any initialization that is necessary for the context returned -(CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat { #if 0 // ORIGINAL SAMPLE CODE // Default handling is fine for this demonstration. CGLContextObj superContext = [super copyCGLContextForPixelFormat:pixelFormat]; return superContext; #else // OUR VERSION TO SHARE OPENGL RESOURCES // THIS LEADS TO CRASH WHEN WINDOW IS MOVED BETWEEN SCREENS if (!_dfContext) { _dfContext = [super copyCGLContextForPixelFormat:pixelFormat]; } return _dfContext; #endif } Our pared-down and updated version of CALayerEssentials source may be downloaded here. Here's the backtrace: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 GLEngine 0x00007fff3eb701a2 gleLookupHashObject + 13 1 GLEngine 0x00007fff3eb6fe3e gleBindTexture + 59 2 GLEngine 0x00007fff3eb6fdc6 glBindTexture_Exec + 405 3 com.apple.QuartzCore 0x00007fff3fbd8a0c CA::(anonymous namespace)::IOSurface::framebuffer() + 84 4 com.apple.QuartzCore 0x00007fff3fbd8907 CA::(anonymous namespace)::IOSurface::attach() + 83 5 com.apple.QuartzCore 0x00007fff3fbd8461 CAOpenGLLayerDraw(CAOpenGLLayer*, double, CVTimeStamp const*, unsigned int) + 1868 6 com.apple.QuartzCore 0x00007fff3fbd7b3a -[CAOpenGLLayer _display] + 580 7 com.apple.QuartzCore 0x00007fff3fb3bcad CA::Layer::display_if_needed(CA::Transaction*) + 757 8 com.apple.QuartzCore 0x00007fff3fb19fca CA::Context::commit_transaction(CA::Transaction*, double) + 334 9 com.apple.QuartzCore 0x00007fff3fb18bb4 CA::Transaction::commit() + 644 10 com.apple.AppKit 0x00007fff315f42f1 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 266 11 com.apple.AppKit 0x00007fff31d12c20 ___NSRunLoopObserverCreateWithHandler_block_invoke + 41 12 com.apple.CoreFoundation 0x00007fff341f17bc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 13 com.apple.CoreFoundation 0x00007fff341f16ec __CFRunLoopDoObservers + 457 14 com.apple.CoreFoundation 0x00007fff341f0c84 __CFRunLoopRun + 884 15 com.apple.CoreFoundation 0x00007fff341f02b3 CFRunLoopRunSpecific + 466 16 com.apple.HIToolbox 0x00007fff32e0baad RunCurrentEventLoopInMode + 292
Posted
by fraapaul.
Last updated
.
Post marked as solved
1 Replies
416 Views
I am currently shopping for a new laptop and have been researching whether or not the new Apple M1 Pro Laptop would meet my requirements. I contacted Apple support, but they were unable to provide me with the answers to my questions and directed me to this forum. I am joining a CS program that is requiring OpenGL support in their hardware documentation. The school's hardware docs state: "Support for OpenGL Required - Support for OpenGL requires a graphics co-processor. This may be a dedicated graphics card, a co-processor imbedded on the motherboard, or integrated in the main cpu." My concern is I've read that OpenGL support was deprecated? Does anyone know whether or not the new M1 Pro Laptops (specifically, the 14"/16" models) support OpenGL for the purposes of education or if there's a suitable workaround?
Posted
by zNaCly.
Last updated
.
Post not yet marked as solved
0 Replies
206 Views
Multiple calls to [UIView drawViewHierarchyInRect:afterScreenUpdates:] invalidates the WKWebView global animation To be more precise, the transition property animation fails But with [CALayer renderInContext:] don't have this problem
Posted
by aeagle.
Last updated
.
Post not yet marked as solved
4 Replies
845 Views
My application freezes on a call to glTexImage2D, this is the stack trace I get from the lldb: thread #3 frame #0: 0x00000001bb04d9b4 libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001bb04dd60 libsystem_kernel.dylib`mach_msg + 76 frame #2: 0x00000001bdb28dd0 IOKit`io_connect_method + 440 frame #3: 0x00000001bdb28bec IOKit`IOConnectCallMethod + 236 frame #4: 0x00000001d5b1b970 IOGPU`IOGPUResourceCreate + 224 frame #5: 0x00000001d5b159f8 IOGPU`-[IOGPUMetalResource initWithDevice:remoteStorageResource:options:args:argsSize:] + 476 frame #6: 0x00000001d5b18ab8 IOGPU`-[IOGPUMetalTexture initWithBuffer:descriptor:sysMemOffset:sysMemRowBytes:vidMemSize:vidMemRowBytes:args:argsSize:isStrideTexture:] + 616 frame #7: 0x00000001d5b1925c IOGPU`-[IOGPUMetalTexture initWithPrimaryBuffer:heapIndex:bufferIndex:bufferOffset:length:descriptor:sysMemRowBytes:vidMemSize:vidMemRowBytes:args:argsSize:] + 96 frame #8: 0x000000021c45bc10 AGXMetal13_3`___lldb_unnamed_symbol4663$$AGXMetal13_3 + 468 frame #9: 0x0000000133953aa8 AppleMetalOpenGLRenderer`GLDTextureRec::loadObj() + 3156 frame #10: 0x000000013398a960 AppleMetalOpenGLRenderer`gldModifyTexSubImage + 160 frame #11: 0x000000021bd9a7e8 GLEngine`glTexImage2D_Exec + 1944 frame #12: 0x000000021bd7b8d0 libGL.dylib`glTexImage2D + 80 My questions are: how could a call to glTexImage2D freezes and cause the thread stuck forever? Why and how to solve it? Thank you in advance, and looking forward to any suggestions
Posted
by changkun.
Last updated
.
Post not yet marked as solved
3 Replies
1.5k Views
OpenGL is deprecated for new development, and Apple's docs no longer even acknowledge the existence of OpenCL. However, many legacy MacOS apps contain modules written in those languages, and they have been building with Xcode and running on Intel Macs just fine. I need to know if they are also tacitly supported on M1 Macs, and if so, whether there is a known kill date.
Posted Last updated
.
Post not yet marked as solved
0 Replies
402 Views
I have an multiple render-backend application on MacOS,so I can compare the performance between Metal and OpenGL about OffscreenRender. I found that, when I do not use MSAA,metal perform better.But when I open MSAA,especially at Large-texture,such as 3840x1920, metal seems slower. Then I simplify the render-pass, no draw call, seems it's the clear of texture was the difference of Metal and OpenGL, I'm not sure. in OpenGL,I use glClearBufferfv; in Metal, I set colorAttachments.loadAction=MTLLoadActionClear(I tried enalbe or disable tripple-buffering); Then I close the clear-action both on OpenGL and Metal,render-pass time of openGL reduce about 3ms ,Metal reduce about 8ms, Is that mean Metal take more time to clear texture? How can I resolve with such problem? (because I need clear-action) @Apple Device: Mac-mini-2018 Xcode: Xcode13.0 Here is the metal instrument screen-shot(idle of GPU seems too long,about 50ms):
Posted Last updated
.
Post not yet marked as solved
0 Replies
318 Views
I am running a program and I want to render and display a 3D bunny. Therefore we use pyrender and trimesh. In my university class they showed a trick so that the rendering is running on a side thread so that we can still interact with the window and change things. This works for everyone but not for me. Here is my code. bunny = trimesh.load("/bun_zipper.ply") mesh = pyrender.Mesh.from_trimesh(bunny) scene = pyrender.Scene(ambient_light=[.5, .5, .5], bg_color=[0, 0, 0]) node = pyrender.Node(name="Node", mesh=mesh) scene.add_node((node)) v = pyrender.Viewer(scene,run_in_thread=True) the problem is here the run_in_thread=True. Without this argument it works fine for me but with that argument I get the following error message: 2021-10-26 10:03:53.756 Python[89940:3624072] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/0m/8zgbz49j2032wtvwfxv6rw2r0000gn/T/org.python.python.savedState 2021-10-26 10:03:53.765 Python[89940:3624072] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' *** First throw call stack: ( 0 CoreFoundation 0x00007fff2067e1db __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff203b7d92 objc_exception_throw + 48 2 CoreFoundation 0x00007fff206a68e6 -[NSException raise] + 9 3 AppKit 0x00007fff22e35eb2 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 321 4 AppKit 0x00007fff22e20aa2 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1296 5 AppKit 0x00007fff22e2058b -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42 6 libffi.dylib 0x00007fff2daec8f5 ffi_call_unix64 + 85 7 ??? 0x0000700002521400 0x0 + 123145341244416 ) libc++abi: terminating with uncaught exception of type NSException
Posted
by philfil.
Last updated
.
Post marked as solved
2 Replies
1.4k Views
Requirements : I need to draw 2D lines, circles, boxes. Fast. That's it. I don't want to learn objC, Swift, Xcode. I'm using C++ and Jetbrains' CLion. OpenGL is deprecated (or soon to be) on Mac I don't even care about Apple (as you probably guessed), but the M1 processor is just too good. (and fanless <3) I'll be happy as long as it runs on my MacBook Air Text would be a useful feature but totally optional I won't even use sprites, or any kind of assets, sound, keyboard, mouse, IO, GUI. I need pure non-interactive visualisation of science-ish stuff. fast FPS, refreshing the visualization as fast as possible. Even if it's a pure framebuffer (an array of pixels), I'll manage. If it's a full fledged 3D accelerated graphic library (eg : openGL, Vulkan, Metal), it also works for me. "as long as it works" What kind of options are available to me with the aforementioned requirements ? use openGL anyway and cry when it will no longer works ? (meh) hack my way to Metal in C++ ? I'm fine if a suggested library isn't Object Oriented (eg : openGL) Vulkan ? I still need to open a graphic window context somehow SDL2 appears to have a some kind of Metal backend/port/whatever but all the exemples I find are in ObjC. honestly, my post feel like I'm crying for a documented c++ metal wrapper of some kind I suppose ? EDIT : I read mixed message and confusion on the Future of OpenGL on Mac. Mostly about "no longer supported" vs "Deprecated". Will OpenGL be removed and no longer works. Or it will works but won't be updated anymore ? (considering my requirements, an outdated version of OpenGL is perfectly fine to me) Thank you <3
Posted
by ker2x.
Last updated
.
Post not yet marked as solved
4 Replies
1.6k Views
Previously on 11.2.3 I was able to run my OpenGL game targeting my M1 Mac mini as an iPad game. After updating to macOS 11.3 I am now getting an error in Metal. Is this expected moving forward and a sign that we need to focus on porting to Metal sooner rather than later? -[_MTLFunctionInternal baseObject]: unrecognized selector sent to instance 0x13046dab0 Crashing on: glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr); Thanks, Steven Behnke
Posted Last updated
.
Post not yet marked as solved
0 Replies
581 Views
Steps to reproduce: Download and open the attached "ARKitTest" project Build and deploy the project to iOS Reproduced with:2018.4.31f1, 2019.4.20f1, 2020.2.4f1, 2021.1.0b5, 2021.2.0a4 Reproducible with iPhone 12 Pro (iOS 14.2.1) [Bug] iOS app crashes after some time (EXC_BAD_ACCESS) · Issue #716 · Unity-Technologies/arfoundation-samples (github.com) https://github.com/Unity-Technologies/arfoundation-samples/issues/716 Unity Issue Tracker - [iOS 14] EXC_BAD_ACCESS crash from com.apple.arkit.ardisplaylink (unity3d.com) https://issuetracker.unity3d.com/issues/ios-14-exc-bad-access-crash-from-com-dot-apple-dot-arkit-dot-ardisplaylink
Posted
by phields.
Last updated
.