Very very strange... I have a Open3.2 compliant performance test software.
It's supposed to run at 50 FPS on a 330M (as it does on Windows 7)
Turns out it does run at 60 FPS, and when mouse grabbing (i do some offscreen additionnal rendering) decrease to 45 FPS... (as it does on Windows...)
This suggest that the geometry is processed correctly by the shaders. I just don't see anything on screen....
Shader compilation logs and GPU loading logs are almost indentical (Windows vs MacOs)
I just get an additional warning on Mac when validating shaders (Warning : no vertex array object bound.)
Regarding the context.m file, I ended up to this :
NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered) {
int bpp;
jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
//if (use_display_bpp)
// bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
//else
bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
int num_aux_buffers = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "num_aux_buffers", "I"));
int accum_bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_bpp", "I"));
int accum_alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "accum_alpha", "I"));
bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
// TODO: Add floating_point_packed attribute below
bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
// TODO: Add sRGB attribute below
bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
attrib_list_t attribs;
jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
initAttribList(&attribs);
putAttrib(&attribs, NSOpenGLPFAOpenGLProfile); // ADDED LINE
putAttrib(&attribs, NSOpenGLProfileVersion3_2Core); // ADDED LINE
if (support_window) // DISPLACED HERE -
putAttrib(&attribs, NSOpenGLPFAWindow);
if (support_pbuffer) // DISPLACED HERE -
putAttrib(&attribs, NSOpenGLPFAPixelBuffer);
if (!allow_software_acceleration)
putAttrib(&attribs, NSOpenGLPFAAccelerated);
if (double_buffered)
putAttrib(&attribs, NSOpenGLPFADoubleBuffer);
putAttrib(&attribs, NSOpenGLPFAMinimumPolicy);
putAttrib(&attribs, NSOpenGLPFAColorSize); putAttrib(&attribs, bpp);
putAttrib(&attribs, NSOpenGLPFAAlphaSize); putAttrib(&attribs, alpha);
putAttrib(&attribs, NSOpenGLPFADepthSize); putAttrib(&attribs, depth);
putAttrib(&attribs, NSOpenGLPFAStencilSize); putAttrib(&attribs, stencil);
putAttrib(&attribs, NSOpenGLPFAAccumSize); putAttrib(&attribs, accum_bpp + accum_alpha);
putAttrib(&attribs, NSOpenGLPFASampleBuffers); putAttrib(&attribs, samples > 0 ? 1 : 0);
putAttrib(&attribs, NSOpenGLPFASamples); putAttrib(&attribs, samples);
putAttrib(&attribs, NSOpenGLPFAAuxBuffers); putAttrib(&attribs, num_aux_buffers);
if (stereo)
putAttrib(&attribs, NSOpenGLPFAStereo);
if (floating_point)
putAttrib(&attribs, NSOpenGLPFAColorFloat);
putAttrib(&attribs, 0);
NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs.attribs];
if (fmt == nil) {
throwException(env, "Could not create pixel format");
return NULL;
}
return fmt;
}
Very few modifications.
I can't find any more test to do... Please anyone help me.
Estraven