-
Notifications
You must be signed in to change notification settings - Fork 545
CompositorServices macOS xcode26.0 b1
Rolf Bjarne Kvinge edited this page Jul 29, 2025
·
2 revisions
#CompositorServices.framework https://github.com/dotnet/macios/issues/23422
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/CompositorServices.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/CompositorServices.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/CompositorServices.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/CompositorServices.h 2025-05-25 00:23:22
@@ -0,0 +1,43 @@
+//
+// CompositorServices.h
+// CompositorServices
+//
+// Copyright © 2023 Apple Inc. All rights reserved.
+//
+
+#import <CoreFoundation/CoreFoundation.h>
+#import <simd/simd.h>
+
+#import <CompositorServices/cp_conditionals.h>
+
+#ifdef __OBJC__
+#if TARGET_OS_IOS || TARGET_OS_VISION
+#import <UIKit/UIKit.h>
+#endif
+#import <Metal/Metal.h>
+#import <ARKit/ARKit.h>
+#endif
+
+/*!
+ * @header
+ *
+ * CompositorServices is an API that allows your application to render directly into the compositor server.
+ * It provides a set of APIs to pace the rendering of your application in a way that
+ * is optimal for the system power constraints and input latency.
+ */
+
+#import <CompositorServices/cp_base.h>
+
+#import <CompositorServices/cp_error.h>
+#import <CompositorServices/cp_types.h>
+#import <CompositorServices/tracking_area.h>
+#import <CompositorServices/frame_timing.h>
+#import <CompositorServices/layer_renderer_layout.h>
+#import <CompositorServices/layer_renderer_capabilities.h>
+#import <CompositorServices/layer_renderer_configuration.h>
+#import <CompositorServices/layer_renderer_properties.h>
+#import <CompositorServices/view.h>
+#import <CompositorServices/drawable_render_context.h>
+#import <CompositorServices/drawable.h>
+#import <CompositorServices/frame.h>
+#import <CompositorServices/layer_renderer.h>
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_base.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_base.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_base.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_base.h 2025-05-31 01:07:51
@@ -0,0 +1,137 @@
+//
+// cp_base.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_base_h
+#define cp_base_h
+
+#ifdef __cplusplus
+ #define CP_EXTERN extern "C"
+#else
+ #define CP_EXTERN extern
+#endif
+
+#ifdef __cplusplus
+ #define CP_EXTERN_C_BEGIN extern "C" {
+ #define CP_EXTERN_C_END }
+#else
+ #define CP_EXTERN_C_BEGIN
+ #define CP_EXTERN_C_END
+#endif
+
+#ifdef __cplusplus
+ #define CP_NONNULL_EXTERN_C_BEGIN CF_ASSUME_NONNULL_BEGIN extern "C" {
+ #define CP_NONNULL_EXTERN_C_END } CF_ASSUME_NONNULL_END
+#else
+ #define CP_NONNULL_EXTERN_C_BEGIN CF_ASSUME_NONNULL_BEGIN
+ #define CP_NONNULL_EXTERN_C_END CF_ASSUME_NONNULL_END
+#endif
+
+#if __has_attribute(objc_subclassing_restricted)
+ #define CP_FINAL_CLASS __attribute__((objc_subclassing_restricted))
+#else
+ #define CP_FINAL_CLASS
+#endif
+
+#define CP_EXPORT __attribute__((visibility("default")))
+
+#define CP_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
+
+/// CP_STRUCT_REF
+#define CP_STRUCT_REF_BASE(object, api_availability) \
+ typedef struct object *object ## _t api_availability
+
+#define CP_STRUCT_REF_2(object, api_availability, ...) \
+ CP_STRUCT_REF_BASE(object, api_availability)
+#define CP_STRUCT_REF_1(object, ...) \
+ CP_STRUCT_REF_BASE(object, )
+
+#ifdef __swift__
+ #define CP_STRUCT_REF_BASE_SWIFT_COMPATIBLE(object, swift_define, api_availability) \
+ typedef struct object ## _t { struct object _Nullable *opaque_pointer CF_REFINED_FOR_SWIFT; } swift_define api_availability object ## _t
+ #define CP_STRUCT_REF_3(object, swift_name, api_availability) \
+ CP_STRUCT_REF_BASE_SWIFT_COMPATIBLE(object, CF_SWIFT_NAME(swift_name), api_availability)
+ #define CP_NULLABLE_STRUCT_REF
+#else
+ #define CP_STRUCT_REF_3(object, swift_name, api_availability) \
+ CP_STRUCT_REF_BASE(object, api_availability)
+ #define CP_NULLABLE_STRUCT_REF _Nullable
+#endif
+
+#define CP_STRUCT_REF_(object, swift_name_or_api_availability, api_availability, n, ...) \
+ CP_STRUCT_REF_##n(object, swift_name_or_api_availability, api_availability)
+
+#define CP_STRUCT_REF(object, ...) CP_STRUCT_REF_(object, ##__VA_ARGS__, 3, 2, 1)
+
+/// CP_OBJECT_DECL
+#ifdef __OBJC__
+ #define CP_OBJECT_NAME(object) CP_OBJECT_ ## object
+ #define CP_OBJECT_DECL_BASE(object, swift_define, api_availability) \
+ CP_EXPORT\
+ swift_define\
+ api_availability\
+ CP_FINAL_CLASS\
+ @interface CP_OBJECT_NAME(object): NSObject \
+ - (instancetype)init NS_UNAVAILABLE; \
+ + (instancetype)new NS_UNAVAILABLE; \
+ @end \
+ typedef CP_OBJECT_NAME(object) *object ## _t CF_REFINED_FOR_SWIFT api_availability
+
+#else
+ #define CP_OBJECT_DECL_BASE(object, swift_define, api_availability) \
+ typedef struct object ## _s *object ## _t api_availability
+#endif
+
+#define CP_OBJECT_DECL_3(object, swift_name, api_availability) \
+ CP_OBJECT_DECL_BASE(object, CF_SWIFT_NAME(swift_name), api_availability)
+#define CP_OBJECT_DECL_2(object, api_availability, ...) \
+ CP_OBJECT_DECL_BASE(object, CF_REFINED_FOR_SWIFT, api_availability)
+#define CP_OBJECT_DECL_1(object, ...) \
+ CP_OBJECT_DECL_BASE(object, CF_REFINED_FOR_SWIFT, )
+
+#define CP_OBJECT_DECL_(object, swift_name_or_api_availability, api_availability, n, ...)\
+ CP_OBJECT_DECL_##n(object, swift_name_or_api_availability, api_availability)
+
+#define CP_OBJECT_DECL(object, ...)\
+ CP_OBJECT_DECL_(object, ##__VA_ARGS__, 3, 2, 1)
+
+#if !OS_OBJECT_USE_OBJC_RETAIN_RELEASE
+CP_EXTERN_C_BEGIN
+
+///Increments the reference count of the specified object.
+///
+///- Parameters:
+/// - obj: The object to retain. If this parameter is an Objective-C object,
+/// the function is equivalent to calling the `retain` method of that object.
+/// - Returns: The retained object.
+///
+/// Don’t call this function in Swift code or on types you manage using
+/// automatic reference counting (ARC).
+void *cp_retain(void *obj)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Decrement the reference count of the specified object.
+///
+/// - Parameters:
+/// - obj: The object to release. If this parameter is an Objective-C object,
+/// the function is equivalent to calling the `release` method of that object.
+///
+/// Don’t call this function in Swift code or on types you manage using
+/// automatic reference counting (ARC).
+void cp_release(void *obj)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+CP_EXTERN_C_END
+#else // !OS_OBJECT_USE_OBJC_RETAIN_RELEASE
+#undef cp_retain
+#undef cp_release
+#define cp_retain(object) [(object) retain]
+#define cp_release(object) [(object) release]
+#endif // !OS_OBJECT_USE_OBJC_RETAIN_RELEASE
+
+#endif /* cp_base_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_conditionals.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_conditionals.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_conditionals.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_conditionals.h 2025-05-25 00:23:22
@@ -0,0 +1,15 @@
+//
+// cp_conditionals.h
+// WakeBoard
+//
+// Created by Jacob Wilson on 3/14/25.
+// Copyright © 2025 Apple. All rights reserved.
+//
+
+#ifndef cp_conditionals_h
+#define cp_conditionals_h
+
+#define CP_ARKITCORE_AVAILABLE ((TARGET_OS_VISION && !TARGET_OS_SIMULATOR) || TARGET_OS_OSX)
+#define CP_MTL4_AVAILABLE !TARGET_OS_SIMULATOR
+
+#endif
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_error.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_error.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_error.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_error.h 2025-05-31 01:33:31
@@ -0,0 +1,125 @@
+//
+// cp_error.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_error_h
+#define cp_error_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// The domain for errors that occur during layer renderer configuration.
+CP_EXTERN CFErrorDomain const cp_layer_renderer_configuration_error_domain CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Errors that can occur during layer configuration.
+typedef CF_ERROR_ENUM(cp_layer_renderer_configuration_error_domain, cp_layer_renderer_configuration_error_code)
+{
+ /// An error that indicates the system didn't find a default
+ /// layer renderer configuration.
+ cp_layer_renderer_configuration_error_code_missing_configuration = -20,
+
+ /// An error that indicates the layer doesn’t support the current
+ /// pixel format for color textures.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_color_format``
+ /// function returns and make sure it matches one of the values the
+ /// ``cp_layer_renderer_capabilities_supported_color_format`` function returns.
+ cp_layer_renderer_configuration_error_code_unsupported_color_format = -4,
+
+ /// An error that indicates the layer doesn’t support the current
+ /// texture usage for color textures.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_color_usage``
+ /// function returns and make sure it has at least `MTLTextureUsageShaderRead`
+ /// and does not contain `MTLTextureUsageShaderAtomic` or `MTLTextureUsageShaderWrite`
+ cp_layer_renderer_configuration_error_code_unsupported_color_usage = -5,
+
+ /// An error that indicates the layer doesn’t support the current
+ /// pixel format for depth textures.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_depth_format``
+ /// function returns and make sure it matches one of the values the
+ /// ``cp_layer_renderer_capabilities_supported_depth_format`` function returns.
+ cp_layer_renderer_configuration_error_code_unsupported_depth_format = -7,
+
+ /// An error that indicates the layer doesn’t support the current
+ /// texture usage for depth textures.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_depth_usage``
+ /// function returns and make sure it has at least `MTLTextureUsageShaderRead`
+ /// and does not contain `MTLTextureUsageShaderAtomic`
+ cp_layer_renderer_configuration_error_code_unsupported_depth_usage = -8,
+
+ /// An error that indicates foveation is enabled but not supported.
+ ///
+ /// Disable foveation in your layer's configuration.
+ cp_layer_renderer_configuration_error_code_variable_rasterization_rate_is_not_supported = -16,
+
+ /// An error that occurs when you try to enable temporal anti-aliasing
+ /// but the current configuration parameters don't support it.
+ cp_layer_renderer_configuration_error_code_temporal_anti_aliasing_not_supported = -17,
+
+ /// An error that indicates not enough frames are available for rendering.
+ cp_layer_renderer_configuration_error_code_not_enough_frames_requested = -10,
+
+ /// An error that indicates the system requested too many frames
+ /// for rendering.
+ cp_layer_renderer_configuration_error_code_too_many_frames_requested = -11,
+
+ /// An error that indicates the depth range values aren't in
+ /// reverse-z order.
+ ///
+ /// When you call the ``cp_drawable_set_depth_range`` function,
+ /// make sure the first value in your `depth_range` vector contains
+ /// the value for the far plane. In addition, make sure the distance
+ /// to the far plane is greater than the distance to the near plane.
+ cp_layer_renderer_configuration_error_code_unsupported_forward_depth_range = -101,
+
+ /// An error that indicates the configuration's current layout value
+ /// is invalid.
+ ///
+ /// Specify a supported layout value using the ``cp_layer_renderer_configuration_set_layout``
+ /// function. Get a list of supported layouts from the
+ /// ``cp_layer_renderer_capabilities_supported_layout`` function.
+ cp_layer_renderer_configuration_error_code_layout_not_supported = -6,
+
+ /// An error that indicates the near plane of the client is smaller
+ /// than the supported value.
+ cp_layer_renderer_configuration_error_code_unsupported_near_plane_distance = -104,
+
+ /// An error that indicates the layer doesn’t support the current
+ /// pixel format for tracking areas textures.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_tracking_areas_format``
+ /// function returns and make sure it matches one of the values the
+ /// ``cp_layer_renderer_capabilities_supported_tracking_areas_format`` function returns.
+ cp_layer_renderer_configuration_error_code_unsupported_tracking_areas_format API_AVAILABLE(visionos(26.0), macosx(26.0)) = -21,
+
+ /// An error that indicates the layer doesn’t support the current
+ /// texture usage for tracking areas textures.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_tracking_areas_usage``
+ /// function returns and make sure it has at least `MTLTextureUsageShaderRead`
+ /// and does not contain `MTLTextureUsageShaderAtomic`
+ cp_layer_renderer_configuration_error_code_unsupported_tracking_areas_usage API_AVAILABLE(visionos(26.0), macosx(26.0)) = -22,
+
+ /// An error that indicates the layer doesn't support the current
+ /// pixel format for stencil texture.
+ ///
+ /// Compare the value the ``cp_layer_renderer_configuration_get_drawable_render_context_stencil_format``
+ /// function returns and make sure it matches one of the values the
+ /// ``cp_layer_renderer_capabilities_drawable_render_context_supported_stencil_format`` function returns.
+ cp_layer_renderer_configuration_error_code_unsupported_drawable_render_context_stencil_format API_AVAILABLE(visionos(26.0), macosx(26.0)) = -23,
+
+ /// An error that indicates the configuration's render quality is unsupported.
+ /// This could be because foveation is disabled or the quality is outside of the valid range of [0, 1],
+ /// the error `userInfo` will contain additional information.
+ cp_layer_renderer_configuration_error_code_unsupported_render_quality API_AVAILABLE(visionos(26.0)) = -18,
+
+} CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0)) ;
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_error_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_types.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_types.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_types.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/cp_types.h 2025-05-25 00:23:22
@@ -0,0 +1,89 @@
+//
+// cp_types.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_types_h
+#define cp_types_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// A frame index in the layer’s timeline.
+///
+/// The layer assigns sequential indexes to the frames it provides to
+/// your app.
+typedef uint64_t cp_layer_frame_index_t CF_SWIFT_NAME(LayerFrameIndex) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// The sequential index for a frame in the compositor’s timeline.
+///
+/// During the creation of your content, the compositor creates
+/// frames for you to render your content. This type stores the
+/// index the compositor assigns to that frame. The compositor
+/// presents frames onscreen sequentially based on their indexes.
+typedef uint64_t cp_compositor_frame_index_t CF_SWIFT_NAME(CompositorFrameIndex) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// A Mach absolute time clock value.
+///
+/// Mach absolute time measures the number of ticks that have elapsed
+/// since an arbitrary point after system startup. Each value represents
+/// a unique point in time during the course of your app's execution.
+typedef struct cp_time { uint64_t cp_mach_abs_time; } API_AVAILABLE(visionos(1.0), macosx(26.0))
+CF_REFINED_FOR_SWIFT cp_time_t CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Converts a Mach absolute time value to a Core Foundation time value.
+///
+/// - Parameters:
+/// - time: The time value to convert.
+/// - Returns: The elapsed time in seconds that correspond to the specified
+/// time value.
+CFTimeInterval
+cp_time_to_cf_time_interval(cp_time_t time)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Blocks the current thread until the specified time.
+///
+/// - Parameters:
+/// - time: The Mach absolute time at which to wake up the thread.
+void cp_time_wait_until(cp_time_t time)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Axis direction convention for defining the X/Y/Z directions.
+///
+/// This can be used to define different coordinate systems such
+/// as model/view/normalized device coordinate spaces for rendering.
+///
+/// @note only defined +X = right convention as this is exclusively used
+/// by ``cp_drawable_compute_projection``
+/// which currently only supports right convention mainly due to foveated
+/// rendering rasterization rate maps using a right axis.
+typedef CF_ENUM(uint8_t, cp_axis_direction_convention) {
+ cp_axis_direction_convention_right_up_back CF_SWIFT_NAME(rightUpBack) = 0,
+ cp_axis_direction_convention_right_up_forward CF_SWIFT_NAME(rightUpForward),
+ cp_axis_direction_convention_right_down_back CF_SWIFT_NAME(rightDownBack),
+ cp_axis_direction_convention_right_down_forward CF_SWIFT_NAME(rightDownForward),
+} CF_SWIFT_NAME(AxisDirectionConvention)
+API_AVAILABLE(visionos(2.0), macosx(26.0));
+
+/// Render quality controls the quality which drawing happens at.
+///
+/// This can be used to increase the quality of what users see,
+/// however this directly impacts the memory allocated for resources
+/// which is billed to the app as well as per-frame GPU time. The app
+/// should monitor its frame rate to ensure its not regularly missing
+/// frames and will likely need to change the quality based on scene
+/// complexity that is being shown.
+///
+/// To control the memory allocated for resources
+/// @see ``cp_layer_renderer_configuration_set_max_render_quality``
+/// To control the per-frame GPU cost
+/// @see ``cp_layer_renderer_set_render_quality``
+typedef float cp_render_quality_t
+CF_TYPED_EXTENSIBLE_ENUM
+CF_SWIFT_NAME(CP_OBJECT_cp_layer_renderer.RenderQuality)
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_types_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable.h 2025-05-31 01:07:51
@@ -0,0 +1,589 @@
+//
+// drawable.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_drawable_h
+#define cp_drawable_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// The state of ownership for the drawable.
+///
+/// Use these constants to determine whether the drawable is ready
+/// for you to use. When the drawable is in the ``cp_drawable_state_rendering``
+/// state, you can begin drawing. Other states indicate the
+/// drawable is either busy or not assigned to a frame.
+typedef CF_ENUM(uint32_t, cp_drawable_state) {
+
+ /// A drawable that is not in use and ready for assignment to a frame.
+ cp_drawable_state_available = 0,
+
+ /// A drawable that is assigned to a frame and ready to accept
+ /// your drawing commands.
+ cp_drawable_state_rendering,
+
+ /// A drawable that the compositor is currently displaying onscreen.
+ cp_drawable_state_presenting
+} CF_SWIFT_NAME(cp_drawable_t.State) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// The target where the drawable will be displayed/used.
+///
+/// Use these constants to determine whether content should
+/// be drawn for certain targets.
+typedef CF_ENUM(uint32_t, cp_drawable_target) {
+
+ /// A drawable that is targeting the built-in display,
+ /// this is what a user will see in the device.
+ cp_drawable_target_built_in CF_SWIFT_NAME(builtIn) = 0,
+
+ /// A drawable that will be used for capture purposes,
+ /// this could be used for video or AirPlay streaming and
+ /// will be visible to users outside of the device.
+ cp_drawable_target_capture,
+
+} CF_SWIFT_NAME(cp_drawable_t.Target) API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// An opaque type that contains the textures and other information
+/// you need to set up your render pipeline.
+///
+/// Use the drawable type to retrieve the textures for your render pipelines,
+/// and use the drawable’s views to get details about how to render to those
+/// textures. Get the drawable for a frame using the ``cp_frame_query_drawable``
+/// function. The layer manages a limited number of reusable drawable types
+/// and recycles them after each use. Draw only one frame at a time to ensure
+/// each new frame’s drawable type is ready in time.
+CP_STRUCT_REF(cp_drawable, CP_OBJECT_NAME(cp_layer_renderer).Drawable, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the number of color and depth textures available in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The number of textures available for drawing. For example, a return
+/// value of `2` indicates there are two color textures and two depth
+/// textures available.
+///
+/// Use the returned value as the maximum number of textures to retrieve
+/// from the ``cp_drawable_get_color_texture`` or ``cp_drawable_get_depth_texture``
+/// functions.
+size_t
+cp_drawable_get_texture_count(cp_drawable_t drawable)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the number of tracking areas textures available in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The number of textures available for drawing. For example, a return
+/// value of `2` indicates there are two tracking areas textures available.
+///
+/// Use the returned value as the maximum number of textures to retrieve
+/// from the ``cp_drawable_get_tracking_areas_texture``function.
+/// This will be equal to ``cp_drawable_get_texture_count`` when tracking
+/// areas textures are enabled through the configuration otherwise will be 0.
+size_t
+cp_drawable_get_tracking_areas_texture_count(cp_drawable_t drawable)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Returns the depth texture at the specified index in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - index: The index of the depth texture you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_drawable_get_texture_count`` returns.
+/// - Returns: The Metal depth texture at the specified index.
+///
+/// Use the returned texture in your render pipeline as the depth texture
+/// for your content. The layer’s texture topology determines the layout and
+/// content for each texture. The drawable’s views contain information
+/// about how those views map to the textures.
+id<MTLTexture>
+cp_drawable_get_depth_texture(cp_drawable_t drawable, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the color texture at the specified index in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - index: The index of the color texture you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_drawable_get_texture_count`` returns.
+/// - Returns: The Metal color texture at the specified index.
+///
+/// Use the returned texture in your render pipeline to store the pixels
+/// you want to appear onscreen. The layer’s texture topology determines
+/// the layout and content for each texture. The drawable’s views contain
+/// information about how those views map to the textures.
+id<MTLTexture>
+cp_drawable_get_color_texture(cp_drawable_t drawable, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the tracking areas texture at the specified index in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - index: The index of the texture you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_drawable_get_tracking_areas_texture_count`` returns.
+/// - Returns: The Metal object index texture at the specified index.
+///
+/// Use the returned texture in your render pipeline to store the tracking areas ID
+/// used for hover effects and indirect gestures. The layer’s texture topology determines
+/// the layout and content for each texture. The drawable’s views contain
+/// information about how those views map to the textures.
+id<MTLTexture>
+cp_drawable_get_tracking_areas_texture(cp_drawable_t drawable, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+#endif
+
+/// Returns a tracking area which is create on the drawable's list of tracking areas.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - identifier: The unique identifier for the tracking area.
+/// - Returns: A tracking area that was created.
+///
+/// A tracking area describes a region of a view that interacts
+/// with the gaze/cursor.
+/// Cannot use ``cp_tracking_area_identifier_invalid`` as
+/// an identifier.
+CP_NULLABLE_STRUCT_REF
+cp_tracking_area_t
+cp_drawable_add_tracking_area(cp_drawable_t drawable,
+ cp_tracking_area_identifier identifier)
+CF_SWIFT_NAME(cp_drawable_t.addTrackingArea(self:identifier:)) API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the number of rasterization rate maps associated with the
+/// drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The number of rasterization rate maps available for drawing.
+///
+/// Use the returned value as the maximum number of rate maps to retrieve
+/// from the ``cp_drawable_get_rasterization_rate_map`` function.
+size_t
+cp_drawable_get_rasterization_rate_map_count(cp_drawable_t drawable)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+/// Returns the rasterization rate map at the specified index in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - index: The index of the rasterization rate map you want.
+/// The index must be greater than or equal to `0` and less than the value
+/// that ``cp_drawable_get_rasterization_rate_map_count`` returns.
+/// - Returns: The rasterization rate map at the specified index.
+///
+/// Apply the rasterization rate map to your render descriptor when you set
+/// up your drawing environment. A rate map defines how the GPU scales
+/// different parts of the texture to fill the screen. You use these rate
+/// maps to save time and render less important parts of your scene at lower
+/// resolutions. For example, when foveation is enabled, the drawable
+/// includes a rasterization rate map to render the portions of the texture
+/// in someone’s peripheral vision at a lower resolution.
+id<MTLRasterizationRateMap>
+cp_drawable_get_rasterization_rate_map(cp_drawable_t drawable, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the Y flipped rasterization rate map at the specified index in the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - index: The index of the rasterization rate map you want.
+/// The index must be greater than or equal to `0` and less than the value
+/// that ``cp_drawable_get_rasterization_rate_map_count`` returns.
+/// - Returns: The Y flipped rasterization rate map at the specified index.
+///
+/// This function provides a Y flipped map that is generated form the ``cp_drawable_get_rasterization_rate_map``.
+/// Flipped is defined as +Y = down for clip/normalized device coordinates (flipped from Metal).
+/// If projection matrix is needed, use ``cp_drawable_compute_projection``
+/// with a +Y = down axes convention to generate the correct matrix.
+///
+/// Can only be used for intermediary render passes, the final render pass of the
+/// drawable it cannot be flipped and must use Metal convention of +Y = up.
+///
+/// Generating a flipped rasterization rate map will bring additional computational
+/// cost to your render loop.
+///
+/// In order to generate Y flipped rasterization rate maps in your rendering session,
+/// update the ``cp_layer_renderer_configuration_t`` using the function
+/// ``cp_layer_renderer_configuration_set_generate_flipped_rasterization_rate_maps``.
+id<MTLRasterizationRateMap>
+cp_drawable_get_flipped_rasterization_rate_map(cp_drawable_t drawable, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+#endif
+
+/// Returns the number of separate views to draw for the frame.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The number of separate views to draw.
+///
+/// The number of views corresponds to the number of separate versions
+/// of your scene you create for the frame. For a device with stereoscopic
+/// video, you render two views — one for each eye. The actual number of
+/// views can vary based on the drawing environment or your app’s
+/// configuration. For example, you typically render only one view in
+/// Simulator.
+///
+/// Fetch the actual views using the ``cp_drawable_get_view`` function.
+size_t
+cp_drawable_get_view_count(cp_drawable_t drawable)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the specified view from the drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - index: The index of the view you want. The index must be
+/// greater than or equal to 0 and less than the value that
+/// ``cp_drawable_get_view_count`` returns.
+/// - Returns: The view at the specified index.
+///
+/// Each view contains information you need to render into the drawable’s
+/// textures.
+cp_view_t
+cp_drawable_get_view(cp_drawable_t drawable, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Specifies the world position and orientation to apply to the current
+/// frame.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - device_anchor: The `ar_device_anchor` that specifies the 3D rotation and translation
+/// factors you applied to your content when you rendered the frame.
+///
+/// Device anchor information tells the compositor the position and orientation
+/// you used to render your frame's content. If you specify a device anchor value,
+/// the compositor compares your value against the hardware-provided device anchor
+/// information before displaying the frame onscreen. If the device anchor values
+/// don't match, the compositor adjusts the pixels of your frame to align it
+/// with the hardware device anchor.
+///
+/// Device anchor information is particularly important on a head-mounted display
+/// because it helps your content more closely match the actual movements
+/// of someone's head. Because the actual device anchor can change between the time
+/// you encode your drawing commands and the time the frame appears onscreen,
+/// you must predict the device anchor in advance using available information. The
+/// ``cp_frame_timing_get_optimal_input_time`` function provides a good
+/// time to start the prediction for each frame. Use the
+/// ``cp_frame_timing_get_presentation_time`` function to get the presentation
+/// time for the frame.
+void
+cp_drawable_set_device_anchor(cp_drawable_t drawable, _Nullable ar_device_anchor_t device_anchor)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the predicted device anchor information you specified for the frame.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The current device anchor for the frame, or ``null``
+/// if you didn't specify a device anchor.
+_Nullable ar_device_anchor_t
+cp_drawable_get_device_anchor(cp_drawable_t drawable)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#endif /* __OBJC__ */
+
+/// Returns the distances to the far and near clipping planes you
+/// use during drawing.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The distances to the far and near planes in meters.
+/// The compositor returns values in reverse-z ordering, with the
+/// value for the far plane in the vector’s `x` property and the
+/// value for the near plane in the vector’s `y` property.
+///
+/// Use this function to get the near and far planes for the specified
+/// drawable. These planes are the distances from the person viewing
+/// the content. The compositor uses these values to compute the
+/// perspective projection matrix and to clip content that is not
+/// between the near and far planes.
+simd_float2
+cp_drawable_get_depth_range(cp_drawable_t drawable)
+CF_SWIFT_NAME(getter:cp_drawable_t.depthRange(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Sets the distances to the near and far clipping planes for the
+/// current drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - depth_range: The distances to the far and near planes in meters.
+/// Specify the values in reverse-z ordering, with the value for the
+/// far plane in the vector’s `x` property and the value for the near
+/// plane in the vector’s `y` property.
+///
+/// Use this function to change the depth range for this frame of content.
+/// The near and far planes correspond to distances from the person viewing
+/// the content. The compositor uses these values to compute the perspective
+/// projection matrix and to clip content that is not between the near and far
+/// planes. It only supports reverse-Z depth, which means the value in the
+/// texture should be 1 for near 0 for far.
+///
+/// After setting depth range for the drawable, the projection matrix will
+/// need to be requeried, see ``cp_drawable_compute_projection``
+///
+/// Configure the default depth range for all frames in your layer using the
+/// ``cp_layer_renderer_configuration_set_default_depth_range`` function.
+void
+cp_drawable_set_depth_range(cp_drawable_t drawable, simd_float2 depth_range)
+CF_SWIFT_NAME(setter:cp_drawable_t.depthRange(self:depthRange:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Encodes a notification event to the specified command buffer to present
+/// the drawable’s content onscreen.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - command_buffer: The command buffer you used to encode your
+/// frame’s content. If the command buffer is already committed,
+/// this function aborts your app with an error.
+///
+/// - Note: Commit the command buffer after calling present.
+///
+/// Call this function as the last step before committing the specified
+/// command buffer. Specifically, call it after you finish encoding all
+/// the work required to render the frame, and immediately before you
+/// call the command buffer’s <doc://com.apple.documentation/documentation/metal/mtlcommandbuffer/1443003-commit>
+/// method. The function adds a presentation event to the buffer that
+/// causes the compositor to display your frame.
+void
+cp_drawable_encode_present(cp_drawable_t drawable,
+ id<MTLCommandBuffer> command_buffer)
+CF_SWIFT_NAME(cp_drawable_t.encodePresent(self:commandBuffer:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#if CP_MTL4_AVAILABLE
+/// Encodes a notification event to the specified command buffer to present
+/// the drawable’s content onscreen.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+///
+/// - Note: Commit the command buffer to the layer queue before calling present.
+///
+/// Call this function as the last step before committing the specified
+/// command buffer. Specifically, call it after you finish encoding all
+/// the work required to render the frame, and immediately before you
+/// call the command buffer’s <doc://com.apple.documentation/documentation/metal/mtlcommandbuffer/1443003-commit>
+/// method. The function adds a presentation event to the buffer that
+/// causes the compositor to display your frame.
+void
+cp_drawable_mtl4_encode_present(cp_drawable_t drawable)
+CF_SWIFT_NAME(cp_drawable_t.encodePresent(self:)) API_AVAILABLE(visionos(26.0), macosx(26.0));
+#endif
+
+#endif
+
+/// Returns a value that indicates the current operational state
+/// of the drawable type.
+///
+/// - Parameters: The drawable to check.
+/// - Returns: ``cp_drawable_state/cp_drawable_state_rendering`` if the
+/// drawable type is ready for you to draw your content, or any other value if
+/// the compositor currently owns the drawable.
+///
+/// Compositor reuses the underlying data structures associated with
+/// drawable types, and the state of the drawable indicates whether
+/// it's ready for you to use. Perform your drawing operations only
+/// when the drawable is in the ``cp_drawable_state/cp_drawable_state_rendering`` state.
+enum cp_drawable_state
+cp_drawable_get_state(cp_drawable_t drawable)
+CF_SWIFT_NAME(getter:cp_drawable_t.state(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns a value that indicates the target of the drawable type.
+///
+/// - Parameters: The drawable to check.
+/// - Returns: ``cp_drawable_target/cp_drawable_target_built_in`` if the
+/// drawable will be displayed for the user in the device, or any other value if the drawable
+/// maybe used for other purposes.
+///
+/// When drawing for the drawable this can be used to alter
+/// what is rendered for different targets.
+/// Renderer should always prioritize ``cp_drawable_target/cp_drawable_target_built_in``
+/// target type.
+cp_drawable_target
+cp_drawable_get_target(cp_drawable_t drawable)
+CF_SWIFT_NAME(getter:cp_drawable_t.target(self:)) API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the index of the frame of content for you to produce.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The presentation index of the frame.
+///
+/// When your compositor scene becomes visible, you start drawing
+/// frames of content. The compositor assigns a sequential index to
+/// each frame to indicate its position in the final output. You can
+/// use these indexes to differentiate frames during drawing or predict
+/// future frame indexes. For example, you might start playback of an
+/// audio file when a specific frame appears onscreen.
+cp_compositor_frame_index_t
+cp_drawable_get_presentation_frame_index(cp_drawable_t drawable)
+CF_SWIFT_NAME(getter:cp_drawable_t.presentationFrameIndex(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the timing information for the frame of the specified drawable.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: The timing information for the drawable’s associated frame.
+///
+/// Pass the returned type to the ``cp_frame_timing_get_optimal_input_time``
+/// function to determine when to start the encoding process for a frame.
+/// Pass it to other functions to determine other time-related deadlines.
+cp_frame_timing_t
+cp_drawable_get_frame_timing(cp_drawable_t drawable)
+CF_SWIFT_NAME(getter:cp_drawable_t.frameTiming(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the perspective projection matrix to be used for rendering.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - normalized_device_coordinates_convension: The
+/// normalized device coordinate axes convention used.
+/// - view_index: The index of the view you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_drawable_get_view_count`` returns.
+/// - Returns: A perspective projection matrix that transforms coordinates
+/// from view coordinate space to clip space.
+///
+/// To update depth range used for the projection matrix, see
+/// ``cp_drawable_set_depth_range``. Should be called
+/// prior to computing the projection matrix.
+///
+/// The convention is defined in normalized device coordinates, which impact
+/// the rendering direction of rendering but have no impact on the convention
+/// used for model/view space. To convert from view space to the axis direction convention
+/// used by the projection matrix, a rotation/mirror matrix can be applied pre-projection matrix.
+///
+/// The axes are defined as:
+/// • X axes determines the horizontal direction of pixels -- right convention means the left-most pixel is the left of the view
+/// • Y axes determines the vertical direction of pixels -- up convention means the top-most pixel is the top of the view
+/// • Z axes determines the handedness/winding order -- depth should still be written in reverse-Z for best precision
+/// The default convention is ``cp_axis_direction_convention_right_up_back``
+/// for CompositorServices and Metal renderers which has a counter-clockwise winding order.
+///
+/// Final render pass must be done using ``cp_axis_direction_convention_right_up_back``
+/// or ``cp_axis_direction_convention_right_up_forward`` depending on the renderer
+/// winding order convention.
+/// Only intermediate passes can be done using different coordinate systems.
+///
+/// For foveated renderers using +Y = down convention, will need to use the flipped version of
+/// the rasterization rate maps, see ``cp_drawable_get_flipped_rasterization_rate_map``
+simd_float4x4
+cp_drawable_compute_projection(cp_drawable_t drawable,
+ cp_axis_direction_convention normalized_device_coordinates_convension,
+ size_t view_index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(2.0), macosx(26.0));
+
+/// Returns whether content capture is protected and it is safe to
+/// draw content that should be protected from capture.
+///
+/// - Parameters:
+/// - drawable: The drawable for a frame.
+/// - Returns: Whether it is safe to draw content that is for built-in
+/// display only. When this value is true, any capture of content
+/// being displayed on the built-in display will be obscured by the
+/// system. If false, it cannot be assumed that content will not
+/// be seen by users outside of the device, both live and recorded.
+///
+/// Use this function to ensure that drawing that is only meant for
+/// eyes in the device is not drawn when false.
+/// Only adopt if app has adopted SwiftUI `activatesContentCaptureProtected`
+/// scene modifier and drawing will have content that is not desired
+/// to meant to be captured.
+/// For ``cp_drawable_target_capture`` this will
+/// always return false as it is upto the renderer to handle drawing
+/// content that will be captured beyond the built-in displays.
+bool
+cp_drawable_is_content_capture_protected(cp_drawable_t drawable)
+CF_SWIFT_NAME(getter:cp_drawable_t.isContentCaptureProtected(self:))
+API_AVAILABLE(visionos(26.0))
+API_UNAVAILABLE(macosx, ios);
+
+#ifdef __OBJC__
+
+/// Adds a render context to a drawable.
+/// This object will draw any content that the compositor needs to render
+/// in the application.
+/// - Note: The render context can only be used when the layer renderer is using layered layout
+/// or in platforms that only render one view (ex: simulator)
+///
+/// - Note: The render context makes use of the device_anchor set in
+/// ``cp_drawable_set_device_anchor`` the device_anchor should be set in the
+/// drawable before calling ``cp_drawable_add_render_context``.
+cp_drawable_render_context_t
+cp_drawable_add_render_context(cp_drawable_t drawable, id<MTLCommandBuffer> cmd_buffer)
+CF_SWIFT_NAME(cp_drawable_t.addRenderContext(self:commandBuffer:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#if CP_MTL4_AVAILABLE
+/// Adds a render context to a drawable.
+/// This object will draw any content that the compositor needs to render
+/// in the application.
+/// - Note: The render context can only be used when the layer renderer is using layered layout
+/// or in platforms that only render one view (ex: simulator)
+///
+/// - Note: The render context makes use of the device_anchor set in
+/// ``cp_drawable_set_device_anchor`` the device_anchor should be set in the
+/// drawable before calling ``cp_drawable_add_render_context``.
+cp_drawable_render_context_t
+cp_drawable_add_mtl4_render_context(cp_drawable_t drawable)
+CF_SWIFT_NAME(cp_drawable_t.addRenderContext(self:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+#endif
+
+#endif
+
+/*
+ * MARK: - cp_drawable_array
+ */
+
+/// An opaque type that contains the drawable types and other information
+/// you need to set up your render pipeline.
+///
+/// See ``cp_drawable_t`` for more information about drawables.
+CP_STRUCT_REF(cp_drawable_array, API_AVAILABLE(visionos(26.0), macosx(26.0)));
+
+/// Returns the drawable at the specified index in the array.
+///
+/// - Parameters:
+/// - drawable_array: The drawable array for a frame.
+/// - index: The index of the drawable you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_drawable_array_get_count`` returns.
+/// - Returns: The drawable available for drawing at the specified index.
+///
+/// The ``cp_drawable_t`` type contains the textures and other
+/// information you need to set up your render descriptor in Metal.
+cp_drawable_t
+cp_drawable_array_get_drawable(cp_drawable_array_t drawable_array, size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the number of drawables in the array.
+///
+/// - Parameters:
+/// - drawable_array: The drawable array for a frame.
+/// - Returns: The number of drawables available for drawing. For example, a return
+/// value of `2` indicates there are two drawables for this frame.
+///
+/// Use the returned value as the maximum number of textures to retrieve
+/// from the ``cp_drawable_array_get_drawable`` functions.
+size_t
+cp_drawable_array_get_count(cp_drawable_array_t drawable_array)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_drawable_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable_render_context.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable_render_context.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable_render_context.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/drawable_render_context.h 2025-05-31 01:07:51
@@ -0,0 +1,144 @@
+//
+// drawable_render_context.h
+// CompositorServices
+//
+// Copyright © 2024 Apple. All rights reserved.
+//
+
+#ifndef drawable_render_context_h
+#define drawable_render_context_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// An object that can render any effects associated with a drawable
+/// This is required for applications that want to render using the
+/// Progressive Immersion Style
+CP_STRUCT_REF(cp_drawable_render_context, cp_drawable_t.RenderContext, API_AVAILABLE(visionos(26.0), macosx(26.0)));
+
+#ifdef __OBJC__
+
+/// Store the `value` parameter in the stencil texture in the pixels that Compositor
+/// will display on the screen.
+///
+/// - Parameters:
+/// - render_context: The render context to use to present the drawable.
+/// - command_encoder: The command encoder to use to render the Compositor effects
+/// and present the drawable.
+/// - value: The value to use when updating the stencil texture in the command_encoder.
+///
+/// - Note: In Full and Mixed immersion style, this will be the full texture.
+///
+/// - Note: The command encoder used in the render context has the following constraints:
+/// - stencil texture: should have the same pixel format as
+/// ``cp_layer_renderer_configuration_get_drawable_render_context_stencil_format``
+/// - renderTargetArrayLength: should be the same as the number of views
+/// in the drawable.
+/// - rasterizationRateMap: should be the one provided by the drawable.
+/// - layer renderer layout: Dedicated and Shared layout is not supported.
+/// - supportColorAttachmentMapping: The render pass descriptor used to create the render encoder should
+/// have ``supportColorAttachmentMapping`` set to true.
+///
+/// - Note: This function will modify the depth stencil state, the viewports, the vertex amplification count
+/// and some of the texture bindings in the render command encoder passed to the function.
+/// Make sure to set those values again to the ones expected in your application.
+void
+cp_drawable_render_context_draw_mask_on_stencil_attachment(cp_drawable_render_context_t render_context,
+ id<MTLRenderCommandEncoder> command_encoder,
+ uint8_t value)
+CF_SWIFT_NAME(cp_drawable_render_context_t.drawMaskOnStencilAttachment(self:commandEncoder:value:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Finish encoding the render context.
+///
+/// - Parameters:
+/// - render_context: The render context to use to present the drawable.
+/// - command_encoder: The command encoder to use to render the Compositor effects
+/// and present the drawable.
+///
+/// - Note: The ownership of the command encoder is passed to the drawable render context, which will
+/// call endEncoding on the command encoder.
+///
+/// - Note: The command encoder used in the render context has the following constraints:
+/// - color texture: colorAttachment[0] should contain the color texture
+/// provided by the drawable.
+/// - depth texture: depthAttachment should contain the depth texture provided
+/// by the drawable.
+/// - renderTargetArrayLength: should be the same as the number of views
+/// in the drawable.
+/// - rasterizationRateMap: should be the one provided by the drawable.
+/// - layer renderer layout: Dedicated and Shared layout is not supported.
+/// - supportColorAttachmentMapping: The render pass descriptor used to create the render encoder should
+/// have ``supportColorAttachmentMapping`` set to true.
+void
+cp_drawable_render_context_end_encoding(cp_drawable_render_context_t render_context,
+ id<MTLRenderCommandEncoder> command_encoder)
+CF_SWIFT_NAME(cp_drawable_render_context_t.endEncoding(self:commandEncoder:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#if CP_MTL4_AVAILABLE
+
+/// Store the `value` parameter in the stencil texture in the pixels that Compositor
+/// will display on the screen.
+///
+/// - Parameters:
+/// - render_context: The render context to use to present the drawable.
+/// - command_encoder: The command encoder to use to render the Compositor effects
+/// and present the drawable.
+/// - value: The value to use when updating the stencil texture in the command_encoder.
+///
+/// - Note: In Full and Mixed immersion style, this will be the full texture.
+///
+/// - Note: The command encoder used in the render context has the following constraints:
+/// - stencil texture: should have the same pixel format as
+/// ``cp_layer_renderer_configuration_get_drawable_render_context_stencil_format``
+/// - renderTargetArrayLength: should be the same as the number of views
+/// in the drawable.
+/// - rasterizationRateMap: should be the one provided by the drawable.
+/// - layer renderer layout: Dedicated and Shared layout is not supported.
+/// - supportColorAttachmentMapping: The render pass descriptor used to create the render encoder should
+/// have ``supportColorAttachmentMapping`` set to true.
+///
+/// - Note: This function will modify the depth stencil state, the viewports, the vertex amplification count
+/// and some of the texture bindings in the render command encoder passed to the function.
+/// Make sure to set those values again to the ones expected in your application.
+void
+cp_drawable_render_context_mtl4_draw_mask_on_stencil_attachment(cp_drawable_render_context_t render_context,
+ id<MTL4RenderCommandEncoder> command_encoder,
+ uint8_t value)
+CF_SWIFT_NAME(cp_drawable_render_context_t.drawMaskOnStencilAttachment(self:commandEncoder:value:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Finish encoding the render context.
+///
+/// - Parameters:
+/// - render_context: The render context to use to present the drawable.
+/// - command_encoder: The command encoder to use to render the Compositor effects
+/// and present the drawable.
+///
+/// - Note: The ownership of the command encoder is passed to the drawable render context, which will
+/// call endEncoding on the command encoder.
+///
+/// - Note: The command encoder used in the render context has the following constraints:
+/// - color texture: colorAttachment[0] should contain the color texture
+/// provided by the drawable.
+/// - depth texture: depthAttachment should contain the depth texture provided
+/// by the drawable.
+/// - renderTargetArrayLength: should be the same as the number of views
+/// in the drawable.
+/// - rasterizationRateMap: should be the one provided by the drawable.
+/// - layer renderer layout: Dedicated and Shared layout is not supported.
+/// - supportColorAttachmentMapping: The render pass descriptor used to create the render encoder should
+/// have ``supportColorAttachmentMapping`` set to true.
+void
+cp_drawable_render_context_mtl4_end_encoding(cp_drawable_render_context_t render_context,
+ id<MTL4RenderCommandEncoder> command_encoder)
+CF_SWIFT_NAME(cp_drawable_render_context_t.endEncoding(self:commandEncoder:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#endif
+
+#endif
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* drawable_render_context_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame.h 2025-05-31 01:33:30
@@ -0,0 +1,424 @@
+//
+// frame.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_frame_h
+#define cp_frame_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// An opaque type that provides access to the timing information and
+/// data types you need to render a single frame of content.
+///
+/// During each cycle of your app’s rendering loop, retrieve a frame
+/// using the ``cp_layer_renderer_query_next_frame`` function and use it to
+/// render your app’s content. The ``cp_frame_t`` type provides access
+/// to the information you need to render your frame in a timely manner.
+/// It also provides access to the ``cp_drawable_t`` type you use to
+/// retrieve the textures you need for drawing.
+///
+/// Separate the work you do for each frame into two phases: the update
+/// phase and the encode phase. Use the update phase to perform app-specific
+/// tasks, such as processing interactions with your content. Use the
+/// encode phase to commit the Metal commands you need to draw your
+/// content for the current pose. For both phases, use frame functions
+/// to notify the Compositor when you start and stop the related work.
+/// For example, surround update work with calls to the
+/// ``cp_frame_start_update`` and ``cp_frame_end_update``
+/// functions.
+CP_STRUCT_REF(cp_frame, CP_OBJECT_NAME(cp_layer_renderer).Frame, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the sequential index number of the specified frame.
+///
+/// - Parameters:
+/// - frame: The frame to query.
+/// - Returns: The sequential index of the frame, which is always a
+/// positive integer.
+///
+/// The layer assigns a unique index number to each frame, starting at
+/// the first frame and incrementing the index by 1 for each new frame.
+cp_layer_frame_index_t
+cp_frame_get_frame_index(cp_frame_t frame)
+CF_SWIFT_NAME(getter:cp_frame_t.frameIndex(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Computes and returns the predicted timing information for the specified frame.
+///
+/// - Parameters:
+/// - frame: The frame you're preparing to draw.
+/// - Returns: The predicted timing information for the specified frame, or `NULL`
+/// if the layer is in the ``cp_layer_renderer/cp_layer_renderer_state_paused`` or
+/// ``cp_layer_renderer/cp_layer_renderer_state_invalidated`` state.
+///
+/// Use the returned timing information in any functions that return
+/// frame-related deadlines. For example, pass the timing information
+/// to the ``cp_frame_timing_get_optimal_input_time`` function to
+/// determine when to start encoding the frame. This function updates
+/// the frame-specific timing information using the latest data from
+/// the compositor before it returns it.
+///
+/// Don’t call this function after you call ``cp_frame_query_drawable``
+/// for the specified frame. If you need the timing information after you
+/// retrieve the frame's ``cp_drawable_t`` type, save the return value
+/// of this function, or call ``cp_drawable_get_frame_timing`` to get
+/// the information from the drawable instead.
+CP_NULLABLE_STRUCT_REF
+cp_frame_timing_t
+cp_frame_predict_timing(cp_frame_t frame)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the drawable type you use to retrieve the textures and
+/// drawing environment for the frame.
+///
+/// - Parameters:
+/// - frame: The frame to query.
+/// - Returns: The drawable type, or `NULL` if the layer is in the
+/// ``cp_layer_renderer/cp_layer_renderer_state_paused`` or
+/// ``cp_layer_renderer/cp_layer_renderer_state_invalidated`` state.
+///
+/// Call this function when you're ready to encode the drawing commands
+/// for the frame. The ``cp_drawable_t`` type contains the textures and
+/// other information you need to set up your render descriptor in Metal.
+///
+/// Note: This function isn't safe to be called concurrently. Always ensure a
+/// single thread call this function at a time.
+CP_NULLABLE_STRUCT_REF
+cp_drawable_t
+cp_frame_query_drawable(cp_frame_t frame)
+API_DEPRECATED("Use cp_frame_query_drawables instead", visionos(1.0, 26.0))
+API_UNAVAILABLE(macosx, ios)
+CF_REFINED_FOR_SWIFT;
+
+/// Returns the drawable array type you use to retrieve the drawables for
+/// drawing environment for the frame.
+///
+/// - Parameters:
+/// - frame: The frame to query.
+/// - Returns: The drawable array type, if the layer is in the
+/// ``cp_layer_renderer/cp_layer_renderer_state_paused`` or
+/// ``cp_layer_renderer/cp_layer_renderer_state_invalidated`` states
+/// the array will have a count of 0 and frame is invalid.
+///
+/// Call this function when you're ready to encode the drawing commands
+/// for the frame. The ``cp_drawable_t`` type contains the textures and
+/// other information you need to set up your render descriptor in Metal.
+/// See ``cp_drawable_get_target`` for how each drawable will be used.
+///
+/// If array count is 0, the frame has been cancelled as there are no drawables
+/// to draw to and the frame should be discarded and is invalid to access.
+///
+/// Note: This function isn't safe to be called concurrently. Always ensure a
+/// single thread call this function at a time.
+cp_drawable_array_t
+cp_frame_query_drawables(cp_frame_t frame)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Notifies the compositor that you started updating the app-specific
+/// content you need to render the frame.
+///
+/// - Parameters:
+/// - frame: The frame you are ready to prepare.
+///
+/// This function helps you optimize your app’s rendering efficiency.
+/// Before you render a frame, you might need to respond to
+/// interactions and update your app's data structures before you can
+/// render items in your scene. Call this function immediately
+/// before you start that work, and call the ``cp_frame_end_update``
+/// function as soon as you finish. The compositor uses the time difference
+/// to improve its predictions for when to start the frame encoding process.
+///
+/// Move as much work as possible into the update phase to minimize encoding
+/// time. Don't do any work that relies on the current pose information during
+/// the update phase. Instead, make any pose-related changes during the
+/// encoding phase.
+void
+cp_frame_start_update(cp_frame_t frame)
+CF_SWIFT_NAME(cp_frame_t.startUpdate(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Notifies the compositor that you finished updating the app-specific
+/// content you need to render the frame.
+///
+/// - Parameters:
+/// - frame: The frame you finished preparing.
+///
+/// This function helps you optimize your app’s rendering efficiency.
+/// Before you render a frame, you might need to respond to
+/// interactions and update your app's data structures before you can
+/// render items in your scene. Call the ``cp_frame_start_update``
+/// function immediately before you start that work, and call this function
+/// as soon as you finish. Compositor uses the frame update time to improve
+/// its predictions for when to start the frame encoding process.
+///
+/// Move as much work as possible into the update phase to minimize encoding
+/// time. Don't do any work that relies on the current pose information during
+/// the update phase. Instead, make any pose-related changes during the
+/// encoding phase.
+void
+cp_frame_end_update(cp_frame_t frame)
+CF_SWIFT_NAME(cp_frame_t.endUpdate(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Notifies the compositor that you're ready to generate the
+/// GPU commands to render the specified frame.
+///
+/// - Parameters:
+/// - frame: The frame you're ready to encode and send to the GPU.
+///
+/// This function helps you optimize your app’s rendering efficiency.
+/// Call this function function before you start any of the GPU work that depends
+/// on the input data. Call the ``cp_frame_end_submission`` function after
+/// you finish your drawing commands and are ready to commit the frame to
+/// the GPU. Compositor uses the time difference to improve its predictions
+/// for when to start the frame submission process. Those predictions help
+/// you schedule the encoding process at a more optimal time for the
+/// system.
+void
+cp_frame_start_submission(cp_frame_t frame)
+CF_SWIFT_NAME(cp_frame_t.startSubmission(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Notifies the compositor that you finished generating the GPU
+/// commands to render the specified frame.
+///
+/// - Parameters:
+/// - frame: The frame you're ready to submit to the GPU.
+///
+/// This function helps you optimize your app’s rendering efficiency.
+/// Call the ``cp_frame_start_submission`` function before you start any of the GPU
+/// work that depends on the input data. Call this function after
+/// you finish your drawing commands and are ready to commit the frame to
+/// the GPU. Compositor uses the time difference to improve its predictions
+/// for when to start the frame submission process. Those predictions help
+/// you schedule the encoding process at a more optimal time for the
+/// system.
+void
+cp_frame_end_submission(cp_frame_t frame)
+CF_SWIFT_NAME(cp_frame_t.endSubmission(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the transform which can be used for monocular frustum culling. A matrix to convert
+/// between the device coordinate space to normalized device coordinate space.
+/// This should be acquired after query frame via ``cp_layer_renderer_query_next_frame`` and
+/// before calling into ``cp_frame_end_submission``. Renderer should not utilize this transform for actual rendering output.
+///
+/// - Parameters:
+/// - frame: frame: The frame you finished preparing.
+/// - drawable_target: whether this is intended for `built_in` or `recorder`drawable
+/// - normalized_device_coordinates_convension: The
+/// normalized device coordinate axes convention used.
+/// - view_index: The index of the view you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_frame_get_drawable_target_view_count`` returns.
+/// - increase_tangents: The requested increased tangents
+/// for computing the projection transform. Values should be positive.
+/// - depth_range: The requested depth range
+/// for computing the projection transform. The range should be bigger than the one used for rendering
+/// - Returns: A perspective projection matrix that transforms coordinates
+/// from view coordinate space to clip space.
+///
+/// The convention is defined in normalized device coordinates, which impact
+/// the rendering direction of rendering but have no impact on the convention
+/// used for model/view space. To convert from view space to the axis direction convention
+/// used by the projection matrix, a rotation/mirror matrix can be applied pre-projection matrix.
+///
+/// The axes are defined as:
+/// • X axes determines the horizontal direction of pixels -- right convention means the left-most pixel is the left of the view
+/// • Y axes determines the vertical direction of pixels -- up convention means the top-most pixel is the top of the view
+/// • Z axes determines the handedness/winding order
+/// The default convention is ``cp_axis_direction_convention_right_up_back``
+/// for CompositorServices and Metal renderers which has a counter-clockwise winding order.
+///
+/// To avoid false positives during culling, transform should have broader tangents and depth range compared to one
+/// will be used for rendering. As the the time performing culling becomes more distant from `presentation time`,
+/// renderer should request for wider tangents/depth.
+simd_float4x4
+cp_frame_monocular_frustum_matrix_for_drawable_target(cp_frame_t frame,
+ cp_drawable_target drawable_target,
+ cp_axis_direction_convention normalized_device_coordinates_convension,
+ size_t view_index,
+ simd_float4 increase_tangents,
+ simd_float2 depth_range)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the transform which can be used for binocular frustum culling. A matrix to convert
+/// between the device coordinate space to normalized device coordinate space.
+/// This should be acquired after query frame via ``cp_layer_renderer_query_next_frame`` and
+/// before calling into ``cp_frame_end_submission``. Renderer should not utilize this transform for actual rendering output.
+///
+/// @code
+/// /
+/// /
+/// / Monocular eye
+/// /------
+/// Binocular /
+/// eye |
+/// \ ╱
+/// \ ╱
+/// \ ╱
+/// \ Monocular eye
+/// ╲
+/// ╲
+/// ╲
+///@endcode
+///
+/// - Parameters:
+/// - frame: frame: The frame you finished preparing.
+/// - drawable_target: whether this is intended for `built_in` or `recorder`drawable
+/// - normalized_device_coordinates_convension: The
+/// normalized device coordinate axes convention used.
+/// - increase_tangents: The requested increased tangents
+/// for computing the projection transform. Values should be positive.
+/// - depth_range: The requested depth range
+/// for computing the projection transform. The range should be bigger than the one used for rendering
+/// - Returns: A transform which combines perspective projection matrix that transforms coordinates
+/// from view coordinate space to clip space and a view matrix which brings device coordinate space to binocular camera space
+///
+/// The convention is defined in normalized device coordinates, which impact
+/// the rendering direction of rendering but have no impact on the convention
+/// used for model/view space. To convert from view space to the axis direction convention
+/// used by the projection matrix, a rotation/mirror matrix can be applied pre-projection matrix.
+///
+/// The axes are defined as:
+/// • X axes determines the horizontal direction of pixels -- right convention means the left-most pixel is the left of the view
+/// • Y axes determines the vertical direction of pixels -- up convention means the top-most pixel is the top of the view
+/// • Z axes determines the handedness/winding order
+/// The default convention is ``cp_axis_direction_convention_right_up_back``
+/// for CompositorServices and Metal renderers which has a counter-clockwise winding order.
+///
+/// It computes corresponding binocular view relative to views, for defined transforms and projection matrix.
+///
+/// To avoid false positives during culling, transform should have broader tangents and depth range compared to one
+/// will be used for rendering. As the the time performing culling becomes more distant from `presentation time`,
+/// renderer should request for wider tangents/depth.
+///
+/// ``cp_frame_get_drawable_target_view_count`` for given target should be more than 1 view.
+simd_float4x4
+cp_frame_binocular_frustum_matrix_for_drawable_target(cp_frame_t frame,
+ cp_drawable_target drawable_target,
+ cp_axis_direction_convention convention,
+ simd_float4 increase_tangents,
+ simd_float2 depth_range)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the number of view in the drawable target.
+///
+/// - Parameters:
+/// - frame: frame: The frame you finished preparing.
+/// - drawable_target: whether this is intended for `built_in` or `recorder`drawable
+/// - Returns: The number of views available for drawing. For example, a return
+/// value of `2` indicates there are two views for this target drawable in this frame.
+/// value of `0` indicates there is no view available for this target drawable in this frame.
+///
+/// Use the returned value as the maximum number of views to retrieve
+/// from the ``cp_frame_binocular_frustum_matrix_for_drawable_target``
+/// or ``cp_frame_monocular_frustum_matrix_for_drawable_target`` functions.
+size_t
+cp_frame_get_drawable_target_view_count(cp_frame_t frame,
+ cp_drawable_target drawable_target)
+CF_SWIFT_NAME(cp_frame_t.drawableTargetViewCount(self:target:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the transform which can be used for monocular frustum culling. A matrix to convert
+/// between the device coordinate space to normalized device coordinate space.
+/// This should be acquired after query frame via ``cp_layer_renderer_query_next_frame`` and
+/// before calling into ``cp_frame_end_submission``. Renderer should not utilize this transform for actual rendering output.
+///
+/// - Parameters:
+/// - frame: frame: The frame you finished preparing.
+/// - normalized_device_coordinates_convension: The
+/// normalized device coordinate axes convention used.
+/// - view_index: The index of the view you want. The index must
+/// be greater than or equal to `0` and less than the value that
+/// ``cp_layer_renderer_properties_get_view_count`` returns.
+/// - increase_tangents: The requested increased tangents
+/// for computing the projection transform. Values should be positive.
+/// - depth_range: The requested depth range
+/// for computing the projection transform. The range should be bigger than the one used for rendering
+/// - Returns: A perspective projection matrix that transforms coordinates
+/// from view coordinate space to clip space.
+///
+/// The convention is defined in normalized device coordinates, which impact
+/// the rendering direction of rendering but have no impact on the convention
+/// used for model/view space. To convert from view space to the axis direction convention
+/// used by the projection matrix, a rotation/mirror matrix can be applied pre-projection matrix.
+///
+/// The axes are defined as:
+/// • X axes determines the horizontal direction of pixels -- right convention means the left-most pixel is the left of the view
+/// • Y axes determines the vertical direction of pixels -- up convention means the top-most pixel is the top of the view
+/// • Z axes determines the handedness/winding order
+/// The default convention is ``cp_axis_direction_convention_right_up_back``
+/// for CompositorServices and Metal renderers which has a counter-clockwise winding order.
+///
+/// To avoid false positives during culling, transform should have broader tangents and depth range compared to one
+/// will be used for rendering. As the the time performing culling becomes more distant from `presentation time`,
+/// renderer should request for wider tangents/depth.
+simd_float4x4
+cp_frame_monocular_frustum_matrix(cp_frame_t frame,
+ cp_axis_direction_convention normalized_device_coordinates_convension,
+ size_t view_index,
+ simd_float4 increase_tangents,
+ simd_float2 depth_range)
+CF_REFINED_FOR_SWIFT
+API_DEPRECATED("Use cp_frame_monocular_frustum_matrix_for_drawable_target with drawable target instead", visionos(2.0, 26.0));
+
+/// Returns the transform which can be used for binocular frustum culling. A matrix to convert
+/// between the device coordinate space to normalized device coordinate space.
+/// This should be acquired after query frame via ``cp_layer_renderer_query_next_frame`` and
+/// before calling into ``cp_frame_end_submission``. Renderer should not utilize this transform for actual rendering output.
+///
+/// @code
+/// /
+/// /
+/// / Monocular eye
+/// /------
+/// Binocular /
+/// eye |
+/// \ ╱
+/// \ ╱
+/// \ ╱
+/// \ Monocular eye
+/// ╲
+/// ╲
+/// ╲
+///@endcode
+///
+/// - Parameters:
+/// - frame: frame: The frame you finished preparing.
+/// - normalized_device_coordinates_convension: The
+/// normalized device coordinate axes convention used.
+/// - increase_tangents: The requested increased tangents
+/// for computing the projection transform. Values should be positive.
+/// - depth_range: The requested depth range
+/// for computing the projection transform. The range should be bigger than the one used for rendering
+/// - Returns: A transform which combines perspective projection matrix that transforms coordinates
+/// from view coordinate space to clip space and a view matrix which brings device coordinate space to binocular camera space
+///
+/// The convention is defined in normalized device coordinates, which impact
+/// the rendering direction of rendering but have no impact on the convention
+/// used for model/view space. To convert from view space to the axis direction convention
+/// used by the projection matrix, a rotation/mirror matrix can be applied pre-projection matrix.
+///
+/// The axes are defined as:
+/// • X axes determines the horizontal direction of pixels -- right convention means the left-most pixel is the left of the view
+/// • Y axes determines the vertical direction of pixels -- up convention means the top-most pixel is the top of the view
+/// • Z axes determines the handedness/winding order
+/// The default convention is ``cp_axis_direction_convention_right_up_back``
+/// for CompositorServices and Metal renderers which has a counter-clockwise winding order.
+///
+/// It computes corresponding binocular view relative to views, for defined transforms and projection matrix.
+///
+/// To avoid false positives during culling, transform should have broader tangents and depth range compared to one
+/// will be used for rendering. As the the time performing culling becomes more distant from `presentation time`,
+/// renderer should request for wider tangents/depth.
+simd_float4x4
+cp_frame_binocular_frustum_matrix(cp_frame_t frame,
+ cp_axis_direction_convention convention,
+ simd_float4 increase_tangents,
+ simd_float2 depth_range)
+CF_REFINED_FOR_SWIFT
+API_DEPRECATED("Use cp_frame_binocular_frustum_matrix_for_drawable_target with drawable target instead", visionos(2.0, 26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_frame_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame_timing.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame_timing.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame_timing.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/frame_timing.h 2025-05-31 01:33:30
@@ -0,0 +1,101 @@
+//
+// frame_timing.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_frame_timing_h
+#define cp_frame_timing_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// An opaque type that stores information about a frame’s
+/// encoding, rendering, and presentation deadlines.
+///
+/// Before you start drawing, call the ``cp_frame_predict_timing``
+/// function to update and retrieve the frame’s timing information.
+/// After you access the frame’s ``cp_drawable_t`` type, get the
+/// timing information using the ``cp_drawable_get_frame_timing`` function.
+CP_STRUCT_REF(cp_frame_timing, cp_frame_t.Timing, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the optimal time to query the input for a frame.
+///
+/// - Parameters:
+/// - timing_information: The frame’s timing information. Fetch this
+/// information using the ``cp_frame_predict_timing`` function. If
+/// you already called that function once for the frame, you can call
+/// the ``cp_drawable_get_frame_timing`` function to get the information
+/// instead.
+/// - Returns: The Mach absolute time at which to query the input for your frame.
+///
+/// The returned value indicates the optimal time for you to query the input
+/// for your frame.
+cp_time_t
+cp_frame_timing_get_optimal_input_time(cp_frame_timing_t frame_timing)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the time at which you must finish all work for the specified
+/// frame.
+///
+/// - Parameters:
+/// - timing_information: The frame’s timing information. Fetch this
+/// information using the ``cp_frame_predict_timing`` function. If you
+/// already called that function once for the frame, you can call the
+/// ``cp_drawable_get_frame_timing`` function to get the information
+/// instead.
+/// - Returns: The Mach absolute time at which you must finish all work
+/// for the frame. This value reflects the total presentation time minus
+/// the overhead for the compositor to render your frame and display it
+/// onscreen.
+///
+/// Finish all CPU and GPU work by the returned time to ensure the timely
+/// display of the frame onscreen.
+cp_time_t
+cp_frame_timing_get_rendering_deadline(cp_frame_timing_t frame_timing)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the time at which the system will display the frame
+/// onscreen.
+///
+/// - Parameters:
+/// - timing_information: The frame’s timing information. Fetch
+/// this information using the ``cp_frame_predict_timing`` function.
+/// If you already called that function once for the frame, you
+/// can call the ``cp_drawable_get_frame_timing`` function to get
+/// the information instead.
+/// - Returns: The Mach absolute time at which the layer presents the
+/// frame onscreen.
+///
+/// You can use the presentation time as a synchronization point for
+/// other parts of your app. For example, you might play a specific
+/// audio clip when the frame appears.
+cp_time_t
+cp_frame_timing_get_presentation_time(cp_frame_timing_t frame_timing)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the time to used to predict transform of trackable anchors to provide best
+/// content registration with the frame.
+///
+/// - Parameters:
+/// - timing_information: The frame’s timing information. Fetch
+/// this information using the ``cp_frame_predict_timing`` function.
+/// If you already called that function once for the frame, you
+/// can call the ``cp_drawable_get_frame_timing`` function to get
+/// the information instead.
+/// - Returns: The Mach absolute time to use to predict transform of a trackable anchor.
+///
+/// You can use trackable anchor prediction time for prediction of ARKit trackable anchors
+/// to register rendered anchored content to the real-world objects. The offset of this time
+/// to presentation time is variable, so it is recommended to query this per-frame.
+///
+/// - note: For predicting ARKit device anchor use presentation time, see
+/// ``cp_frame_timing_get_presentation_time``
+cp_time_t
+cp_frame_timing_get_trackable_anchor_time(cp_frame_timing_t frame_timing)
+API_AVAILABLE(visionos(2.0), macosx(26.0))
+CF_REFINED_FOR_SWIFT;
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_frame_timing_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer.h 2025-05-25 00:23:22
@@ -0,0 +1,236 @@
+//
+// layer_renderer.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_layer_renderer_h
+#define cp_layer_renderer_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// The potential states of the layer renderer, which tell you how to
+/// proceed with drawing operations.
+typedef CF_ENUM(uint32_t, cp_layer_renderer_state) {
+
+ /// A state that indicates the layer renderer isn't currently drawing.
+ ///
+ /// A layer renderer starts in this state and later transitions to the
+ /// running or invalid states. Don't draw while in this state.
+ /// Wait until the layer changes to one of the other states to
+ /// take further action on the layer.
+ cp_layer_renderer_state_paused = 1,
+
+ /// A state that indicates the layer renderer is ready for you to draw
+ /// your content.
+ ///
+ /// When the layer enters this state, start your rendering loop
+ /// and draw your content. Keep drawing frames of content until
+ /// the layer transitions to another state.
+ cp_layer_renderer_state_running,
+
+ /// A state that indicates the layer renderer no longer supports drawing
+ /// operations.
+ ///
+ /// A layer enters this state shortly before the system releases
+ /// its resources. When the layer enters this state, exit your
+ /// rendering loop and release any drawing-related structures.
+ cp_layer_renderer_state_invalidated
+} CF_SWIFT_NAME(CP_OBJECT_cp_layer_renderer.State) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// An opaque type that provides the Metal types and timing
+/// information you need to draw your content.
+CP_OBJECT_DECL(cp_layer_renderer, LayerRenderer, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the configuration details you used to create the
+/// specified layer.
+///
+/// - Parameters layer_renderer: The layer renderer to query.
+/// - Returns: An opaque type you use to retrieve the configuration details.
+///
+/// Provide a custom ``LayerStageConfiguration`` to provide the initial
+/// configuration details for the layer. After the system creates the layer, use this
+/// function to retrieve those details. The system uses this information during the
+/// initial setup of the layer's data structures. Changes you make to the
+/// returned structure don't affect the layer's current configuration.
+cp_layer_renderer_configuration_t
+cp_layer_renderer_get_configuration(cp_layer_renderer_t layer_renderer)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the configured properties of the specified layer renderer.
+///
+/// - Parameters layer_renderer: The layer renderer to query.
+/// - Returns: An opaque type you can use to fetch the individual
+/// layer properties.
+///
+/// The layer properties include details about the layer's textures,
+/// such as their organization and the location of drawable views in those
+/// textures.
+cp_layer_renderer_properties_t
+cp_layer_renderer_get_properties(cp_layer_renderer_t layer_renderer)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Returns the GPU interface that the layer uses for drawing operations.
+///
+/// - Parameters layer_renderer: The layer renderer to query.
+/// - Returns: The Metal device to use for your drawing operations.
+///
+/// You can inspect the returned device for any information you might need.
+/// The system uses the returned device to create the textures you use for
+/// drawing. It also uses the device to create synchronization events for
+/// the layer.
+id<MTLDevice>
+cp_layer_renderer_get_device(cp_layer_renderer_t layer_renderer)
+CF_SWIFT_NAME(getter:CP_OBJECT_cp_layer_renderer.device(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#if CP_MTL4_AVAILABLE
+/// Returns the command queue that the layer uses for drawing operations.
+///
+/// - Parameters layer_renderer: The layer renderer to query.
+///
+/// Should only be called with when supporting Metal4 through configuration.
+/// ``cp_layer_renderer_configuration_set_supports_mtl4``
+id<MTL4CommandQueue>
+cp_layer_renderer_get_mtl4_command_queue(cp_layer_renderer_t layer_renderer)
+CF_SWIFT_NAME(getter:CP_OBJECT_cp_layer_renderer.commandQueue(self:)) API_AVAILABLE(visionos(26.0), macosx(26.0));
+#endif
+
+#endif
+
+/// Returns the layer's current state, which indicates whether the layer is
+/// visible and ready for you to draw content.
+///
+/// - Parameters layer_renderer: The layer renderer to query.
+/// - Returns: The current state of the layer.
+///
+/// Use the layer's state value to determine when to start and stop your
+/// rendering loop. Draw content only when the layer is in the
+/// ``cp_layer_renderer/cp_layer_renderer_state_running`` state. Stop your rendering loop when
+/// the layer enters other states. When the layer reaches the
+/// ``cp_layer_renderer/cp_layer_renderer_state_invalidated`` state, it's safe to
+/// clean up and deallocate your render loop structures.
+enum cp_layer_renderer_state
+cp_layer_renderer_get_state(cp_layer_renderer_t layer_renderer)
+CF_SWIFT_NAME(getter:CP_OBJECT_cp_layer_renderer.state(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Stops further execution of your code until the layer renderer leaves
+/// the paused state.
+///
+/// - Parameters layer_renderer: The layer renderer to monitor. If the layer isn't
+/// in the ``cp_layer_renderer/cp_layer_renderer_state_paused`` state, this function returns
+/// immediately.
+///
+/// Call this function to let the system handle events while
+/// you wait for the layer renderer to become ready. The function services
+/// incoming layer-related events until the layer exits the paused
+/// state.
+void
+cp_layer_renderer_wait_until_running(cp_layer_renderer_t layer_renderer)
+CF_SWIFT_NAME(CP_OBJECT_cp_layer_renderer.waitUntilRunning(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the next frame to use for drawing.
+///
+/// - Parameters layer_renderer: The layer renderer that manages the drawing destination.
+///
+/// - Returns: An opaque type to use for drawing operations. The function
+/// returns `nil` if the layer is paused, invalidated, or has too many frames
+/// already in use.
+///
+/// This function retrieves the next frame for you to use in your drawing
+/// operations. The system maintains a limited number of frames, so don't try
+/// to render more than one frame in advance. If this function returns `nil`,
+/// wait a short time and try again. After the system draws the current frame,
+/// it returns that frame to the shared pool and makes it available for you
+/// to use.
+///
+/// The index of each returned frame is always greater than the index of the
+/// previous frame. The system increments index values sequentially so you
+/// can differentiate frames you are currently drawing.
+CP_NULLABLE_STRUCT_REF
+cp_frame_t
+cp_layer_renderer_query_next_frame(cp_layer_renderer_t layer_renderer)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Return how many times a frame is repeated on display. This is typically used to
+/// build dynamic frame pacing.
+///
+/// - Parameters layer_renderer: The layer on which you're drawing.
+///
+/// - Returns: The repeat count. If the repeat count is set to a value greater or equal to 1, it means this
+/// layer repeated the client frame `repeat count` times, effectively multiplying the
+/// frame duration by `repeat count + 1`.
+///
+/// Lowering the number of frames being rendered every second will decrease the power usage per frame.
+/// This value should only be increased if appropriate for the content being rendered.
+int
+cp_layer_renderer_get_minimum_frame_repeat_count(cp_layer_renderer_t layer_renderer)
+CF_SWIFT_NAME(getter:CP_OBJECT_cp_layer_renderer.minimumFrameRepeatCount(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Set the frame repeat count. This is typically used to build dynamic frame pacing.
+///
+/// - Parameters:
+/// - layer_renderer: The layer on which you're drawing.
+/// - frame_repeat_count: How many times a frame is repeated on display.
+///
+/// If the repeat count is set to a value greater or equal to 1, it means this
+/// layer repeats the client frame `repeat count` times, effectively multiplying the
+/// frame duration by `repeat count + 1`.
+///
+/// Lowering the number of frames being rendered every second will decrease the power usage per frame.
+/// This value should only be increased if appropriate for the content being rendered.
+void
+cp_layer_renderer_set_minimum_frame_repeat_count(cp_layer_renderer_t layer_renderer,
+ int frame_repeat_count)
+CF_SWIFT_NAME(setter:CP_OBJECT_cp_layer_renderer.minimumFrameRepeatCount(self:frame_repeat_count:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Get the render quality to be used by the drawables.
+///
+/// - Parameters:
+/// - layer_renderer: The layer on which you're drawing.
+///
+/// The render quality will increase the resolution at which rendering happens.
+/// This value cannot exceed the quality specified on the layer renderer configuration
+/// see ``cp_layer_renderer_configuration_set_max_render_quality``.
+/// The quality will be changed to the target render quality over a set duration to hide
+/// the transition of quality from the user.
+///
+/// The renderer should monitor its frame rate to determine whether its making the frames
+/// on time. If it is unable to maintain proper frame rate, the app should reduce the render
+/// quality, reduce the scene complexity, or increase the frame repeat count see
+/// ``cp_layer_renderer_set_minimum_frame_repeat_count``.
+/// It is generally preferable to reduce anything else before increasing the frame repeat count.
+cp_render_quality_t
+cp_layer_renderer_get_render_quality(cp_layer_renderer_t layer_renderer)
+CF_SWIFT_NAME(getter:CP_OBJECT_cp_layer_renderer.renderQuality(self:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Set the render quality to be used by the drawables.
+///
+/// - Parameters:
+/// - layer_renderer: The layer on which you're drawing.
+/// - render_quality: The value of quality [0, 1].
+/// With 0 being the minimum quality that is supported on the device,
+/// and 1 being the highest quality that is supported on the device.
+///
+/// The render quality will increase the resolution at which rendering happens.
+/// This value cannot exceed the quality specified on the layer renderer configuration
+/// see ``cp_layer_renderer_configuration_set_max_render_quality``.
+/// The quality will be changed to the target render quality over a set duration to hide
+/// the transition of quality from the user.
+///
+/// The renderer should monitor its frame rate to determine whether its making the frames
+/// on time. If it is unable to maintain proper frame rate, the app should reduce the render
+/// quality, reduce the scene complexity, or increase the frame repeat count see
+/// ``cp_layer_renderer_set_minimum_frame_repeat_count``.
+/// It is generally preferable to reduce anything else before increasing the frame repeat count.
+void
+cp_layer_renderer_set_render_quality(cp_layer_renderer_t layer_renderer, cp_render_quality_t render_quality)
+CF_SWIFT_NAME(setter:CP_OBJECT_cp_layer_renderer.renderQuality(self:renderQuality:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_layer_renderer_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_capabilities.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_capabilities.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_capabilities.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_capabilities.h 2025-05-25 00:23:22
@@ -0,0 +1,255 @@
+//
+// layer_renderer_capabilities.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_layer_renderer_capabilities_h
+#define cp_layer_renderer_capabilities_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// A type that stores the supported configurations for a layer.
+CP_OBJECT_DECL(cp_layer_renderer_capabilities, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns a Boolean value that indicates whether the layer supports
+/// variable rasterization rates.
+///
+/// - Parameters:
+/// - layer_capabilities: The system-provided layer capabilities type.
+/// - Returns: `true` if the layer supports variable rasterization rates or
+/// `false` if you must render the entire layer at the same resolution.
+///
+/// Foveation support lets you reduce the amount of high-resolution drawing
+/// you do. When foveation support is available, you can render content in
+/// someone’s peripheral vision at a lower resolution than content under
+/// their direct gaze.
+bool
+cp_layer_renderer_capabilities_supports_foveation(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// The options to provide when calling ``cp_layer_renderer_capabilities_supported_color_formats`` and
+/// ``cp_layer_renderer_capabilities_supported_color_formats_count``
+typedef CF_OPTIONS(uint32_t, cp_supported_color_formats_options) {
+ cp_supported_color_formats_options_none = 0,
+ cp_supported_color_formats_options_progressive_immersion_enabled = 1 << 0,
+} CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the number of color formats the specified layer supports.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - Returns: The number of color formats the layer supports.
+///
+/// To iterate over the color formats, use the ``cp_layer_renderer_capabilities_supported_color_format``
+/// function.
+size_t
+cp_layer_renderer_capabilities_supported_color_formats_count_with_options(cp_layer_renderer_capabilities_t layer_capabilities,
+ cp_supported_color_formats_options options)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+size_t
+cp_layer_renderer_capabilities_supported_color_formats_count(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0)) API_UNAVAILABLE(macosx, ios)
+API_DEPRECATED("Use cp_layer_renderer_capabilities_supported_color_formats_count_with_options instead.", visionos(1.0, 26.0));
+
+#ifdef __OBJC__
+
+/// Returns the color format at the specified index in the layer capabilities.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - index: A zero-based index into the list of color formats.
+/// - Returns: The color format at the specified index.
+///
+/// Use this function to determine the pixel arrangements and characteristics
+/// you can apply to the layer.
+MTLPixelFormat
+cp_layer_renderer_capabilities_supported_color_format_with_options(cp_layer_renderer_capabilities_t layer_capabilities,
+ cp_supported_color_formats_options options,
+ size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+MTLPixelFormat
+cp_layer_renderer_capabilities_supported_color_format(cp_layer_renderer_capabilities_t layer_capabilities,
+ size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0)) API_UNAVAILABLE(macosx, ios)
+API_DEPRECATED("Use cp_layer_renderer_capabilities_supported_color_format_with_options instead.", visionos(1.0, 26.0));
+
+#endif
+
+/// Returns the number of depth formats the specified layer supports.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - Returns: The number of depth formats the layer supports.
+///
+/// To iterate over the depth formats, use the ``cp_layer_renderer_capabilities_supported_depth_format``
+/// function.
+size_t
+cp_layer_renderer_capabilities_supported_depth_formats_count(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Returns the depth format at the specified index in the layer capabilities.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - index: A zero-based index into the list of depth formats.
+/// - Returns: The pixel format at the specified index.
+///
+/// Use this function to determine what depth texture formats the layer
+/// supports.
+MTLPixelFormat
+cp_layer_renderer_capabilities_supported_depth_format(cp_layer_renderer_capabilities_t layer_capabilities,
+ size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#endif
+
+/// Returns the number of tracking areas formats the specified layer supports.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - Returns: The number of tracking areas formats the layer supports.
+///
+/// To iterate over the index formats, use the ``cp_layer_renderer_capabilities_supported_tracking_areas_format``
+/// function.
+size_t
+cp_layer_renderer_capabilities_supported_tracking_areas_formats_count(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Returns the tracking areas format at the specified index in the layer capabilities.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - index: A zero-based index into the list of index formats.
+/// - Returns: The pixel format at the specified index.
+///
+/// Use this function to determine what tracking areas texture formats the layer
+/// supports.
+MTLPixelFormat
+cp_layer_renderer_capabilities_supported_tracking_areas_format(cp_layer_renderer_capabilities_t layer_capabilities,
+ size_t index)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#endif // __OBJC__
+
+/// The options to provide when calling ``cp_layer_renderer_capabilities_supported_layout`` and
+/// ``cp_layer_renderer_capabilities_supported_layouts_count``
+typedef CF_OPTIONS(uint32_t, cp_supported_layouts_options) {
+ cp_supported_layouts_options_none = 0,
+ cp_supported_layouts_options_foveation_enabled = 1 << 0,
+ cp_supported_layouts_options_progressive_immersion_enabled
+ API_AVAILABLE(visionos(26.0), macosx(26.0)) = 1 << 1,
+} CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the number of layouts the specified layer supports.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - options: The options to consider when creating the list of supported
+/// layouts.
+/// - Returns: The number of layouts the layer supports.
+///
+/// To iterate over the layouts, use the ``cp_layer_renderer_capabilities_supported_layout``
+/// function.
+size_t
+cp_layer_renderer_capabilities_supported_layouts_count(cp_layer_renderer_capabilities_t layer_capabilities,
+ cp_supported_layouts_options options)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the layout at the specified index in the layer capabilities.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - options: The options to consider when creating the list of supported
+/// layouts.
+/// - index: A zero-based index into the list of layouts. This value must
+/// be less than the value the ``cp_layer_renderer_capabilities_supported_layouts_count``
+/// function returns for the same value of the `foveation_enabled` parameter.
+/// - Returns: The layer layout at the specified index.
+///
+/// Use this function to determine what texture layouts the layer supports.
+cp_layer_renderer_layout
+cp_layer_renderer_capabilities_supported_layout(cp_layer_renderer_capabilities_t layer_capabilities,
+ cp_supported_layouts_options options,
+ size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the minimum distance in meters to the near projection plane
+/// that the layer supports.
+///
+/// The compositor uses the near and far projection planes to compute the
+/// perspective projection matrix and to clip content that is not between
+/// the near and far planes. Use this method to retrieve the
+/// minimum distance to the near plane that the layer allows. When you
+/// configure your layer, you can specify a different minimum distance,
+/// but that value must be greater than or equal to the distance this
+/// method returns.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - Returns: The minimum allowed distance in meters from the camera
+/// origin to the near projection plane.
+float
+cp_layer_renderer_capabilities_supported_minimum_near_plane_distance(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the number of stencil formats the specified layer supports.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - Returns: The number of stencil formats the layer supports.
+///
+/// To iterate over the stencil formats, use the ``cp_layer_renderer_capabilities_drawable_render_context_supported_stencil_format``
+/// function.
+size_t
+cp_layer_renderer_capabilities_drawable_render_context_supported_stencil_formats_count(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Returns the stencil format at the specified index in the layer capabilities.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - index: A zero-based index into the list of stencil formats.
+/// - Returns: The stencil format at the specified index.
+///
+/// Use this function to determine the pixel arrangements and characteristics
+/// you can apply to the layer.
+MTLPixelFormat
+cp_layer_renderer_capabilities_drawable_render_context_supported_stencil_format(cp_layer_renderer_capabilities_t layer_capabilities,
+ size_t index)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#endif
+
+/// Returns default render quality for drawing on this platform.
+///
+/// This should be used as a base value for the platform quality
+/// for drawing.
+///
+/// @see ``cp_layer_renderer_configuration_set_max_render_quality``
+/// for usage.
+///
+/// - Parameters:
+/// - layer_capabilities: The layer capabilities to query.
+/// - Returns: The default render quality allowed for drawing.
+cp_render_quality_t
+cp_layer_renderer_capabilities_get_default_render_quality(cp_layer_renderer_capabilities_t layer_capabilities)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_layer_renderer_capabilities_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_configuration.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_configuration.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_configuration.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_configuration.h 2025-05-31 01:07:51
@@ -0,0 +1,552 @@
+//
+// layer_renderer_configuration.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_layer_renderer_configuration_h
+#define cp_layer_renderer_configuration_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// An opaque type that stores the settings to apply to a Compositor layer renderer.
+///
+/// You don’t create this type directly. If your ``CompositorLayer`` uses a custom
+/// ``CompositorLayerConfiguration``, the compositor layer creates an instance of this type and
+/// passes it to the provider’s
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// function. Use that instance to modify the default configuration settings
+/// for your layer.
+CP_OBJECT_DECL(cp_layer_renderer_configuration, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+#ifdef __OBJC__
+
+/// Returns the pixel format to use for the layer’s color textures.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The pixel format to use for the layer’s color textures.
+///
+/// The compositor creates the color textures using the pixel format
+/// information you provide.
+MTLPixelFormat
+cp_layer_renderer_configuration_get_color_format(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Sets the pixel format for the layer’s color textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - color_format: The pixel format to apply to the layer’s color textures.
+///
+/// Use this function to modify the configuration details for your layer. Call the
+/// ``cp_layer_renderer_capabilities_supported_color_format`` function to determine which
+/// pixel formats the layer’s color textures support.
+void
+cp_layer_renderer_configuration_set_color_format(cp_layer_renderer_configuration_t configuration,
+ MTLPixelFormat color_format)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the texture usage value to apply to the layer’s color textures.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The Metal texture usage value to apply to the layer’s color
+/// textures.
+///
+/// Metal optimizes texture-related operations based on the texture's usage value.
+/// The usage value can be a combination of options. For example, a texture
+/// might be readable and writable. For more information, see
+/// <doc://com.apple.documentation/documentation/metal/mtltextureusage>.
+MTLTextureUsage
+cp_layer_renderer_configuration_get_color_usage(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Sets the texture usage for the layer’s color textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - color_usage: The usage value to apply to the layer’s color textures.
+///
+/// Use this function to modify the configuration details for your layer. Metal
+/// optimizes texture-related operations based on the texture's usage value.
+/// The usage value can be a combination of options. For example, a texture
+/// might be readable and writable. For more information, see
+/// <doc://com.apple.documentation/documentation/metal/mtltextureusage>.
+void
+cp_layer_renderer_configuration_set_color_usage(cp_layer_renderer_configuration_t configuration,
+ MTLTextureUsage color_usage)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the pixel format to apply to the layer’s tracking areas textures.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The pixel format to apply to the layer’s tracking areas textures.
+///
+/// The compositor creates the tracking areas textures using the pixel format
+/// information you provide.
+MTLPixelFormat
+cp_layer_renderer_configuration_get_tracking_areas_format(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Sets the pixel format for the layer’s tracking areas textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - tracking_areas_format: The pixel format to apply to the layer’s tracking areas textures.
+///
+/// Use this function to modify the configuration details for your layer. Call the
+/// ``cp_layer_renderer_capabilities_supported_tracking_areas_format`` function to determine which
+/// pixel formats the layer’s tracking areas textures supports.
+void
+cp_layer_renderer_configuration_set_tracking_areas_format(cp_layer_renderer_configuration_t configuration,
+ MTLPixelFormat tracking_areas_format)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the texture usage value to apply to the layer’s tracking areas textures.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The Metal texture usage value to apply to the layer’s tracking areas textures.
+///
+/// Metal optimizes texture-related operations based on the texture's usage value.
+/// The usage value can be a combination of options. For example, a texture
+/// might be readable and writable. For more information, see
+/// <doc://com.apple.documentation/documentation/metal/mtltextureusage>.
+MTLTextureUsage
+cp_layer_renderer_configuration_get_tracking_areas_usage(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Sets the texture usage for the layer’s tracking areas textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - tracking_areas_usage: The usage value to apply to the layer’s
+/// tracking areas textures.
+///
+/// Use this function to modify the configuration details for your layer.
+void
+cp_layer_renderer_configuration_set_tracking_areas_usage(cp_layer_renderer_configuration_t configuration,
+ MTLTextureUsage tracking_areas_usage)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the pixel format to apply to the layer’s depth textures.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The pixel format to apply to the layer’s depth textures.
+///
+/// The compositor creates the depth textures using the pixel format
+/// information you provide.
+MTLPixelFormat
+cp_layer_renderer_configuration_get_depth_format(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Sets the pixel format for the layer’s depth textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - color_format: The pixel format to apply to the layer’s depth textures.
+///
+/// Use this function to modify the configuration details for your layer. Call the
+/// ``cp_layer_renderer_capabilities_supported_depth_format`` function to determine which
+/// pixel formats the layer’s depth textures supports.
+void
+cp_layer_renderer_configuration_set_depth_format(cp_layer_renderer_configuration_t configuration,
+ MTLPixelFormat depth_format)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the texture usage value to apply to the layer’s depth textures.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The Metal texture usage value to apply to the layer’s depth textures.
+///
+/// Metal optimizes texture-related operations based on the texture's usage value.
+/// The usage value can be a combination of options. For example, a texture
+/// might be readable and writable. For more information, see
+/// <doc://com.apple.documentation/documentation/metal/mtltextureusage>.
+MTLTextureUsage
+cp_layer_renderer_configuration_get_depth_usage(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Sets the texture usage for the layer’s depth textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - depth_usage: The usage value to apply to the layer’s depth
+/// textures.
+///
+/// Use this function to modify the configuration details for your layer.
+void
+cp_layer_renderer_configuration_set_depth_usage(cp_layer_renderer_configuration_t configuration,
+ MTLTextureUsage depth_usage)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#endif
+
+/// Returns a Boolean value that indicates whether the layer supports
+/// variable rasterization rates.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: `true` if the layer supports variable rasterization rates,
+/// or `false` if it doesn’t.
+///
+/// Foveation support lets you reduce the amount of high-resolution drawing
+/// you do. When foveation is enabled, the drawable resource for each frame
+/// reduces the size of the texture you use for rendering. The drawable also
+/// provides rasterization rate maps that specify the amount of rasterization
+/// to apply to different parts of the texture. When rendering your scene,
+/// the GPU generates fewer pixels in areas with low rasterization
+/// rates, and then scales up those areas before displaying them onscreen.
+bool
+cp_layer_renderer_configuration_get_foveation_enabled(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Changes the setting that indicates whether the layer supports variable
+/// rasterization rates.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - foveation_enabled: `true` to enable variable rasterization rates in
+/// the layer, or `false` to render everything at the same resolution.
+///
+/// Foveation support lets you reduce the amount of high-resolution drawing
+/// you do. If you enable foveation, the drawable resource for each frame
+/// reduces the size of the texture you use for rendering. The drawable also
+/// provides rasterization rate maps that specify the amount of rasterization
+/// to apply to different parts of the texture. When rendering your scene,
+/// the GPU generates fewer pixels in areas with low rasterization
+/// rates, and then scales up those areas before displaying them onscreen.
+void
+cp_layer_renderer_configuration_set_foveation_enabled(cp_layer_renderer_configuration_t configuration,
+ bool foveation_enabled)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns a Boolean value that indicates whether the layer provides
+/// flipped variable rasterization rate maps in addition to the regular maps.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: `true` if the layer generates flipped variable rasterization rate maps,
+/// or `false` if it doesn’t.
+///
+/// Flipped is defined as +Y = up for clip/normalized device coordinates (flipped from Metal convention).
+/// Generating flipped rasterization rate maps requires the configuration to have foveation enabled.
+/// Can only be used for intermediatry render passes, the final render pass of the drawable cannot
+/// be flipped and must use +Y = down for clip/normalized device coordinates (Metal conventions).
+/// Generating flipped maps will bring additional computational cost to your render loop, regardless
+/// of if the map is accessed/used.
+///
+/// When `true` the `cp_drawable_t` will provide flipped variable rasterization rate maps via the
+/// `cp_drawable_get_flipped_rasterization_rate_map` function.
+bool
+cp_layer_renderer_configuration_get_generate_flipped_rasterization_rate_maps(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Changes the setting that indicates whether the layer provides
+/// flipped variable rasterization rate maps in addition to the regular maps.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - generate_flipped_rasterization_rate_maps: `true` to generate flipped variable rasterization rate maps in
+/// the layer, or `false` to only generate regular variable rasterization rate maps.
+///
+/// Flipped is defined as +Y = up for clip/normalized device coordinates (flipped from Metal convention).
+/// Generating flipped rasterization rate maps requires the configuration to have foveation enabled.
+/// Can only be used for intermediatry render passes, the final render pass of the drawable cannot
+/// be flipped and must use +Y = down for clip/normalized device coordinates (Metal conventions).
+/// Generating flipped maps will bring additional computational cost to your render loop, regardless
+/// of if the map is accessed/used.
+///
+/// When `true` the `cp_drawable_t` will provide flipped variable rasterization rate maps via the
+/// `cp_drawable_get_flipped_rasterization_rate_map` function.
+void
+cp_layer_renderer_configuration_set_generate_flipped_rasterization_rate_maps(cp_layer_renderer_configuration_t configuration,
+ bool generate_flipped_rasterization_rate_maps)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the texture configuration for the drawable views in the layer.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The layout configuration for the textures.
+///
+/// Layouts define how the compositor creates the color and depth textures
+/// it passes to your app. A layout might use separate textures for each view,
+/// or combine the content from multiple views into a single texture. The layout
+/// type also determines which Metal texture type the compositor creates for you.
+/// For more information about the supported layouts, see ``cp_layer_renderer_layout``.
+cp_layer_renderer_layout
+cp_layer_renderer_configuration_get_layout(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Changes the layout configuration for the drawable views in the layer.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - layout: The layout configuration to apply to the layer.
+///
+/// Layouts define how the compositor creates the textures it passes to your
+/// app. Use this function to change the layout you use for your content. A
+/// layout might use separate textures for each view, or combine the content
+/// from multiple views into a single texture. The layout type also determines
+/// which Metal texture type the compositor creates for you. For more
+/// information about the supported layouts, see ``cp_layer_renderer_layout``.
+void
+cp_layer_renderer_configuration_set_layout(cp_layer_renderer_configuration_t configuration,
+ cp_layer_renderer_layout layout)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the distances for the far and near clipping planes you use
+/// during drawing.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The distances to the far and near planes in meters. The
+/// compositor returns values in reverse-z ordering, with the value for the
+/// far plane in the vector’s `x` property and the value for the near plane
+/// in the vector’s `y` property.
+///
+/// The near and far planes reflect distances from the person viewing
+/// the content. The compositor uses these values to compute the perspective
+/// projection matrix and to clip content that is not between the near
+/// and far planes.
+simd_float2
+cp_layer_renderer_configuration_get_default_depth_range(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Sets the default distances to the far and near clipping planes you use
+/// during drawing.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - depth_range: The distances to the far and near planes in meters.
+/// Specify the values in reverse-z ordering, with the value for the far
+/// plane in the vector’s `x` property and the value for the near plane
+/// in the vector’s `y` property.
+///
+/// Use this function to modify the configuration details for your layer.
+/// The near and far planes correspond to distances from the person viewing
+/// the content. The compositor uses these values to compute the perspective
+/// projection matrix and to clip content that is not between the near and far
+/// planes. It only supports reverse-Z depth, which means the value in the
+/// texture should be 1 for near 0 for far.
+///
+/// This function modifies the layer's default depth values. You can
+/// also change these values separately for the ``cp_drawable_t`` type of
+/// individual frames.
+void
+cp_layer_renderer_configuration_set_default_depth_range(cp_layer_renderer_configuration_t configuration,
+ simd_float2 depth_range)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Sets the pixel format for the drawable's render context stencil textures to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - stencil_format: The pixel format to apply to the drawable's render context stencil
+/// textures.
+void
+cp_layer_renderer_configuration_set_drawable_render_context_stencil_format(cp_layer_renderer_configuration_t configuration,
+ MTLPixelFormat stencil_format)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the pixel format to use for the stencil texture in drawable's render context.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The pixel format to use for the drawable's render context stencil textures.
+MTLPixelFormat
+cp_layer_renderer_configuration_get_drawable_render_context_stencil_format(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#endif
+
+/// Returns the raster sample count to use in drawable's render context.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type that contains the
+/// information. The system passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The raster sample count to use for the drawable's render context.
+int
+cp_layer_renderer_configuration_get_drawable_render_context_raster_sample_count(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Sets the raster sample count for the drawable's render context to the specified
+/// value.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - raster_sample_count: The raster sample count to apply to the drawable's render context.
+void
+cp_layer_renderer_configuration_set_drawable_render_context_raster_sample_count(cp_layer_renderer_configuration_t configuration,
+ int raster_sample_count)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Get max render quality the layer can use when drawing to the drawables.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: The max render qualityto use for the drawable's.
+///
+/// The max render quality is a value between [0, 1].
+/// This determines the max render quality at which drawing can happen.
+///
+/// Setting a higher max render quality will impact the resolution that is allocated for the drawable textures.
+/// This memory will count against the app's memory limit so should only be specified as high as renderer
+/// can reasonably achieve frame rate at. During runtime, the render quality can be changed on the
+/// layer renderer but will not impact memory usage, see ``cp_layer_renderer_set_render_quality``.
+cp_render_quality_t
+cp_layer_renderer_configuration_get_max_render_quality(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Set max render quality the layer can use when drawing to the drawables.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - render_quality: A value between between [0, 1].
+/// This determines the max render quality at which drawing can happen.
+///
+/// Setting a higher max render quality will impact the resolution that is allocated for the drawable textures.
+/// This memory will count against the app's memory limit so should only be specified as high as renderer
+/// can reasonably achieve frame rate at. During runtime, the render quality can be changed on the
+/// layer renderer but will not impact memory usage, see ``cp_layer_renderer_set_render_quality``.
+void
+cp_layer_renderer_configuration_set_max_render_quality(cp_layer_renderer_configuration_t configuration,
+ cp_render_quality_t render_quality)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#if CP_MTL4_AVAILABLE
+
+/// Get whether the layer can use Metal4 when drawing to the drawables.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - Returns: Whether the layer supports using Metal4, otherwise defaults to Metal3.
+bool
+cp_layer_renderer_configuration_get_supports_mtl4(cp_layer_renderer_configuration_t configuration)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0));
+
+/// Set whether the layer can use Metal4 when drawing to the drawables.
+///
+/// - Parameters:
+/// - configuration: The layer configuration type to modify. The system
+/// passes an instance of this type to the
+/// ``CompositorLayerConfiguration/makeConfiguration(capabilities:configuration:)``
+/// method of your configuration provider.
+/// - supports_mtl4: Whether the layer supports using Metal4, otherwise defaults to Metal3.
+void
+cp_layer_renderer_configuration_set_supports_mtl4(cp_layer_renderer_configuration_t configuration,
+ bool supports_mtl4)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+#endif
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_layer_renderer_configuration_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_layout.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_layout.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_layout.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_layout.h 2025-05-25 00:23:22
@@ -0,0 +1,40 @@
+//
+// layer_renderer_layout.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_layer_renderer_layout_h
+#define cp_layer_renderer_layout_h
+
+/// Constants that specify the organization of the textures you use for
+/// drawing.
+typedef CF_ENUM(uint32_t, cp_layer_renderer_layout) {
+
+ /// A layout that assigns a separate texture to each rendered view.
+ ///
+ /// When the layout contains multiple views, each view receives its
+ /// own dedicated texture. The type of each texture is MTLTextureType2D.
+ cp_layer_renderer_layout_dedicated = 0,
+
+ /// A layout that uses a single texture to store the content for all
+ /// rendered views.
+ ///
+ /// When a layer contains multiple views, the texture stores the images
+ /// for those views side-by-side. The texture map for each view contains
+ /// a viewport that defines the boundaries of the view’s content. The
+ /// type of each texture is MTLTextureType2D.
+ cp_layer_renderer_layout_shared = 1,
+
+ /// A layout that specifies each view’s content as a slice of a single
+ /// texture.
+ ///
+ /// The layout uses a single texture to store the content for all rendered
+ /// views. The type of the texture is MTLTextureType2DArray. The texture
+ /// map’s slice index indicates which array slot contains the view’s
+ /// content.
+ cp_layer_renderer_layout_layered = 2,
+} CF_SWIFT_NAME(CP_OBJECT_cp_layer_renderer.Layout) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#endif /* cp_layer_renderer_layout_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_properties.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_properties.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_properties.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/layer_renderer_properties.h 2025-05-25 00:23:22
@@ -0,0 +1,174 @@
+//
+// layer_renderer_properties.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_layer_renderer_properties_h
+#define cp_layer_renderer_properties_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/*!
+ * MARK: Texture Topology
+ */
+
+/// An opaque type that specifies the configuration of one of the layer’s
+/// drawable textures.
+///
+/// For direct-to-screen drawing, you specify how you want Compositor to
+/// configure the required textures when you configure your layer. For a
+/// device with multiple displays, Compositor can configure the textures
+/// in different ways. For example, it can create a separate texture for
+/// each display, or it can combine the images from multiple displays into
+/// a single texture. A texture topology type contains the details of one
+/// of the textures Compositor creates for your app.
+CP_STRUCT_REF(cp_texture_topology, TextureTopology, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the number of items in the texture array.
+///
+/// - Parameters:
+/// - texture_topology: A texture configuration you obtained from the
+/// layer's properties. Fetch this value using the
+/// ``cp_layer_renderer_properties_get_texture_topology`` function.
+/// - Returns: The number of separate items in the texture array.
+///
+/// Array-based texture types such as
+/// <doc://com.apple.documentation/documentation/metal/mtltexturetype/type2darray>
+/// manage one or more images of the same size. This function returns the
+/// number of separate images the texture manages. Other array types store
+/// only one image.
+uint64_t
+cp_texture_topology_get_array_length(cp_texture_topology_t texture_topology)
+CF_SWIFT_NAME(getter:cp_texture_topology_t.arrayLength(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+/// Returns the type value that specifies how the underlying texture
+/// organizes its views.
+///
+/// - Parameters:
+/// - texture_topology: The texture topology to query. Get the texture
+/// topology from the layer properties using the
+/// ``cp_layer_renderer_properties_get_texture_topology`` function.
+/// - Returns: A Metal value that indicates the arrangement of views
+/// within the texture.
+///
+/// A texture might store the content of one view or multiple views. For
+/// example, a single texture might store one or both views for the left
+/// and right eyes of a head-mounted display. The texture type indicates
+/// this content organization strategy.
+MTLTextureType
+cp_texture_topology_get_texture_type(cp_texture_topology_t texture_topology)
+CF_SWIFT_NAME(getter:cp_texture_topology_t.textureType(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+#endif
+
+/*!
+ * MARK: Layer Properties
+ */
+
+/// An opaque type that describes the organization of the layer's textures
+/// and the relationships between those textures and the views you use
+/// for drawing.
+///
+/// You might use the layer's properties to configure other parts of
+/// your app. For example, use them to configure your app's render pipeline.
+///
+/// You can obtain layer properties directly from your layer. If you don't
+/// yet have the layer type, you can create an equivalent set of properties
+/// using the ``cp_layer_renderer_properties_create_using_configuration`` function.
+CP_OBJECT_DECL(cp_layer_renderer_properties, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Creates a new opaque type to store layer-related properties.
+///
+/// - Parameters:
+/// - configuration: An opaque type that contains the layer’s
+/// configuration details. Compositor uses this information to
+/// configure the properties an equivalent layer would use.
+/// - error: A pointer to an error object. On success, the function sets
+/// this value to `nil`. If an error occurs, this function sets the value
+/// of the pointer to an error object with details about the problem.
+/// The caller is responsible for releasing the returned error object.
+/// - Returns: A new layer properties type with details about how the layer
+/// configures its topologies and texture maps. The function returns `nil`
+/// if an error occurs.
+///
+/// Call this function to create a set of layer properties when you don't
+/// yet have a ``cp_layer_renderer_t`` type. This function generates an equivalent
+/// set of properties for the configuration you provide. You can use those
+/// properties to configure other parts of your app before the layer becomes
+/// available. For example, you might use the information to configure portions
+/// of your app's render pipeline.
+cp_layer_renderer_properties_t _Nullable
+cp_layer_renderer_properties_create_using_configuration(cp_layer_renderer_configuration_t configuration,
+ CFErrorRef * __nullable error)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0))
+OS_OBJECT_RETURNS_RETAINED;
+
+/// Returns the number of texture topologies available for you to inspect.
+///
+/// - Parameters:
+/// - layer_properties: The layer properties to query.
+/// - Returns: The number of texture topologies present in the layer.
+///
+/// The layer’s configuration determines the total number of available
+/// topologies, and each topology contains details about one texture you
+/// use for rendering. Fetch the topology details using the
+/// ``cp_layer_renderer_properties_get_texture_topology`` function.
+size_t
+cp_layer_renderer_properties_get_texture_topology_count(cp_layer_renderer_properties_t layer_properties)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Retrieves the texture topology at the specified index in the
+/// layer's properties.
+///
+/// - Parameters:
+/// - layer_properties: The layer properties to query.
+/// - index: The index into the array of texture configurations.
+/// This value must be less than the value returned by the
+/// ``cp_layer_renderer_properties_get_texture_topology`` function.
+/// - Returns: An opaque type that contains details about the specific
+/// texture.
+///
+/// Retrieve the topology type and use accessor functions to get details
+/// of that topology, including its type and array length.
+/// Use that information to allocate the resources you need to manage
+/// your content.
+cp_texture_topology_t
+cp_layer_renderer_properties_get_texture_topology(cp_layer_renderer_properties_t layer_properties,
+ size_t index)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the number of views that will need to be rendered.
+///
+/// - Parameters:
+/// - layer_properties: The layer properties to query.
+/// - Returns: The total number of views that need to be support on the drawables.
+///
+/// Should use ``cp_frame_get_drawable_target_view_count`` when
+/// performing frustum culling to determine how many views specific views each
+/// drawable target has.
+///
+/// Should use ``cp_drawable_get_view_count`` when drawing to
+/// determine how many views the specific frame has.
+size_t
+cp_layer_renderer_properties_get_view_count(cp_layer_renderer_properties_t layer_properties)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the max render value for tracking areas' render values.
+///
+/// - Parameters:
+/// - layer_properties: The layer properties to query.
+/// - Returns: The max render value for the tracking areas render values.
+///
+/// The layer’s configuration determines the total number of available
+/// tracking areas. This will be the max render value available, based on
+/// ``cp_layer_renderer_configuration_get_tracking_areas_format`` function.
+cp_tracking_area_render_value
+cp_layer_renderer_properties_get_tracking_areas_max_value(cp_layer_renderer_properties_t properties)
+CF_REFINED_FOR_SWIFT API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_layer_renderer_properties_h */
+
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/tracking_area.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/tracking_area.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/tracking_area.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/tracking_area.h 2025-05-31 01:07:51
@@ -0,0 +1,105 @@
+//
+// tracking_area.h
+// CompositorNonUI
+//
+// Created by Jacob Wilson on 10/9/24.
+// Copyright © 2024 Apple. All rights reserved.
+//
+
+#ifndef cp_tracking_area_h
+#define cp_tracking_area_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/// An opaque type that describes a region of a view that
+/// interacts with the gaze/cursor.
+CP_STRUCT_REF(cp_tracking_area, cp_drawable_t.TrackingArea, API_AVAILABLE(visionos(26.0), macosx(26.0)));
+
+/// An opaque type that describes a hover effect of the tracking area.
+CP_STRUCT_REF(cp_hover_effect, API_AVAILABLE(visionos(26.0), macosx(26.0)));
+
+/// A value used when rendering a tracking area.
+///
+/// When rendering to ``cp_drawable_get_tracking_areas_texture``
+/// use this value to write the pixel value.
+/// Upper bound limit is based on pixel format set by
+/// ``cp_layer_renderer_configuration_get_tracking_areas_format``
+/// Can change per-frame for the same rendered mesh/object.
+/// A value of 0 is reserved to represent the absence of a tracking area.
+typedef uint16_t cp_tracking_area_render_value
+CF_TYPED_EXTENSIBLE_ENUM
+CF_SWIFT_NAME(cp_tracking_area_t.RenderValue)
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Value to be used in the tracking area texture, to indicate that there
+/// is no tracking area at a given pixel.
+static const cp_tracking_area_render_value cp_tracking_area_render_value_invalid
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0)) = 0;
+
+/// An identifier for the tracking area.
+///
+/// All tracking areas should have a unique value in a frame.
+/// This value should be constant for the same rendered mesh/object
+/// across frames to ensure tracking areas are identifiable between
+/// frames.
+/// There is no reserved values so all values are considered valid
+/// but should be unique.
+typedef uint64_t cp_tracking_area_identifier
+CF_TYPED_EXTENSIBLE_ENUM
+CF_SWIFT_NAME(cp_tracking_area_t.Identifier)
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Identifier reserved as invalid.
+///
+/// Should not be used as identifier for ``cp_drawable_add_tracking_area``.
+static const cp_tracking_area_identifier cp_tracking_area_identifier_invalid
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0)) = 0;
+
+/// Returns the render value for the tracking area.
+///
+/// - Parameters:
+/// - tracking_area: The tracking area for a frame.
+/// - Returns: The render value for the tracking area for this frame.
+/// This value is what should be used in this frames render pass to identify the
+/// tracking area of given identifier.
+///
+/// Use the returned value in the render pass of ``cp_drawable_get_tracking_areas_texture``
+/// for the pixel value of the tracking area identifier.
+cp_tracking_area_render_value
+cp_tracking_area_get_render_value(cp_tracking_area_t tracking_area)
+CF_SWIFT_NAME(getter:cp_tracking_area_t.renderValue(self:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the identifier for the tracking area.
+///
+/// - Parameters:
+/// - tracking_area: The tracking area for a frame.
+/// - Returns: The identifier for the tracking area.
+/// This should be a unique value for this tracking area and consistent
+/// for the rendered mesh/object across frames.
+cp_tracking_area_identifier
+cp_tracking_area_get_identifier(cp_tracking_area_t tracking_area)
+CF_SWIFT_NAME(getter:cp_tracking_area_t.identifier(self:))
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+/// Returns the hover effect opaque object for the tracking area for this frame.
+///
+/// - Parameters:
+/// - tracking_area: The tracking area for a frame.
+/// - Returns: The hover effect for the tracking area.
+///
+/// The hover effect contains information used to render the hover
+/// effect using the tracking area textures and gaze once application
+/// render pass has completed.
+/// Can only create 1 hover effect per-tracking area, to destroy and
+/// disable the hover effect see ``cp_hover_effect_destroy``
+cp_hover_effect_t
+cp_tracking_area_add_automatic_hover_effect(cp_tracking_area_t tracking_area)
+CF_REFINED_FOR_SWIFT
+API_AVAILABLE(visionos(26.0), macosx(26.0));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_tracking_area_h */
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/view.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/view.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/view.h 1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CompositorServices.framework/Headers/view.h 2025-05-31 01:07:51
@@ -0,0 +1,157 @@
+//
+// view.h
+// CompositorServices
+//
+// Copyright © 2023 Apple. All rights reserved.
+//
+
+#ifndef cp_view_h
+#define cp_view_h
+
+CP_NONNULL_EXTERN_C_BEGIN
+
+/*!
+ * MARK: View Texture Map
+ */
+
+/// An opaque type that describes the relationship between a
+/// view and the underlying texture.
+///
+/// A texture map helps you locate the content for a specific view within
+/// a texture. Texture maps are especially important when a layer uses a
+/// single texture to manage multiple views. For example, a head-mounted
+/// display might store the images for both the left and right eyes in a
+/// single texture. Pass this type to other functions to get specific details
+/// about the current texture, such as its view bounds or its index into
+/// a texture array.
+CP_STRUCT_REF(cp_view_texture_map, cp_view_t.TextureMap, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the index of the view’s textures in the drawable.
+///
+/// - Parameters:
+/// - view_texture_map: The texture map for your view.
+/// - Returns: The index of the color or depth texture in the drawable.
+///
+/// Pass the returned index to the ``cp_drawable_get_color_texture``
+/// or ``cp_drawable_get_depth_texture`` function.
+size_t
+cp_view_texture_map_get_texture_index(cp_view_texture_map_t view_texture_map)
+CF_SWIFT_NAME(getter:cp_view_texture_map_t.textureIndex(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the index of the view’s texture in an array-based texture type.
+///
+/// - Parameters:
+/// - view_texture_map: The texture map for your view.
+/// - Returns: The index of the view’s texture in an array-based texture type.
+///
+/// Use the returned index to retrieve the view’s texture when the texture
+/// type is <doc://com.apple.documentation/documentation/metal/mtltexturetype/type2darray>.
+/// When configuring your render pass descriptor, specify the index in the
+/// <doc://com.apple.documentation/documentation/metal/mtlrenderpassattachmentdescriptor/1437914-slice>
+/// property of the descriptor’s color and depth attachments.
+///
+/// To request an array-based texture from your layer, configure your layer
+/// with the ``cp_layer_renderer_layout/cp_layer_renderer_layout_dedicated`` layout option.
+size_t
+cp_view_texture_map_get_slice_index(cp_view_texture_map_t view_texture_map)
+CF_SWIFT_NAME(getter:cp_view_texture_map_t.sliceIndex(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+#ifdef __OBJC__
+
+/// Returns the portion of the texture that the view uses to draw its content.
+///
+/// - Parameters:
+/// - view_texture_map: The texture map for your view.
+/// - Returns: A Metal viewport that specifies the view’s size and location
+/// in the texture.
+///
+/// Call this function to get the size of the view and its location within
+/// the texture. If the layer dedicates a separate texture to each view,
+/// the texture bounds and view bounds match. However, if the layer uses a
+/// shared or layered texture, the view’s location or other slice index
+/// might differ.
+MTLViewport
+cp_view_texture_map_get_viewport(cp_view_texture_map_t view_texture_map)
+CF_SWIFT_NAME(getter:cp_view_texture_map_t.viewport(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+#endif
+
+/*!
+ * MARK: View
+ */
+
+/// An opaque type that manages the information for how to render
+/// content into the current frame.
+///
+/// Compositor provides a view for each distinct render viewpoint.
+/// For example, a head-mounted display typically contains two views:
+/// one for each eye. Use the information in the views to set up your
+/// render pass descriptor. For example, use it to determine which
+/// part of a texture to fill with content.
+CP_STRUCT_REF(cp_view, cp_drawable_t.View, API_AVAILABLE(visionos(1.0), macosx(26.0)));
+
+/// Returns the texture map for this view.
+///
+/// - Parameters:
+/// - view: The view with the texture map.
+/// - Returns: The texture map for the layer assigned to this view.
+///
+/// Use the texture map to fetch additional information you need to
+/// draw your content. For example, use it to fetch the rectangle to
+/// use for drawing in the associated texture.
+cp_view_texture_map_t
+cp_view_get_view_texture_map(cp_view_t view)
+CF_SWIFT_NAME(getter:cp_view_t.textureMap(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the transformation matrix to convert between the device
+/// coordinate space to the position of the view in that space.
+///
+/// - Parameters:
+/// - view: The view to query.
+/// - Returns: A transform matrix to the device coordinate space
+/// from the view coordinate space.
+///
+/// When you generate a frame, you specify a pose matrix that indicates
+/// the device’s position and orientation in the world coordinate space.
+/// When the device is a head-mounted display, the view for each eye
+/// has an additional matrix to specify the position of that eye relative
+/// to the device’s pose. Multiply the device’s pose matrix by the
+/// returned matrix to obtain the view’s location in the world coordinate space.
+simd_float4x4
+cp_view_get_transform(cp_view_t view)
+CF_SWIFT_NAME(getter:cp_view_t.transform(self:)) API_AVAILABLE(visionos(1.0), macosx(26.0));
+
+/// Returns the tangent values for the angles you use to determine
+/// the planes of the viewing frustum.
+///
+/// - Parameters:
+/// - view: The view to query.
+/// - Returns: A vector that contains the left, right, top, and bottom
+/// tangent values in that order. In other words, the value at index 0
+/// contains the left tangent, the value at index 1 contains the right
+/// tangent, and so on. The angles and tangent values are always positive.
+///
+/// In a 3D scene, the viewing frustum is the volume between the near and
+/// far clipping planes that contains the scene’s visible content. When
+/// you render this content into a view, you generate a two-dimensional
+/// version of your content suitable for display onscreen. To ensure
+/// your content still looks three-dimensional, apply a perspective
+/// projection matrix to your content. This matrix scales your content
+/// appropriately based on its distance from the viewing point.
+///
+/// This function returns the tangent values you use to build the perspective
+/// projection matrix for your content. You can also use the values to
+/// determine the apparent size of the view at any distance from the viewing
+/// point. When you multiply a tangent value by a distance, you obtain
+/// the horizontal or vertical distance from the view’s center point to
+/// the corresponding rectangle edge at that distance. For a perspective
+/// projection matrix, multiply these values by the distance to the near
+/// clipping plane and combine them to create the matrix rows you need.
+simd_float4
+cp_view_get_tangents(cp_view_t view)
+API_DEPRECATED("Use cp_drawable_compute_projection instead", visionos(1.0, 2.0))
+API_UNAVAILABLE(macosx, ios)
+CF_SWIFT_NAME(getter:cp_view_t.tangents(self:));
+
+CP_NONNULL_EXTERN_C_END
+
+#endif /* cp_view_h */