yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
develop
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 ) { 38TextureType1D = 0 , 39TextureType1DArray = 1 , 40TextureType2D = 2 , 41TextureType2DArray = 3 , 42TextureType2DMultisample = 4 , 43TextureTypeCube = 5 , 44TextureTypeCubeArray = 6 , 45TextureType3D = 7 , 46TextureType2DMultisampleArray = 8 , 47TextureTypeTextureBuffer = 9 , 48}; 49 50_MTL_ENUM (uint8_t ,TextureSwizzle ) { 51TextureSwizzleZero = 0 , 52TextureSwizzleOne = 1 , 53TextureSwizzleRed = 2 , 54TextureSwizzleGreen = 3 , 55TextureSwizzleBlue = 4 , 56TextureSwizzleAlpha = 5 , 57}; 58 59struct TextureSwizzleChannels 60{ 61MTL ::TextureSwizzle red ; 62MTL ::TextureSwizzle green ; 63MTL ::TextureSwizzle blue ; 64MTL ::TextureSwizzle alpha ; 65}_MTL_PACKED ; 66 67class SharedTextureHandle :public NS ::Referencing < SharedTextureHandle > 68{ 69public : 70static class SharedTextureHandle * alloc (); 71 72class SharedTextureHandle * init (); 73 74class Device * device ()const ; 75 76NS ::String * label ()const ; 77}; 78 79struct SharedTextureHandlePrivate 80{ 81}_MTL_PACKED ; 82 83_MTL_OPTIONS (NS ::UInteger ,TextureUsage ) { 84TextureUsageUnknown = 0 , 85TextureUsageShaderRead = 1 , 86TextureUsageShaderWrite = 2 , 87TextureUsageRenderTarget = 4 , 88TextureUsagePixelFormatView = 16 , 89}; 90 91_MTL_ENUM (NS ::Integer ,TextureCompressionType ) { 92TextureCompressionTypeLossless = 0 , 93TextureCompressionTypeLossy = 1 , 94}; 95 96class TextureDescriptor :public NS ::Copying < TextureDescriptor > 97{ 98public : 99static class TextureDescriptor * alloc (); 100 101class TextureDescriptor * init (); 102 103static class TextureDescriptor * texture2DDescriptor (MTL ::PixelFormat pixelFormat ,NS ::UInteger width ,NS ::UInteger height ,bool mipmapped ); 104 105static class TextureDescriptor * textureCubeDescriptor (MTL ::PixelFormat pixelFormat ,NS ::UInteger size ,bool mipmapped ); 106 107static class TextureDescriptor * textureBufferDescriptor (MTL ::PixelFormat pixelFormat ,NS ::UInteger width ,MTL ::ResourceOptions resourceOptions ,MTL ::TextureUsage usage ); 108 109MTL ::TextureType textureType ()const ; 110void setTextureType (MTL ::TextureType textureType ); 111 112MTL ::PixelFormat pixelFormat ()const ; 113void setPixelFormat (MTL ::PixelFormat pixelFormat ); 114 115NS ::UInteger width ()const ; 116void setWidth (NS ::UInteger width ); 117 118NS ::UInteger height ()const ; 119void setHeight (NS ::UInteger height ); 120 121NS ::UInteger depth ()const ; 122void setDepth (NS ::UInteger depth ); 123 124NS ::UInteger mipmapLevelCount ()const ; 125void setMipmapLevelCount (NS ::UInteger mipmapLevelCount ); 126 127NS ::UInteger sampleCount ()const ; 128void setSampleCount (NS ::UInteger sampleCount ); 129 130NS ::UInteger arrayLength ()const ; 131void setArrayLength (NS ::UInteger arrayLength ); 132 133MTL ::ResourceOptions resourceOptions ()const ; 134void setResourceOptions (MTL ::ResourceOptions resourceOptions ); 135 136MTL ::CPUCacheMode cpuCacheMode ()const ; 137void setCpuCacheMode (MTL ::CPUCacheMode cpuCacheMode ); 138 139MTL ::StorageMode storageMode ()const ; 140void setStorageMode (MTL ::StorageMode storageMode ); 141 142MTL ::HazardTrackingMode hazardTrackingMode ()const ; 143void setHazardTrackingMode (MTL ::HazardTrackingMode hazardTrackingMode ); 144 145MTL ::TextureUsage usage ()const ; 146void setUsage (MTL ::TextureUsage usage ); 147 148bool allowGPUOptimizedContents ()const ; 149void setAllowGPUOptimizedContents (bool allowGPUOptimizedContents ); 150 151MTL ::TextureSwizzleChannels swizzle ()const ; 152void setSwizzle (MTL ::TextureSwizzleChannels swizzle ); 153}; 154 155class Texture :public NS ::Referencing < Texture ,Resource > 156{ 157public : 158class Resource * rootResource ()const ; 159 160class Texture * parentTexture ()const ; 161 162NS ::UInteger parentRelativeLevel ()const ; 163 164NS ::UInteger parentRelativeSlice ()const ; 165 166class Buffer * buffer ()const ; 167 168NS ::UInteger bufferOffset ()const ; 169 170NS ::UInteger bufferBytesPerRow ()const ; 171 172IOSurfaceRef iosurface ()const ; 173 174NS ::UInteger iosurfacePlane ()const ; 175 176MTL ::TextureType textureType ()const ; 177 178MTL ::PixelFormat pixelFormat ()const ; 179 180NS ::UInteger width ()const ; 181 182NS ::UInteger height ()const ; 183 184NS ::UInteger depth ()const ; 185 186NS ::UInteger mipmapLevelCount ()const ; 187 188NS ::UInteger sampleCount ()const ; 189 190NS ::UInteger arrayLength ()const ; 191 192MTL ::TextureUsage usage ()const ; 193 194bool shareable ()const ; 195 196bool framebufferOnly ()const ; 197 198NS ::UInteger firstMipmapInTail ()const ; 199 200NS ::UInteger tailSizeInBytes ()const ; 201 202bool isSparse ()const ; 203 204bool allowGPUOptimizedContents ()const ; 205 206void getBytes (const void * pixelBytes ,NS ::UInteger bytesPerRow ,NS ::UInteger bytesPerImage ,MTL ::Region region ,NS ::UInteger level ,NS ::UInteger slice ); 207 208void replaceRegion (MTL ::Region region ,NS ::UInteger level ,NS ::UInteger slice ,const void * pixelBytes ,NS ::UInteger bytesPerRow ,NS ::UInteger bytesPerImage ); 209 210void getBytes (const void * pixelBytes ,NS ::UInteger bytesPerRow ,MTL ::Region region ,NS ::UInteger level ); 211 212void replaceRegion (MTL ::Region region ,NS ::UInteger level ,const void * pixelBytes ,NS ::UInteger bytesPerRow ); 213 214class Texture * newTextureView (MTL ::PixelFormat pixelFormat ); 215 216class Texture * newTextureView (MTL ::PixelFormat pixelFormat ,MTL ::TextureType textureType ,NS ::Range levelRange ,NS ::Range sliceRange ); 217 218class SharedTextureHandle * newSharedTextureHandle (); 219 220class Texture * remoteStorageTexture ()const ; 221 222class Texture * newRemoteTextureViewForDevice (const class Device * device ); 223 224MTL ::TextureSwizzleChannels swizzle ()const ; 225 226class 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{ 234return NS ::Object ::alloc < MTL ::SharedTextureHandle > (_MTL_PRIVATE_CLS (MTLSharedTextureHandle )); 235} 236 237// method: init 238_MTL_INLINE MTL ::SharedTextureHandle * MTL ::SharedTextureHandle ::init () 239{ 240return NS ::Object ::init < MTL ::SharedTextureHandle > (); 241} 242 243// property: device 244_MTL_INLINE MTL ::Device * MTL ::SharedTextureHandle ::device ()const 245{ 246return Object ::sendMessage < MTL ::Device *> (this ,_MTL_PRIVATE_SEL (device )); 247} 248 249// property: label 250_MTL_INLINE NS ::String * MTL ::SharedTextureHandle ::label ()const 251{ 252return Object ::sendMessage < NS ::String *> (this ,_MTL_PRIVATE_SEL (label )); 253} 254 255// static method: alloc 256_MTL_INLINE MTL ::TextureDescriptor * MTL ::TextureDescriptor ::alloc () 257{ 258return NS ::Object ::alloc < MTL ::TextureDescriptor > (_MTL_PRIVATE_CLS (MTLTextureDescriptor )); 259} 260 261// method: init 262_MTL_INLINE MTL ::TextureDescriptor * MTL ::TextureDescriptor ::init () 263{ 264return 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{ 270return 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{ 276return 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{ 282return 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{ 288return Object ::sendMessage < MTL ::TextureType > (this ,_MTL_PRIVATE_SEL (textureType )); 289} 290 291_MTL_INLINE voidMTL ::TextureDescriptor ::setTextureType (MTL ::TextureType textureType ) 292{ 293Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setTextureType_ ),textureType ); 294} 295 296// property: pixelFormat 297_MTL_INLINE MTL ::PixelFormat MTL ::TextureDescriptor ::pixelFormat ()const 298{ 299return Object ::sendMessage < MTL ::PixelFormat > (this ,_MTL_PRIVATE_SEL (pixelFormat )); 300} 301 302_MTL_INLINE voidMTL ::TextureDescriptor ::setPixelFormat (MTL ::PixelFormat pixelFormat ) 303{ 304Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setPixelFormat_ ),pixelFormat ); 305} 306 307// property: width 308_MTL_INLINE NS ::UInteger MTL ::TextureDescriptor ::width ()const 309{ 310return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (width )); 311} 312 313_MTL_INLINE voidMTL ::TextureDescriptor ::setWidth (NS ::UInteger width ) 314{ 315Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setWidth_ ),width ); 316} 317 318// property: height 319_MTL_INLINE NS ::UInteger MTL ::TextureDescriptor ::height ()const 320{ 321return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (height )); 322} 323 324_MTL_INLINE voidMTL ::TextureDescriptor ::setHeight (NS ::UInteger height ) 325{ 326Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setHeight_ ),height ); 327} 328 329// property: depth 330_MTL_INLINE NS ::UInteger MTL ::TextureDescriptor ::depth ()const 331{ 332return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (depth )); 333} 334 335_MTL_INLINE voidMTL ::TextureDescriptor ::setDepth (NS ::UInteger depth ) 336{ 337Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setDepth_ ),depth ); 338} 339 340// property: mipmapLevelCount 341_MTL_INLINE NS ::UInteger MTL ::TextureDescriptor ::mipmapLevelCount ()const 342{ 343return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (mipmapLevelCount )); 344} 345 346_MTL_INLINE voidMTL ::TextureDescriptor ::setMipmapLevelCount (NS ::UInteger mipmapLevelCount ) 347{ 348Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setMipmapLevelCount_ ),mipmapLevelCount ); 349} 350 351// property: sampleCount 352_MTL_INLINE NS ::UInteger MTL ::TextureDescriptor ::sampleCount ()const 353{ 354return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (sampleCount )); 355} 356 357_MTL_INLINE voidMTL ::TextureDescriptor ::setSampleCount (NS ::UInteger sampleCount ) 358{ 359Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setSampleCount_ ),sampleCount ); 360} 361 362// property: arrayLength 363_MTL_INLINE NS ::UInteger MTL ::TextureDescriptor ::arrayLength ()const 364{ 365return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (arrayLength )); 366} 367 368_MTL_INLINE voidMTL ::TextureDescriptor ::setArrayLength (NS ::UInteger arrayLength ) 369{ 370Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setArrayLength_ ),arrayLength ); 371} 372 373// property: resourceOptions 374_MTL_INLINE MTL ::ResourceOptions MTL ::TextureDescriptor ::resourceOptions ()const 375{ 376return Object ::sendMessage < MTL ::ResourceOptions > (this ,_MTL_PRIVATE_SEL (resourceOptions )); 377} 378 379_MTL_INLINE voidMTL ::TextureDescriptor ::setResourceOptions (MTL ::ResourceOptions resourceOptions ) 380{ 381Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setResourceOptions_ ),resourceOptions ); 382} 383 384// property: cpuCacheMode 385_MTL_INLINE MTL ::CPUCacheMode MTL ::TextureDescriptor ::cpuCacheMode ()const 386{ 387return Object ::sendMessage < MTL ::CPUCacheMode > (this ,_MTL_PRIVATE_SEL (cpuCacheMode )); 388} 389 390_MTL_INLINE voidMTL ::TextureDescriptor ::setCpuCacheMode (MTL ::CPUCacheMode cpuCacheMode ) 391{ 392Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setCpuCacheMode_ ),cpuCacheMode ); 393} 394 395// property: storageMode 396_MTL_INLINE MTL ::StorageMode MTL ::TextureDescriptor ::storageMode ()const 397{ 398return Object ::sendMessage < MTL ::StorageMode > (this ,_MTL_PRIVATE_SEL (storageMode )); 399} 400 401_MTL_INLINE voidMTL ::TextureDescriptor ::setStorageMode (MTL ::StorageMode storageMode ) 402{ 403Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setStorageMode_ ),storageMode ); 404} 405 406// property: hazardTrackingMode 407_MTL_INLINE MTL ::HazardTrackingMode MTL ::TextureDescriptor ::hazardTrackingMode ()const 408{ 409return Object ::sendMessage < MTL ::HazardTrackingMode > (this ,_MTL_PRIVATE_SEL (hazardTrackingMode )); 410} 411 412_MTL_INLINE voidMTL ::TextureDescriptor ::setHazardTrackingMode (MTL ::HazardTrackingMode hazardTrackingMode ) 413{ 414Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setHazardTrackingMode_ ),hazardTrackingMode ); 415} 416 417// property: usage 418_MTL_INLINE MTL ::TextureUsage MTL ::TextureDescriptor ::usage ()const 419{ 420return Object ::sendMessage < MTL ::TextureUsage > (this ,_MTL_PRIVATE_SEL (usage )); 421} 422 423_MTL_INLINE voidMTL ::TextureDescriptor ::setUsage (MTL ::TextureUsage usage ) 424{ 425Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setUsage_ ),usage ); 426} 427 428// property: allowGPUOptimizedContents 429_MTL_INLINE boolMTL ::TextureDescriptor ::allowGPUOptimizedContents ()const 430{ 431return Object ::sendMessage < bool > (this ,_MTL_PRIVATE_SEL (allowGPUOptimizedContents )); 432} 433 434_MTL_INLINE voidMTL ::TextureDescriptor ::setAllowGPUOptimizedContents (bool allowGPUOptimizedContents ) 435{ 436Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setAllowGPUOptimizedContents_ ),allowGPUOptimizedContents ); 437} 438 439// property: swizzle 440_MTL_INLINE MTL ::TextureSwizzleChannels MTL ::TextureDescriptor ::swizzle ()const 441{ 442return Object ::sendMessage < MTL ::TextureSwizzleChannels > (this ,_MTL_PRIVATE_SEL (swizzle )); 443} 444 445_MTL_INLINE voidMTL ::TextureDescriptor ::setSwizzle (MTL ::TextureSwizzleChannels swizzle ) 446{ 447Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setSwizzle_ ),swizzle ); 448} 449 450// property: rootResource 451_MTL_INLINE MTL ::Resource * MTL ::Texture ::rootResource ()const 452{ 453return Object ::sendMessage < MTL ::Resource *> (this ,_MTL_PRIVATE_SEL (rootResource )); 454} 455 456// property: parentTexture 457_MTL_INLINE MTL ::Texture * MTL ::Texture ::parentTexture ()const 458{ 459return Object ::sendMessage < MTL ::Texture *> (this ,_MTL_PRIVATE_SEL (parentTexture )); 460} 461 462// property: parentRelativeLevel 463_MTL_INLINE NS ::UInteger MTL ::Texture ::parentRelativeLevel ()const 464{ 465return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (parentRelativeLevel )); 466} 467 468// property: parentRelativeSlice 469_MTL_INLINE NS ::UInteger MTL ::Texture ::parentRelativeSlice ()const 470{ 471return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (parentRelativeSlice )); 472} 473 474// property: buffer 475_MTL_INLINE MTL ::Buffer * MTL ::Texture ::buffer ()const 476{ 477return Object ::sendMessage < MTL ::Buffer *> (this ,_MTL_PRIVATE_SEL (buffer )); 478} 479 480// property: bufferOffset 481_MTL_INLINE NS ::UInteger MTL ::Texture ::bufferOffset ()const 482{ 483return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (bufferOffset )); 484} 485 486// property: bufferBytesPerRow 487_MTL_INLINE NS ::UInteger MTL ::Texture ::bufferBytesPerRow ()const 488{ 489return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (bufferBytesPerRow )); 490} 491 492// property: iosurface 493_MTL_INLINE IOSurfaceRef MTL ::Texture ::iosurface ()const 494{ 495return Object ::sendMessage < IOSurfaceRef > (this ,_MTL_PRIVATE_SEL (iosurface )); 496} 497 498// property: iosurfacePlane 499_MTL_INLINE NS ::UInteger MTL ::Texture ::iosurfacePlane ()const 500{ 501return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (iosurfacePlane )); 502} 503 504// property: textureType 505_MTL_INLINE MTL ::TextureType MTL ::Texture ::textureType ()const 506{ 507return Object ::sendMessage < MTL ::TextureType > (this ,_MTL_PRIVATE_SEL (textureType )); 508} 509 510// property: pixelFormat 511_MTL_INLINE MTL ::PixelFormat MTL ::Texture ::pixelFormat ()const 512{ 513return Object ::sendMessage < MTL ::PixelFormat > (this ,_MTL_PRIVATE_SEL (pixelFormat )); 514} 515 516// property: width 517_MTL_INLINE NS ::UInteger MTL ::Texture ::width ()const 518{ 519return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (width )); 520} 521 522// property: height 523_MTL_INLINE NS ::UInteger MTL ::Texture ::height ()const 524{ 525return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (height )); 526} 527 528// property: depth 529_MTL_INLINE NS ::UInteger MTL ::Texture ::depth ()const 530{ 531return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (depth )); 532} 533 534// property: mipmapLevelCount 535_MTL_INLINE NS ::UInteger MTL ::Texture ::mipmapLevelCount ()const 536{ 537return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (mipmapLevelCount )); 538} 539 540// property: sampleCount 541_MTL_INLINE NS ::UInteger MTL ::Texture ::sampleCount ()const 542{ 543return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (sampleCount )); 544} 545 546// property: arrayLength 547_MTL_INLINE NS ::UInteger MTL ::Texture ::arrayLength ()const 548{ 549return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (arrayLength )); 550} 551 552// property: usage 553_MTL_INLINE MTL ::TextureUsage MTL ::Texture ::usage ()const 554{ 555return Object ::sendMessage < MTL ::TextureUsage > (this ,_MTL_PRIVATE_SEL (usage )); 556} 557 558// property: shareable 559_MTL_INLINE boolMTL ::Texture ::shareable ()const 560{ 561return Object ::sendMessage < bool > (this ,_MTL_PRIVATE_SEL (isShareable )); 562} 563 564// property: framebufferOnly 565_MTL_INLINE boolMTL ::Texture ::framebufferOnly ()const 566{ 567return Object ::sendMessage < bool > (this ,_MTL_PRIVATE_SEL (isFramebufferOnly )); 568} 569 570// property: firstMipmapInTail 571_MTL_INLINE NS ::UInteger MTL ::Texture ::firstMipmapInTail ()const 572{ 573return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (firstMipmapInTail )); 574} 575 576// property: tailSizeInBytes 577_MTL_INLINE NS ::UInteger MTL ::Texture ::tailSizeInBytes ()const 578{ 579return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (tailSizeInBytes )); 580} 581 582// property: isSparse 583_MTL_INLINE boolMTL ::Texture ::isSparse ()const 584{ 585return Object ::sendMessage < bool > (this ,_MTL_PRIVATE_SEL (isSparse )); 586} 587 588// property: allowGPUOptimizedContents 589_MTL_INLINE boolMTL ::Texture ::allowGPUOptimizedContents ()const 590{ 591return Object ::sendMessage < bool > (this ,_MTL_PRIVATE_SEL (allowGPUOptimizedContents )); 592} 593 594// method: getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice: 595_MTL_INLINE voidMTL ::Texture ::getBytes (const void * pixelBytes ,NS ::UInteger bytesPerRow ,NS ::UInteger bytesPerImage ,MTL ::Region region ,NS ::UInteger level ,NS ::UInteger slice ) 596{ 597Object ::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 voidMTL ::Texture ::replaceRegion (MTL ::Region region ,NS ::UInteger level ,NS ::UInteger slice ,const void * pixelBytes ,NS ::UInteger bytesPerRow ,NS ::UInteger bytesPerImage ) 602{ 603Object ::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 voidMTL ::Texture ::getBytes (const void * pixelBytes ,NS ::UInteger bytesPerRow ,MTL ::Region region ,NS ::UInteger level ) 608{ 609Object ::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 voidMTL ::Texture ::replaceRegion (MTL ::Region region ,NS ::UInteger level ,const void * pixelBytes ,NS ::UInteger bytesPerRow ) 614{ 615Object ::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{ 621return 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{ 627return 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{ 633return Object ::sendMessage < MTL ::SharedTextureHandle *> (this ,_MTL_PRIVATE_SEL (newSharedTextureHandle )); 634} 635 636// property: remoteStorageTexture 637_MTL_INLINE MTL ::Texture * MTL ::Texture ::remoteStorageTexture ()const 638{ 639return 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{ 645return 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{ 651return 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{ 657return Object ::sendMessage < MTL ::Texture *> (this ,_MTL_PRIVATE_SEL (newTextureViewWithPixelFormat_textureType_levels_slices_swizzle_ ),pixelFormat ,textureType ,levelRange ,sliceRange ,swizzle ); 658}