objc2_metal/generated/
MTLRasterizationRate.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A helper object for convient access to samples stored in an array.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrasterizationratesamplearray?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct MTLRasterizationRateSampleArray;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for MTLRasterizationRateSampleArray {}
21);
22
23impl MTLRasterizationRateSampleArray {
24    extern_methods!(
25        /// Retrieves the sample value at the specified index.
26        ///
27        /// Returns: NSNumber instance describing the value of the sample at the specified index, or 0 if the index is out of range.
28        ///
29        /// # Safety
30        ///
31        /// `index` might not be bounds-checked.
32        #[unsafe(method(objectAtIndexedSubscript:))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn objectAtIndexedSubscript(&self, index: NSUInteger) -> Retained<NSNumber>;
35
36        /// Stores a sample value at the specified index.
37        ///
38        /// The value will be converted to a single precision floating point value.
39        ///
40        /// # Safety
41        ///
42        /// `index` might not be bounds-checked.
43        #[unsafe(method(setObject:atIndexedSubscript:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setObject_atIndexedSubscript(&self, value: &NSNumber, index: NSUInteger);
46    );
47}
48
49/// Methods declared on superclass `NSObject`.
50impl MTLRasterizationRateSampleArray {
51    extern_methods!(
52        #[unsafe(method(init))]
53        #[unsafe(method_family = init)]
54        pub fn init(this: Allocated<Self>) -> Retained<Self>;
55
56        #[unsafe(method(new))]
57        #[unsafe(method_family = new)]
58        pub fn new() -> Retained<Self>;
59    );
60}
61
62impl DefaultRetained for MTLRasterizationRateSampleArray {
63    #[inline]
64    fn default_retained() -> Retained<Self> {
65        Self::new()
66    }
67}
68
69extern_class!(
70    /// Describes the minimum rasterization rate screen space using two piecewise linear functions.
71    ///
72    /// The two piecewise linear function (PLF) describe the desired rasterization quality on the horizontal and vertical axis separately.
73    /// Each quality sample in the PLF is stored in an array as single precision floating point value between 0 (lowest quality) and 1 (highest quality).
74    /// The first sample in the array describes the quality at the top (vertical) or left (horizontal) edge of screen space.
75    /// The last sample in the array describes the quality at the bottom (vertical) or right (horizontal) edge of screen space.
76    /// All other samples are spaced equidistant in screen space.
77    /// MTLRasterizationRateLayerDescriptor instances will be stored inside a MTLRasterizationRateMapDescriptor which in turn is compiled by MTLDevice into a MTLRasterizationRateMap.
78    /// Because MTLDevice may not support the requested granularity, the provided samples may be rounded up (towards higher quality) during compilation.
79    ///
80    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrasterizationratelayerdescriptor?language=objc)
81    #[unsafe(super(NSObject))]
82    #[derive(Debug, PartialEq, Eq, Hash)]
83    pub struct MTLRasterizationRateLayerDescriptor;
84);
85
86extern_conformance!(
87    unsafe impl NSCopying for MTLRasterizationRateLayerDescriptor {}
88);
89
90unsafe impl CopyingHelper for MTLRasterizationRateLayerDescriptor {
91    type Result = Self;
92}
93
94extern_conformance!(
95    unsafe impl NSObjectProtocol for MTLRasterizationRateLayerDescriptor {}
96);
97
98impl MTLRasterizationRateLayerDescriptor {
99    extern_methods!(
100        /// Do not use, instead use initWithNumSamples:
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[cfg(feature = "MTLTypes")]
106        /// Initialize a descriptor for a layer with the given number of quality samples on the horizontal and vertical axis.
107        ///
108        /// Parameter `sampleCount`: The width and height components are the number of samples on the horizontal and vertical axis respectively. The depth component is ignored.
109        ///
110        /// All values are initialized to zero.
111        ///
112        /// # Safety
113        ///
114        /// `sampleCount` might not be bounds-checked.
115        #[unsafe(method(initWithSampleCount:))]
116        #[unsafe(method_family = init)]
117        pub unsafe fn initWithSampleCount(
118            this: Allocated<Self>,
119            sample_count: MTLSize,
120        ) -> Retained<Self>;
121
122        #[cfg(feature = "MTLTypes")]
123        /// Initialize a descriptor for a layer with the given number of quality samples on the horizontal and vertical axis.
124        ///
125        /// Parameter `sampleCount`: The width and height components are the number of samples on the horizontal and vertical axis respectively. The depth component is ignored.
126        ///
127        /// Parameter `horizontal`: The initial sample values on the horizontal axis. Must point to an array of sampleCount.width elements, of which the values will be copied into the MTLRasterizationRateLayerDescriptor.
128        ///
129        /// Parameter `vertical`: The initial sample values on the vertical axis. Must point to an array of sampleCount.height elements, of which the values will be copied into the MTLRasterizationRateLayerDescriptor.
130        ///
131        /// Use initWithSampleCount: to initialize with zeroes instead.
132        ///
133        /// # Safety
134        ///
135        /// - `sampleCount` might not be bounds-checked.
136        /// - `horizontal` must be a valid pointer.
137        /// - `vertical` must be a valid pointer.
138        #[unsafe(method(initWithSampleCount:horizontal:vertical:))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn initWithSampleCount_horizontal_vertical(
141            this: Allocated<Self>,
142            sample_count: MTLSize,
143            horizontal: NonNull<c_float>,
144            vertical: NonNull<c_float>,
145        ) -> Retained<Self>;
146
147        #[cfg(feature = "MTLTypes")]
148        /// Returns: The maximum number of quality samples that this descriptor can use to describe its function, for the horizontal and vertical axis, this is the sampleCount that the descriptor was initialized with. The depth component of the returned MTLSize is always 0.
149        #[unsafe(method(maxSampleCount))]
150        #[unsafe(method_family = none)]
151        pub fn maxSampleCount(&self) -> MTLSize;
152
153        /// Provide direct access to the quality samples stored in the descriptor.
154        ///
155        /// Returns: Pointer to the (mutable) storage array for samples on the horizontal axis.
156        ///
157        /// The returned pointer points to the first element of an array of sampleCount.width elements.
158        #[unsafe(method(horizontalSampleStorage))]
159        #[unsafe(method_family = none)]
160        pub fn horizontalSampleStorage(&self) -> NonNull<c_float>;
161
162        /// Provide direct access to the quality samples stored in the descriptor.
163        ///
164        /// Returns: Pointer to the (mutable) storage array for samples on the vertical axis.
165        ///
166        /// The returned pointer points to the first element of an array of sampleCount.height elements.
167        #[unsafe(method(verticalSampleStorage))]
168        #[unsafe(method_family = none)]
169        pub fn verticalSampleStorage(&self) -> NonNull<c_float>;
170
171        /// Provide convenient bounds-checked access to the quality samples stored in the descriptor.
172        ///
173        /// Returns: Returns a syntactic sugar helper to get or set sample values on the horizontal axis.
174        #[unsafe(method(horizontal))]
175        #[unsafe(method_family = none)]
176        pub fn horizontal(&self) -> Retained<MTLRasterizationRateSampleArray>;
177
178        /// Provide convenient bounds-checked access to the quality samples stored in the descriptor.
179        ///
180        /// Returns: Returns a syntactic sugar helper to get or set sample values on the vertical axis.
181        #[unsafe(method(vertical))]
182        #[unsafe(method_family = none)]
183        pub fn vertical(&self) -> Retained<MTLRasterizationRateSampleArray>;
184    );
185}
186
187/// Methods declared on superclass `NSObject`.
188impl MTLRasterizationRateLayerDescriptor {
189    extern_methods!(
190        #[unsafe(method(new))]
191        #[unsafe(method_family = new)]
192        pub fn new() -> Retained<Self>;
193    );
194}
195
196impl DefaultRetained for MTLRasterizationRateLayerDescriptor {
197    #[inline]
198    fn default_retained() -> Retained<Self> {
199        Self::new()
200    }
201}
202
203impl MTLRasterizationRateLayerDescriptor {
204    extern_methods!(
205        #[cfg(feature = "MTLTypes")]
206        /// Setter for [`sampleCount`][Self::sampleCount].
207        ///
208        /// # Safety
209        ///
210        /// This might not be bounds-checked.
211        #[unsafe(method(setSampleCount:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn setSampleCount(&self, sample_count: MTLSize);
214    );
215}
216
217extern_class!(
218    /// Mutable array of MTLRasterizationRateLayerDescriptor
219    ///
220    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrasterizationratelayerarray?language=objc)
221    #[unsafe(super(NSObject))]
222    #[derive(Debug, PartialEq, Eq, Hash)]
223    pub struct MTLRasterizationRateLayerArray;
224);
225
226extern_conformance!(
227    unsafe impl NSObjectProtocol for MTLRasterizationRateLayerArray {}
228);
229
230impl MTLRasterizationRateLayerArray {
231    extern_methods!(
232        /// Returns: The MTLRasterizationRateLayerDescriptor instance for the given layerIndex, or nil if no instance hasn't been set for this index.
233        ///
234        /// Use setObject:atIndexedSubscript: to set the layer
235        ///
236        /// # Safety
237        ///
238        /// `layerIndex` might not be bounds-checked.
239        #[unsafe(method(objectAtIndexedSubscript:))]
240        #[unsafe(method_family = none)]
241        pub unsafe fn objectAtIndexedSubscript(
242            &self,
243            layer_index: NSUInteger,
244        ) -> Option<Retained<MTLRasterizationRateLayerDescriptor>>;
245
246        /// Sets the MTLRasterizationRateLayerDescriptor instance for the given layerIndex.
247        ///
248        /// The previous instance at this index will be overwritten.
249        ///
250        /// # Safety
251        ///
252        /// `layerIndex` might not be bounds-checked.
253        #[unsafe(method(setObject:atIndexedSubscript:))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn setObject_atIndexedSubscript(
256            &self,
257            layer: Option<&MTLRasterizationRateLayerDescriptor>,
258            layer_index: NSUInteger,
259        );
260    );
261}
262
263/// Methods declared on superclass `NSObject`.
264impl MTLRasterizationRateLayerArray {
265    extern_methods!(
266        #[unsafe(method(init))]
267        #[unsafe(method_family = init)]
268        pub fn init(this: Allocated<Self>) -> Retained<Self>;
269
270        #[unsafe(method(new))]
271        #[unsafe(method_family = new)]
272        pub fn new() -> Retained<Self>;
273    );
274}
275
276impl DefaultRetained for MTLRasterizationRateLayerArray {
277    #[inline]
278    fn default_retained() -> Retained<Self> {
279        Self::new()
280    }
281}
282
283extern_class!(
284    /// Describes a MTLRasterizationRateMap containing an arbitrary number of MTLRasterizationRateLayerDescriptor instances.
285    ///
286    /// An MTLRasterizationRateMapDescriptor is compiled into an MTLRasterizationRateMap using MTLDevice.
287    ///
288    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrasterizationratemapdescriptor?language=objc)
289    #[unsafe(super(NSObject))]
290    #[derive(Debug, PartialEq, Eq, Hash)]
291    pub struct MTLRasterizationRateMapDescriptor;
292);
293
294extern_conformance!(
295    unsafe impl NSCopying for MTLRasterizationRateMapDescriptor {}
296);
297
298unsafe impl CopyingHelper for MTLRasterizationRateMapDescriptor {
299    type Result = Self;
300}
301
302extern_conformance!(
303    unsafe impl NSObjectProtocol for MTLRasterizationRateMapDescriptor {}
304);
305
306impl MTLRasterizationRateMapDescriptor {
307    extern_methods!(
308        #[cfg(feature = "MTLTypes")]
309        /// Convenience descriptor creation function without layers
310        ///
311        /// Parameter `screenSize`: The dimensions, in screen space pixels, of the region where variable rasterization is applied. The depth component of MTLSize is ignored.
312        ///
313        /// Returns: A descriptor containing no layers. Add or remove layers using setObject:atIndexedSubscript:.
314        ///
315        /// # Safety
316        ///
317        /// `screenSize` might not be bounds-checked.
318        #[unsafe(method(rasterizationRateMapDescriptorWithScreenSize:))]
319        #[unsafe(method_family = none)]
320        pub unsafe fn rasterizationRateMapDescriptorWithScreenSize(
321            screen_size: MTLSize,
322        ) -> Retained<MTLRasterizationRateMapDescriptor>;
323
324        #[cfg(feature = "MTLTypes")]
325        /// Convenience descriptor creation function for a single layer.
326        ///
327        /// Parameter `screenSize`: The dimensions, in screen space pixels, of the region where variable rasterization is applied. The depth component of MTLSize is ignored.
328        ///
329        /// Parameter `layer`: The single layer describing how the rasterization rate varies in screen space
330        ///
331        /// Returns: A descriptor containing a single layer. Add or remove layers using setObject:atIndexedSubscript:.
332        ///
333        /// # Safety
334        ///
335        /// `screenSize` might not be bounds-checked.
336        #[unsafe(method(rasterizationRateMapDescriptorWithScreenSize:layer:))]
337        #[unsafe(method_family = none)]
338        pub unsafe fn rasterizationRateMapDescriptorWithScreenSize_layer(
339            screen_size: MTLSize,
340            layer: &MTLRasterizationRateLayerDescriptor,
341        ) -> Retained<MTLRasterizationRateMapDescriptor>;
342
343        /// Returns: The MTLRasterizationRateLayerDescriptor instance for the given layerIndex, or nil if no instance hasn't been set for this index.
344        ///
345        /// Use setLayer:atIndex: to add or set the layer.
346        /// Identical to "layers[layerIndex]".
347        ///
348        /// # Safety
349        ///
350        /// `layerIndex` might not be bounds-checked.
351        #[unsafe(method(layerAtIndex:))]
352        #[unsafe(method_family = none)]
353        pub unsafe fn layerAtIndex(
354            &self,
355            layer_index: NSUInteger,
356        ) -> Option<Retained<MTLRasterizationRateLayerDescriptor>>;
357
358        /// Sets the MTLRasterizationRateLayerDescriptor instance for the given layerIndex.
359        ///
360        /// The previous instance at the index, if any, will be overwritten.
361        /// Set nil to an index to remove the layer at that index from the descriptor.
362        /// Identical to "layers[layerIndex] = layer".
363        ///
364        /// # Safety
365        ///
366        /// `layerIndex` might not be bounds-checked.
367        #[unsafe(method(setLayer:atIndex:))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn setLayer_atIndex(
370            &self,
371            layer: Option<&MTLRasterizationRateLayerDescriptor>,
372            layer_index: NSUInteger,
373        );
374
375        /// Returns: A modifiable array of layers
376        ///
377        /// Accesses the layers currently stored in the descriptor.
378        /// Syntactic sugar around "layerAtIndex:" and "setLayer:atIndex:"
379        #[unsafe(method(layers))]
380        #[unsafe(method_family = none)]
381        pub fn layers(&self) -> Retained<MTLRasterizationRateLayerArray>;
382
383        #[cfg(feature = "MTLTypes")]
384        /// Returns: The dimensions, in screen space pixels, of the region where variable rasterization is applied.
385        ///
386        /// The region always has its origin at [0, 0].
387        /// The depth component of MTLSize is ignored.
388        #[unsafe(method(screenSize))]
389        #[unsafe(method_family = none)]
390        pub fn screenSize(&self) -> MTLSize;
391
392        #[cfg(feature = "MTLTypes")]
393        /// Setter for [`screenSize`][Self::screenSize].
394        ///
395        /// # Safety
396        ///
397        /// This might not be bounds-checked.
398        #[unsafe(method(setScreenSize:))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn setScreenSize(&self, screen_size: MTLSize);
401
402        /// A string to help identify this object.
403        ///
404        /// The default value is nil.
405        #[unsafe(method(label))]
406        #[unsafe(method_family = none)]
407        pub fn label(&self) -> Option<Retained<NSString>>;
408
409        /// Setter for [`label`][Self::label].
410        ///
411        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
412        #[unsafe(method(setLabel:))]
413        #[unsafe(method_family = none)]
414        pub fn setLabel(&self, label: Option<&NSString>);
415
416        /// Returns: The number of subsequent non-nil layer instances stored in the descriptor, starting at index 0.
417        ///
418        /// This property is modified by setting new layer instances using setLayer:atIndex: or assigning to layers[X]
419        #[unsafe(method(layerCount))]
420        #[unsafe(method_family = none)]
421        pub fn layerCount(&self) -> NSUInteger;
422    );
423}
424
425/// Methods declared on superclass `NSObject`.
426impl MTLRasterizationRateMapDescriptor {
427    extern_methods!(
428        #[unsafe(method(init))]
429        #[unsafe(method_family = init)]
430        pub fn init(this: Allocated<Self>) -> Retained<Self>;
431
432        #[unsafe(method(new))]
433        #[unsafe(method_family = new)]
434        pub fn new() -> Retained<Self>;
435    );
436}
437
438impl DefaultRetained for MTLRasterizationRateMapDescriptor {
439    #[inline]
440    fn default_retained() -> Retained<Self> {
441        Self::new()
442    }
443}
444
445extern_protocol!(
446    /// Compiled read-only object that determines how variable rasterization rate is applied when rendering.
447    ///
448    /// A variable rasterization rate map is compiled by MTLDevice from a MTLRasterizationRateMapDescriptor containing one or more MTLRasterizationRateLayerDescriptor.
449    /// During compilation, the quality samples provided in the MTLRasterizationRateLayerDescriptor may be rounded up to the nearest supported value or granularity, depending on hardware support.
450    /// However, the compilation will never round values down, so the actual rasterization will always happen at a quality level matching or exceeding the provided quality samples.
451    /// During rasterization using the MTLRasterizationRateMap the screen space rendering is stored in a smaller area of the framebuffer, such that lower quality regions will not occupy as many texels as higher quality regions.
452    /// The quality will never exceed 1:1 in any region of screen space.
453    /// Because a smaller area of the framebuffer is populated, less fragment shader invocations are required to render content, and less bandwidth is consumed to store the shaded values.
454    /// Use a rasterization rate map to reduce rendering quality in less-important or less-sampled regions of the framebuffer, such as the periphery of a VR/AR display or a far-away cascade of a shadow map.
455    ///
456    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrasterizationratemap?language=objc)
457    pub unsafe trait MTLRasterizationRateMap: NSObjectProtocol + Send + Sync {
458        #[cfg(feature = "MTLDevice")]
459        /// Returns: The device on which the rasterization rate map was created
460        #[unsafe(method(device))]
461        #[unsafe(method_family = none)]
462        fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
463
464        /// A string to help identify this object.
465        #[unsafe(method(label))]
466        #[unsafe(method_family = none)]
467        fn label(&self) -> Option<Retained<NSString>>;
468
469        #[cfg(feature = "MTLTypes")]
470        /// Returns: The dimensions, in screen space pixels, of the region where variable rasterization is applied.
471        ///
472        /// The region always has its origin at [0, 0].
473        /// The depth component of the returned MTLSize is always 0.
474        #[unsafe(method(screenSize))]
475        #[unsafe(method_family = none)]
476        fn screenSize(&self) -> MTLSize;
477
478        #[cfg(feature = "MTLTypes")]
479        /// Returns: The granularity, in physical pixels, at which variable rasterization rate varies.
480        ///
481        /// Rendering algorithms that use binning or tiling in screen space may want to determine the screen space bin size using this value.
482        /// The depth component of the returned MTLSize is always 0.
483        #[unsafe(method(physicalGranularity))]
484        #[unsafe(method_family = none)]
485        fn physicalGranularity(&self) -> MTLSize;
486
487        /// Returns: The number of different configured layers in the rasterization map.
488        ///
489        /// Different render-target layers may target different variable rasterization configurations.
490        /// The rasterization rate layer for a primitive is selected on the [[render_target_layer_index]].
491        #[unsafe(method(layerCount))]
492        #[unsafe(method_family = none)]
493        fn layerCount(&self) -> NSUInteger;
494
495        #[cfg(feature = "MTLDevice")]
496        /// Returns the size and alignment requirements of the parameter buffer for this rate map.
497        ///
498        /// The parameter data can be copied into a buffer with this size and alignment using copyParameterDataToBuffer:offset:
499        #[unsafe(method(parameterBufferSizeAndAlign))]
500        #[unsafe(method_family = none)]
501        fn parameterBufferSizeAndAlign(&self) -> MTLSizeAndAlign;
502
503        #[cfg(all(
504            feature = "MTLAllocation",
505            feature = "MTLBuffer",
506            feature = "MTLResource"
507        ))]
508        /// Copy the parameter data into the provided buffer at the provided offset.
509        ///
510        /// The buffer must have storageMode MTLStorageModeShared, and a size of at least parameterBufferSizeAndAlign.size + offset.
511        /// The specified offset must be a multiple of parameterBufferSize.align.
512        /// The buffer can be bound to a shader stage to map screen space to physical fragment space, or vice versa.
513        ///
514        /// # Safety
515        ///
516        /// - `buffer` may need to be synchronized.
517        /// - `buffer` may be unretained, you must ensure it is kept alive while in use.
518        /// - `buffer` contents should be of the correct type.
519        /// - `offset` might not be bounds-checked.
520        #[unsafe(method(copyParameterDataToBuffer:offset:))]
521        #[unsafe(method_family = none)]
522        unsafe fn copyParameterDataToBuffer_offset(
523            &self,
524            buffer: &ProtocolObject<dyn MTLBuffer>,
525            offset: NSUInteger,
526        );
527
528        #[cfg(feature = "MTLTypes")]
529        /// The dimensions, in physical fragments, of the area in the render target where variable rasterization is applied
530        ///
531        /// Different configured layers may have a different rasterization rate and may have different size after rendering.
532        /// The rasterization rate layer for a primitive is selected on the [[render_target_layer_index]].
533        ///
534        /// # Safety
535        ///
536        /// `layerIndex` might not be bounds-checked.
537        #[unsafe(method(physicalSizeForLayer:))]
538        #[unsafe(method_family = none)]
539        unsafe fn physicalSizeForLayer(&self, layer_index: NSUInteger) -> MTLSize;
540
541        #[cfg(feature = "MTLTypes")]
542        /// Computes where an offset relative to the top-left of screen space, in screen space pixels, would end up in the framebuffer, in physical fragments.
543        /// The returned value is less-or-equal the input value because the rasterization quality never exceeds 1:1 in any region.
544        ///
545        /// # Safety
546        ///
547        /// `layerIndex` might not be bounds-checked.
548        #[unsafe(method(mapScreenToPhysicalCoordinates:forLayer:))]
549        #[unsafe(method_family = none)]
550        unsafe fn mapScreenToPhysicalCoordinates_forLayer(
551            &self,
552            screen_coordinates: MTLCoordinate2D,
553            layer_index: NSUInteger,
554        ) -> MTLCoordinate2D;
555
556        #[cfg(feature = "MTLTypes")]
557        /// Computes where an offset relative to the top-left of the framebuffer, in physical pixels, would end up in screen space, in screen space pixels.
558        /// The returned value is greater-or-equal the input value because the rasterization quality never exceeds 1:1 in any region.
559        ///
560        /// # Safety
561        ///
562        /// `layerIndex` might not be bounds-checked.
563        #[unsafe(method(mapPhysicalToScreenCoordinates:forLayer:))]
564        #[unsafe(method_family = none)]
565        unsafe fn mapPhysicalToScreenCoordinates_forLayer(
566            &self,
567            physical_coordinates: MTLCoordinate2D,
568            layer_index: NSUInteger,
569        ) -> MTLCoordinate2D;
570    }
571);