diff --git a/src/Backends/WaylandBackend.cpp b/src/Backends/WaylandBackend.cpp index 9862641..e9d2923 100644 --- a/src/Backends/WaylandBackend.cpp +++ b/src/Backends/WaylandBackend.cpp @@ -1972,7 +1972,7 @@ namespace gamescope { auto *pHDRInfo = &m_pConnector->m_HDRInfo; if (m_pBackend->SupportsColorManagement()) { - pHDRInfo->bExposeHDRSupport = ( cv_hdr_enabled && m_pConnector->m_uMaxTargetLuminance > m_pConnector->m_uReferenceLuminance ); + pHDRInfo->bExposeHDRSupport = ( m_pConnector->m_uMaxTargetLuminance > m_pConnector->m_uReferenceLuminance ); pHDRInfo->eOutputEncodingEOTF = pHDRInfo->bExposeHDRSupport ? EOTF_PQ : EOTF_Gamma22; } @@ -2282,7 +2282,7 @@ namespace gamescope assert( u8BitFormat != DRM_FORMAT_INVALID ); - *pPrimaryPlaneFormat = u10BitFormat != DRM_FORMAT_INVALID ? u10BitFormat : u8BitFormat; + *pPrimaryPlaneFormat = ( cv_hdr_enabled && u10BitFormat != DRM_FORMAT_INVALID ) ? u10BitFormat : u8BitFormat; *pOverlayPlaneFormat = u8BitFormat; } @@ -2493,13 +2493,17 @@ namespace gamescope // XXX: We should do this a better way that handles per-window and appid stuff // down the line - if ( cv_hdr_enabled && GetCurrentConnector()->GetHDRInfo().bExposeHDRSupport ) + if ( !GetCurrentConnector()->GetHDRInfo().bExposeHDRSupport ) + { + setenv( "DXVK_HDR", "0", true ); + } + else if ( cv_hdr_enabled ) { setenv( "DXVK_HDR", "1", true ); } else { - setenv( "DXVK_HDR", "0", true ); + unsetenv( "DXVK_HDR" ); } WritePatchedEdid( GetCurrentConnector()->GetRawEDID(), GetCurrentConnector()->GetHDRInfo(), false ); diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index 42cc9c4..d0d21f0 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -3735,6 +3735,7 @@ bool vulkan_remake_output_images() if ( vulkan_defer_output_images() ) { + GetBackend()->GetPreferredOutputFormat( &pOutput->uOutputFormat, &pOutput->uOutputFormatOverlay ); pOutput->outputImages.clear(); pOutput->outputImagesPartialOverlay.clear(); pOutput->temporaryHackyBlankImage = vulkan_create_debug_blank_texture();