Skip to content

Commit

Permalink
Fix using xr pixel format on compatible device (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii authored Nov 27, 2023
1 parent 681e353 commit 278f49b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Dev/Brightroom.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = KU2QEJ9K3Z;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Demo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2619,7 +2619,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = KU2QEJ9K3Z;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Demo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2640,7 +2640,7 @@
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_ASSET_PATHS = "\"Sources/SwiftUIDemo/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = JX92XL88RZ;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = Sources/SwiftUIDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -2662,7 +2662,7 @@
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Sources/SwiftUIDemo/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = JX92XL88RZ;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = Sources/SwiftUIDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -2682,7 +2682,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = GKNHX9R5U2;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = "Tests/$(TARGET_NAME)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2702,7 +2702,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = GKNHX9R5U2;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = "Tests/$(TARGET_NAME)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2721,7 +2721,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = KU2QEJ9K3Z;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = "$(SRCROOT)/Bundle/LUTs/Import LUT/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2742,7 +2742,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = KU2QEJ9K3Z;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = "$(SRCROOT)/Bundle/LUTs/Import LUT/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2763,7 +2763,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = KU2QEJ9K3Z;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = Bundle/LUTs/ShareLUT/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2784,7 +2784,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = KU2QEJ9K3Z;
DEVELOPMENT_TEAM = JX92XL88RZ;
INFOPLIST_FILE = Bundle/LUTs/ShareLUT/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,19 @@ open class MetalImageView: MTKView, CIImageDisplaying, MTKViewDelegate {
#if targetEnvironment(simulator)
#else
/// For supporting wide-color - extended sRGB
colorPixelFormat = .bgra10_xr

let metalLayer = layer as! CAMetalLayer

if #available(iOS 16, *) {
metalLayer.wantsExtendedDynamicRangeContent = true
}

let hasP3Display = traitCollection.displayGamut == .P3

if hasP3Display {
metalLayer.pixelFormat = .bgra10_xr
}

#endif

}
Expand Down

0 comments on commit 278f49b

Please sign in to comment.