yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
master
1//------------------------------------------------------------------------------------------------------------------------------------------------------------- 2// 3// Metal/MTLVertexDescriptor.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 "MTLVertexDescriptor.hpp" 30 31namespace MTL 32{ 33_MTL_ENUM (NS ::UInteger ,VertexFormat ) { 34VertexFormatInvalid = 0 , 35VertexFormatUChar2 = 1 , 36VertexFormatUChar3 = 2 , 37VertexFormatUChar4 = 3 , 38VertexFormatChar2 = 4 , 39VertexFormatChar3 = 5 , 40VertexFormatChar4 = 6 , 41VertexFormatUChar2Normalized = 7 , 42VertexFormatUChar3Normalized = 8 , 43VertexFormatUChar4Normalized = 9 , 44VertexFormatChar2Normalized = 10 , 45VertexFormatChar3Normalized = 11 , 46VertexFormatChar4Normalized = 12 , 47VertexFormatUShort2 = 13 , 48VertexFormatUShort3 = 14 , 49VertexFormatUShort4 = 15 , 50VertexFormatShort2 = 16 , 51VertexFormatShort3 = 17 , 52VertexFormatShort4 = 18 , 53VertexFormatUShort2Normalized = 19 , 54VertexFormatUShort3Normalized = 20 , 55VertexFormatUShort4Normalized = 21 , 56VertexFormatShort2Normalized = 22 , 57VertexFormatShort3Normalized = 23 , 58VertexFormatShort4Normalized = 24 , 59VertexFormatHalf2 = 25 , 60VertexFormatHalf3 = 26 , 61VertexFormatHalf4 = 27 , 62VertexFormatFloat = 28 , 63VertexFormatFloat2 = 29 , 64VertexFormatFloat3 = 30 , 65VertexFormatFloat4 = 31 , 66VertexFormatInt = 32 , 67VertexFormatInt2 = 33 , 68VertexFormatInt3 = 34 , 69VertexFormatInt4 = 35 , 70VertexFormatUInt = 36 , 71VertexFormatUInt2 = 37 , 72VertexFormatUInt3 = 38 , 73VertexFormatUInt4 = 39 , 74VertexFormatInt1010102Normalized = 40 , 75VertexFormatUInt1010102Normalized = 41 , 76VertexFormatUChar4Normalized_BGRA = 42 , 77VertexFormatUChar = 45 , 78VertexFormatChar = 46 , 79VertexFormatUCharNormalized = 47 , 80VertexFormatCharNormalized = 48 , 81VertexFormatUShort = 49 , 82VertexFormatShort = 50 , 83VertexFormatUShortNormalized = 51 , 84VertexFormatShortNormalized = 52 , 85VertexFormatHalf = 53 , 86}; 87 88_MTL_ENUM (NS ::UInteger ,VertexStepFunction ) { 89VertexStepFunctionConstant = 0 , 90VertexStepFunctionPerVertex = 1 , 91VertexStepFunctionPerInstance = 2 , 92VertexStepFunctionPerPatch = 3 , 93VertexStepFunctionPerPatchControlPoint = 4 , 94}; 95 96class VertexBufferLayoutDescriptor :public NS ::Copying < VertexBufferLayoutDescriptor > 97{ 98public : 99static class VertexBufferLayoutDescriptor * alloc (); 100 101class VertexBufferLayoutDescriptor * init (); 102 103NS ::UInteger stride ()const ; 104void setStride (NS ::UInteger stride ); 105 106MTL ::VertexStepFunction stepFunction ()const ; 107void setStepFunction (MTL ::VertexStepFunction stepFunction ); 108 109NS ::UInteger stepRate ()const ; 110void setStepRate (NS ::UInteger stepRate ); 111}; 112 113class VertexBufferLayoutDescriptorArray :public NS ::Referencing < VertexBufferLayoutDescriptorArray > 114{ 115public : 116static class VertexBufferLayoutDescriptorArray * alloc (); 117 118class VertexBufferLayoutDescriptorArray * init (); 119 120class VertexBufferLayoutDescriptor * object (NS ::UInteger index ); 121 122void setObject (const class VertexBufferLayoutDescriptor * bufferDesc ,NS ::UInteger index ); 123}; 124 125class VertexAttributeDescriptor :public NS ::Copying < VertexAttributeDescriptor > 126{ 127public : 128static class VertexAttributeDescriptor * alloc (); 129 130class VertexAttributeDescriptor * init (); 131 132MTL ::VertexFormat format ()const ; 133void setFormat (MTL ::VertexFormat format ); 134 135NS ::UInteger offset ()const ; 136void setOffset (NS ::UInteger offset ); 137 138NS ::UInteger bufferIndex ()const ; 139void setBufferIndex (NS ::UInteger bufferIndex ); 140}; 141 142class VertexAttributeDescriptorArray :public NS ::Referencing < VertexAttributeDescriptorArray > 143{ 144public : 145static class VertexAttributeDescriptorArray * alloc (); 146 147class VertexAttributeDescriptorArray * init (); 148 149class VertexAttributeDescriptor * object (NS ::UInteger index ); 150 151void setObject (const class VertexAttributeDescriptor * attributeDesc ,NS ::UInteger index ); 152}; 153 154class VertexDescriptor :public NS ::Copying < VertexDescriptor > 155{ 156public : 157static class VertexDescriptor * alloc (); 158 159class VertexDescriptor * init (); 160 161static class VertexDescriptor * vertexDescriptor (); 162 163class VertexBufferLayoutDescriptorArray * layouts ()const ; 164 165class VertexAttributeDescriptorArray * attributes ()const ; 166 167void reset (); 168}; 169 170} 171 172// static method: alloc 173_MTL_INLINE MTL ::VertexBufferLayoutDescriptor * MTL ::VertexBufferLayoutDescriptor ::alloc () 174{ 175return NS ::Object ::alloc < MTL ::VertexBufferLayoutDescriptor > (_MTL_PRIVATE_CLS (MTLVertexBufferLayoutDescriptor )); 176} 177 178// method: init 179_MTL_INLINE MTL ::VertexBufferLayoutDescriptor * MTL ::VertexBufferLayoutDescriptor ::init () 180{ 181return NS ::Object ::init < MTL ::VertexBufferLayoutDescriptor > (); 182} 183 184// property: stride 185_MTL_INLINE NS ::UInteger MTL ::VertexBufferLayoutDescriptor ::stride ()const 186{ 187return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (stride )); 188} 189 190_MTL_INLINE voidMTL ::VertexBufferLayoutDescriptor ::setStride (NS ::UInteger stride ) 191{ 192Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setStride_ ),stride ); 193} 194 195// property: stepFunction 196_MTL_INLINE MTL ::VertexStepFunction MTL ::VertexBufferLayoutDescriptor ::stepFunction ()const 197{ 198return Object ::sendMessage < MTL ::VertexStepFunction > (this ,_MTL_PRIVATE_SEL (stepFunction )); 199} 200 201_MTL_INLINE voidMTL ::VertexBufferLayoutDescriptor ::setStepFunction (MTL ::VertexStepFunction stepFunction ) 202{ 203Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setStepFunction_ ),stepFunction ); 204} 205 206// property: stepRate 207_MTL_INLINE NS ::UInteger MTL ::VertexBufferLayoutDescriptor ::stepRate ()const 208{ 209return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (stepRate )); 210} 211 212_MTL_INLINE voidMTL ::VertexBufferLayoutDescriptor ::setStepRate (NS ::UInteger stepRate ) 213{ 214Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setStepRate_ ),stepRate ); 215} 216 217// static method: alloc 218_MTL_INLINE MTL ::VertexBufferLayoutDescriptorArray * MTL ::VertexBufferLayoutDescriptorArray ::alloc () 219{ 220return NS ::Object ::alloc < MTL ::VertexBufferLayoutDescriptorArray > (_MTL_PRIVATE_CLS (MTLVertexBufferLayoutDescriptorArray )); 221} 222 223// method: init 224_MTL_INLINE MTL ::VertexBufferLayoutDescriptorArray * MTL ::VertexBufferLayoutDescriptorArray ::init () 225{ 226return NS ::Object ::init < MTL ::VertexBufferLayoutDescriptorArray > (); 227} 228 229// method: objectAtIndexedSubscript: 230_MTL_INLINE MTL ::VertexBufferLayoutDescriptor * MTL ::VertexBufferLayoutDescriptorArray ::object (NS ::UInteger index ) 231{ 232return Object ::sendMessage < MTL ::VertexBufferLayoutDescriptor *> (this ,_MTL_PRIVATE_SEL (objectAtIndexedSubscript_ ),index ); 233} 234 235// method: setObject:atIndexedSubscript: 236_MTL_INLINE voidMTL ::VertexBufferLayoutDescriptorArray ::setObject (const MTL ::VertexBufferLayoutDescriptor * bufferDesc ,NS ::UInteger index ) 237{ 238Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setObject_atIndexedSubscript_ ),bufferDesc ,index ); 239} 240 241// static method: alloc 242_MTL_INLINE MTL ::VertexAttributeDescriptor * MTL ::VertexAttributeDescriptor ::alloc () 243{ 244return NS ::Object ::alloc < MTL ::VertexAttributeDescriptor > (_MTL_PRIVATE_CLS (MTLVertexAttributeDescriptor )); 245} 246 247// method: init 248_MTL_INLINE MTL ::VertexAttributeDescriptor * MTL ::VertexAttributeDescriptor ::init () 249{ 250return NS ::Object ::init < MTL ::VertexAttributeDescriptor > (); 251} 252 253// property: format 254_MTL_INLINE MTL ::VertexFormat MTL ::VertexAttributeDescriptor ::format ()const 255{ 256return Object ::sendMessage < MTL ::VertexFormat > (this ,_MTL_PRIVATE_SEL (format )); 257} 258 259_MTL_INLINE voidMTL ::VertexAttributeDescriptor ::setFormat (MTL ::VertexFormat format ) 260{ 261Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setFormat_ ),format ); 262} 263 264// property: offset 265_MTL_INLINE NS ::UInteger MTL ::VertexAttributeDescriptor ::offset ()const 266{ 267return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (offset )); 268} 269 270_MTL_INLINE voidMTL ::VertexAttributeDescriptor ::setOffset (NS ::UInteger offset ) 271{ 272Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setOffset_ ),offset ); 273} 274 275// property: bufferIndex 276_MTL_INLINE NS ::UInteger MTL ::VertexAttributeDescriptor ::bufferIndex ()const 277{ 278return Object ::sendMessage < NS ::UInteger > (this ,_MTL_PRIVATE_SEL (bufferIndex )); 279} 280 281_MTL_INLINE voidMTL ::VertexAttributeDescriptor ::setBufferIndex (NS ::UInteger bufferIndex ) 282{ 283Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setBufferIndex_ ),bufferIndex ); 284} 285 286// static method: alloc 287_MTL_INLINE MTL ::VertexAttributeDescriptorArray * MTL ::VertexAttributeDescriptorArray ::alloc () 288{ 289return NS ::Object ::alloc < MTL ::VertexAttributeDescriptorArray > (_MTL_PRIVATE_CLS (MTLVertexAttributeDescriptorArray )); 290} 291 292// method: init 293_MTL_INLINE MTL ::VertexAttributeDescriptorArray * MTL ::VertexAttributeDescriptorArray ::init () 294{ 295return NS ::Object ::init < MTL ::VertexAttributeDescriptorArray > (); 296} 297 298// method: objectAtIndexedSubscript: 299_MTL_INLINE MTL ::VertexAttributeDescriptor * MTL ::VertexAttributeDescriptorArray ::object (NS ::UInteger index ) 300{ 301return Object ::sendMessage < MTL ::VertexAttributeDescriptor *> (this ,_MTL_PRIVATE_SEL (objectAtIndexedSubscript_ ),index ); 302} 303 304// method: setObject:atIndexedSubscript: 305_MTL_INLINE voidMTL ::VertexAttributeDescriptorArray ::setObject (const MTL ::VertexAttributeDescriptor * attributeDesc ,NS ::UInteger index ) 306{ 307Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setObject_atIndexedSubscript_ ),attributeDesc ,index ); 308} 309 310// static method: alloc 311_MTL_INLINE MTL ::VertexDescriptor * MTL ::VertexDescriptor ::alloc () 312{ 313return NS ::Object ::alloc < MTL ::VertexDescriptor > (_MTL_PRIVATE_CLS (MTLVertexDescriptor )); 314} 315 316// method: init 317_MTL_INLINE MTL ::VertexDescriptor * MTL ::VertexDescriptor ::init () 318{ 319return NS ::Object ::init < MTL ::VertexDescriptor > (); 320} 321 322// static method: vertexDescriptor 323_MTL_INLINE MTL ::VertexDescriptor * MTL ::VertexDescriptor ::vertexDescriptor () 324{ 325return Object ::sendMessage < MTL ::VertexDescriptor *> (_MTL_PRIVATE_CLS (MTLVertexDescriptor ),_MTL_PRIVATE_SEL (vertexDescriptor )); 326} 327 328// property: layouts 329_MTL_INLINE MTL ::VertexBufferLayoutDescriptorArray * MTL ::VertexDescriptor ::layouts ()const 330{ 331return Object ::sendMessage < MTL ::VertexBufferLayoutDescriptorArray *> (this ,_MTL_PRIVATE_SEL (layouts )); 332} 333 334// property: attributes 335_MTL_INLINE MTL ::VertexAttributeDescriptorArray * MTL ::VertexDescriptor ::attributes ()const 336{ 337return Object ::sendMessage < MTL ::VertexAttributeDescriptorArray *> (this ,_MTL_PRIVATE_SEL (attributes )); 338} 339 340// method: reset 341_MTL_INLINE voidMTL ::VertexDescriptor ::reset () 342{ 343Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (reset )); 344}