yum-mirror/VkFFT

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

Tolmachev DmitriiMetal support in VkFFTba7001c

master
4.0 KiB94 linesraw
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) {
34    SparseTextureMappingModeMap = 0,
35    SparseTextureMappingModeUnmap = 1,
36};
37
38struct MapIndirectArguments
39{
40    uint32_t regionOriginX;
41    uint32_t regionOriginY;
42    uint32_t regionOriginZ;
43    uint32_t regionSizeWidth;
44    uint32_t regionSizeHeight;
45    uint32_t regionSizeDepth;
46    uint32_t mipMapLevel;
47    uint32_t sliceId;
48} _MTL_PACKED;
49
50class ResourceStateCommandEncoder : public NS::Referencing<ResourceStateCommandEncoder, CommandEncoder>
51{
52public:
53    void 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
55    void updateTextureMapping(const class Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Region region, const NS::UInteger mipLevel, const NS::UInteger slice);
56
57    void updateTextureMapping(const class Texture* texture, const MTL::SparseTextureMappingMode mode, const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset);
58
59    void updateFence(const class Fence* fence);
60
61    void 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{
69    Object::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{
75    Object::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{
81    Object::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{
87    Object::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{
93    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(waitForFence_), fence);
94}