yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
develop
1//------------------------------------------------------------------------------------------------------------------------------------------------------------- 2// 3// Metal/MTLResourceStateCommandEncoder.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 "MTLCommandEncoder.hpp" 30 31namespace MTL 32{ 33_MTL_ENUM ( NS :: UInteger , SparseTextureMappingMode ) { 34SparseTextureMappingModeMap = 0 , 35SparseTextureMappingModeUnmap = 1 , 36} ; 37 38struct MapIndirectArguments 39{ 40uint32_t regionOriginX ; 41uint32_t regionOriginY ; 42uint32_t regionOriginZ ; 43uint32_t regionSizeWidth ; 44uint32_t regionSizeHeight ; 45uint32_t regionSizeDepth ; 46uint32_t mipMapLevel ; 47uint32_t sliceId ; 48} _MTL_PACKED ; 49 50class ResourceStateCommandEncoder : public NS :: Referencing < ResourceStateCommandEncoder , CommandEncoder > 51{ 52public : 53void updateTextureMappings ( const class Texture * texture , const MTL :: SparseTextureMappingMode mode , const MTL :: Region * regions , const NS :: UInteger * mipLevels , const NS :: UInteger * slices , NS :: UInteger numRegions ) ; 54 55void updateTextureMapping ( const class Texture * texture , const MTL :: SparseTextureMappingMode mode , const MTL :: Region region , const NS :: UInteger mipLevel , const NS :: UInteger slice ) ; 56 57void updateTextureMapping ( const class Texture * texture , const MTL :: SparseTextureMappingMode mode , const class Buffer * indirectBuffer , NS :: UInteger indirectBufferOffset ) ; 58 59void updateFence ( const class Fence * fence ) ; 60 61void waitForFence ( const class Fence * fence ) ; 62} ; 63 64} 65 66// method: updateTextureMappings:mode:regions:mipLevels:slices:numRegions: 67_MTL_INLINE void MTL :: ResourceStateCommandEncoder :: updateTextureMappings ( const MTL :: Texture * texture , const MTL :: SparseTextureMappingMode mode , const MTL :: Region * regions , const NS :: UInteger * mipLevels , const NS :: UInteger * slices , NS :: UInteger numRegions ) 68{ 69Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( updateTextureMappings_mode_regions_mipLevels_slices_numRegions_ ) , texture , mode , regions , mipLevels , slices , numRegions ) ; 70} 71 72// method: updateTextureMapping:mode:region:mipLevel:slice: 73_MTL_INLINE void MTL :: ResourceStateCommandEncoder :: updateTextureMapping ( const MTL :: Texture * texture , const MTL :: SparseTextureMappingMode mode , const MTL :: Region region , const NS :: UInteger mipLevel , const NS :: UInteger slice ) 74{ 75Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( updateTextureMapping_mode_region_mipLevel_slice_ ) , texture , mode , region , mipLevel , slice ) ; 76} 77 78// method: updateTextureMapping:mode:indirectBuffer:indirectBufferOffset: 79_MTL_INLINE void MTL :: ResourceStateCommandEncoder :: updateTextureMapping ( const MTL :: Texture * texture , const MTL :: SparseTextureMappingMode mode , const MTL :: Buffer * indirectBuffer , NS :: UInteger indirectBufferOffset ) 80{ 81Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( updateTextureMapping_mode_indirectBuffer_indirectBufferOffset_ ) , texture , mode , indirectBuffer , indirectBufferOffset ) ; 82} 83 84// method: updateFence: 85_MTL_INLINE void MTL :: ResourceStateCommandEncoder :: updateFence ( const MTL :: Fence * fence ) 86{ 87Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( updateFence_ ) , fence ) ; 88} 89 90// method: waitForFence: 91_MTL_INLINE void MTL :: ResourceStateCommandEncoder :: waitForFence ( const MTL :: Fence * fence ) 92{ 93Object :: sendMessage < void > ( this , _MTL_PRIVATE_SEL ( waitForFence_ ) , fence ) ; 94}