summaryrefslogtreecommitdiff
path: root/indra/llwindow/llopenglview-objc.mm
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.com>2025-09-11 18:50:58 +0200
committermobserveur <mobserveur@gmail.com>2025-09-11 18:50:58 +0200
commit067d83b640d3fae45098ef8bc71e913c1eb65a44 (patch)
tree245cee2165d49b9c593d47f14f753c8e20373ae5 /indra/llwindow/llopenglview-objc.mm
parentccf0114f36968d6cf6dfb11e1c5a035406314924 (diff)
Fix for multithreaded textures on Mac and more optimisations
This commit fixes an issue with the multithreaded textures option on Mac and adds some more optimisations.
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
-rw-r--r--indra/llwindow/llopenglview-objc.mm60
1 files changed, 41 insertions, 19 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 577311bf49..7579f28656 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -160,8 +160,18 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void)viewWillMoveToWindow:(nullable NSWindow *)newWindow
{
- if(mHDRDisplay) self.wantsExtendedDynamicRangeOpenGLSurface = YES;
- //else self.wantsExtendedDynamicRangeOpenGLSurface = NO;
+ if(mHDRDisplay)
+ {
+ self.wantsExtendedDynamicRangeOpenGLSurface = YES;
+ NSLog(@"Wants Extended Dynamic Range OpenGL", nil);
+ }
+ /*
+ else
+ {
+ self.wantsExtendedDynamicRangeOpenGLSurface = NO;
+ NSLog(@"Wants Standard Color Range OpenGL", nil);
+ }
+ */
}
- (void)viewDidMoveToWindow
@@ -257,25 +267,34 @@ attributedStringInfo getSegments(NSAttributedString *str)
// Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6.
// Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat.
// 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons).
- NSOpenGLPixelFormatAttribute SDRAttrs[] = {
- NSOpenGLPFADoubleBuffer,
- NSOpenGLPFASampleBuffers, 0,
- NSOpenGLPFASamples, 0,
- NSOpenGLPFAStencilSize, 8,
- NSOpenGLPFADepthSize, 24,
- NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core,
- 0};
+
+ NSOpenGLPixelFormatAttribute SDRAttrs[] = {
+ NSOpenGLPFANoRecovery,
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAClosestPolicy,
+ NSOpenGLPFAAccelerated,
+ NSOpenGLPFASampleBuffers, 0,
+ NSOpenGLPFASamples, 0,
+ NSOpenGLPFADepthSize, 24,
+ NSOpenGLPFAAlphaSize, 8,
+ NSOpenGLPFAColorSize, 32,
+ NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core,
+ 0
+ };
NSOpenGLPixelFormatAttribute HDRAttrs[] = {
- NSOpenGLPFADoubleBuffer,
- NSOpenGLPFASampleBuffers, 0,
- NSOpenGLPFASamples, 0,
- NSOpenGLPFAStencilSize, 8,
- NSOpenGLPFAColorFloat,
- NSOpenGLPFAColorSize, 64,
- NSOpenGLPFADepthSize, 24,
- NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core,
- 0};
+ NSOpenGLPFANoRecovery,
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAClosestPolicy,
+ NSOpenGLPFAAccelerated,
+ NSOpenGLPFASampleBuffers, 0,
+ NSOpenGLPFASamples, 0,
+ NSOpenGLPFAColorFloat,
+ NSOpenGLPFAColorSize, 64,
+ NSOpenGLPFADepthSize, 24,
+ NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core,
+ 0
+ };
NSOpenGLPixelFormat *pixelFormat = nil;
@@ -291,6 +310,7 @@ attributedStringInfo getSegments(NSAttributedString *str)
}
else
{
+ NSLog(@"pixel format created successfully for HDR Display", nil);
mHDRDisplay = YES;
}
}
@@ -324,6 +344,8 @@ attributedStringInfo getSegments(NSAttributedString *str)
self.window.colorSpace = extended_ns_color_space;
CGColorSpaceRelease(color_space_extended);
+
+ NSLog(@"Extended color space applied for HDR Display", nil);
}
//for retina support