yum-mirror/VkFFT

git clone https://git.yummers.dev/yum-mirror/VkFFT

Tolmachev DmitriiMetal support in VkFFTba7001c

develop
23.2 KiB658 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Metal/MTLTexture.hpp
4//
5// Copyright 2020-2021 Apple Inc.
6//
7// Licensed under the Apache License, Version 2.0 (the "License");
8// you may not use this file except in compliance with the License.
9// You may obtain a copy of the License at
10//
11//     http://www.apache.org/licenses/LICENSE-2.0
12//
13// Unless required by applicable law or agreed to in writing, software
14// distributed under the License is distributed on an "AS IS" BASIS,
15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16// See the License for the specific language governing permissions and
17// limitations under the License.
18//
19//-------------------------------------------------------------------------------------------------------------------------------------------------------------
20
21#pragma once
22
23#include "MTLDefines.hpp"
24#include "MTLHeaderBridge.hpp"
25#include "MTLPrivate.hpp"
26
27#include <Foundation/Foundation.hpp>
28
29#include "MTLPixelFormat.hpp"
30#include "MTLResource.hpp"
31#include "MTLTexture.hpp"
32#include "MTLTypes.hpp"
33#include <IOSurface/IOSurfaceRef.h>
34
35namespace MTL
36{
37_MTL_ENUM(NS::UInteger, TextureType) {
38    TextureType1D = 0,
39    TextureType1DArray = 1,
40    TextureType2D = 2,
41    TextureType2DArray = 3,
42    TextureType2DMultisample = 4,
43    TextureTypeCube = 5,
44    TextureTypeCubeArray = 6,
45    TextureType3D = 7,
46    TextureType2DMultisampleArray = 8,
47    TextureTypeTextureBuffer = 9,
48};
49
50_MTL_ENUM(uint8_t, TextureSwizzle) {
51    TextureSwizzleZero = 0,
52    TextureSwizzleOne = 1,
53    TextureSwizzleRed = 2,
54    TextureSwizzleGreen = 3,
55    TextureSwizzleBlue = 4,
56    TextureSwizzleAlpha = 5,
57};
58
59struct TextureSwizzleChannels
60{
61    MTL::TextureSwizzle red;
62    MTL::TextureSwizzle green;
63    MTL::TextureSwizzle blue;
64    MTL::TextureSwizzle alpha;
65} _MTL_PACKED;
66
67class SharedTextureHandle : public NS::Referencing<SharedTextureHandle>
68{
69public:
70    static class SharedTextureHandle* alloc();
71
72    class SharedTextureHandle*        init();
73
74    class Device*                     device() const;
75
76    NS::String*                       label() const;
77};
78
79struct SharedTextureHandlePrivate
80{
81} _MTL_PACKED;
82
83_MTL_OPTIONS(NS::UInteger, TextureUsage) {
84    TextureUsageUnknown = 0,
85    TextureUsageShaderRead = 1,
86    TextureUsageShaderWrite = 2,
87    TextureUsageRenderTarget = 4,
88    TextureUsagePixelFormatView = 16,
89};
90
91_MTL_ENUM(NS::Integer, TextureCompressionType) {
92    TextureCompressionTypeLossless = 0,
93    TextureCompressionTypeLossy = 1,
94};
95
96class TextureDescriptor : public NS::Copying<TextureDescriptor>
97{
98public:
99    static class TextureDescriptor* alloc();
100
101    class TextureDescriptor*        init();
102
103    static class TextureDescriptor* texture2DDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, NS::UInteger height, bool mipmapped);
104
105    static class TextureDescriptor* textureCubeDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger size, bool mipmapped);
106
107    static class TextureDescriptor* textureBufferDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, MTL::ResourceOptions resourceOptions, MTL::TextureUsage usage);
108
109    MTL::TextureType                textureType() const;
110    void                            setTextureType(MTL::TextureType textureType);
111
112    MTL::PixelFormat                pixelFormat() const;
113    void                            setPixelFormat(MTL::PixelFormat pixelFormat);
114
115    NS::UInteger                    width() const;
116    void                            setWidth(NS::UInteger width);
117
118    NS::UInteger                    height() const;
119    void                            setHeight(NS::UInteger height);
120
121    NS::UInteger                    depth() const;
122    void                            setDepth(NS::UInteger depth);
123
124    NS::UInteger                    mipmapLevelCount() const;
125    void                            setMipmapLevelCount(NS::UInteger mipmapLevelCount);
126
127    NS::UInteger                    sampleCount() const;
128    void                            setSampleCount(NS::UInteger sampleCount);
129
130    NS::UInteger                    arrayLength() const;
131    void                            setArrayLength(NS::UInteger arrayLength);
132
133    MTL::ResourceOptions            resourceOptions() const;
134    void                            setResourceOptions(MTL::ResourceOptions resourceOptions);
135
136    MTL::CPUCacheMode               cpuCacheMode() const;
137    void                            setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode);
138
139    MTL::StorageMode                storageMode() const;
140    void                            setStorageMode(MTL::StorageMode storageMode);
141
142    MTL::HazardTrackingMode         hazardTrackingMode() const;
143    void                            setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode);
144
145    MTL::TextureUsage               usage() const;
146    void                            setUsage(MTL::TextureUsage usage);
147
148    bool                            allowGPUOptimizedContents() const;
149    void                            setAllowGPUOptimizedContents(bool allowGPUOptimizedContents);
150
151    MTL::TextureSwizzleChannels     swizzle() const;
152    void                            setSwizzle(MTL::TextureSwizzleChannels swizzle);
153};
154
155class Texture : public NS::Referencing<Texture, Resource>
156{
157public:
158    class Resource*             rootResource() const;
159
160    class Texture*              parentTexture() const;
161
162    NS::UInteger                parentRelativeLevel() const;
163
164    NS::UInteger                parentRelativeSlice() const;
165
166    class Buffer*               buffer() const;
167
168    NS::UInteger                bufferOffset() const;
169
170    NS::UInteger                bufferBytesPerRow() const;
171
172    IOSurfaceRef                iosurface() const;
173
174    NS::UInteger                iosurfacePlane() const;
175
176    MTL::TextureType            textureType() const;
177
178    MTL::PixelFormat            pixelFormat() const;
179
180    NS::UInteger                width() const;
181
182    NS::UInteger                height() const;
183
184    NS::UInteger                depth() const;
185
186    NS::UInteger                mipmapLevelCount() const;
187
188    NS::UInteger                sampleCount() const;
189
190    NS::UInteger                arrayLength() const;
191
192    MTL::TextureUsage           usage() const;
193
194    bool                        shareable() const;
195
196    bool                        framebufferOnly() const;
197
198    NS::UInteger                firstMipmapInTail() const;
199
200    NS::UInteger                tailSizeInBytes() const;
201
202    bool                        isSparse() const;
203
204    bool                        allowGPUOptimizedContents() const;
205
206    void                        getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage, MTL::Region region, NS::UInteger level, NS::UInteger slice);
207
208    void                        replaceRegion(MTL::Region region, NS::UInteger level, NS::UInteger slice, const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage);
209
210    void                        getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, MTL::Region region, NS::UInteger level);
211
212    void                        replaceRegion(MTL::Region region, NS::UInteger level, const void* pixelBytes, NS::UInteger bytesPerRow);
213
214    class Texture*              newTextureView(MTL::PixelFormat pixelFormat);
215
216    class Texture*              newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange);
217
218    class SharedTextureHandle*  newSharedTextureHandle();
219
220    class Texture*              remoteStorageTexture() const;
221
222    class Texture*              newRemoteTextureViewForDevice(const class Device* device);
223
224    MTL::TextureSwizzleChannels swizzle() const;
225
226    class Texture*              newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange, MTL::TextureSwizzleChannels swizzle);
227};
228
229}
230
231// static method: alloc
232_MTL_INLINE MTL::SharedTextureHandle* MTL::SharedTextureHandle::alloc()
233{
234    return NS::Object::alloc<MTL::SharedTextureHandle>(_MTL_PRIVATE_CLS(MTLSharedTextureHandle));
235}
236
237// method: init
238_MTL_INLINE MTL::SharedTextureHandle* MTL::SharedTextureHandle::init()
239{
240    return NS::Object::init<MTL::SharedTextureHandle>();
241}
242
243// property: device
244_MTL_INLINE MTL::Device* MTL::SharedTextureHandle::device() const
245{
246    return Object::sendMessage<MTL::Device*>(this, _MTL_PRIVATE_SEL(device));
247}
248
249// property: label
250_MTL_INLINE NS::String* MTL::SharedTextureHandle::label() const
251{
252    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
253}
254
255// static method: alloc
256_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::alloc()
257{
258    return NS::Object::alloc<MTL::TextureDescriptor>(_MTL_PRIVATE_CLS(MTLTextureDescriptor));
259}
260
261// method: init
262_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::init()
263{
264    return NS::Object::init<MTL::TextureDescriptor>();
265}
266
267// static method: texture2DDescriptorWithPixelFormat:width:height:mipmapped:
268_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::texture2DDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, NS::UInteger height, bool mipmapped)
269{
270    return Object::sendMessage<MTL::TextureDescriptor*>(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(texture2DDescriptorWithPixelFormat_width_height_mipmapped_), pixelFormat, width, height, mipmapped);
271}
272
273// static method: textureCubeDescriptorWithPixelFormat:size:mipmapped:
274_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::textureCubeDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger size, bool mipmapped)
275{
276    return Object::sendMessage<MTL::TextureDescriptor*>(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(textureCubeDescriptorWithPixelFormat_size_mipmapped_), pixelFormat, size, mipmapped);
277}
278
279// static method: textureBufferDescriptorWithPixelFormat:width:resourceOptions:usage:
280_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::textureBufferDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, MTL::ResourceOptions resourceOptions, MTL::TextureUsage usage)
281{
282    return Object::sendMessage<MTL::TextureDescriptor*>(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(textureBufferDescriptorWithPixelFormat_width_resourceOptions_usage_), pixelFormat, width, resourceOptions, usage);
283}
284
285// property: textureType
286_MTL_INLINE MTL::TextureType MTL::TextureDescriptor::textureType() const
287{
288    return Object::sendMessage<MTL::TextureType>(this, _MTL_PRIVATE_SEL(textureType));
289}
290
291_MTL_INLINE void MTL::TextureDescriptor::setTextureType(MTL::TextureType textureType)
292{
293    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTextureType_), textureType);
294}
295
296// property: pixelFormat
297_MTL_INLINE MTL::PixelFormat MTL::TextureDescriptor::pixelFormat() const
298{
299    return Object::sendMessage<MTL::PixelFormat>(this, _MTL_PRIVATE_SEL(pixelFormat));
300}
301
302_MTL_INLINE void MTL::TextureDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat)
303{
304    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat);
305}
306
307// property: width
308_MTL_INLINE NS::UInteger MTL::TextureDescriptor::width() const
309{
310    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(width));
311}
312
313_MTL_INLINE void MTL::TextureDescriptor::setWidth(NS::UInteger width)
314{
315    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setWidth_), width);
316}
317
318// property: height
319_MTL_INLINE NS::UInteger MTL::TextureDescriptor::height() const
320{
321    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(height));
322}
323
324_MTL_INLINE void MTL::TextureDescriptor::setHeight(NS::UInteger height)
325{
326    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setHeight_), height);
327}
328
329// property: depth
330_MTL_INLINE NS::UInteger MTL::TextureDescriptor::depth() const
331{
332    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(depth));
333}
334
335_MTL_INLINE void MTL::TextureDescriptor::setDepth(NS::UInteger depth)
336{
337    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setDepth_), depth);
338}
339
340// property: mipmapLevelCount
341_MTL_INLINE NS::UInteger MTL::TextureDescriptor::mipmapLevelCount() const
342{
343    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(mipmapLevelCount));
344}
345
346_MTL_INLINE void MTL::TextureDescriptor::setMipmapLevelCount(NS::UInteger mipmapLevelCount)
347{
348    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setMipmapLevelCount_), mipmapLevelCount);
349}
350
351// property: sampleCount
352_MTL_INLINE NS::UInteger MTL::TextureDescriptor::sampleCount() const
353{
354    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(sampleCount));
355}
356
357_MTL_INLINE void MTL::TextureDescriptor::setSampleCount(NS::UInteger sampleCount)
358{
359    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount);
360}
361
362// property: arrayLength
363_MTL_INLINE NS::UInteger MTL::TextureDescriptor::arrayLength() const
364{
365    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(arrayLength));
366}
367
368_MTL_INLINE void MTL::TextureDescriptor::setArrayLength(NS::UInteger arrayLength)
369{
370    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setArrayLength_), arrayLength);
371}
372
373// property: resourceOptions
374_MTL_INLINE MTL::ResourceOptions MTL::TextureDescriptor::resourceOptions() const
375{
376    return Object::sendMessage<MTL::ResourceOptions>(this, _MTL_PRIVATE_SEL(resourceOptions));
377}
378
379_MTL_INLINE void MTL::TextureDescriptor::setResourceOptions(MTL::ResourceOptions resourceOptions)
380{
381    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setResourceOptions_), resourceOptions);
382}
383
384// property: cpuCacheMode
385_MTL_INLINE MTL::CPUCacheMode MTL::TextureDescriptor::cpuCacheMode() const
386{
387    return Object::sendMessage<MTL::CPUCacheMode>(this, _MTL_PRIVATE_SEL(cpuCacheMode));
388}
389
390_MTL_INLINE void MTL::TextureDescriptor::setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode)
391{
392    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setCpuCacheMode_), cpuCacheMode);
393}
394
395// property: storageMode
396_MTL_INLINE MTL::StorageMode MTL::TextureDescriptor::storageMode() const
397{
398    return Object::sendMessage<MTL::StorageMode>(this, _MTL_PRIVATE_SEL(storageMode));
399}
400
401_MTL_INLINE void MTL::TextureDescriptor::setStorageMode(MTL::StorageMode storageMode)
402{
403    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode);
404}
405
406// property: hazardTrackingMode
407_MTL_INLINE MTL::HazardTrackingMode MTL::TextureDescriptor::hazardTrackingMode() const
408{
409    return Object::sendMessage<MTL::HazardTrackingMode>(this, _MTL_PRIVATE_SEL(hazardTrackingMode));
410}
411
412_MTL_INLINE void MTL::TextureDescriptor::setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode)
413{
414    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setHazardTrackingMode_), hazardTrackingMode);
415}
416
417// property: usage
418_MTL_INLINE MTL::TextureUsage MTL::TextureDescriptor::usage() const
419{
420    return Object::sendMessage<MTL::TextureUsage>(this, _MTL_PRIVATE_SEL(usage));
421}
422
423_MTL_INLINE void MTL::TextureDescriptor::setUsage(MTL::TextureUsage usage)
424{
425    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setUsage_), usage);
426}
427
428// property: allowGPUOptimizedContents
429_MTL_INLINE bool MTL::TextureDescriptor::allowGPUOptimizedContents() const
430{
431    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(allowGPUOptimizedContents));
432}
433
434_MTL_INLINE void MTL::TextureDescriptor::setAllowGPUOptimizedContents(bool allowGPUOptimizedContents)
435{
436    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setAllowGPUOptimizedContents_), allowGPUOptimizedContents);
437}
438
439// property: swizzle
440_MTL_INLINE MTL::TextureSwizzleChannels MTL::TextureDescriptor::swizzle() const
441{
442    return Object::sendMessage<MTL::TextureSwizzleChannels>(this, _MTL_PRIVATE_SEL(swizzle));
443}
444
445_MTL_INLINE void MTL::TextureDescriptor::setSwizzle(MTL::TextureSwizzleChannels swizzle)
446{
447    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSwizzle_), swizzle);
448}
449
450// property: rootResource
451_MTL_INLINE MTL::Resource* MTL::Texture::rootResource() const
452{
453    return Object::sendMessage<MTL::Resource*>(this, _MTL_PRIVATE_SEL(rootResource));
454}
455
456// property: parentTexture
457_MTL_INLINE MTL::Texture* MTL::Texture::parentTexture() const
458{
459    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(parentTexture));
460}
461
462// property: parentRelativeLevel
463_MTL_INLINE NS::UInteger MTL::Texture::parentRelativeLevel() const
464{
465    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(parentRelativeLevel));
466}
467
468// property: parentRelativeSlice
469_MTL_INLINE NS::UInteger MTL::Texture::parentRelativeSlice() const
470{
471    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(parentRelativeSlice));
472}
473
474// property: buffer
475_MTL_INLINE MTL::Buffer* MTL::Texture::buffer() const
476{
477    return Object::sendMessage<MTL::Buffer*>(this, _MTL_PRIVATE_SEL(buffer));
478}
479
480// property: bufferOffset
481_MTL_INLINE NS::UInteger MTL::Texture::bufferOffset() const
482{
483    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(bufferOffset));
484}
485
486// property: bufferBytesPerRow
487_MTL_INLINE NS::UInteger MTL::Texture::bufferBytesPerRow() const
488{
489    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(bufferBytesPerRow));
490}
491
492// property: iosurface
493_MTL_INLINE IOSurfaceRef MTL::Texture::iosurface() const
494{
495    return Object::sendMessage<IOSurfaceRef>(this, _MTL_PRIVATE_SEL(iosurface));
496}
497
498// property: iosurfacePlane
499_MTL_INLINE NS::UInteger MTL::Texture::iosurfacePlane() const
500{
501    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(iosurfacePlane));
502}
503
504// property: textureType
505_MTL_INLINE MTL::TextureType MTL::Texture::textureType() const
506{
507    return Object::sendMessage<MTL::TextureType>(this, _MTL_PRIVATE_SEL(textureType));
508}
509
510// property: pixelFormat
511_MTL_INLINE MTL::PixelFormat MTL::Texture::pixelFormat() const
512{
513    return Object::sendMessage<MTL::PixelFormat>(this, _MTL_PRIVATE_SEL(pixelFormat));
514}
515
516// property: width
517_MTL_INLINE NS::UInteger MTL::Texture::width() const
518{
519    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(width));
520}
521
522// property: height
523_MTL_INLINE NS::UInteger MTL::Texture::height() const
524{
525    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(height));
526}
527
528// property: depth
529_MTL_INLINE NS::UInteger MTL::Texture::depth() const
530{
531    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(depth));
532}
533
534// property: mipmapLevelCount
535_MTL_INLINE NS::UInteger MTL::Texture::mipmapLevelCount() const
536{
537    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(mipmapLevelCount));
538}
539
540// property: sampleCount
541_MTL_INLINE NS::UInteger MTL::Texture::sampleCount() const
542{
543    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(sampleCount));
544}
545
546// property: arrayLength
547_MTL_INLINE NS::UInteger MTL::Texture::arrayLength() const
548{
549    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(arrayLength));
550}
551
552// property: usage
553_MTL_INLINE MTL::TextureUsage MTL::Texture::usage() const
554{
555    return Object::sendMessage<MTL::TextureUsage>(this, _MTL_PRIVATE_SEL(usage));
556}
557
558// property: shareable
559_MTL_INLINE bool MTL::Texture::shareable() const
560{
561    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isShareable));
562}
563
564// property: framebufferOnly
565_MTL_INLINE bool MTL::Texture::framebufferOnly() const
566{
567    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isFramebufferOnly));
568}
569
570// property: firstMipmapInTail
571_MTL_INLINE NS::UInteger MTL::Texture::firstMipmapInTail() const
572{
573    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(firstMipmapInTail));
574}
575
576// property: tailSizeInBytes
577_MTL_INLINE NS::UInteger MTL::Texture::tailSizeInBytes() const
578{
579    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(tailSizeInBytes));
580}
581
582// property: isSparse
583_MTL_INLINE bool MTL::Texture::isSparse() const
584{
585    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(isSparse));
586}
587
588// property: allowGPUOptimizedContents
589_MTL_INLINE bool MTL::Texture::allowGPUOptimizedContents() const
590{
591    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(allowGPUOptimizedContents));
592}
593
594// method: getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice:
595_MTL_INLINE void MTL::Texture::getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage, MTL::Region region, NS::UInteger level, NS::UInteger slice)
596{
597    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_slice_), pixelBytes, bytesPerRow, bytesPerImage, region, level, slice);
598}
599
600// method: replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:
601_MTL_INLINE void MTL::Texture::replaceRegion(MTL::Region region, NS::UInteger level, NS::UInteger slice, const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage)
602{
603    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(replaceRegion_mipmapLevel_slice_withBytes_bytesPerRow_bytesPerImage_), region, level, slice, pixelBytes, bytesPerRow, bytesPerImage);
604}
605
606// method: getBytes:bytesPerRow:fromRegion:mipmapLevel:
607_MTL_INLINE void MTL::Texture::getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, MTL::Region region, NS::UInteger level)
608{
609    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(getBytes_bytesPerRow_fromRegion_mipmapLevel_), pixelBytes, bytesPerRow, region, level);
610}
611
612// method: replaceRegion:mipmapLevel:withBytes:bytesPerRow:
613_MTL_INLINE void MTL::Texture::replaceRegion(MTL::Region region, NS::UInteger level, const void* pixelBytes, NS::UInteger bytesPerRow)
614{
615    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(replaceRegion_mipmapLevel_withBytes_bytesPerRow_), region, level, pixelBytes, bytesPerRow);
616}
617
618// method: newTextureViewWithPixelFormat:
619_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat)
620{
621    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_), pixelFormat);
622}
623
624// method: newTextureViewWithPixelFormat:textureType:levels:slices:
625_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange)
626{
627    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_), pixelFormat, textureType, levelRange, sliceRange);
628}
629
630// method: newSharedTextureHandle
631_MTL_INLINE MTL::SharedTextureHandle* MTL::Texture::newSharedTextureHandle()
632{
633    return Object::sendMessage<MTL::SharedTextureHandle*>(this, _MTL_PRIVATE_SEL(newSharedTextureHandle));
634}
635
636// property: remoteStorageTexture
637_MTL_INLINE MTL::Texture* MTL::Texture::remoteStorageTexture() const
638{
639    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(remoteStorageTexture));
640}
641
642// method: newRemoteTextureViewForDevice:
643_MTL_INLINE MTL::Texture* MTL::Texture::newRemoteTextureViewForDevice(const MTL::Device* device)
644{
645    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newRemoteTextureViewForDevice_), device);
646}
647
648// property: swizzle
649_MTL_INLINE MTL::TextureSwizzleChannels MTL::Texture::swizzle() const
650{
651    return Object::sendMessage<MTL::TextureSwizzleChannels>(this, _MTL_PRIVATE_SEL(swizzle));
652}
653
654// method: newTextureViewWithPixelFormat:textureType:levels:slices:swizzle:
655_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange, MTL::TextureSwizzleChannels swizzle)
656{
657    return Object::sendMessage<MTL::Texture*>(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_swizzle_), pixelFormat, textureType, levelRange, sliceRange, swizzle);
658}