MacOS: Enable support for EDR rendering #105662
|
@ -92,10 +92,11 @@ GHOST_ContextCGL::GHOST_ContextCGL(bool stereoVisual,
|
|||
m_metalLayer.allowsNextDrawableTimeout = NO;
|
||||
|
||||
if (m_useMetalForRendering) {
|
||||
// Enable EDR support. This is done by:
|
||||
// 1. Using a floating point render target, so that values ouside 0..1 can be used
|
||||
// 2. Informing the OS that we are EDR aware, and intend to use values outside 0..1
|
||||
// 3. Setting the extended sRGB color space so that the OS knows how to interpret the values
|
||||
/* Enable EDR support. This is done by:
|
||||
* 1. Using a floating point render target, so that values ouside 0..1 can be used
|
||||
* 2. Informing the OS that we are EDR aware, and intend to use values outside 0..1
|
||||
* 3. Setting the extended sRGB color space so that the OS knows how to interpret the
|
||||
* values. */
|
||||
m_metalLayer.wantsExtendedDynamicRangeContent = YES;
|
||||
m_metalLayer.pixelFormat = MTLPixelFormatRGBA16Float;
|
||||
const CFStringRef name = kCGColorSpaceExtendedSRGB;
|
||||
|
@ -607,8 +608,8 @@ void GHOST_ContextCGL::metalInit()
|
|||
/* Ensure library is released. */
|
||||
[library autorelease];
|
||||
|
||||
MTLPixelFormat attachmentFormat = m_useMetalForRendering ?
|
||||
METAL_FRAMEBUFFERPIXEL_FORMAT_EDR : METAL_FRAMEBUFFERPIXEL_FORMAT_SDR;
|
||||
MTLPixelFormat attachmentFormat = m_useMetalForRendering ? METAL_FRAMEBUFFERPIXEL_FORMAT_EDR :
|
||||
METAL_FRAMEBUFFERPIXEL_FORMAT_SDR;
|
||||
[desc.colorAttachments objectAtIndexedSubscript:0].pixelFormat = attachmentFormat;
|
||||
|
||||
m_metalRenderPipeline = (MTLRenderPipelineState *)[device
|
||||
|
|
|
@ -343,12 +343,13 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
|
|||
[m_metalLayer setPresentsWithTransaction:NO];
|
||||
[m_metalLayer removeAllAnimations];
|
||||
[m_metalLayer setDevice:metalDevice];
|
||||
|
||||
|
||||
if (type == GHOST_kDrawingContextTypeMetal) {
|
||||
// Enable EDR support. This is done by:
|
||||
// 1. Using a floating point render target, so that values ouside 0..1 can be used
|
||||
// 2. Informing the OS that we are EDR aware, and intend to use values outside 0..1
|
||||
// 3. Setting the extended sRGB color space so that the OS knows how to interpret the values
|
||||
/* Enable EDR support. This is done by:
|
||||
* 1. Using a floating point render target, so that values ouside 0..1 can be used
|
||||
* 2. Informing the OS that we are EDR aware, and intend to use values outside 0..1
|
||||
* 3. Setting the extended sRGB color space so that the OS knows how to interpret the
|
||||
* values. */
|
||||
m_metalLayer.wantsExtendedDynamicRangeContent = YES;
|
||||
m_metalLayer.pixelFormat = MTLPixelFormatRGBA16Float;
|
||||
const CFStringRef name = kCGColorSpaceExtendedSRGB;
|
||||
|
|
Loading…
Reference in New Issue