From e0af63c913339973006e798030723d030518a519 Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Mon, 4 May 2026 12:14:18 +0200 Subject: [PATCH] Update metal-cpp (#4087) Co-authored-by: Alex Cristici --- .pre-commit-config.yaml | 3 +- vendor/metal-cpp/CADefines.hpp | 41 + vendor/metal-cpp/CAMetalDrawable.hpp | 57 + vendor/metal-cpp/CAMetalLayer.hpp | 216 ++ vendor/metal-cpp/CAPrivate.hpp | 150 ++ vendor/metal-cpp/Foundation/Foundation.hpp | 2 +- vendor/metal-cpp/Foundation/NSArray.hpp | 15 +- .../Foundation/NSAutoreleasePool.hpp | 2 +- vendor/metal-cpp/Foundation/NSBundle.hpp | 100 +- vendor/metal-cpp/Foundation/NSData.hpp | 2 +- vendor/metal-cpp/Foundation/NSDate.hpp | 4 +- vendor/metal-cpp/Foundation/NSDefines.hpp | 2 +- vendor/metal-cpp/Foundation/NSDictionary.hpp | 2 +- vendor/metal-cpp/Foundation/NSEnumerator.hpp | 2 +- vendor/metal-cpp/Foundation/NSError.hpp | 2 +- vendor/metal-cpp/Foundation/NSLock.hpp | 4 +- .../metal-cpp/Foundation/NSNotification.hpp | 3 +- vendor/metal-cpp/Foundation/NSNumber.hpp | 2 +- vendor/metal-cpp/Foundation/NSObjCRuntime.hpp | 2 +- vendor/metal-cpp/Foundation/NSObject.hpp | 6 +- vendor/metal-cpp/Foundation/NSPrivate.hpp | 28 +- vendor/metal-cpp/Foundation/NSProcessInfo.hpp | 34 +- vendor/metal-cpp/Foundation/NSRange.hpp | 2 +- vendor/metal-cpp/Foundation/NSSet.hpp | 2 +- vendor/metal-cpp/Foundation/NSSharedPtr.hpp | 77 +- vendor/metal-cpp/Foundation/NSString.hpp | 2 +- vendor/metal-cpp/Foundation/NSTypes.hpp | 2 +- vendor/metal-cpp/Foundation/NSURL.hpp | 2 +- vendor/metal-cpp/LICENSE.txt | 2 +- vendor/metal-cpp/MTL4FXFrameInterpolator.hpp | 47 + vendor/metal-cpp/MTL4FXSpatialScaler.hpp | 49 + .../MTL4FXTemporalDenoisedScaler.hpp | 49 + vendor/metal-cpp/MTL4FXTemporalScaler.hpp | 49 + vendor/metal-cpp/MTLFXDefines.hpp | 41 + vendor/metal-cpp/MTLFXFrameInterpolator.hpp | 719 ++++++ vendor/metal-cpp/MTLFXPrivate.hpp | 482 ++++ vendor/metal-cpp/MTLFXSpatialScaler.hpp | 397 +++ .../metal-cpp/MTLFXTemporalDenoisedScaler.hpp | 1208 +++++++++ vendor/metal-cpp/MTLFXTemporalScaler.hpp | 803 ++++++ vendor/metal-cpp/MakeSingleHeader.py | 271 ++ .../Metal/MTL4AccelerationStructure.hpp | 1395 +++++++++++ vendor/metal-cpp/Metal/MTL4Archive.hpp | 93 + vendor/metal-cpp/Metal/MTL4ArgumentTable.hpp | 187 ++ vendor/metal-cpp/Metal/MTL4BinaryFunction.hpp | 50 + .../Metal/MTL4BinaryFunctionDescriptor.hpp | 97 + .../metal-cpp/Metal/MTL4CommandAllocator.hpp | 100 + vendor/metal-cpp/Metal/MTL4CommandBuffer.hpp | 193 ++ vendor/metal-cpp/Metal/MTL4CommandEncoder.hpp | 134 + vendor/metal-cpp/Metal/MTL4CommandQueue.hpp | 283 +++ vendor/metal-cpp/Metal/MTL4CommitFeedback.hpp | 62 + vendor/metal-cpp/Metal/MTL4Compiler.hpp | 345 +++ vendor/metal-cpp/Metal/MTL4CompilerTask.hpp | 63 + .../Metal/MTL4ComputeCommandEncoder.hpp | 300 +++ .../metal-cpp/Metal/MTL4ComputePipeline.hpp | 158 ++ vendor/metal-cpp/Metal/MTL4Counters.hpp | 138 ++ .../Metal/MTL4FunctionDescriptor.hpp | 49 + .../metal-cpp/Metal/MTL4LibraryDescriptor.hpp | 98 + .../Metal/MTL4LibraryFunctionDescriptor.hpp | 86 + .../metal-cpp/Metal/MTL4LinkingDescriptor.hpp | 204 ++ .../MTL4MachineLearningCommandEncoder.hpp | 66 + .../Metal/MTL4MachineLearningPipeline.hpp | 172 ++ .../Metal/MTL4MeshRenderPipeline.hpp | 413 +++ .../Metal/MTL4PipelineDataSetSerializer.hpp | 85 + vendor/metal-cpp/Metal/MTL4PipelineState.hpp | 150 ++ .../Metal/MTL4RenderCommandEncoder.hpp | 340 +++ vendor/metal-cpp/Metal/MTL4RenderPass.hpp | 280 +++ vendor/metal-cpp/Metal/MTL4RenderPipeline.hpp | 587 +++++ .../MTL4SpecializedFunctionDescriptor.hpp | 100 + .../Metal/MTL4StitchedFunctionDescriptor.hpp | 86 + .../Metal/MTL4TileRenderPipeline.hpp | 173 ++ .../Metal/MTLAccelerationStructure.hpp | 2058 ++++++++++----- ...MTLAccelerationStructureCommandEncoder.hpp | 272 +- .../Metal/MTLAccelerationStructureTypes.hpp | 127 +- vendor/metal-cpp/Metal/MTLAllocation.hpp | 40 + vendor/metal-cpp/Metal/MTLArgument.hpp | 866 +++---- vendor/metal-cpp/Metal/MTLArgumentEncoder.hpp | 282 ++- vendor/metal-cpp/Metal/MTLBinaryArchive.hpp | 137 +- .../metal-cpp/Metal/MTLBlitCommandEncoder.hpp | 260 +- vendor/metal-cpp/Metal/MTLBlitPass.hpp | 111 +- vendor/metal-cpp/Metal/MTLBuffer.hpp | 108 +- vendor/metal-cpp/Metal/MTLCaptureManager.hpp | 191 +- vendor/metal-cpp/Metal/MTLCaptureScope.hpp | 5 +- vendor/metal-cpp/Metal/MTLCommandBuffer.hpp | 562 +++-- vendor/metal-cpp/Metal/MTLCommandEncoder.hpp | 96 +- vendor/metal-cpp/Metal/MTLCommandQueue.hpp | 121 +- .../Metal/MTLComputeCommandEncoder.hpp | 436 ++-- vendor/metal-cpp/Metal/MTLComputePass.hpp | 130 +- vendor/metal-cpp/Metal/MTLComputePipeline.hpp | 454 ++-- vendor/metal-cpp/Metal/MTLCounters.hpp | 227 +- vendor/metal-cpp/Metal/MTLDataType.hpp | 129 + vendor/metal-cpp/Metal/MTLDefines.hpp | 2 +- vendor/metal-cpp/Metal/MTLDepthStencil.hpp | 228 +- vendor/metal-cpp/Metal/MTLDevice.hpp | 2127 ++++++++-------- vendor/metal-cpp/Metal/MTLDrawable.hpp | 75 +- vendor/metal-cpp/Metal/MTLDynamicLibrary.hpp | 50 +- vendor/metal-cpp/Metal/MTLEvent.hpp | 111 +- vendor/metal-cpp/Metal/MTLFence.hpp | 16 +- .../Metal/MTLFunctionConstantValues.hpp | 45 +- .../metal-cpp/Metal/MTLFunctionDescriptor.hpp | 141 +- vendor/metal-cpp/Metal/MTLFunctionHandle.hpp | 36 +- vendor/metal-cpp/Metal/MTLFunctionLog.hpp | 65 +- .../metal-cpp/Metal/MTLFunctionStitching.hpp | 254 +- vendor/metal-cpp/Metal/MTLGPUAddress.hpp | 36 + vendor/metal-cpp/Metal/MTLHeaderBridge.hpp | 822 +++++- vendor/metal-cpp/Metal/MTLHeap.hpp | 387 ++- vendor/metal-cpp/Metal/MTLIOCommandBuffer.hpp | 194 +- vendor/metal-cpp/Metal/MTLIOCommandQueue.hpp | 130 +- vendor/metal-cpp/Metal/MTLIOCompressor.hpp | 12 +- .../Metal/MTLIndirectCommandBuffer.hpp | 334 ++- .../Metal/MTLIndirectCommandEncoder.hpp | 257 +- .../Metal/MTLIntersectionFunctionTable.hpp | 122 +- vendor/metal-cpp/Metal/MTLLibrary.hpp | 1047 ++++---- vendor/metal-cpp/Metal/MTLLinkedFunctions.hpp | 75 +- vendor/metal-cpp/Metal/MTLLogState.hpp | 111 + .../Metal/MTLParallelRenderCommandEncoder.hpp | 55 +- vendor/metal-cpp/Metal/MTLPipeline.hpp | 41 +- vendor/metal-cpp/Metal/MTLPixelFormat.hpp | 14 +- vendor/metal-cpp/Metal/MTLPrivate.hpp | 16 +- .../metal-cpp/Metal/MTLRasterizationRate.hpp | 341 ++- .../Metal/MTLRenderCommandEncoder.hpp | 1728 ++++++------- vendor/metal-cpp/Metal/MTLRenderPass.hpp | 892 +++---- vendor/metal-cpp/Metal/MTLRenderPipeline.hpp | 2206 ++++++++++------- vendor/metal-cpp/Metal/MTLResidencySet.hpp | 178 ++ vendor/metal-cpp/Metal/MTLResource.hpp | 186 +- .../Metal/MTLResourceStateCommandEncoder.hpp | 67 +- .../metal-cpp/Metal/MTLResourceStatePass.hpp | 101 +- .../metal-cpp/Metal/MTLResourceViewPool.hpp | 118 + vendor/metal-cpp/Metal/MTLSampler.hpp | 354 +-- .../Metal/MTLStageInputOutputDescriptor.hpp | 239 +- vendor/metal-cpp/Metal/MTLTensor.hpp | 297 +++ vendor/metal-cpp/Metal/MTLTexture.hpp | 899 ++++--- vendor/metal-cpp/Metal/MTLTextureViewPool.hpp | 59 + vendor/metal-cpp/Metal/MTLTypes.hpp | 40 +- vendor/metal-cpp/Metal/MTLVersion.hpp | 8 +- .../metal-cpp/Metal/MTLVertexDescriptor.hpp | 210 +- .../Metal/MTLVisibleFunctionTable.hpp | 56 +- vendor/metal-cpp/Metal/Metal.hpp | 38 +- vendor/metal-cpp/MetalFX.hpp | 35 + .../MetalFX/MTL4FXFrameInterpolator.hpp | 47 + .../metal-cpp/MetalFX/MTL4FXSpatialScaler.hpp | 49 + .../MetalFX/MTL4FXTemporalDenoisedScaler.hpp | 49 + .../MetalFX/MTL4FXTemporalScaler.hpp | 49 + vendor/metal-cpp/MetalFX/MTLFXDefines.hpp | 41 + .../MetalFX/MTLFXFrameInterpolator.hpp | 719 ++++++ vendor/metal-cpp/MetalFX/MTLFXPrivate.hpp | 482 ++++ .../metal-cpp/MetalFX/MTLFXSpatialScaler.hpp | 397 +++ .../MetalFX/MTLFXTemporalDenoisedScaler.hpp | 1208 +++++++++ .../metal-cpp/MetalFX/MTLFXTemporalScaler.hpp | 803 ++++++ vendor/metal-cpp/MetalFX/MetalFX.hpp | 35 + vendor/metal-cpp/QuartzCore.hpp | 28 + vendor/metal-cpp/QuartzCore/CADefines.hpp | 2 +- .../metal-cpp/QuartzCore/CAMetalDrawable.hpp | 2 +- vendor/metal-cpp/QuartzCore/CAMetalLayer.hpp | 87 +- vendor/metal-cpp/QuartzCore/CAPrivate.hpp | 20 +- vendor/metal-cpp/QuartzCore/QuartzCore.hpp | 2 +- vendor/metal-cpp/README.md | 23 +- .../SingleHeader/MakeSingleHeader.py | 14 +- 157 files changed, 27718 insertions(+), 9176 deletions(-) create mode 100644 vendor/metal-cpp/CADefines.hpp create mode 100644 vendor/metal-cpp/CAMetalDrawable.hpp create mode 100644 vendor/metal-cpp/CAMetalLayer.hpp create mode 100644 vendor/metal-cpp/CAPrivate.hpp create mode 100644 vendor/metal-cpp/MTL4FXFrameInterpolator.hpp create mode 100644 vendor/metal-cpp/MTL4FXSpatialScaler.hpp create mode 100644 vendor/metal-cpp/MTL4FXTemporalDenoisedScaler.hpp create mode 100644 vendor/metal-cpp/MTL4FXTemporalScaler.hpp create mode 100644 vendor/metal-cpp/MTLFXDefines.hpp create mode 100644 vendor/metal-cpp/MTLFXFrameInterpolator.hpp create mode 100644 vendor/metal-cpp/MTLFXPrivate.hpp create mode 100644 vendor/metal-cpp/MTLFXSpatialScaler.hpp create mode 100644 vendor/metal-cpp/MTLFXTemporalDenoisedScaler.hpp create mode 100644 vendor/metal-cpp/MTLFXTemporalScaler.hpp create mode 100755 vendor/metal-cpp/MakeSingleHeader.py create mode 100644 vendor/metal-cpp/Metal/MTL4AccelerationStructure.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4Archive.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4ArgumentTable.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4BinaryFunction.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4BinaryFunctionDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4CommandAllocator.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4CommandBuffer.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4CommandEncoder.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4CommandQueue.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4CommitFeedback.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4Compiler.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4CompilerTask.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4ComputeCommandEncoder.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4ComputePipeline.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4Counters.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4FunctionDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4LibraryDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4LibraryFunctionDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4LinkingDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4MachineLearningCommandEncoder.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4MachineLearningPipeline.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4MeshRenderPipeline.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4PipelineDataSetSerializer.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4PipelineState.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4RenderCommandEncoder.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4RenderPass.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4RenderPipeline.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4SpecializedFunctionDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4StitchedFunctionDescriptor.hpp create mode 100644 vendor/metal-cpp/Metal/MTL4TileRenderPipeline.hpp create mode 100644 vendor/metal-cpp/Metal/MTLAllocation.hpp create mode 100644 vendor/metal-cpp/Metal/MTLDataType.hpp create mode 100644 vendor/metal-cpp/Metal/MTLGPUAddress.hpp create mode 100644 vendor/metal-cpp/Metal/MTLLogState.hpp create mode 100644 vendor/metal-cpp/Metal/MTLResidencySet.hpp create mode 100644 vendor/metal-cpp/Metal/MTLResourceViewPool.hpp create mode 100644 vendor/metal-cpp/Metal/MTLTensor.hpp create mode 100644 vendor/metal-cpp/Metal/MTLTextureViewPool.hpp create mode 100644 vendor/metal-cpp/MetalFX.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTL4FXFrameInterpolator.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTL4FXSpatialScaler.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTL4FXTemporalDenoisedScaler.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTL4FXTemporalScaler.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTLFXDefines.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTLFXFrameInterpolator.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTLFXPrivate.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTLFXSpatialScaler.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTLFXTemporalDenoisedScaler.hpp create mode 100644 vendor/metal-cpp/MetalFX/MTLFXTemporalScaler.hpp create mode 100644 vendor/metal-cpp/MetalFX/MetalFX.hpp create mode 100644 vendor/metal-cpp/QuartzCore.hpp diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f93cabd1..84a6e8a28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,13 +10,14 @@ repos: - id: check-yaml args: [ --allow-multiple-documents, --unsafe ] - id: end-of-file-fixer + exclude: 'vendor/.*' - id: mixed-line-ending args: [ --fix=lf ] # these are generated by Gradle exclude: 'gradlew\.bat$' - id: trailing-whitespace # FIXME: these autogenerate files contain trailing whitespace. Need to fix generator. - exclude: '(platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/(location/LocationIndicatorLayer|style/layers/PropertyFactory)\.java$)|(platform/windows/vendor/.*)|(platform/ios/vendor/.*)' + exclude: '(platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/(location/LocationIndicatorLayer|style/layers/PropertyFactory)\.java$)|(platform/windows/vendor/.*)|(platform/ios/vendor/.*|vendor/.*)' - repo: https://github.com/pre-commit/mirrors-clang-format rev: v20.1.8 diff --git a/vendor/metal-cpp/CADefines.hpp b/vendor/metal-cpp/CADefines.hpp new file mode 100644 index 000000000..b0641de05 --- /dev/null +++ b/vendor/metal-cpp/CADefines.hpp @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// QuartzCore/CADefines.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "../Foundation/NSDefines.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#define _CA_EXPORT _NS_EXPORT +#define _CA_EXTERN _NS_EXTERN +#define _CA_INLINE _NS_INLINE +#define _CA_PACKED _NS_PACKED + +#define _CA_CONST(type, name) _NS_CONST(type, name) +#define _CA_ENUM(type, name) _NS_ENUM(type, name) +#define _CA_OPTIONS(type, name) _NS_OPTIONS(type, name) + +#define _CA_VALIDATE_SIZE(ns, name) _NS_VALIDATE_SIZE(ns, name) +#define _CA_VALIDATE_ENUM(ns, name) _NS_VALIDATE_ENUM(ns, name) + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/CAMetalDrawable.hpp b/vendor/metal-cpp/CAMetalDrawable.hpp new file mode 100644 index 000000000..0057773a2 --- /dev/null +++ b/vendor/metal-cpp/CAMetalDrawable.hpp @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// QuartzCore/CAMetalDrawable.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "../Metal/MTLDrawable.hpp" +#include "../Metal/MTLTexture.hpp" + +#include "CADefines.hpp" +#include "CAPrivate.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace CA +{ +class MetalDrawable : public NS::Referencing +{ +public: + class MetalLayer* layer() const; + MTL::Texture* texture() const; +}; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE CA::MetalLayer* CA::MetalDrawable::layer() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(layer)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE MTL::Texture* CA::MetalDrawable::texture() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(texture)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/CAMetalLayer.hpp b/vendor/metal-cpp/CAMetalLayer.hpp new file mode 100644 index 000000000..53f6857d2 --- /dev/null +++ b/vendor/metal-cpp/CAMetalLayer.hpp @@ -0,0 +1,216 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// QuartzCore/CAMetalDrawable.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "../Metal/MTLPixelFormat.hpp" +#include "../Metal/MTLTexture.hpp" +#include "../Metal/MTLResidencySet.hpp" +#include "../Foundation/NSTypes.hpp" +#include +#include + +#include "CADefines.hpp" +#include "CAMetalDrawable.hpp" +#include "CAPrivate.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace CA +{ + +class MetalLayer : public NS::Referencing +{ +public: + static class MetalLayer* layer(); + + MTL::Device* device() const; + void setDevice(MTL::Device* device); + + MTL::PixelFormat pixelFormat() const; + void setPixelFormat(MTL::PixelFormat pixelFormat); + + bool framebufferOnly() const; + void setFramebufferOnly(bool framebufferOnly); + + CGSize drawableSize() const; + void setDrawableSize(CGSize drawableSize); + + class MetalDrawable* nextDrawable(); + + NS::UInteger maximumDrawableCount() const; + void setMaximumDrawableCount(NS::UInteger maximumDrawableCount); + + bool displaySyncEnabled() const; + void setDisplaySyncEnabled(bool displaySyncEnabled); + + CGColorSpaceRef colorspace() const; + void setColorspace(CGColorSpaceRef colorspace); + + bool allowsNextDrawableTimeout() const; + void setAllowsNextDrawableTimeout(bool allowsNextDrawableTimeout); + + MTL::ResidencySet* residencySet() const; +}; +} // namespace CA + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +_CA_INLINE CA::MetalLayer* CA::MetalLayer::layer() +{ + return Object::sendMessage(_CA_PRIVATE_CLS(CAMetalLayer), _CA_PRIVATE_SEL(layer)); +} +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE MTL::Device* CA::MetalLayer::device() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(device)); +} +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setDevice(MTL::Device* device) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setDevice_), device); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE MTL::PixelFormat CA::MetalLayer::pixelFormat() const +{ + return Object::sendMessage(this, + _CA_PRIVATE_SEL(pixelFormat)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setPixelFormat(MTL::PixelFormat pixelFormat) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setPixelFormat_), + pixelFormat); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE bool CA::MetalLayer::framebufferOnly() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(framebufferOnly)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setFramebufferOnly(bool framebufferOnly) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setFramebufferOnly_), + framebufferOnly); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE CGSize CA::MetalLayer::drawableSize() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(drawableSize)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setDrawableSize(CGSize drawableSize) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setDrawableSize_), + drawableSize); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE CA::MetalDrawable* CA::MetalLayer::nextDrawable() +{ + return Object::sendMessage(this, + _CA_PRIVATE_SEL(nextDrawable)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE NS::UInteger CA::MetalLayer::maximumDrawableCount() const +{ + return Object::sendMessage(this, + _CA_PRIVATE_SEL(maximumDrawableCount)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setMaximumDrawableCount(NS::UInteger maximumDrawableCount) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setMaximumDrawableCount_), + maximumDrawableCount); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE bool CA::MetalLayer::displaySyncEnabled() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(displaySyncEnabled)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setDisplaySyncEnabled(bool displaySyncEnabled) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setDisplaySyncEnabled_), + displaySyncEnabled); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE CGColorSpaceRef CA::MetalLayer::colorspace() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(colorspace)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setColorspace(CGColorSpaceRef colorspace) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setColorspace_), + colorspace); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE bool CA::MetalLayer::allowsNextDrawableTimeout() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(allowsNextDrawableTimeout)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setAllowsNextDrawableTimeout(bool allowsNextDrawableTimeout) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setAllowsNextDrawableTimeout_), + allowsNextDrawableTimeout); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE MTL::ResidencySet* CA::MetalLayer::residencySet() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(residencySet) ); +} diff --git a/vendor/metal-cpp/CAPrivate.hpp b/vendor/metal-cpp/CAPrivate.hpp new file mode 100644 index 000000000..0b7486a75 --- /dev/null +++ b/vendor/metal-cpp/CAPrivate.hpp @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// QuartzCore/CAPrivate.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "CADefines.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#define _CA_PRIVATE_CLS(symbol) (Private::Class::s_k##symbol) +#define _CA_PRIVATE_SEL(accessor) (Private::Selector::s_k##accessor) + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#if defined(CA_PRIVATE_IMPLEMENTATION) + +#ifdef METALCPP_SYMBOL_VISIBILITY_HIDDEN +#define _CA_PRIVATE_VISIBILITY __attribute__((visibility("hidden"))) +#else +#define _CA_PRIVATE_VISIBILITY __attribute__((visibility("default"))) +#endif // METALCPP_SYMBOL_VISIBILITY_HIDDEN + +#define _CA_PRIVATE_IMPORT __attribute__((weak_import)) + +#ifdef __OBJC__ +#define _CA_PRIVATE_OBJC_LOOKUP_CLASS(symbol) ((__bridge void*)objc_lookUpClass(#symbol)) +#define _CA_PRIVATE_OBJC_GET_PROTOCOL(symbol) ((__bridge void*)objc_getProtocol(#symbol)) +#else +#define _CA_PRIVATE_OBJC_LOOKUP_CLASS(symbol) objc_lookUpClass(#symbol) +#define _CA_PRIVATE_OBJC_GET_PROTOCOL(symbol) objc_getProtocol(#symbol) +#endif // __OBJC__ + +#define _CA_PRIVATE_DEF_CLS(symbol) void* s_k##symbol _CA_PRIVATE_VISIBILITY = _CA_PRIVATE_OBJC_LOOKUP_CLASS(symbol) +#define _CA_PRIVATE_DEF_PRO(symbol) void* s_k##symbol _CA_PRIVATE_VISIBILITY = _CA_PRIVATE_OBJC_GET_PROTOCOL(symbol) +#define _CA_PRIVATE_DEF_SEL(accessor, symbol) SEL s_k##accessor _CA_PRIVATE_VISIBILITY = sel_registerName(symbol) +#define _CA_PRIVATE_DEF_STR(type, symbol) \ + _CA_EXTERN type const CA##symbol _CA_PRIVATE_IMPORT; \ + type const CA::symbol = (nullptr != &CA##symbol) ? CA##symbol : nullptr + +#else + +#define _CA_PRIVATE_DEF_CLS(symbol) extern void* s_k##symbol +#define _CA_PRIVATE_DEF_PRO(symbol) extern void* s_k##symbol +#define _CA_PRIVATE_DEF_SEL(accessor, symbol) extern SEL s_k##accessor +#define _CA_PRIVATE_DEF_STR(type, symbol) extern type const CA::symbol + +#endif // CA_PRIVATE_IMPLEMENTATION + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace CA +{ +namespace Private +{ + namespace Class + { + _CA_PRIVATE_DEF_CLS(CAMetalLayer); + } // Class +} // Private +} // CA + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace CA +{ +namespace Private +{ + namespace Protocol + { + + _CA_PRIVATE_DEF_PRO(CAMetalDrawable); + + } // Protocol +} // Private +} // CA + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace CA +{ +namespace Private +{ + namespace Selector + { + _CA_PRIVATE_DEF_SEL(allowsNextDrawableTimeout, + "allowsNextDrawableTimeout"); + _CA_PRIVATE_DEF_SEL(colorspace, + "colorspace"); + _CA_PRIVATE_DEF_SEL(device, + "device"); + _CA_PRIVATE_DEF_SEL(displaySyncEnabled, + "displaySyncEnabled"); + _CA_PRIVATE_DEF_SEL(drawableSize, + "drawableSize"); + _CA_PRIVATE_DEF_SEL(framebufferOnly, + "framebufferOnly"); + _CA_PRIVATE_DEF_SEL(layer, + "layer"); + _CA_PRIVATE_DEF_SEL(maximumDrawableCount, + "maximumDrawableCount"); + _CA_PRIVATE_DEF_SEL(nextDrawable, + "nextDrawable"); + _CA_PRIVATE_DEF_SEL(pixelFormat, + "pixelFormat"); + _CA_PRIVATE_DEF_SEL(residencySet, + "residencySet"); + _CA_PRIVATE_DEF_SEL(setAllowsNextDrawableTimeout_, + "setAllowsNextDrawableTimeout:"); + _CA_PRIVATE_DEF_SEL(setColorspace_, + "setColorspace:"); + _CA_PRIVATE_DEF_SEL(setDevice_, + "setDevice:"); + _CA_PRIVATE_DEF_SEL(setDisplaySyncEnabled_, + "setDisplaySyncEnabled:"); + _CA_PRIVATE_DEF_SEL(setDrawableSize_, + "setDrawableSize:"); + _CA_PRIVATE_DEF_SEL(setFramebufferOnly_, + "setFramebufferOnly:"); + _CA_PRIVATE_DEF_SEL(setMaximumDrawableCount_, + "setMaximumDrawableCount:"); + _CA_PRIVATE_DEF_SEL(setPixelFormat_, + "setPixelFormat:"); + _CA_PRIVATE_DEF_SEL(texture, + "texture"); + } // Class +} // Private +} // CA + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/Foundation/Foundation.hpp b/vendor/metal-cpp/Foundation/Foundation.hpp index 8b64277ff..31e8fb3cb 100644 --- a/vendor/metal-cpp/Foundation/Foundation.hpp +++ b/vendor/metal-cpp/Foundation/Foundation.hpp @@ -2,7 +2,7 @@ // // Foundation/Foundation.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSArray.hpp b/vendor/metal-cpp/Foundation/NSArray.hpp index 7ccdb8044..ea04d1ea3 100644 --- a/vendor/metal-cpp/Foundation/NSArray.hpp +++ b/vendor/metal-cpp/Foundation/NSArray.hpp @@ -2,7 +2,7 @@ // // Foundation/NSArray.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ #include "NSObject.hpp" #include "NSTypes.hpp" +#include "NSEnumerator.hpp" //------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -43,8 +44,9 @@ public: Array* init(const class Coder* pCoder); template - _Object* object(UInteger index) const; - UInteger count() const; + _Object* object(UInteger index) const; + UInteger count() const; + Enumerator* objectEnumerator() const; }; } @@ -113,3 +115,10 @@ _NS_INLINE _Object* NS::Array::object(UInteger index) const } //------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_NS_INLINE NS::Enumerator* NS::Array::objectEnumerator() const +{ + return NS::Object::sendMessage*>(this, _NS_PRIVATE_SEL(objectEnumerator)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/Foundation/NSAutoreleasePool.hpp b/vendor/metal-cpp/Foundation/NSAutoreleasePool.hpp index 3008590d4..6d01a465f 100644 --- a/vendor/metal-cpp/Foundation/NSAutoreleasePool.hpp +++ b/vendor/metal-cpp/Foundation/NSAutoreleasePool.hpp @@ -2,7 +2,7 @@ // // Foundation/NSAutoreleasePool.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSBundle.hpp b/vendor/metal-cpp/Foundation/NSBundle.hpp index 323d93f33..b9637f517 100644 --- a/vendor/metal-cpp/Foundation/NSBundle.hpp +++ b/vendor/metal-cpp/Foundation/NSBundle.hpp @@ -2,7 +2,7 @@ // // Foundation/NSBundle.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,54 +42,54 @@ class String* LocalizedStringWithDefaultValue(const String* pKey, const String* class Bundle : public Referencing { public: - static Bundle* mainBundle(); + static Bundle* mainBundle(); - static Bundle* bundle(const class String* pPath); - static Bundle* bundle(const class URL* pURL); + static Bundle* bundle(const class String* pPath); + static Bundle* bundle(const class URL* pURL); - static Bundle* alloc(); + static class Array* allBundles(); + static class Array* allFrameworks(); - Bundle* init(const class String* pPath); - Bundle* init(const class URL* pURL); + static Bundle* alloc(); - class Array* allBundles() const; - class Array* allFrameworks() const; + Bundle* init(const class String* pPath); + Bundle* init(const class URL* pURL); - bool load(); - bool unload(); + bool load(); + bool unload(); - bool isLoaded() const; + bool isLoaded() const; - bool preflightAndReturnError(class Error** pError) const; - bool loadAndReturnError(class Error** pError); + bool preflightAndReturnError(class Error** pError) const; + bool loadAndReturnError(class Error** pError); - class URL* bundleURL() const; - class URL* resourceURL() const; - class URL* executableURL() const; - class URL* URLForAuxiliaryExecutable(const class String* pExecutableName) const; + class URL* bundleURL() const; + class URL* resourceURL() const; + class URL* executableURL() const; + class URL* URLForAuxiliaryExecutable(const class String* pExecutableName) const; - class URL* privateFrameworksURL() const; - class URL* sharedFrameworksURL() const; - class URL* sharedSupportURL() const; - class URL* builtInPlugInsURL() const; - class URL* appStoreReceiptURL() const; + class URL* privateFrameworksURL() const; + class URL* sharedFrameworksURL() const; + class URL* sharedSupportURL() const; + class URL* builtInPlugInsURL() const; + class URL* appStoreReceiptURL() const; - class String* bundlePath() const; - class String* resourcePath() const; - class String* executablePath() const; - class String* pathForAuxiliaryExecutable(const class String* pExecutableName) const; + class String* bundlePath() const; + class String* resourcePath() const; + class String* executablePath() const; + class String* pathForAuxiliaryExecutable(const class String* pExecutableName) const; - class String* privateFrameworksPath() const; - class String* sharedFrameworksPath() const; - class String* sharedSupportPath() const; - class String* builtInPlugInsPath() const; + class String* privateFrameworksPath() const; + class String* sharedFrameworksPath() const; + class String* sharedSupportPath() const; + class String* builtInPlugInsPath() const; - class String* bundleIdentifier() const; - class Dictionary* infoDictionary() const; - class Dictionary* localizedInfoDictionary() const; - class Object* objectForInfoDictionaryKey(const class String* pKey); + class String* bundleIdentifier() const; + class Dictionary* infoDictionary() const; + class Dictionary* localizedInfoDictionary() const; + class Object* objectForInfoDictionaryKey(const class String* pKey); - class String* localizedString(const class String* pKey, const class String* pValue = nullptr, const class String* pTableName = nullptr) const; + class String* localizedString(const class String* pKey, const class String* pValue = nullptr, const class String* pTableName = nullptr) const; }; } @@ -149,6 +149,20 @@ _NS_INLINE NS::Bundle* NS::Bundle::bundle(const class URL* pURL) //------------------------------------------------------------------------------------------------------------------------------------------------------------- +_NS_INLINE NS::Array* NS::Bundle::allBundles() +{ + return Object::sendMessage(_NS_PRIVATE_CLS(NSBundle), _NS_PRIVATE_SEL(allBundles)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_NS_INLINE NS::Array* NS::Bundle::allFrameworks() +{ + return Object::sendMessage(_NS_PRIVATE_CLS(NSBundle), _NS_PRIVATE_SEL(allFrameworks)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + _NS_INLINE NS::Bundle* NS::Bundle::alloc() { return Object::sendMessage(_NS_PRIVATE_CLS(NSBundle), _NS_PRIVATE_SEL(alloc)); @@ -170,20 +184,6 @@ _NS_INLINE NS::Bundle* NS::Bundle::init(const URL* pURL) //------------------------------------------------------------------------------------------------------------------------------------------------------------- -_NS_INLINE NS::Array* NS::Bundle::allBundles() const -{ - return Object::sendMessage(this, _NS_PRIVATE_SEL(allBundles)); -} - -//------------------------------------------------------------------------------------------------------------------------------------------------------------- - -_NS_INLINE NS::Array* NS::Bundle::allFrameworks() const -{ - return Object::sendMessage(this, _NS_PRIVATE_SEL(allFrameworks)); -} - -//------------------------------------------------------------------------------------------------------------------------------------------------------------- - _NS_INLINE bool NS::Bundle::load() { return Object::sendMessage(this, _NS_PRIVATE_SEL(load)); diff --git a/vendor/metal-cpp/Foundation/NSData.hpp b/vendor/metal-cpp/Foundation/NSData.hpp index ddfa6dd08..3ad360609 100644 --- a/vendor/metal-cpp/Foundation/NSData.hpp +++ b/vendor/metal-cpp/Foundation/NSData.hpp @@ -2,7 +2,7 @@ // // Foundation/NSData.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSDate.hpp b/vendor/metal-cpp/Foundation/NSDate.hpp index 3aa22cb59..0a5ec7ddb 100644 --- a/vendor/metal-cpp/Foundation/NSDate.hpp +++ b/vendor/metal-cpp/Foundation/NSDate.hpp @@ -2,7 +2,7 @@ // // Foundation/NSDate.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,4 +50,4 @@ _NS_INLINE NS::Date* NS::Date::dateWithTimeIntervalSinceNow(NS::TimeInterval sec return NS::Object::sendMessage(_NS_PRIVATE_CLS(NSDate), _NS_PRIVATE_SEL(dateWithTimeIntervalSinceNow_), secs); } -//------------------------------------------------------------------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/vendor/metal-cpp/Foundation/NSDefines.hpp b/vendor/metal-cpp/Foundation/NSDefines.hpp index a042be631..38bbb56b2 100644 --- a/vendor/metal-cpp/Foundation/NSDefines.hpp +++ b/vendor/metal-cpp/Foundation/NSDefines.hpp @@ -2,7 +2,7 @@ // // Foundation/NSDefines.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSDictionary.hpp b/vendor/metal-cpp/Foundation/NSDictionary.hpp index 078cd5c8f..d4a1519d5 100644 --- a/vendor/metal-cpp/Foundation/NSDictionary.hpp +++ b/vendor/metal-cpp/Foundation/NSDictionary.hpp @@ -2,7 +2,7 @@ // // Foundation/NSDictionary.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSEnumerator.hpp b/vendor/metal-cpp/Foundation/NSEnumerator.hpp index eed19dbac..5a2500c1e 100644 --- a/vendor/metal-cpp/Foundation/NSEnumerator.hpp +++ b/vendor/metal-cpp/Foundation/NSEnumerator.hpp @@ -2,7 +2,7 @@ // // Foundation/NSEnumerator.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSError.hpp b/vendor/metal-cpp/Foundation/NSError.hpp index f19ff861f..ea331d46e 100644 --- a/vendor/metal-cpp/Foundation/NSError.hpp +++ b/vendor/metal-cpp/Foundation/NSError.hpp @@ -2,7 +2,7 @@ // // Foundation/NSError.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSLock.hpp b/vendor/metal-cpp/Foundation/NSLock.hpp index b3cd91954..01df21940 100644 --- a/vendor/metal-cpp/Foundation/NSLock.hpp +++ b/vendor/metal-cpp/Foundation/NSLock.hpp @@ -2,7 +2,7 @@ // // Foundation/NSLock.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -115,4 +115,4 @@ _NS_INLINE void NS::Condition::broadcast() NS::Object::sendMessage(this, _NS_PRIVATE_SEL(broadcast)); } -//------------------------------------------------------------------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/vendor/metal-cpp/Foundation/NSNotification.hpp b/vendor/metal-cpp/Foundation/NSNotification.hpp index cc9ddc7e6..6b5be1211 100644 --- a/vendor/metal-cpp/Foundation/NSNotification.hpp +++ b/vendor/metal-cpp/Foundation/NSNotification.hpp @@ -2,7 +2,7 @@ // // Foundation/NSNotification.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -107,3 +107,4 @@ _NS_INLINE void NS::NotificationCenter::removeObserver(Object* pObserver) { return NS::Object::sendMessage(this, _NS_PRIVATE_SEL(removeObserver_), pObserver); } + diff --git a/vendor/metal-cpp/Foundation/NSNumber.hpp b/vendor/metal-cpp/Foundation/NSNumber.hpp index 13c780248..eec7ceac5 100644 --- a/vendor/metal-cpp/Foundation/NSNumber.hpp +++ b/vendor/metal-cpp/Foundation/NSNumber.hpp @@ -2,7 +2,7 @@ // // Foundation/NSNumber.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSObjCRuntime.hpp b/vendor/metal-cpp/Foundation/NSObjCRuntime.hpp index a3860e94a..9a5364c2e 100644 --- a/vendor/metal-cpp/Foundation/NSObjCRuntime.hpp +++ b/vendor/metal-cpp/Foundation/NSObjCRuntime.hpp @@ -2,7 +2,7 @@ // // Foundation/NSObjCRuntime.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSObject.hpp b/vendor/metal-cpp/Foundation/NSObject.hpp index 957071bca..aff8e6762 100644 --- a/vendor/metal-cpp/Foundation/NSObject.hpp +++ b/vendor/metal-cpp/Foundation/NSObject.hpp @@ -2,7 +2,7 @@ // // Foundation/NSObject.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -164,7 +164,7 @@ _NS_INLINE constexpr bool NS::Object::doesRequireMsgSendStret() #elif defined(__arm__) constexpr size_t kStructLimit = sizeof(std::uintptr_t); - return std::is_class(_Type) && (sizeof(_Type) > kStructLimit); + return std::is_class_v<_Type> && (sizeof(_Type) > kStructLimit); #else #error "Unsupported architecture!" #endif @@ -243,7 +243,7 @@ _NS_INLINE _Ret NS::Object::sendMessageSafe(const void* pObj, SEL selector, _Arg if constexpr (!std::is_void<_Ret>::value) { - return 0; + return _Ret(0); } } diff --git a/vendor/metal-cpp/Foundation/NSPrivate.hpp b/vendor/metal-cpp/Foundation/NSPrivate.hpp index af5ffb148..f8d87004f 100644 --- a/vendor/metal-cpp/Foundation/NSPrivate.hpp +++ b/vendor/metal-cpp/Foundation/NSPrivate.hpp @@ -2,7 +2,7 @@ // // Foundation/NSPrivate.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,19 @@ #if defined(NS_PRIVATE_IMPLEMENTATION) +#include + +namespace NS::Private +{ + template + inline _Type const LoadSymbol(const char* pSymbol) + { + const _Type* pAddress = static_cast<_Type*>(dlsym(RTLD_DEFAULT, pSymbol)); + + return pAddress ? *pAddress : _Type(); + } +} // NS::Private + #ifdef METALCPP_SYMBOL_VISIBILITY_HIDDEN #define _NS_PRIVATE_VISIBILITY __attribute__((visibility("hidden"))) #else @@ -52,9 +65,16 @@ #define _NS_PRIVATE_DEF_CLS(symbol) void* s_k##symbol _NS_PRIVATE_VISIBILITY = _NS_PRIVATE_OBJC_LOOKUP_CLASS(symbol) #define _NS_PRIVATE_DEF_PRO(symbol) void* s_k##symbol _NS_PRIVATE_VISIBILITY = _NS_PRIVATE_OBJC_GET_PROTOCOL(symbol) #define _NS_PRIVATE_DEF_SEL(accessor, symbol) SEL s_k##accessor _NS_PRIVATE_VISIBILITY = sel_registerName(symbol) + +#if defined(__MAC_26_0) || defined(__IPHONE_26_0) || defined(__TVOS_26_0) #define _NS_PRIVATE_DEF_CONST(type, symbol) \ _NS_EXTERN type const NS##symbol _NS_PRIVATE_IMPORT; \ - type const NS::symbol = (nullptr != &NS##symbol) ? NS##symbol : nullptr + type const NS::symbol = (nullptr != &NS##symbol) ? NS##symbol : type() +#else +#define _NS_PRIVATE_DEF_CONST(type, symbol) \ + _NS_EXTERN type const MTL##symbol _NS_PRIVATE_IMPORT; \ + type const NS::symbol = Private::LoadSymbol("NS" #symbol) +#endif #else @@ -236,6 +256,8 @@ namespace Private "globallyUniqueString"); _NS_PRIVATE_DEF_SEL(hash, "hash"); + _NS_PRIVATE_DEF_SEL(hasPerformanceProfile_, + "hasPerformanceProfile:"); _NS_PRIVATE_DEF_SEL(hostName, "hostName"); _NS_PRIVATE_DEF_SEL(infoDictionary, @@ -294,6 +316,8 @@ namespace Private "integerValue"); _NS_PRIVATE_DEF_SEL(intValue, "intValue"); + _NS_PRIVATE_DEF_SEL(isDeviceCertified_, + "isDeviceCertifiedFor:"); _NS_PRIVATE_DEF_SEL(isEqual_, "isEqual:"); _NS_PRIVATE_DEF_SEL(isEqualToNumber_, diff --git a/vendor/metal-cpp/Foundation/NSProcessInfo.hpp b/vendor/metal-cpp/Foundation/NSProcessInfo.hpp index 565b59937..09c212d54 100644 --- a/vendor/metal-cpp/Foundation/NSProcessInfo.hpp +++ b/vendor/metal-cpp/Foundation/NSProcessInfo.hpp @@ -2,7 +2,7 @@ // // Foundation/NSProcessInfo.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ namespace NS { _NS_CONST(NotificationName, ProcessInfoThermalStateDidChangeNotification); _NS_CONST(NotificationName, ProcessInfoPowerStateDidChangeNotification); +_NS_CONST(NotificationName, ProcessInfoPerformanceProfileDidChangeNotification); _NS_ENUM(NS::Integer, ProcessInfoThermalState) { ProcessInfoThermalStateNominal = 0, @@ -55,6 +56,13 @@ _NS_OPTIONS(std::uint64_t, ActivityOptions) { ActivityLatencyCritical = 0xFF00000000ULL, }; +typedef NS::Integer DeviceCertification; +_NS_CONST(DeviceCertification, DeviceCertificationiPhonePerformanceGaming); + +typedef NS::Integer ProcessPerformanceProfile; +_NS_CONST(ProcessPerformanceProfile, ProcessPerformanceProfileDefault); +_NS_CONST(ProcessPerformanceProfile, ProcessPerformanceProfileSustained); + class ProcessInfo : public Referencing { public: @@ -101,6 +109,10 @@ public: bool isiOSAppOnMac() const; bool isMacCatalystApp() const; + + bool isDeviceCertified(DeviceCertification performanceTier) const; + bool hasPerformanceProfile(ProcessPerformanceProfile performanceProfile) const; + }; } @@ -109,6 +121,12 @@ public: _NS_PRIVATE_DEF_CONST(NS::NotificationName, ProcessInfoThermalStateDidChangeNotification); _NS_PRIVATE_DEF_CONST(NS::NotificationName, ProcessInfoPowerStateDidChangeNotification); +// The linker searches for these symbols in the Metal framework, be sure to link it in as well: +_NS_PRIVATE_DEF_CONST(NS::NotificationName, ProcessInfoPerformanceProfileDidChangeNotification); +_NS_PRIVATE_DEF_CONST(NS::DeviceCertification, DeviceCertificationiPhonePerformanceGaming); +_NS_PRIVATE_DEF_CONST(NS::ProcessPerformanceProfile, ProcessPerformanceProfileDefault); +_NS_PRIVATE_DEF_CONST(NS::ProcessPerformanceProfile, ProcessPerformanceProfileSustained); + //------------------------------------------------------------------------------------------------------------------------------------------------------------- _NS_INLINE NS::ProcessInfo* NS::ProcessInfo::processInfo() @@ -352,3 +370,17 @@ _NS_INLINE bool NS::ProcessInfo::isMacCatalystApp() const } //------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_NS_INLINE bool NS::ProcessInfo::isDeviceCertified(DeviceCertification performanceTier) const +{ + return Object::sendMessageSafe(this, _NS_PRIVATE_SEL(isDeviceCertified_), performanceTier); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_NS_INLINE bool NS::ProcessInfo::hasPerformanceProfile(ProcessPerformanceProfile performanceProfile) const +{ + return Object::sendMessageSafe(this, _NS_PRIVATE_SEL(hasPerformanceProfile_), performanceProfile); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/Foundation/NSRange.hpp b/vendor/metal-cpp/Foundation/NSRange.hpp index 2c5beb5b9..8500271d6 100644 --- a/vendor/metal-cpp/Foundation/NSRange.hpp +++ b/vendor/metal-cpp/Foundation/NSRange.hpp @@ -2,7 +2,7 @@ // // Foundation/NSRange.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSSet.hpp b/vendor/metal-cpp/Foundation/NSSet.hpp index a4eb0d64e..382b6714e 100644 --- a/vendor/metal-cpp/Foundation/NSSet.hpp +++ b/vendor/metal-cpp/Foundation/NSSet.hpp @@ -2,7 +2,7 @@ // // Foundation/NSSet.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSSharedPtr.hpp b/vendor/metal-cpp/Foundation/NSSharedPtr.hpp index 09e8855ef..f1cf68e42 100644 --- a/vendor/metal-cpp/Foundation/NSSharedPtr.hpp +++ b/vendor/metal-cpp/Foundation/NSSharedPtr.hpp @@ -2,7 +2,7 @@ // // Foundation/NSSharedPtr.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #pragma once +#include #include "NSDefines.hpp" namespace NS @@ -38,6 +39,11 @@ public: */ ~SharedPtr(); + /** + * Create a new null pointer. + */ + SharedPtr(std::nullptr_t) noexcept; + /** * SharedPtr copy constructor. */ @@ -159,29 +165,32 @@ _NS_INLINE NS::SharedPtr<_Class>::SharedPtr() } template -_NS_INLINE NS::SharedPtr<_Class>::~SharedPtr() +_NS_INLINE NS::SharedPtr<_Class>::~SharedPtr<_Class>() __attribute__((no_sanitize("undefined"))) { - if (m_pObject) - { - m_pObject->release(); - } + m_pObject->release(); } template -_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(const NS::SharedPtr<_Class>& other) noexcept +_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(std::nullptr_t) noexcept + : m_pObject(nullptr) +{ +} + +template +_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(const SharedPtr<_Class>& other) noexcept : m_pObject(other.m_pObject->retain()) { } template template -_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(const NS::SharedPtr<_OtherClass>& other, typename std::enable_if_t> *) noexcept +_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(const SharedPtr<_OtherClass>& other, typename std::enable_if_t> *) noexcept : m_pObject(reinterpret_cast<_Class*>(other.get()->retain())) { } template -_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(NS::SharedPtr<_Class>&& other) noexcept +_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(SharedPtr<_Class>&& other) noexcept : m_pObject(other.m_pObject) { other.m_pObject = nullptr; @@ -189,7 +198,7 @@ _NS_INLINE NS::SharedPtr<_Class>::SharedPtr(NS::SharedPtr<_Class>&& other) noexc template template -_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(NS::SharedPtr<_OtherClass>&& other, typename std::enable_if_t> *) noexcept +_NS_INLINE NS::SharedPtr<_Class>::SharedPtr(SharedPtr<_OtherClass>&& other, typename std::enable_if_t> *) noexcept : m_pObject(reinterpret_cast<_Class*>(other.get())) { other.detach(); @@ -214,7 +223,7 @@ _NS_INLINE NS::SharedPtr<_Class>::operator bool() const } template -_NS_INLINE void NS::SharedPtr<_Class>::reset() +_NS_INLINE void NS::SharedPtr<_Class>::reset() __attribute__((no_sanitize("undefined"))) { m_pObject->release(); m_pObject = nullptr; @@ -227,44 +236,37 @@ _NS_INLINE void NS::SharedPtr<_Class>::detach() } template -_NS_INLINE NS::SharedPtr<_Class>& NS::SharedPtr<_Class>::operator=(const SharedPtr<_Class>& other) +_NS_INLINE NS::SharedPtr<_Class>& NS::SharedPtr<_Class>::operator=(const SharedPtr<_Class>& other) __attribute__((no_sanitize("undefined"))) { - if (m_pObject != other.m_pObject) - { - if (m_pObject) - { - m_pObject->release(); - } - m_pObject = other.m_pObject->retain(); - } + _Class* pOldObject = m_pObject; + + m_pObject = other.m_pObject->retain(); + + pOldObject->release(); + return *this; } template template typename std::enable_if_t, NS::SharedPtr<_Class> &> -_NS_INLINE NS::SharedPtr<_Class>::operator=(const SharedPtr<_OtherClass>& other) +_NS_INLINE NS::SharedPtr<_Class>::operator=(const SharedPtr<_OtherClass>& other) __attribute__((no_sanitize("undefined"))) { - if (m_pObject != other.get()) - { - if (m_pObject) - { - m_pObject->release(); - } - m_pObject = reinterpret_cast<_Class*>(other.get()->retain()); - } + _Class* pOldObject = m_pObject; + + m_pObject = reinterpret_cast<_Class*>(other.get()->retain()); + + pOldObject->release(); + return *this; } template -_NS_INLINE NS::SharedPtr<_Class>& NS::SharedPtr<_Class>::operator=(SharedPtr<_Class>&& other) +_NS_INLINE NS::SharedPtr<_Class>& NS::SharedPtr<_Class>::operator=(SharedPtr<_Class>&& other) __attribute__((no_sanitize("undefined"))) { if (m_pObject != other.m_pObject) { - if (m_pObject) - { - m_pObject->release(); - } + m_pObject->release(); m_pObject = other.m_pObject; } else @@ -279,14 +281,11 @@ _NS_INLINE NS::SharedPtr<_Class>& NS::SharedPtr<_Class>::operator=(SharedPtr<_Cl template template typename std::enable_if_t, NS::SharedPtr<_Class> &> -_NS_INLINE NS::SharedPtr<_Class>::operator=(SharedPtr<_OtherClass>&& other) +_NS_INLINE NS::SharedPtr<_Class>::operator=(SharedPtr<_OtherClass>&& other) __attribute__((no_sanitize("undefined"))) { if (m_pObject != other.get()) { - if (m_pObject) - { - m_pObject->release(); - } + m_pObject->release(); m_pObject = reinterpret_cast<_Class*>(other.get()); other.detach(); } diff --git a/vendor/metal-cpp/Foundation/NSString.hpp b/vendor/metal-cpp/Foundation/NSString.hpp index c601fc012..c48e0689e 100644 --- a/vendor/metal-cpp/Foundation/NSString.hpp +++ b/vendor/metal-cpp/Foundation/NSString.hpp @@ -2,7 +2,7 @@ // // Foundation/NSString.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSTypes.hpp b/vendor/metal-cpp/Foundation/NSTypes.hpp index 5f098f670..e6b723e5c 100644 --- a/vendor/metal-cpp/Foundation/NSTypes.hpp +++ b/vendor/metal-cpp/Foundation/NSTypes.hpp @@ -2,7 +2,7 @@ // // Foundation/NSTypes.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Foundation/NSURL.hpp b/vendor/metal-cpp/Foundation/NSURL.hpp index a7bc3e6e3..d90e5d70b 100644 --- a/vendor/metal-cpp/Foundation/NSURL.hpp +++ b/vendor/metal-cpp/Foundation/NSURL.hpp @@ -2,7 +2,7 @@ // // Foundation/NSURL.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/LICENSE.txt b/vendor/metal-cpp/LICENSE.txt index 6c877ff98..d07f885e7 100644 --- a/vendor/metal-cpp/LICENSE.txt +++ b/vendor/metal-cpp/LICENSE.txt @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright © 2023 Apple Inc. + Copyright © 2024 Apple Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/MTL4FXFrameInterpolator.hpp b/vendor/metal-cpp/MTL4FXFrameInterpolator.hpp new file mode 100644 index 000000000..1c50ec9e9 --- /dev/null +++ b/vendor/metal-cpp/MTL4FXFrameInterpolator.hpp @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTL4FXFrameInterpolator.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXFrameInterpolator.hpp" +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class FrameInterpolator : public NS::Referencing + { + public: + void encodeToCommandBuffer(MTL4::CommandBuffer* commandBuffer); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::FrameInterpolator::encodeToCommandBuffer(MTL4::CommandBuffer* commandBuffer) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MTL4FXSpatialScaler.hpp b/vendor/metal-cpp/MTL4FXSpatialScaler.hpp new file mode 100644 index 000000000..8ea8dfdd5 --- /dev/null +++ b/vendor/metal-cpp/MTL4FXSpatialScaler.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTL4FXSpatialScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXSpatialScaler.hpp" +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class SpatialScaler : public NS::Referencing< SpatialScaler, MTLFX::SpatialScalerBase > + { + public: + void encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::SpatialScaler::encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MTL4FXTemporalDenoisedScaler.hpp b/vendor/metal-cpp/MTL4FXTemporalDenoisedScaler.hpp new file mode 100644 index 000000000..73014bbc2 --- /dev/null +++ b/vendor/metal-cpp/MTL4FXTemporalDenoisedScaler.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXTemporalDenoisedScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXTemporalDenoisedScaler.hpp" +#include "../Metal/Metal.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalDenoisedScaler : public NS::Referencing< TemporalDenoisedScaler, MTLFX::TemporalDenoisedScalerBase > + { + public: + void encodeToCommandBuffer(MTL4::CommandBuffer* commandBuffer); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::TemporalDenoisedScaler::encodeToCommandBuffer( MTL4::CommandBuffer* commandBuffer ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MTL4FXTemporalScaler.hpp b/vendor/metal-cpp/MTL4FXTemporalScaler.hpp new file mode 100644 index 000000000..3bda5dca8 --- /dev/null +++ b/vendor/metal-cpp/MTL4FXTemporalScaler.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTL4FXTemporalScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXTemporalScaler.hpp" +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalScaler : public NS::Referencing< TemporalScaler, MTLFX::TemporalScalerBase > + { + public: + void encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::TemporalScaler::encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MTLFXDefines.hpp b/vendor/metal-cpp/MTLFXDefines.hpp new file mode 100644 index 000000000..320e0aa84 --- /dev/null +++ b/vendor/metal-cpp/MTLFXDefines.hpp @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXDefines.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "../Foundation/NSDefines.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#define _MTLFX_EXPORT _NS_EXPORT +#define _MTLFX_EXTERN _NS_EXTERN +#define _MTLFX_INLINE _NS_INLINE +#define _MTLFX_PACKED _NS_PACKED + +#define _MTLFX_CONST( type, name ) _NS_CONST( type, name ) +#define _MTLFX_ENUM( type, name ) _NS_ENUM( type, name ) +#define _MTLFX_OPTIONS( type, name ) _NS_OPTIONS( type, name ) + +#define _MTLFX_VALIDATE_SIZE( mtlfx, name ) _NS_VALIDATE_SIZE( mtlfx, name ) +#define _MTLFX_VALIDATE_ENUM( mtlfx, name ) _NS_VALIDATE_ENUM( mtlfx, name ) + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MTLFXFrameInterpolator.hpp b/vendor/metal-cpp/MTLFXFrameInterpolator.hpp new file mode 100644 index 000000000..10ff69cbc --- /dev/null +++ b/vendor/metal-cpp/MTLFXFrameInterpolator.hpp @@ -0,0 +1,719 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXFrameInterpolator.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" +#include "MTLFXTemporalScaler.hpp" + +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalScaler; + class TemporalDenoisedScaler; + class FrameInterpolator; +} + +namespace MTLFX +{ + class FrameInterpolatorDescriptor : public NS::Copying< FrameInterpolatorDescriptor > + { + public: + static FrameInterpolatorDescriptor* alloc(); + FrameInterpolatorDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat(MTL::PixelFormat colorTextureFormat); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat(MTL::PixelFormat outputTextureFormat); + + MTL::PixelFormat depthTextureFormat() const; + void setDepthTextureFormat(MTL::PixelFormat depthTextureFormat); + + MTL::PixelFormat motionTextureFormat() const; + void setMotionTextureFormat(MTL::PixelFormat motionTextureFormat); + + MTL::PixelFormat uiTextureFormat() const; + void setUITextureFormat(MTL::PixelFormat uiTextureFormat); + + MTLFX::FrameInterpolatableScaler* scaler() const; + void setScaler(MTLFX::FrameInterpolatableScaler* scaler); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger inputWidth ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger inputHeight ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger outputWidth ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger outputHeight ); + + class FrameInterpolator* newFrameInterpolator( const MTL::Device* pDevice) const; + MTL4FX::FrameInterpolator* newFrameInterpolator( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler) const; + + static bool supportsMetal4FX(MTL::Device* device); + static bool supportsDevice(MTL::Device* device); + }; + + class FrameInterpolatorBase : public NS::Referencing + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + MTL::TextureUsage depthTextureUsage() const; + MTL::TextureUsage motionTextureUsage() const; + MTL::TextureUsage uiTextureUsage() const; + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat depthTextureFormat() const; + MTL::PixelFormat motionTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + MTL::PixelFormat uiTextureFormat() const; + + MTL::Texture* colorTexture() const; + void setColorTexture(MTL::Texture* colorTexture); + + MTL::Texture* prevColorTexture() const; + void setPrevColorTexture(MTL::Texture* prevColorTexture); + + MTL::Texture* depthTexture() const; + void setDepthTexture(MTL::Texture* depthTexture); + + MTL::Texture* motionTexture() const; + void setMotionTexture(MTL::Texture* motionTexture); + + float motionVectorScaleX() const; + void setMotionVectorScaleX(float scaleX); + + float motionVectorScaleY() const; + void setMotionVectorScaleY(float scaleY); + + float deltaTime() const; + void setDeltaTime( float deltaTime ); + + float nearPlane() const; + void setNearPlane( float nearPlane ); + + float farPlane() const; + void setFarPlane( float farPlane ); + + float fieldOfView() const; + void setFieldOfView( float fieldOfView ); + + float aspectRatio() const; + void setAspectRatio( float aspectRatio ); + + MTL::Texture* uiTexture() const; + void setUITexture(MTL::Texture* uiTexture); + + float jitterOffsetX() const; + void setJitterOffsetX( float jitterOffsetX ); + + float jitterOffsetY() const; + void setJitterOffsetY( float jitterOffsetY ); + + bool isUITextureComposited() const; + void setIsUITextureComposited( bool uiTextureComposited ); + + bool shouldResetHistory() const; + void setShouldResetHistory( bool shouldResetHistory ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* outputTexture ); + + MTL::Fence* fence() const; + void setFence( MTL::Fence* fence ); + + bool isDepthReversed() const; + void setDepthReversed( bool depthReversed ); + }; + + class FrameInterpolator : public NS::Referencing + { + public: + void encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer); + }; + +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolatorDescriptor* MTLFX::FrameInterpolatorDescriptor::alloc() +{ + return NS::Object::alloc< FrameInterpolatorDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXFrameInterpolatorDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolatorDescriptor* MTLFX::FrameInterpolatorDescriptor::init() +{ + return NS::Object::init< FrameInterpolatorDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setColorTextureFormat( MTL::PixelFormat colorTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), colorTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputTextureFormat( MTL::PixelFormat outputTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), outputTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setDepthTextureFormat( MTL::PixelFormat depthTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), depthTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setMotionTextureFormat( MTL::PixelFormat motionTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), motionTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::uiTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( uiTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setUITextureFormat( MTL::PixelFormat uiTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setUITextureFormat_ ), uiTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolatableScaler* MTLFX::FrameInterpolatorDescriptor::scaler() const +{ + return NS::Object::sendMessage< MTLFX::FrameInterpolatableScaler* >( this, _MTLFX_PRIVATE_SEL( scaler ) ); +} + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setScaler(MTLFX::FrameInterpolatableScaler* scaler) +{ + NS::Object::sendMessage< void >(this, _MTLFX_PRIVATE_SEL( setScaler_ ), scaler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setInputWidth( NS::UInteger inputWidth ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), inputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setInputHeight( NS::UInteger inputHeight ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), inputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputWidth( NS::UInteger outputWidth ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), outputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputHeight( NS::UInteger outputHeight ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), outputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolator* MTLFX::FrameInterpolatorDescriptor::newFrameInterpolator( const MTL::Device* device ) const +{ + return NS::Object::sendMessage< MTLFX::FrameInterpolator* >( this, _MTLFX_PRIVATE_SEL( newFrameInterpolatorWithDevice_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::FrameInterpolator* MTLFX::FrameInterpolatorDescriptor::newFrameInterpolator( const MTL::Device* device, const MTL4::Compiler* compiler ) const +{ + return NS::Object::sendMessage< MTL4FX::FrameInterpolator* >( this, _MTLFX_PRIVATE_SEL( newFrameInterpolatorWithDevice_compiler_ ), device, compiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorDescriptor::supportsMetal4FX(MTL::Device* device) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXFrameInterpolatorDescriptor), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorDescriptor::supportsDevice(MTL::Device* device) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXFrameInterpolatorDescriptor), _MTLFX_PRIVATE_SEL( supportsDevice_ ), device ); +} + + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::colorTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::outputTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::depthTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::motionTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::uiTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( uiTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::uiTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( uiTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::colorTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setColorTexture(MTL::Texture* colorTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), colorTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::prevColorTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( prevColorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setPrevColorTexture(MTL::Texture* prevColorTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPrevColorTexture_ ), prevColorTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::depthTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthTexture(MTL::Texture* depthTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), depthTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::motionTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionTexture(MTL::Texture* motionTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), motionTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::motionVectorScaleX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionVectorScaleX(float scaleX) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), scaleX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::motionVectorScaleY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionVectorScaleY(float scaleY) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), scaleY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::deltaTime() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( deltaTime ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDeltaTime( float deltaTime ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDeltaTime_ ), deltaTime ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::nearPlane() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( nearPlane ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setNearPlane( float nearPlane ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNearPlane_ ), nearPlane ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::farPlane() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( farPlane ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFarPlane( float farPlane ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFarPlane_ ), farPlane ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::fieldOfView() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( fieldOfView ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFieldOfView( float fieldOfView ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFieldOfView_ ), fieldOfView ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::aspectRatio() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( aspectRatio ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setAspectRatio( float aspectRatio ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAspectRatio_ ), aspectRatio ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::uiTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( uiTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setUITexture(MTL::Texture* uiTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setUITexture_ ), uiTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::jitterOffsetX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setJitterOffsetX( float jitterOffsetX ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), jitterOffsetX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::jitterOffsetY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setJitterOffsetY( float jitterOffsetY ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), jitterOffsetY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::isUITextureComposited() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isUITextureComposited ) ); +} + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setIsUITextureComposited( bool uiTextureComposited ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setIsUITextureComposited_ ), uiTextureComposited ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::shouldResetHistory() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( shouldResetHistory ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setShouldResetHistory(bool shouldResetHistory) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setShouldResetHistory_ ), shouldResetHistory ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::outputTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setOutputTexture(MTL::Texture* outputTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), outputTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::FrameInterpolatorBase::fence() const +{ + return NS::Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFence(MTL::Fence* fence) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), fence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::isDepthReversed() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthReversed(bool depthReversed) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolator::encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MTLFXPrivate.hpp b/vendor/metal-cpp/MTLFXPrivate.hpp new file mode 100644 index 000000000..21fd728e4 --- /dev/null +++ b/vendor/metal-cpp/MTLFXPrivate.hpp @@ -0,0 +1,482 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXPrivate.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#define _MTLFX_PRIVATE_CLS( symbol ) ( MTLFX::Private::Class::s_k##symbol ) +#define _MTLFX_PRIVATE_SEL( accessor ) ( MTLFX::Private::Selector::s_k##accessor ) + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#if defined( MTLFX_PRIVATE_IMPLEMENTATION ) + +#if defined( METALCPP_SYMBOL_VISIBILITY_HIDDEN ) +#define _MTLFX_PRIVATE_VISIBILITY __attribute__( ( visibility("hidden" ) ) ) +#else +#define _MTLFX_PRIVATE_VISIBILITY __attribute__( ( visibility("default" ) ) ) +#endif // METALCPP_SYMBOL_VISIBILITY_HIDDEN + +#define _MTLFX_PRIVATE_IMPORT __attribute__( ( weak_import ) ) + +#ifdef __OBJC__ +#define _MTLFX_PRIVATE_OBJC_LOOKUP_CLASS( symbol ) ( ( __bridge void* ) objc_lookUpClass( #symbol ) ) +#define _MTLFX_PRIVATE_OBJC_GET_PROTOCOL( symbol ) ( ( __bridge void* ) objc_getProtocol( #symbol ) ) +#else +#define _MTLFX_PRIVATE_OBJC_LOOKUP_CLASS( symbol ) objc_lookUpClass(#symbol) +#define _MTLFX_PRIVATE_OBJC_GET_PROTOCOL( symbol ) objc_getProtocol(#symbol) +#endif // __OBJC__ + +#define _MTLFX_PRIVATE_DEF_CLS( symbol ) void* s_k##symbol _MTLFX_PRIVATE_VISIBILITY = _MTLFX_PRIVATE_OBJC_LOOKUP_CLASS( symbol ) +#define _MTLFX_PRIVATE_DEF_PRO( symbol ) void* s_k##symbol _MTLFX_PRIVATE_VISIBILITY = _MTLFX_PRIVATE_OBJC_GET_PROTOCOL( symbol ) +#define _MTLFX_PRIVATE_DEF_SEL( accessor, symbol ) SEL s_k##accessor _MTLFX_PRIVATE_VISIBILITY = sel_registerName( symbol ) + +#include +#define MTLFX_DEF_FUNC( name, signature ) using Fn##name = signature; \ + Fn##name name = reinterpret_cast< Fn##name >( dlsym( RTLD_DEFAULT, #name ) ) + +namespace MTLFX::Private +{ + template + + inline _Type const LoadSymbol(const char* pSymbol) + { + const _Type* pAddress = static_cast<_Type*>(dlsym(RTLD_DEFAULT, pSymbol)); + + return pAddress ? *pAddress : nullptr; + } +} // MTLFX::Private + +#if defined(__MAC_26_0) || defined(__IPHONE_26_0) || defined(__TVOS_26_0) + +#define _MTLFX_PRIVATE_DEF_STR( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##symbol _MTLFX_PRIVATE_IMPORT; \ + type const MTLFX::symbol = ( nullptr != &MTLFX##symbol ) ? MTLFX##ssymbol : nullptr + +#define _MTLFX_PRIVATE_DEF_CONST( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol _MTLFX_PRIVATE_IMPORT; \ + type const MTLFX::symbol = (nullptr != &MTLFX##ssymbol) ? MTLFX##ssymbol : nullptr + +#define _MTLFX_PRIVATE_DEF_WEAK_CONST( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol; \ + type const MTLFX::symbol = Private::LoadSymbol< type >( "MTLFX" #symbol ) + +#else + +#define _MTLFX_PRIVATE_DEF_STR( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol; \ + type const MTLFX::symbol = Private::LoadSymbol< type >( "MTLFX" #symbol ) + +#define _MTLFX_PRIVATE_DEF_CONST( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol; \ + type const MTLFX::symbol = Private::LoadSymbol< type >( "MTLFX" #symbol ) + +#define _MTLFX_PRIVATE_DEF_WEAK_CONST( type, symbol ) _MTLFX_PRIVATE_DEF_CONST( type, symbol ) + +#endif + +#else + +#define _MTLFX_PRIVATE_DEF_CLS( symbol ) extern void* s_k##symbol +#define _MTLFX_PRIVATE_DEF_PRO( symbol ) extern void* s_k##symbol +#define _MTLFX_PRIVATE_DEF_SEL( accessor, symbol ) extern SEL s_k##accessor +#define _MTLFX_PRIVATE_DEF_STR( type, symbol ) extern type const MTLFX::symbol +#define _MTLFX_PRIVATE_DEF_CONST( type, symbol ) extern type const MTLFX::symbol +#define _MTLFX_PRIVATE_DEF_WEAK_CONST( type, symbol ) extern type const MTLFX::symbol + +#endif // MTLFX_PRIVATE_IMPLEMENTATION + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTLFX +{ + namespace Private + { + namespace Class + { + _MTLFX_PRIVATE_DEF_CLS( MTLFXSpatialScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTLFXTemporalScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTLFXFrameInterpolatorDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTLFXTemporalDenoisedScalerDescriptor ); + + _MTLFX_PRIVATE_DEF_CLS( MTL4FXSpatialScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTL4FXTemporalScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTL4FXFrameInterpolatorDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTL4FXTemporalDenoisedScalerDescriptor ); + } // Class + } // Private +} // MTLFX + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTLFX +{ + namespace Private + { + namespace Protocol + { + _MTLFX_PRIVATE_DEF_PRO( MTLFXSpatialScaler ); + _MTLFX_PRIVATE_DEF_PRO( MTLFXTemporalScaler ); + } // Protocol + } // Private +} // MTLFX + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTLFX +{ + namespace Private + { + namespace Selector + { + _MTLFX_PRIVATE_DEF_SEL( aspectRatio, + "aspectRatio" ); + _MTLFX_PRIVATE_DEF_SEL( colorProcessingMode, + "colorProcessingMode" ); + _MTLFX_PRIVATE_DEF_SEL( colorTexture, + "colorTexture" ); + _MTLFX_PRIVATE_DEF_SEL( colorTextureFormat, + "colorTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( colorTextureUsage, + "colorTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( deltaTime, + "deltaTime" ); + _MTLFX_PRIVATE_DEF_SEL( denoiseStrengthMaskTexture, + "denoiseStrengthMaskTexture" ); + _MTLFX_PRIVATE_DEF_SEL( denoiseStrengthMaskTextureFormat, + "denoiseStrengthMaskTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( denoiseStrengthMaskTextureUsage, + "denoiseStrengthMaskTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( depthTexture, + "depthTexture" ); + _MTLFX_PRIVATE_DEF_SEL( depthTextureFormat, + "depthTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( depthTextureUsage, + "depthTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( diffuseAlbedoTexture, + "diffuseAlbedoTexture" ); + _MTLFX_PRIVATE_DEF_SEL( diffuseAlbedoTextureFormat, + "diffuseAlbedoTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( diffuseAlbedoTextureUsage, + "diffuseAlbedoTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( encodeToCommandBuffer_, + "encodeToCommandBuffer:" ); + _MTLFX_PRIVATE_DEF_SEL( exposureTexture, + "exposureTexture" ); + _MTLFX_PRIVATE_DEF_SEL( farPlane, + "farPlane" ); + _MTLFX_PRIVATE_DEF_SEL( fence, + "fence" ); + _MTLFX_PRIVATE_DEF_SEL( fieldOfView, + "fieldOfView" ); + _MTLFX_PRIVATE_DEF_SEL( height, + "height" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentHeight, + "inputContentHeight" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentMaxScale, + "inputContentMaxScale" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentMinScale, + "inputContentMinScale" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentWidth, + "inputContentWidth" ); + _MTLFX_PRIVATE_DEF_SEL( inputHeight, + "inputHeight" ); + _MTLFX_PRIVATE_DEF_SEL( inputWidth, + "inputWidth" ); + _MTLFX_PRIVATE_DEF_SEL( isAutoExposureEnabled, + "isAutoExposureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isDenoiseStrengthMaskTextureEnabled, + "isDenoiseStrengthMaskTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isDepthReversed, + "isDepthReversed" ); + _MTLFX_PRIVATE_DEF_SEL( isInputContentPropertiesEnabled, + "isInputContentPropertiesEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isTransparencyOverlayTextureEnabled, + "isTransparencyOverlayTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isReactiveMaskTextureEnabled, + "isReactiveMaskTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isSpecularHitDistanceTextureEnabled, + "isSpecularHitDistanceTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isUITextureComposited, + "isUITextureComposited" ); + _MTLFX_PRIVATE_DEF_SEL( jitterOffsetX, + "jitterOffsetX" ); + _MTLFX_PRIVATE_DEF_SEL( jitterOffsetY, + "jitterOffsetY" ); + _MTLFX_PRIVATE_DEF_SEL( maskTexture, + "maskTexture" ); + _MTLFX_PRIVATE_DEF_SEL( maskTextureFormat, + "maskTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( maskTextureUsage, + "maskTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( motionTexture, + "motionTexture" ); + _MTLFX_PRIVATE_DEF_SEL( motionTextureFormat, + "motionTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( motionTextureUsage, + "motionTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( motionVectorScaleX, + "motionVectorScaleX" ); + _MTLFX_PRIVATE_DEF_SEL( motionVectorScaleY, + "motionVectorScaleY" ); + _MTLFX_PRIVATE_DEF_SEL( nearPlane, + "nearPlane" ); + _MTLFX_PRIVATE_DEF_SEL( newFrameInterpolatorWithDevice_, + "newFrameInterpolatorWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newFrameInterpolatorWithDevice_compiler_, + "newFrameInterpolatorWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalDenoisedScalerWithDevice_, + "newTemporalDenoisedScalerWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalDenoisedScalerWithDevice_compiler_, + "newTemporalDenoisedScalerWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( newSpatialScalerWithDevice_, + "newSpatialScalerWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newSpatialScalerWithDevice_compiler_, + "newSpatialScalerWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalScalerWithDevice_, + "newTemporalScalerWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalScalerWithDevice_compiler_, + "newTemporalScalerWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( normalTexture, + "normalTexture" ); + _MTLFX_PRIVATE_DEF_SEL( normalTextureFormat, + "normalTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( normalTextureUsage, + "normalTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( outputHeight, + "outputHeight" ); + _MTLFX_PRIVATE_DEF_SEL( outputTexture, + "outputTexture" ); + _MTLFX_PRIVATE_DEF_SEL( outputTextureFormat, + "outputTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( outputTextureUsage, + "outputTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( outputWidth, + "outputWidth" ); + _MTLFX_PRIVATE_DEF_SEL( preExposure, + "preExposure" ); + _MTLFX_PRIVATE_DEF_SEL( transparencyOverlayTextureFormat, + "transparencyOverlayTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( transparencyOverlayTextureUsage, + "transparencyOverlayTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( prevColorTexture, + "prevColorTexture" ); + _MTLFX_PRIVATE_DEF_SEL( reactiveMaskTextureFormat, + "reactiveMaskTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( reactiveTextureUsage, + "reactiveTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( reactiveMaskTexture, + "reactiveMaskTexture" ); + _MTLFX_PRIVATE_DEF_SEL( reset, + "reset" ); + _MTLFX_PRIVATE_DEF_SEL( requiresSynchronousInitialization, + "requiresSynchronousInitialization" ); + _MTLFX_PRIVATE_DEF_SEL( roughnessTextureFormat, + "roughnessTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( roughnessTextureUsage, + "roughnessTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( scaler, + "scaler" ); + _MTLFX_PRIVATE_DEF_SEL( scaler4, + "scaler4" ); + _MTLFX_PRIVATE_DEF_SEL( setAspectRatio_, + "setAspectRatio:" ); + _MTLFX_PRIVATE_DEF_SEL( setAutoExposureEnabled_, + "setAutoExposureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setColorProcessingMode_, + "setColorProcessingMode:" ); + _MTLFX_PRIVATE_DEF_SEL( setColorTexture_, + "setColorTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setColorTextureFormat_, + "setColorTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setDeltaTime_, + "setDeltaTime:" ); + _MTLFX_PRIVATE_DEF_SEL( setDenoiseStrengthMaskTexture_, + "setDenoiseStrengthMaskTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setDenoiseStrengthMaskTextureEnabled_, + "setDenoiseStrengthMaskTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setDenoiseStrengthMaskTextureFormat_, + "setDenoiseStrengthMaskTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthInverted_, + "setDepthInverted:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthReversed_, + "setDepthReversed:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthTexture_, + "setDepthTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthTextureFormat_, + "setDepthTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setDiffuseAlbedoTexture_, + "setDiffuseAlbedoTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setDiffuseAlbedoTextureFormat_, + "setDiffuseAlbedoTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setExposureTexture_, + "setExposureTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setFarPlane_, + "setFarPlane:" ); + _MTLFX_PRIVATE_DEF_SEL( setFence_, + "setFence:" ); + _MTLFX_PRIVATE_DEF_SEL( setFieldOfView_, + "setFieldOfView:" ); + _MTLFX_PRIVATE_DEF_SEL( setHeight_, + "setHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentHeight_, + "setInputContentHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentMaxScale_, + "setInputContentMaxScale:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentMinScale_, + "setInputContentMinScale:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentPropertiesEnabled_, + "setInputContentPropertiesEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentWidth_, + "setInputContentWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputHeight_, + "setInputHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputWidth_, + "setInputWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( setIsUITextureComposited_, + "setIsUITextureComposited:" ); + _MTLFX_PRIVATE_DEF_SEL( setJitterOffsetX_, + "setJitterOffsetX:" ); + _MTLFX_PRIVATE_DEF_SEL( setJitterOffsetY_, + "setJitterOffsetY:" ); + _MTLFX_PRIVATE_DEF_SEL( setNearPlane_, + "setNearPlane:" ); + _MTLFX_PRIVATE_DEF_SEL( setMaskTexture_, + "setMaskTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setMaskTextureFormat_, + "setMaskTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionTexture_, + "setMotionTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionTextureFormat_, + "setMotionTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionVectorScaleX_, + "setMotionVectorScaleX:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionVectorScaleY_, + "setMotionVectorScaleY:" ); + _MTLFX_PRIVATE_DEF_SEL( setNormalTexture_, + "setNormalTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setNormalTextureFormat_, + "setNormalTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputHeight_, + "setOutputHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputTexture_, + "setOutputTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputTextureFormat_, + "setOutputTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputWidth_, + "setOutputWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( transparencyOverlayTexture, + "transparencyOverlayTexture" ); + _MTLFX_PRIVATE_DEF_SEL( setTransparencyOverlayTexture_, + "setTransparencyOverlayTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setTransparencyOverlayTextureEnabled_, + "setTransparencyOverlayTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setPreExposure_, + "setPreExposure:" ); + _MTLFX_PRIVATE_DEF_SEL( setTransparencyOverlayTextureFormat_, + "setTransparencyOverlayTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setPrevColorTexture_, + "setPrevColorTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setReactiveMaskTexture_, + "setReactiveMaskTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setReactiveMaskTextureEnabled_, + "setReactiveMaskTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setReactiveMaskTextureFormat_, + "setReactiveMaskTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setRequiresSynchronousInitialization_, + "setRequiresSynchronousInitialization:" ); + _MTLFX_PRIVATE_DEF_SEL( setReset_, + "setReset:" ); + _MTLFX_PRIVATE_DEF_SEL( roughnessTexture, + "roughnessTexture" ); + _MTLFX_PRIVATE_DEF_SEL( setRoughnessTexture_, + "setRoughnessTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setRoughnessTextureFormat_, + "setRoughnessTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setScaler_, + "setScaler:" ); + _MTLFX_PRIVATE_DEF_SEL( setShouldResetHistory_, + "setShouldResetHistory:" ); + _MTLFX_PRIVATE_DEF_SEL( specularHitDistanceTexture, + "specularHitDistanceTexture" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularHitDistanceTexture_, + "setSpecularHitDistanceTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularHitDistanceTextureEnabled_, + "setSpecularHitDistanceTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularAlbedoTexture_, + "setSpecularAlbedoTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularAlbedoTextureFormat_, + "setSpecularAlbedoTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularHitDistanceTextureFormat_, + "setSpecularHitDistanceTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setUITexture_, + "setUITexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setUITextureFormat_, + "setUITextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setViewToClipMatrix_, + "setViewToClipMatrix:" ); + _MTLFX_PRIVATE_DEF_SEL( setWidth_, + "setWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( setWorldToViewMatrix_, + "setWorldToViewMatrix:" ); + _MTLFX_PRIVATE_DEF_SEL( shouldResetHistory, + "shouldResetHistory" ); + _MTLFX_PRIVATE_DEF_SEL( specularAlbedoTexture, + "specularAlbedoTexture" ); + _MTLFX_PRIVATE_DEF_SEL( specularAlbedoTextureFormat, + "specularAlbedoTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( specularAlbedoTextureUsage, + "specularAlbedoTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( specularHitDistanceTextureFormat, + "specularHitDistanceTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( specularHitDistanceTextureUsage, + "specularHitDistanceTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( supportedInputContentMaxScaleForDevice_, + "supportedInputContentMaxScaleForDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( supportedInputContentMinScaleForDevice_, + "supportedInputContentMinScaleForDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( supportsDevice_, + "supportsDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( supportsMetal4FX_, + "supportsMetal4FX:" ); + _MTLFX_PRIVATE_DEF_SEL( uiTexture, + "uiTexture" ); + _MTLFX_PRIVATE_DEF_SEL( uiTextureFormat, + "uiTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( uiTextureUsage, + "uiTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( viewToClipMatrix, + "viewToClipMatrix" ); + _MTLFX_PRIVATE_DEF_SEL( width, + "width" ); + _MTLFX_PRIVATE_DEF_SEL( worldToViewMatrix, + "worldToViewMatrix" ); + } // Selector + } // Private +} // MTLFX + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MTLFXSpatialScaler.hpp b/vendor/metal-cpp/MTLFXSpatialScaler.hpp new file mode 100644 index 000000000..cb1186ed8 --- /dev/null +++ b/vendor/metal-cpp/MTLFXSpatialScaler.hpp @@ -0,0 +1,397 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXSpatialScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class SpatialScaler; +} + +namespace MTLFX +{ + _MTLFX_ENUM( NS::Integer, SpatialScalerColorProcessingMode ) + { + SpatialScalerColorProcessingModePerceptual = 0, + SpatialScalerColorProcessingModeLinear = 1, + SpatialScalerColorProcessingModeHDR = 2 + }; + + class SpatialScalerDescriptor : public NS::Copying< SpatialScalerDescriptor > + { + public: + static class SpatialScalerDescriptor* alloc(); + class SpatialScalerDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat( MTL::PixelFormat format ); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger width ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger height ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger width ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger height ); + + SpatialScalerColorProcessingMode colorProcessingMode() const; + void setColorProcessingMode( SpatialScalerColorProcessingMode mode ); + + class SpatialScaler* newSpatialScaler( const MTL::Device* pDevice ) const; + MTL4FX::SpatialScaler* newSpatialScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const; + + static bool supportsDevice( const MTL::Device* pDevice); + static bool supportsMetal4FX( const MTL::Device* pDevice ); + }; + + class SpatialScalerBase : public NS::Referencing< SpatialScaler > + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + + NS::UInteger inputContentWidth() const; + void setInputContentWidth( NS::UInteger width ); + + NS::UInteger inputContentHeight() const; + void setInputContentHeight( NS::UInteger height ); + + MTL::Texture* colorTexture() const; + void setColorTexture( MTL::Texture* pTexture ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* pTexture ); + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + SpatialScalerColorProcessingMode colorProcessingMode() const; + + MTL::Fence* fence() const; + void setFence( MTL::Fence* pFence ); + }; + + class SpatialScaler : public NS::Referencing< SpatialScaler, SpatialScalerBase > + { + public: + void encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerDescriptor* MTLFX::SpatialScalerDescriptor::alloc() +{ + return NS::Object::alloc< SpatialScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXSpatialScalerDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerDescriptor* MTLFX::SpatialScalerDescriptor::init() +{ + return NS::Object::init< SpatialScalerDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerDescriptor::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setColorTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerDescriptor::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setInputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setInputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setOutputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setOutputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerColorProcessingMode MTLFX::SpatialScalerDescriptor::colorProcessingMode() const +{ + return Object::sendMessage< SpatialScalerColorProcessingMode >( this, _MTLFX_PRIVATE_SEL( colorProcessingMode ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setColorProcessingMode( SpatialScalerColorProcessingMode mode ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorProcessingMode_ ), mode ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScaler* MTLFX::SpatialScalerDescriptor::newSpatialScaler( const MTL::Device* pDevice ) const +{ + return Object::sendMessage< SpatialScaler* >( this, _MTLFX_PRIVATE_SEL( newSpatialScalerWithDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::SpatialScaler* MTLFX::SpatialScalerDescriptor::newSpatialScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const +{ + return Object::sendMessage< MTL4FX::SpatialScaler* >( this, _MTLFX_PRIVATE_SEL( newSpatialScalerWithDevice_compiler_ ), pDevice, pCompiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::SpatialScalerDescriptor::supportsDevice( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXSpatialScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::SpatialScalerDescriptor::supportsMetal4FX( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXSpatialScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::SpatialScalerBase::colorTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::SpatialScalerBase::outputTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputContentWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setInputContentWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputContentHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setInputContentHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::SpatialScalerBase::colorTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setColorTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::SpatialScalerBase::outputTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setOutputTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerBase::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerBase::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerColorProcessingMode MTLFX::SpatialScalerBase::colorProcessingMode() const +{ + return Object::sendMessage< SpatialScalerColorProcessingMode >( this, _MTLFX_PRIVATE_SEL( colorProcessingMode ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::SpatialScalerBase::fence() const +{ + return Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setFence( MTL::Fence* pFence ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), pFence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScaler::encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MTLFXTemporalDenoisedScaler.hpp b/vendor/metal-cpp/MTLFXTemporalDenoisedScaler.hpp new file mode 100644 index 000000000..5863e078d --- /dev/null +++ b/vendor/metal-cpp/MTLFXTemporalDenoisedScaler.hpp @@ -0,0 +1,1208 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXTemporalDenoisedScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" +#include "MTLFXTemporalScaler.hpp" + +#include "../Metal/Metal.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalDenoisedScaler; +} + +namespace MTLFX +{ + class TemporalDenoisedScalerDescriptor : public NS::Copying< TemporalDenoisedScalerDescriptor > + { + public: + static class TemporalDenoisedScalerDescriptor* alloc(); + class TemporalDenoisedScalerDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat depthTextureFormat() const; + void setDepthTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat motionTextureFormat() const; + void setMotionTextureFormat( MTL::PixelFormat pixelFormal ); + + MTL::PixelFormat diffuseAlbedoTextureFormat() const; + void setDiffuseAlbedoTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat specularAlbedoTextureFormat() const; + void setSpecularAlbedoTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat normalTextureFormat() const; + void setNormalTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat roughnessTextureFormat() const; + void setRoughnessTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat specularHitDistanceTextureFormat() const; + void setSpecularHitDistanceTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat denoiseStrengthMaskTextureFormat() const; + void setDenoiseStrengthMaskTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat transparencyOverlayTextureFormat() const; + void setTransparencyOverlayTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat( MTL::PixelFormat pixelFormat ); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger inputWidth ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger inputHeight ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger outputWidth ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger outputHeight ); + + bool requiresSynchronousInitialization() const; + void setRequiresSynchronousInitialization( bool requiresSynchronousInitialization ); + + bool isAutoExposureEnabled() const; + void setAutoExposureEnabled( bool enabled ); + + bool isInputContentPropertiesEnabled() const; + void setInputContentPropertiesEnabled( bool enabled ); + + float inputContentMinScale() const; + void setInputContentMinScale( float inputContentMinScale ); + + float inputContentMaxScale() const; + void setInputContentMaxScale( float inputContentMaxScale ); + + bool isReactiveMaskTextureEnabled() const; + void setReactiveMaskTextureEnabled( bool enabled ); + + MTL::PixelFormat reactiveMaskTextureFormat() const; + void setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ); + + bool isSpecularHitDistanceTextureEnabled() const; + void setSpecularHitDistanceTextureEnabled( bool enabled ); + + bool isDenoiseStrengthMaskTextureEnabled() const; + void setDenoiseStrengthMaskTextureEnabled( bool enabled ); + + bool isTransparencyOverlayTextureEnabled() const; + void setTransparencyOverlayTextureEnabled( bool enabled ); + + class TemporalDenoisedScaler* newTemporalDenoisedScaler( const MTL::Device* device ) const; + MTL4FX::TemporalDenoisedScaler* newTemporalDenoisedScaler( const MTL::Device* device, const MTL4::Compiler* compiler) const; + + static float supportedInputContentMinScale(MTL::Device* device); + static float supportedInputContentMaxScale(MTL::Device* device); + + static bool supportsMetal4FX( MTL::Device* device); + static bool supportsDevice( MTL::Device* device); + }; + + class TemporalDenoisedScalerBase : public NS::Referencing< TemporalDenoisedScalerBase, FrameInterpolatableScaler > + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage depthTextureUsage() const; + MTL::TextureUsage motionTextureUsage() const; + MTL::TextureUsage reactiveTextureUsage() const; + MTL::TextureUsage diffuseAlbedoTextureUsage() const; + MTL::TextureUsage specularAlbedoTextureUsage() const; + MTL::TextureUsage normalTextureUsage() const; + MTL::TextureUsage roughnessTextureUsage() const; + MTL::TextureUsage specularHitDistanceTextureUsage() const; + MTL::TextureUsage denoiseStrengthMaskTextureUsage() const; + MTL::TextureUsage transparencyOverlayTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + + MTL::Texture* colorTexture() const; + void setColorTexture( MTL::Texture* colorTexture ); + + MTL::Texture* depthTexture() const; + void setDepthTexture( MTL::Texture* depthTexture ); + + MTL::Texture* motionTexture() const; + void setMotionTexture( MTL::Texture* motionTexture ); + + MTL::Texture* diffuseAlbedoTexture() const; + void setDiffuseAlbedoTexture( MTL::Texture* diffuseAlbedoTexture ); + + MTL::Texture* specularAlbedoTexture() const; + void setSpecularAlbedoTexture( MTL::Texture* specularAlbedoTexture ); + + MTL::Texture* normalTexture() const; + void setNormalTexture( MTL::Texture* normalTexture ); + + MTL::Texture* roughnessTexture() const; + void setRoughnessTexture( MTL::Texture* roughnessTexture ); + + MTL::Texture* specularHitDistanceTexture() const; + void setSpecularHitDistanceTexture( MTL::Texture* specularHitDistanceTexture ); + + MTL::Texture* denoiseStrengthMaskTexture() const; + void setDenoiseStrengthMaskTexture( MTL::Texture* denoiseStrengthMaskTexture ); + + MTL::Texture* transparencyOverlayTexture() const; + void setTransparencyOverlayTexture( MTL::Texture* transparencyOverlayTexture ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* outputTexture ); + + MTL::Texture* exposureTexture() const; + void setExposureTexture( MTL::Texture* exposureTexture ); + + float preExposure() const; + void setPreExposure( float preExposure ); + + MTL::Texture* reactiveMaskTexture() const; + void setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ); + + float jitterOffsetX() const; + void setJitterOffsetX( float jitterOffsetX ); + + float jitterOffsetY() const; + void setJitterOffsetY( float jitterOffsetY ); + + float motionVectorScaleX() const; + void setMotionVectorScaleX( float motionVectorScaleX ); + + float motionVectorScaleY() const; + void setMotionVectorScaleY( float motionVectorScaleY ); + + bool shouldResetHistory() const; + void setShouldResetHistory( bool shouldResetHistory ); + + bool isDepthReversed() const; + void setDepthReversed( bool depthReversed ); + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat depthTextureFormat() const; + MTL::PixelFormat motionTextureFormat() const; + MTL::PixelFormat diffuseAlbedoTextureFormat() const; + MTL::PixelFormat specularAlbedoTextureFormat() const; + MTL::PixelFormat normalTextureFormat() const; + MTL::PixelFormat roughnessTextureFormat() const; + MTL::PixelFormat specularHitDistanceTextureFormat() const; + MTL::PixelFormat denoiseStrengthMaskTextureFormat() const; + MTL::PixelFormat transparencyOverlayTextureFormat() const; + MTL::PixelFormat reactiveMaskTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + float inputContentMinScale() const; + float inputContentMaxScale() const; + + simd::float4x4 worldToViewMatrix() const; + void setWorldToViewMatrix( simd::float4x4 worldToViewMatrix ); + + simd::float4x4 viewToClipMatrix() const; + void setViewToClipMatrix( simd::float4x4 viewToClipMatrix ); + + MTL::Fence* fence() const; + void setFence( MTL::Fence* fence ); + }; + + class TemporalDenoisedScaler : public NS::Referencing< TemporalDenoisedScaler, TemporalDenoisedScalerBase > + { + public: + + void encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalDenoisedScalerDescriptor* MTLFX::TemporalDenoisedScalerDescriptor::alloc() +{ + return NS::Object::alloc< TemporalDenoisedScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalDenoisedScalerDescriptor* MTLFX::TemporalDenoisedScalerDescriptor::init() +{ + return NS::Object::init< TemporalDenoisedScalerDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setColorTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDepthTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setMotionTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::diffuseAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDiffuseAlbedoTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDiffuseAlbedoTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::specularAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setSpecularAlbedoTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularAlbedoTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::normalTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( normalTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setNormalTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNormalTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::roughnessTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( roughnessTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setRoughnessTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRoughnessTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::specularHitDistanceTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setSpecularHitDistanceTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularHitDistanceTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::denoiseStrengthMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDenoiseStrengthMaskTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDenoiseStrengthMaskTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::transparencyOverlayTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setTransparencyOverlayTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setTransparencyOverlayTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputWidth( NS::UInteger inputWidth ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), inputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputHeight( NS::UInteger inputHeight ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), inputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setOutputWidth( NS::UInteger outputWidth ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), outputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setOutputHeight( NS::UInteger outputHeight ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), outputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::requiresSynchronousInitialization() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( requiresSynchronousInitialization ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setRequiresSynchronousInitialization( bool requiresSynchronousInitialization ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRequiresSynchronousInitialization_ ), requiresSynchronousInitialization ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isAutoExposureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isAutoExposureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setAutoExposureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAutoExposureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isInputContentPropertiesEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isInputContentPropertiesEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputContentPropertiesEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentPropertiesEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::inputContentMinScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputContentMinScale( float inputContentMinScale ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMinScale_ ), inputContentMinScale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::inputContentMaxScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputContentMaxScale( float inputContentMaxScale ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMaxScale_ ), inputContentMaxScale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isReactiveMaskTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isReactiveMaskTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setReactiveMaskTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::reactiveMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isSpecularHitDistanceTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isSpecularHitDistanceTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setSpecularHitDistanceTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularHitDistanceTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isDenoiseStrengthMaskTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDenoiseStrengthMaskTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDenoiseStrengthMaskTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDenoiseStrengthMaskTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isTransparencyOverlayTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isTransparencyOverlayTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setTransparencyOverlayTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setTransparencyOverlayTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalDenoisedScaler* MTLFX::TemporalDenoisedScalerDescriptor::newTemporalDenoisedScaler( const MTL::Device* device ) const +{ + return NS::Object::sendMessage< TemporalDenoisedScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalDenoisedScalerWithDevice_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::TemporalDenoisedScaler* MTLFX::TemporalDenoisedScalerDescriptor::newTemporalDenoisedScaler( const MTL::Device* device, const MTL4::Compiler* compiler ) const +{ + return NS::Object::sendMessage< MTL4FX::TemporalDenoisedScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalDenoisedScalerWithDevice_compiler_ ), device, compiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::supportedInputContentMinScale( MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ), pDevice ); + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::supportedInputContentMaxScale( MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ), pDevice ); + } + else if ( supportsDevice( pDevice ) ) + { + scale = 2.0f; + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::supportsMetal4FX( MTL::Device* device ) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXTemporalDenoisedScalerDescriptor), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::supportsDevice( MTL::Device* device ) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXTemporalDenoisedScalerDescriptor), _MTLFX_PRIVATE_SEL( supportsDevice_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::colorTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::depthTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::motionTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::reactiveTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( reactiveTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::diffuseAlbedoTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::specularAlbedoTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::normalTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( normalTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::roughnessTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( roughnessTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::specularHitDistanceTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::denoiseStrengthMaskTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::transparencyOverlayTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::outputTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::colorTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setColorTexture( MTL::Texture* colorTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), colorTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::depthTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDepthTexture( MTL::Texture* depthTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), depthTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::motionTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setMotionTexture( MTL::Texture* motionTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), motionTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::diffuseAlbedoTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDiffuseAlbedoTexture( MTL::Texture* diffuseAlbedoTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDiffuseAlbedoTexture_ ), diffuseAlbedoTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::specularAlbedoTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setSpecularAlbedoTexture( MTL::Texture* specularAlbedoTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularAlbedoTexture_ ), specularAlbedoTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::normalTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( normalTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setNormalTexture( MTL::Texture* normalTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNormalTexture_ ), normalTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::roughnessTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( roughnessTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setRoughnessTexture( MTL::Texture* roughnessTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRoughnessTexture_ ), roughnessTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::specularHitDistanceTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setSpecularHitDistanceTexture( MTL::Texture* specularHitDistanceTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularHitDistanceTexture_ ), specularHitDistanceTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::denoiseStrengthMaskTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDenoiseStrengthMaskTexture( MTL::Texture* denoiseStrengthMaskTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDenoiseStrengthMaskTexture_ ), denoiseStrengthMaskTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::transparencyOverlayTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setTransparencyOverlayTexture( MTL::Texture* transparencyOverlayTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setTransparencyOverlayTexture_ ), transparencyOverlayTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::outputTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setOutputTexture( MTL::Texture* outputTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), outputTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::exposureTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( exposureTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setExposureTexture( MTL::Texture* exposureTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setExposureTexture_ ), exposureTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::preExposure() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( preExposure ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setPreExposure( float preExposure ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPreExposure_ ), preExposure ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::reactiveMaskTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTexture_ ), reactiveMaskTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::jitterOffsetX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setJitterOffsetX( float jitterOffsetX ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), jitterOffsetX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::jitterOffsetY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setJitterOffsetY( float jitterOffsetY ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), jitterOffsetY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::motionVectorScaleX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setMotionVectorScaleX( float motionVectorScaleX ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), motionVectorScaleX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::motionVectorScaleY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setMotionVectorScaleY( float motionVectorScaleY ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), motionVectorScaleY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerBase::shouldResetHistory() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( shouldResetHistory ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setShouldResetHistory( bool shouldResetHistory ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setShouldResetHistory_ ), shouldResetHistory ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerBase::isDepthReversed() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDepthReversed( bool depthReversed ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::diffuseAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::specularAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::normalTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( normalTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::roughnessTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( roughnessTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::specularHitDistanceTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::denoiseStrengthMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::transparencyOverlayTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::reactiveMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::inputContentMinScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::inputContentMaxScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE simd::float4x4 MTLFX::TemporalDenoisedScalerBase::worldToViewMatrix() const +{ + return NS::Object::sendMessage< simd::float4x4 >( this, _MTLFX_PRIVATE_SEL( worldToViewMatrix ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setWorldToViewMatrix( simd::float4x4 worldToViewMatrix ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setWorldToViewMatrix_ ), worldToViewMatrix ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE simd::float4x4 MTLFX::TemporalDenoisedScalerBase::viewToClipMatrix() const +{ + return NS::Object::sendMessage< simd::float4x4 >( this, _MTLFX_PRIVATE_SEL( viewToClipMatrix ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setViewToClipMatrix( simd::float4x4 viewToClipMatrix ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setViewToClipMatrix_ ), viewToClipMatrix ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::TemporalDenoisedScalerBase::fence() const +{ + return NS::Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setFence( MTL::Fence* fence ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), fence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScaler::encodeToCommandBuffer( MTL::CommandBuffer* commandBuffer ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MTLFXTemporalScaler.hpp b/vendor/metal-cpp/MTLFXTemporalScaler.hpp new file mode 100644 index 000000000..c13d4242a --- /dev/null +++ b/vendor/metal-cpp/MTLFXTemporalScaler.hpp @@ -0,0 +1,803 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXTemporalScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalScaler; +} + +namespace MTLFX +{ + class TemporalScalerDescriptor : public NS::Copying< TemporalScalerDescriptor > + { + public: + static class TemporalScalerDescriptor* alloc(); + class TemporalScalerDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat depthTextureFormat() const; + void setDepthTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat motionTextureFormat() const; + void setMotionTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat( MTL::PixelFormat format ); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger width ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger height ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger width ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger height ); + + bool isAutoExposureEnabled() const; + void setAutoExposureEnabled( bool enabled ); + + bool isInputContentPropertiesEnabled() const; + void setInputContentPropertiesEnabled( bool enabled ); + + bool requiresSynchronousInitialization() const; + void setRequiresSynchronousInitialization(bool requiresSynchronousInitialization); + + bool isReactiveMaskTextureEnabled() const; + void setReactiveMaskTextureEnabled( bool enabled ); + + MTL::PixelFormat reactiveMaskTextureFormat() const; + void setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ); + + float inputContentMinScale() const; + void setInputContentMinScale( float scale ); + + float inputContentMaxScale() const; + void setInputContentMaxScale( float scale ); + + class TemporalScaler* newTemporalScaler( const MTL::Device* pDevice ) const; + MTL4FX::TemporalScaler* newTemporalScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler) const; + + static float supportedInputContentMinScale( const MTL::Device* pDevice ); + static float supportedInputContentMaxScale( const MTL::Device* pDevice ); + + static bool supportsDevice( const MTL::Device* pDevice ); + static bool supportsMetal4FX( const MTL::Device* pDevice ); + }; + + class FrameInterpolatableScaler : public NS::Copying< FrameInterpolatableScaler > + { + }; + + class TemporalScalerBase : public NS::Referencing< TemporalScaler, FrameInterpolatableScaler > + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage depthTextureUsage() const; + MTL::TextureUsage motionTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + + NS::UInteger inputContentWidth() const; + void setInputContentWidth( NS::UInteger width ); + + NS::UInteger inputContentHeight() const; + void setInputContentHeight( NS::UInteger height ); + + MTL::Texture* colorTexture() const; + void setColorTexture( MTL::Texture* pTexture ); + + MTL::Texture* depthTexture() const; + void setDepthTexture( MTL::Texture* pTexture ); + + MTL::Texture* motionTexture() const; + void setMotionTexture( MTL::Texture* pTexture ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* pTexture ); + + MTL::Texture* exposureTexture() const; + void setExposureTexture( MTL::Texture* pTexture ); + + float preExposure() const; + void setPreExposure( float preExposure ); + + float jitterOffsetX() const; + void setJitterOffsetX( float offset ); + + float jitterOffsetY() const; + void setJitterOffsetY( float offset ); + + float motionVectorScaleX() const; + void setMotionVectorScaleX( float scale ); + + float motionVectorScaleY() const; + void setMotionVectorScaleY( float scale ); + + MTL::Texture* reactiveMaskTexture() const; + void setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ); + + MTL::TextureUsage reactiveTextureUsage() const; + + bool reset() const; + void setReset( bool reset ); + + bool isDepthReversed() const; + void setDepthReversed( bool depthReversed ); + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat depthTextureFormat() const; + MTL::PixelFormat motionTextureFormat() const; + MTL::PixelFormat reactiveTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + float inputContentMinScale() const; + float inputContentMaxScale() const; + + MTL::Fence* fence() const; + void setFence( MTL::Fence* pFence ); + }; + + class TemporalScaler : public NS::Referencing< TemporalScaler, TemporalScalerBase > + { + public: + void encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalScalerDescriptor* MTLFX::TemporalScalerDescriptor::alloc() +{ + return NS::Object::alloc< TemporalScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalScalerDescriptor* MTLFX::TemporalScalerDescriptor::init() +{ + return NS::Object::init< TemporalScalerDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setColorTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::depthTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setDepthTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::motionTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setMotionTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isAutoExposureEnabled() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isAutoExposureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setAutoExposureEnabled( bool enabled ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAutoExposureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isInputContentPropertiesEnabled() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isInputContentPropertiesEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentPropertiesEnabled( bool enabled ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentPropertiesEnabled_ ), enabled ); +} + + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::requiresSynchronousInitialization() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( requiresSynchronousInitialization ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setRequiresSynchronousInitialization(bool requiresSynchronousInitialization) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRequiresSynchronousInitialization_ ), requiresSynchronousInitialization ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isReactiveMaskTextureEnabled() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isReactiveMaskTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setReactiveMaskTextureEnabled( bool enabled ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::reactiveMaskTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::inputContentMinScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentMinScale( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMinScale_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::inputContentMaxScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentMaxScale( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMaxScale_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalScaler* MTLFX::TemporalScalerDescriptor::newTemporalScaler( const MTL::Device* pDevice ) const +{ + return Object::sendMessage< TemporalScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalScalerWithDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::TemporalScaler* MTLFX::TemporalScalerDescriptor::newTemporalScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const +{ + return Object::sendMessage< MTL4FX::TemporalScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalScalerWithDevice_compiler_ ), pDevice, pCompiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::supportedInputContentMinScale( const MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ), pDevice ); + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::supportedInputContentMaxScale( const MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ), pDevice ); + } + else if ( supportsDevice( pDevice ) ) + { + scale = 2.0f; + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::supportsDevice( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::supportsMetal4FX( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::colorTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::depthTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::motionTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::outputTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputContentWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setInputContentWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputContentHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setInputContentHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::colorTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setColorTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::depthTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::motionTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::outputTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setOutputTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::exposureTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( exposureTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setExposureTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setExposureTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::preExposure() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( preExposure ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setPreExposure( float preExposure ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPreExposure_ ), preExposure ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::jitterOffsetX() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setJitterOffsetX( float offset ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), offset ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::jitterOffsetY() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setJitterOffsetY( float offset ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), offset ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::motionVectorScaleX() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionVectorScaleX( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::motionVectorScaleY() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionVectorScaleY( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::reactiveMaskTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTexture_ ), reactiveMaskTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::reactiveTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( reactiveTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerBase::reset() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( reset ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReset( bool reset ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReset_ ), reset ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerBase::isDepthReversed() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthReversed( bool depthReversed ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::depthTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::motionTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::inputContentMinScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::inputContentMaxScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::TemporalScalerBase::fence() const +{ + return Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setFence( MTL::Fence* pFence ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), pFence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScaler::encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MakeSingleHeader.py b/vendor/metal-cpp/MakeSingleHeader.py new file mode 100755 index 000000000..c8d3715fe --- /dev/null +++ b/vendor/metal-cpp/MakeSingleHeader.py @@ -0,0 +1,271 @@ +#!/usr/bin/env python3 + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- +# +# SingleHeader/MakeSingleHeader.py +# +# Copyright 2020-2024 Apple Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +import argparse +import datetime +import logging +import os +import re +import subprocess +import sys + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +class HeaderPrefix( object ): + __template = ( '//\n' + '// {file}\n' + '//\n' + '// {meta_data}\n' + '//\n' + '// Copyright 2020-2024 Apple Inc.\n' + '//\n' + '// Licensed under the Apache License, Version 2.0 (the "License");\n' + '// you may not use this file except in compliance with the License.\n' + '// You may obtain a copy of the License at\n' + '//\n' + '// http://www.apache.org/licenses/LICENSE-2.0\n' + '//\n' + '// Unless required by applicable law or agreed to in writing, software\n' + '// distributed under the License is distributed on an "AS IS" BASIS,\n' + '// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' + '// See the License for the specific language governing permissions and\n' + '// limitations under the License.\n' + '//\n' + '\n' ) + + __template_commit = 'Autogenerated from commit {commit}.' + __template_date = 'Autogenerated on %B %d, %Y.' + + def __init__( self, file ): + self.__file = file + + def __str__( self ): + return self.__template.format( file = self.__file, meta_data = self.__meta_data_string() ) + + def __get_commit_hash( self ): + git_commit_hash = None + + try: + git_dir = os.path.dirname( os.path.realpath( __file__ ) ) + proc = subprocess.Popen( [ 'git', 'rev-parse', 'HEAD' ], cwd = git_dir, stdout = subprocess.PIPE, stderr = subprocess.PIPE ) + git_commit_hash = proc.stdout.read().decode( 'utf-8', 'replace' ).strip() + except: + logging.error( 'Failed to determine git commit hash!' ) + pass + + return git_commit_hash + + def __get_commit_string( self ): + meta_data = None + git_commit_hash = self.__get_commit_hash() + + if git_commit_hash: + meta_data = self.__template_commit.format( commit = git_commit_hash ) + + return meta_data + + def __get_date_string( self ): + today = datetime.date.today() + + return today.strftime( self.__template_date ) + + def __meta_data_string( self ): + meta_data = self.__get_commit_string() + + if not meta_data: + meta_data = self.__get_date_string() + + return meta_data + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +class SingleHeader( object ): + __pragma_once = '#pragma once\n\n' + + def __init__( self ): + self.__header_paths = list() + + def __str__( self ): + return self.process() + + def append( self, header_path ): + self.__header_paths.append( header_path ) + + def process( self ): + out_header = self.__pragma_once + + self.__included_headers = set() + self.__base_path = list() + + for header_path in self.__header_paths: + out_header += self.__process_header( header_path ) + + return self.__strip_empty_lines( out_header ) + + def __read_header( self, path ): + path = os.path.realpath( path ) + + try: + f = open( path, 'r' ) + except: + raise RuntimeError( 'Failed to open file \"' + path + '\" for read!' ) + + return f.read() + + def __strip_pragma_once( self, header ): + return re.sub( '\\s*#pragma once\s*\\/\\/-*\\n', '', header ) + + def __strip_comments( self, header ): + return re.sub( '^//.*\\n', '', header, flags = re.MULTILINE ) + + def __strip_empty_lines( self, header ): + return re.sub( '\\n\\n+', '\\n\\n', header, flags = re.MULTILINE ) + + def __substitute_include_directive( self, match ): + header_path = match.group( 'HEADER_PATH' ) + + logging.info( '\tSubstituting \"' + header_path + '\"...' ) + + return self.__process_header( os.path.join( self.__base_path[-1], header_path ) ) + + def __process_include_directives( self, header ): + return re.sub( '^\\s*#include\\s\\"(?P\\S*)\\"', self.__substitute_include_directive, header, flags = re.MULTILINE ) + + def __process_foundation_directives( self, header ): + if header.find("#include ") != -1: + logging.info( '\tSubstituting ...' ) + return header.replace("#include ", self.__process_header( os.path.join( self.__base_path[-1], "../Foundation/Foundation.hpp" ) ) ) + return header + + + def __process_header( self, header_path ): + out_header = '' + + header_path = os.path.realpath( header_path ) + + if not header_path in self.__included_headers: + logging.info( 'Processing \"' + header_path + '\"...' ) + + self.__base_path.append( os.path.dirname( header_path ) ) + self.__included_headers.add( header_path ) + + out_header = self.__read_header( header_path ) + out_header = self.__strip_pragma_once( out_header ) + out_header = self.__strip_comments( out_header ) + out_header = self.__process_include_directives( out_header ) + out_header = self.__process_foundation_directives( out_header ) + + self.__base_path.pop() + else: + logging.info( '\tSkipping \"' + header_path + '\"...' ) + + return out_header + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +def create_argument_parser(): + parser = argparse.ArgumentParser() + base_path = os.path.dirname( os.path.realpath( __file__ ) ) + output_path = os.path.join( base_path, 'Metal.hpp' ) + + parser.add_argument( '-o', '--output', dest = 'output_path', metavar = 'PATH', default = output_path, help = 'Output path for the single header file.' ) + parser.add_argument( '-v', '--verbose', action = 'store_true', help = 'Show verbose output.' ) + parser.add_argument( dest = 'header_paths', metavar = 'HEADER_FILE', nargs='+', help = 'Input header file.' ) + + return parser + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +def parse_arguments(): + parser = create_argument_parser() + args = parser.parse_args() + + if args.verbose: + logging.getLogger().setLevel( logging.INFO ) + else: + logging.getLogger().setLevel( logging.ERROR ) + + return args + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +def make_header( args ): + prefix = HeaderPrefix( os.path.basename( args.output_path ) ) + header = SingleHeader() + + for header_path in args.header_paths: + header.append( header_path ) + + return str( prefix ) + str( header ) + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +def make_dir( path ): + try: + if not os.path.exists( path ): + os.makedirs( path ) + except os.error: + pass + except: + raise + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +def write_header( args, content ): + path = os.path.realpath( args.output_path ) + + logging.info( 'Writing \"' + path + '\"...' ) + + make_dir( os.path.dirname( path ) ) + + try: + f = open( path, 'w' ) + except: + raise RuntimeError( 'Failed to open file \"' + path + '\" for write!' ) + + f.write( content ) + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +if __name__ == '__main__': + result = -1 + + try: + if sys.getdefaultencoding().lower() == 'ascii': + reload( sys ) + sys.setdefaultencoding( 'utf-8' ) + + args = parse_arguments() + header = make_header( args ) + + write_header( args, header ) + + result = 0 + + except ( KeyboardInterrupt, SystemExit ): + pass + except: + raise + + sys.exit( result ) + +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/Metal/MTL4AccelerationStructure.hpp b/vendor/metal-cpp/Metal/MTL4AccelerationStructure.hpp new file mode 100644 index 000000000..11540150f --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4AccelerationStructure.hpp @@ -0,0 +1,1395 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4AccelerationStructure.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLAccelerationStructure.hpp" +#include "MTLAccelerationStructureTypes.hpp" +#include "MTLArgument.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLStageInputOutputDescriptor.hpp" + +namespace MTL4 +{ +class AccelerationStructureBoundingBoxGeometryDescriptor; +class AccelerationStructureCurveGeometryDescriptor; +class AccelerationStructureDescriptor; +class AccelerationStructureGeometryDescriptor; +class AccelerationStructureMotionBoundingBoxGeometryDescriptor; +class AccelerationStructureMotionCurveGeometryDescriptor; +class AccelerationStructureMotionTriangleGeometryDescriptor; +class AccelerationStructureTriangleGeometryDescriptor; +class IndirectInstanceAccelerationStructureDescriptor; +class InstanceAccelerationStructureDescriptor; +class PrimitiveAccelerationStructureDescriptor; + +class AccelerationStructureDescriptor : public NS::Copying +{ +public: + static AccelerationStructureDescriptor* alloc(); + + AccelerationStructureDescriptor* init(); +}; +class AccelerationStructureGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureGeometryDescriptor* alloc(); + + bool allowDuplicateIntersectionFunctionInvocation() const; + + AccelerationStructureGeometryDescriptor* init(); + + NS::UInteger intersectionFunctionTableOffset() const; + + NS::String* label() const; + + bool opaque() const; + + BufferRange primitiveDataBuffer() const; + + NS::UInteger primitiveDataElementSize() const; + + NS::UInteger primitiveDataStride() const; + + void setAllowDuplicateIntersectionFunctionInvocation(bool allowDuplicateIntersectionFunctionInvocation); + + void setIntersectionFunctionTableOffset(NS::UInteger intersectionFunctionTableOffset); + + void setLabel(const NS::String* label); + + void setOpaque(bool opaque); + + void setPrimitiveDataBuffer(const MTL4::BufferRange primitiveDataBuffer); + + void setPrimitiveDataElementSize(NS::UInteger primitiveDataElementSize); + + void setPrimitiveDataStride(NS::UInteger primitiveDataStride); +}; +class PrimitiveAccelerationStructureDescriptor : public NS::Copying +{ +public: + static PrimitiveAccelerationStructureDescriptor* alloc(); + + NS::Array* geometryDescriptors() const; + + PrimitiveAccelerationStructureDescriptor* init(); + + MTL::MotionBorderMode motionEndBorderMode() const; + + float motionEndTime() const; + + NS::UInteger motionKeyframeCount() const; + + MTL::MotionBorderMode motionStartBorderMode() const; + + float motionStartTime() const; + + void setGeometryDescriptors(const NS::Array* geometryDescriptors); + + void setMotionEndBorderMode(MTL::MotionBorderMode motionEndBorderMode); + + void setMotionEndTime(float motionEndTime); + + void setMotionKeyframeCount(NS::UInteger motionKeyframeCount); + + void setMotionStartBorderMode(MTL::MotionBorderMode motionStartBorderMode); + + void setMotionStartTime(float motionStartTime); +}; +class AccelerationStructureTriangleGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureTriangleGeometryDescriptor* alloc(); + + BufferRange indexBuffer() const; + + MTL::IndexType indexType() const; + + AccelerationStructureTriangleGeometryDescriptor* init(); + + void setIndexBuffer(const MTL4::BufferRange indexBuffer); + + void setIndexType(MTL::IndexType indexType); + + void setTransformationMatrixBuffer(const MTL4::BufferRange transformationMatrixBuffer); + + void setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout); + + void setTriangleCount(NS::UInteger triangleCount); + + void setVertexBuffer(const MTL4::BufferRange vertexBuffer); + + void setVertexFormat(MTL::AttributeFormat vertexFormat); + + void setVertexStride(NS::UInteger vertexStride); + + BufferRange transformationMatrixBuffer() const; + + MTL::MatrixLayout transformationMatrixLayout() const; + + NS::UInteger triangleCount() const; + + BufferRange vertexBuffer() const; + + MTL::AttributeFormat vertexFormat() const; + + NS::UInteger vertexStride() const; +}; +class AccelerationStructureBoundingBoxGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureBoundingBoxGeometryDescriptor* alloc(); + + BufferRange boundingBoxBuffer() const; + + NS::UInteger boundingBoxCount() const; + + NS::UInteger boundingBoxStride() const; + + AccelerationStructureBoundingBoxGeometryDescriptor* init(); + + void setBoundingBoxBuffer(const MTL4::BufferRange boundingBoxBuffer); + + void setBoundingBoxCount(NS::UInteger boundingBoxCount); + + void setBoundingBoxStride(NS::UInteger boundingBoxStride); +}; +class AccelerationStructureMotionTriangleGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureMotionTriangleGeometryDescriptor* alloc(); + + BufferRange indexBuffer() const; + + MTL::IndexType indexType() const; + + AccelerationStructureMotionTriangleGeometryDescriptor* init(); + + void setIndexBuffer(const MTL4::BufferRange indexBuffer); + + void setIndexType(MTL::IndexType indexType); + + void setTransformationMatrixBuffer(const MTL4::BufferRange transformationMatrixBuffer); + + void setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout); + + void setTriangleCount(NS::UInteger triangleCount); + + void setVertexBuffers(const MTL4::BufferRange vertexBuffers); + + void setVertexFormat(MTL::AttributeFormat vertexFormat); + + void setVertexStride(NS::UInteger vertexStride); + + BufferRange transformationMatrixBuffer() const; + + MTL::MatrixLayout transformationMatrixLayout() const; + + NS::UInteger triangleCount() const; + + BufferRange vertexBuffers() const; + + MTL::AttributeFormat vertexFormat() const; + + NS::UInteger vertexStride() const; +}; +class AccelerationStructureMotionBoundingBoxGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureMotionBoundingBoxGeometryDescriptor* alloc(); + + BufferRange boundingBoxBuffers() const; + + NS::UInteger boundingBoxCount() const; + + NS::UInteger boundingBoxStride() const; + + AccelerationStructureMotionBoundingBoxGeometryDescriptor* init(); + + void setBoundingBoxBuffers(const MTL4::BufferRange boundingBoxBuffers); + + void setBoundingBoxCount(NS::UInteger boundingBoxCount); + + void setBoundingBoxStride(NS::UInteger boundingBoxStride); +}; +class AccelerationStructureCurveGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureCurveGeometryDescriptor* alloc(); + + BufferRange controlPointBuffer() const; + + NS::UInteger controlPointCount() const; + + MTL::AttributeFormat controlPointFormat() const; + + NS::UInteger controlPointStride() const; + + MTL::CurveBasis curveBasis() const; + + MTL::CurveEndCaps curveEndCaps() const; + + MTL::CurveType curveType() const; + + BufferRange indexBuffer() const; + + MTL::IndexType indexType() const; + + AccelerationStructureCurveGeometryDescriptor* init(); + + BufferRange radiusBuffer() const; + + MTL::AttributeFormat radiusFormat() const; + + NS::UInteger radiusStride() const; + + NS::UInteger segmentControlPointCount() const; + + NS::UInteger segmentCount() const; + + void setControlPointBuffer(const MTL4::BufferRange controlPointBuffer); + + void setControlPointCount(NS::UInteger controlPointCount); + + void setControlPointFormat(MTL::AttributeFormat controlPointFormat); + + void setControlPointStride(NS::UInteger controlPointStride); + + void setCurveBasis(MTL::CurveBasis curveBasis); + + void setCurveEndCaps(MTL::CurveEndCaps curveEndCaps); + + void setCurveType(MTL::CurveType curveType); + + void setIndexBuffer(const MTL4::BufferRange indexBuffer); + + void setIndexType(MTL::IndexType indexType); + + void setRadiusBuffer(const MTL4::BufferRange radiusBuffer); + + void setRadiusFormat(MTL::AttributeFormat radiusFormat); + + void setRadiusStride(NS::UInteger radiusStride); + + void setSegmentControlPointCount(NS::UInteger segmentControlPointCount); + + void setSegmentCount(NS::UInteger segmentCount); +}; +class AccelerationStructureMotionCurveGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureMotionCurveGeometryDescriptor* alloc(); + + BufferRange controlPointBuffers() const; + + NS::UInteger controlPointCount() const; + + MTL::AttributeFormat controlPointFormat() const; + + NS::UInteger controlPointStride() const; + + MTL::CurveBasis curveBasis() const; + + MTL::CurveEndCaps curveEndCaps() const; + + MTL::CurveType curveType() const; + + BufferRange indexBuffer() const; + + MTL::IndexType indexType() const; + + AccelerationStructureMotionCurveGeometryDescriptor* init(); + + BufferRange radiusBuffers() const; + + MTL::AttributeFormat radiusFormat() const; + + NS::UInteger radiusStride() const; + + NS::UInteger segmentControlPointCount() const; + + NS::UInteger segmentCount() const; + + void setControlPointBuffers(const MTL4::BufferRange controlPointBuffers); + + void setControlPointCount(NS::UInteger controlPointCount); + + void setControlPointFormat(MTL::AttributeFormat controlPointFormat); + + void setControlPointStride(NS::UInteger controlPointStride); + + void setCurveBasis(MTL::CurveBasis curveBasis); + + void setCurveEndCaps(MTL::CurveEndCaps curveEndCaps); + + void setCurveType(MTL::CurveType curveType); + + void setIndexBuffer(const MTL4::BufferRange indexBuffer); + + void setIndexType(MTL::IndexType indexType); + + void setRadiusBuffers(const MTL4::BufferRange radiusBuffers); + + void setRadiusFormat(MTL::AttributeFormat radiusFormat); + + void setRadiusStride(NS::UInteger radiusStride); + + void setSegmentControlPointCount(NS::UInteger segmentControlPointCount); + + void setSegmentCount(NS::UInteger segmentCount); +}; +class InstanceAccelerationStructureDescriptor : public NS::Copying +{ +public: + static InstanceAccelerationStructureDescriptor* alloc(); + + InstanceAccelerationStructureDescriptor* init(); + + NS::UInteger instanceCount() const; + + BufferRange instanceDescriptorBuffer() const; + + NS::UInteger instanceDescriptorStride() const; + + MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType() const; + + MTL::MatrixLayout instanceTransformationMatrixLayout() const; + + BufferRange motionTransformBuffer() const; + + NS::UInteger motionTransformCount() const; + + NS::UInteger motionTransformStride() const; + + MTL::TransformType motionTransformType() const; + + void setInstanceCount(NS::UInteger instanceCount); + + void setInstanceDescriptorBuffer(const MTL4::BufferRange instanceDescriptorBuffer); + + void setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride); + + void setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType); + + void setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout); + + void setMotionTransformBuffer(const MTL4::BufferRange motionTransformBuffer); + + void setMotionTransformCount(NS::UInteger motionTransformCount); + + void setMotionTransformStride(NS::UInteger motionTransformStride); + + void setMotionTransformType(MTL::TransformType motionTransformType); +}; +class IndirectInstanceAccelerationStructureDescriptor : public NS::Copying +{ +public: + static IndirectInstanceAccelerationStructureDescriptor* alloc(); + + IndirectInstanceAccelerationStructureDescriptor* init(); + + BufferRange instanceCountBuffer() const; + + BufferRange instanceDescriptorBuffer() const; + + NS::UInteger instanceDescriptorStride() const; + + MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType() const; + + MTL::MatrixLayout instanceTransformationMatrixLayout() const; + + NS::UInteger maxInstanceCount() const; + + NS::UInteger maxMotionTransformCount() const; + + BufferRange motionTransformBuffer() const; + + BufferRange motionTransformCountBuffer() const; + + NS::UInteger motionTransformStride() const; + + MTL::TransformType motionTransformType() const; + + void setInstanceCountBuffer(const MTL4::BufferRange instanceCountBuffer); + + void setInstanceDescriptorBuffer(const MTL4::BufferRange instanceDescriptorBuffer); + + void setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride); + + void setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType); + + void setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout); + + void setMaxInstanceCount(NS::UInteger maxInstanceCount); + + void setMaxMotionTransformCount(NS::UInteger maxMotionTransformCount); + + void setMotionTransformBuffer(const MTL4::BufferRange motionTransformBuffer); + + void setMotionTransformCountBuffer(const MTL4::BufferRange motionTransformCountBuffer); + + void setMotionTransformStride(NS::UInteger motionTransformStride); + + void setMotionTransformType(MTL::TransformType motionTransformType); +}; + +} +_MTL_INLINE MTL4::AccelerationStructureDescriptor* MTL4::AccelerationStructureDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureDescriptor)); +} + +_MTL_INLINE MTL4::AccelerationStructureDescriptor* MTL4::AccelerationStructureDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::AccelerationStructureGeometryDescriptor* MTL4::AccelerationStructureGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureGeometryDescriptor)); +} + +_MTL_INLINE bool MTL4::AccelerationStructureGeometryDescriptor::allowDuplicateIntersectionFunctionInvocation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowDuplicateIntersectionFunctionInvocation)); +} + +_MTL_INLINE MTL4::AccelerationStructureGeometryDescriptor* MTL4::AccelerationStructureGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureGeometryDescriptor::intersectionFunctionTableOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(intersectionFunctionTableOffset)); +} + +_MTL_INLINE NS::String* MTL4::AccelerationStructureGeometryDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE bool MTL4::AccelerationStructureGeometryDescriptor::opaque() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(opaque)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureGeometryDescriptor::primitiveDataBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureGeometryDescriptor::primitiveDataElementSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataElementSize)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureGeometryDescriptor::primitiveDataStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataStride)); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setAllowDuplicateIntersectionFunctionInvocation(bool allowDuplicateIntersectionFunctionInvocation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAllowDuplicateIntersectionFunctionInvocation_), allowDuplicateIntersectionFunctionInvocation); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setIntersectionFunctionTableOffset(NS::UInteger intersectionFunctionTableOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTableOffset_), intersectionFunctionTableOffset); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setOpaque(bool opaque) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaque_), opaque); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setPrimitiveDataBuffer(const MTL4::BufferRange primitiveDataBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataBuffer_), primitiveDataBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setPrimitiveDataElementSize(NS::UInteger primitiveDataElementSize) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataElementSize_), primitiveDataElementSize); +} + +_MTL_INLINE void MTL4::AccelerationStructureGeometryDescriptor::setPrimitiveDataStride(NS::UInteger primitiveDataStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataStride_), primitiveDataStride); +} + +_MTL_INLINE MTL4::PrimitiveAccelerationStructureDescriptor* MTL4::PrimitiveAccelerationStructureDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4PrimitiveAccelerationStructureDescriptor)); +} + +_MTL_INLINE NS::Array* MTL4::PrimitiveAccelerationStructureDescriptor::geometryDescriptors() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(geometryDescriptors)); +} + +_MTL_INLINE MTL4::PrimitiveAccelerationStructureDescriptor* MTL4::PrimitiveAccelerationStructureDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::MotionBorderMode MTL4::PrimitiveAccelerationStructureDescriptor::motionEndBorderMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionEndBorderMode)); +} + +_MTL_INLINE float MTL4::PrimitiveAccelerationStructureDescriptor::motionEndTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionEndTime)); +} + +_MTL_INLINE NS::UInteger MTL4::PrimitiveAccelerationStructureDescriptor::motionKeyframeCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionKeyframeCount)); +} + +_MTL_INLINE MTL::MotionBorderMode MTL4::PrimitiveAccelerationStructureDescriptor::motionStartBorderMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionStartBorderMode)); +} + +_MTL_INLINE float MTL4::PrimitiveAccelerationStructureDescriptor::motionStartTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionStartTime)); +} + +_MTL_INLINE void MTL4::PrimitiveAccelerationStructureDescriptor::setGeometryDescriptors(const NS::Array* geometryDescriptors) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setGeometryDescriptors_), geometryDescriptors); +} + +_MTL_INLINE void MTL4::PrimitiveAccelerationStructureDescriptor::setMotionEndBorderMode(MTL::MotionBorderMode motionEndBorderMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionEndBorderMode_), motionEndBorderMode); +} + +_MTL_INLINE void MTL4::PrimitiveAccelerationStructureDescriptor::setMotionEndTime(float motionEndTime) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionEndTime_), motionEndTime); +} + +_MTL_INLINE void MTL4::PrimitiveAccelerationStructureDescriptor::setMotionKeyframeCount(NS::UInteger motionKeyframeCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionKeyframeCount_), motionKeyframeCount); +} + +_MTL_INLINE void MTL4::PrimitiveAccelerationStructureDescriptor::setMotionStartBorderMode(MTL::MotionBorderMode motionStartBorderMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionStartBorderMode_), motionStartBorderMode); +} + +_MTL_INLINE void MTL4::PrimitiveAccelerationStructureDescriptor::setMotionStartTime(float motionStartTime) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionStartTime_), motionStartTime); +} + +_MTL_INLINE MTL4::AccelerationStructureTriangleGeometryDescriptor* MTL4::AccelerationStructureTriangleGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureTriangleGeometryDescriptor)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureTriangleGeometryDescriptor::indexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); +} + +_MTL_INLINE MTL::IndexType MTL4::AccelerationStructureTriangleGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL4::AccelerationStructureTriangleGeometryDescriptor* MTL4::AccelerationStructureTriangleGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setIndexBuffer(const MTL4::BufferRange indexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setIndexType(MTL::IndexType indexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setTransformationMatrixBuffer(const MTL4::BufferRange transformationMatrixBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixBuffer_), transformationMatrixBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixLayout_), transformationMatrixLayout); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setTriangleCount(NS::UInteger triangleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleCount_), triangleCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setVertexBuffer(const MTL4::BufferRange vertexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_), vertexBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setVertexFormat(MTL::AttributeFormat vertexFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFormat_), vertexFormat); +} + +_MTL_INLINE void MTL4::AccelerationStructureTriangleGeometryDescriptor::setVertexStride(NS::UInteger vertexStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStride_), vertexStride); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBuffer)); +} + +_MTL_INLINE MTL::MatrixLayout MTL4::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixLayout)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureTriangleGeometryDescriptor::triangleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(triangleCount)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureTriangleGeometryDescriptor::vertexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffer)); +} + +_MTL_INLINE MTL::AttributeFormat MTL4::AccelerationStructureTriangleGeometryDescriptor::vertexFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFormat)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureTriangleGeometryDescriptor::vertexStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStride)); +} + +_MTL_INLINE MTL4::AccelerationStructureBoundingBoxGeometryDescriptor* MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureBoundingBoxGeometryDescriptor)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxCount)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxStride)); +} + +_MTL_INLINE MTL4::AccelerationStructureBoundingBoxGeometryDescriptor* MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxBuffer(const MTL4::BufferRange boundingBoxBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxBuffer_), boundingBoxBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxCount(NS::UInteger boundingBoxCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxCount_), boundingBoxCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxStride(NS::UInteger boundingBoxStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxStride_), boundingBoxStride); +} + +_MTL_INLINE MTL4::AccelerationStructureMotionTriangleGeometryDescriptor* MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureMotionTriangleGeometryDescriptor)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::indexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); +} + +_MTL_INLINE MTL::IndexType MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL4::AccelerationStructureMotionTriangleGeometryDescriptor* MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setIndexBuffer(const MTL4::BufferRange indexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setIndexType(MTL::IndexType indexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setTransformationMatrixBuffer(const MTL4::BufferRange transformationMatrixBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixBuffer_), transformationMatrixBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixLayout_), transformationMatrixLayout); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setTriangleCount(NS::UInteger triangleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleCount_), triangleCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexBuffers(const MTL4::BufferRange vertexBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffers_), vertexBuffers); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexFormat(MTL::AttributeFormat vertexFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFormat_), vertexFormat); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexStride(NS::UInteger vertexStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStride_), vertexStride); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBuffer)); +} + +_MTL_INLINE MTL::MatrixLayout MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixLayout)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::triangleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(triangleCount)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::vertexBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffers)); +} + +_MTL_INLINE MTL::AttributeFormat MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::vertexFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFormat)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionTriangleGeometryDescriptor::vertexStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStride)); +} + +_MTL_INLINE MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxBuffers)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxCount)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxStride)); +} + +_MTL_INLINE MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxBuffers(const MTL4::BufferRange boundingBoxBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxBuffers_), boundingBoxBuffers); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxCount(NS::UInteger boundingBoxCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxCount_), boundingBoxCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxStride(NS::UInteger boundingBoxStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxStride_), boundingBoxStride); +} + +_MTL_INLINE MTL4::AccelerationStructureCurveGeometryDescriptor* MTL4::AccelerationStructureCurveGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureCurveGeometryDescriptor)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureCurveGeometryDescriptor::controlPointBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureCurveGeometryDescriptor::controlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointCount)); +} + +_MTL_INLINE MTL::AttributeFormat MTL4::AccelerationStructureCurveGeometryDescriptor::controlPointFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointFormat)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureCurveGeometryDescriptor::controlPointStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointStride)); +} + +_MTL_INLINE MTL::CurveBasis MTL4::AccelerationStructureCurveGeometryDescriptor::curveBasis() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveBasis)); +} + +_MTL_INLINE MTL::CurveEndCaps MTL4::AccelerationStructureCurveGeometryDescriptor::curveEndCaps() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveEndCaps)); +} + +_MTL_INLINE MTL::CurveType MTL4::AccelerationStructureCurveGeometryDescriptor::curveType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveType)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureCurveGeometryDescriptor::indexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); +} + +_MTL_INLINE MTL::IndexType MTL4::AccelerationStructureCurveGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL4::AccelerationStructureCurveGeometryDescriptor* MTL4::AccelerationStructureCurveGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureCurveGeometryDescriptor::radiusBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusBuffer)); +} + +_MTL_INLINE MTL::AttributeFormat MTL4::AccelerationStructureCurveGeometryDescriptor::radiusFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusFormat)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureCurveGeometryDescriptor::radiusStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusStride)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureCurveGeometryDescriptor::segmentControlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentControlPointCount)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureCurveGeometryDescriptor::segmentCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentCount)); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setControlPointBuffer(const MTL4::BufferRange controlPointBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointBuffer_), controlPointBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setControlPointCount(NS::UInteger controlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointCount_), controlPointCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setControlPointFormat(MTL::AttributeFormat controlPointFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointFormat_), controlPointFormat); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setControlPointStride(NS::UInteger controlPointStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointStride_), controlPointStride); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setCurveBasis(MTL::CurveBasis curveBasis) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveBasis_), curveBasis); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setCurveEndCaps(MTL::CurveEndCaps curveEndCaps) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveEndCaps_), curveEndCaps); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setCurveType(MTL::CurveType curveType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveType_), curveType); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setIndexBuffer(const MTL4::BufferRange indexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setIndexType(MTL::IndexType indexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setRadiusBuffer(const MTL4::BufferRange radiusBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusBuffer_), radiusBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setRadiusFormat(MTL::AttributeFormat radiusFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusFormat_), radiusFormat); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setRadiusStride(NS::UInteger radiusStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusStride_), radiusStride); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setSegmentControlPointCount(NS::UInteger segmentControlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentControlPointCount_), segmentControlPointCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureCurveGeometryDescriptor::setSegmentCount(NS::UInteger segmentCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentCount_), segmentCount); +} + +_MTL_INLINE MTL4::AccelerationStructureMotionCurveGeometryDescriptor* MTL4::AccelerationStructureMotionCurveGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4AccelerationStructureMotionCurveGeometryDescriptor)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionCurveGeometryDescriptor::controlPointBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointBuffers)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionCurveGeometryDescriptor::controlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointCount)); +} + +_MTL_INLINE MTL::AttributeFormat MTL4::AccelerationStructureMotionCurveGeometryDescriptor::controlPointFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointFormat)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionCurveGeometryDescriptor::controlPointStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointStride)); +} + +_MTL_INLINE MTL::CurveBasis MTL4::AccelerationStructureMotionCurveGeometryDescriptor::curveBasis() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveBasis)); +} + +_MTL_INLINE MTL::CurveEndCaps MTL4::AccelerationStructureMotionCurveGeometryDescriptor::curveEndCaps() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveEndCaps)); +} + +_MTL_INLINE MTL::CurveType MTL4::AccelerationStructureMotionCurveGeometryDescriptor::curveType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveType)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionCurveGeometryDescriptor::indexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); +} + +_MTL_INLINE MTL::IndexType MTL4::AccelerationStructureMotionCurveGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL4::AccelerationStructureMotionCurveGeometryDescriptor* MTL4::AccelerationStructureMotionCurveGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::BufferRange MTL4::AccelerationStructureMotionCurveGeometryDescriptor::radiusBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusBuffers)); +} + +_MTL_INLINE MTL::AttributeFormat MTL4::AccelerationStructureMotionCurveGeometryDescriptor::radiusFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusFormat)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionCurveGeometryDescriptor::radiusStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusStride)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionCurveGeometryDescriptor::segmentControlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentControlPointCount)); +} + +_MTL_INLINE NS::UInteger MTL4::AccelerationStructureMotionCurveGeometryDescriptor::segmentCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentCount)); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointBuffers(const MTL4::BufferRange controlPointBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointBuffers_), controlPointBuffers); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointCount(NS::UInteger controlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointCount_), controlPointCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointFormat(MTL::AttributeFormat controlPointFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointFormat_), controlPointFormat); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointStride(NS::UInteger controlPointStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointStride_), controlPointStride); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setCurveBasis(MTL::CurveBasis curveBasis) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveBasis_), curveBasis); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setCurveEndCaps(MTL::CurveEndCaps curveEndCaps) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveEndCaps_), curveEndCaps); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setCurveType(MTL::CurveType curveType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveType_), curveType); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setIndexBuffer(const MTL4::BufferRange indexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setIndexType(MTL::IndexType indexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setRadiusBuffers(const MTL4::BufferRange radiusBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusBuffers_), radiusBuffers); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setRadiusFormat(MTL::AttributeFormat radiusFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusFormat_), radiusFormat); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setRadiusStride(NS::UInteger radiusStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusStride_), radiusStride); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setSegmentControlPointCount(NS::UInteger segmentControlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentControlPointCount_), segmentControlPointCount); +} + +_MTL_INLINE void MTL4::AccelerationStructureMotionCurveGeometryDescriptor::setSegmentCount(NS::UInteger segmentCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentCount_), segmentCount); +} + +_MTL_INLINE MTL4::InstanceAccelerationStructureDescriptor* MTL4::InstanceAccelerationStructureDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4InstanceAccelerationStructureDescriptor)); +} + +_MTL_INLINE MTL4::InstanceAccelerationStructureDescriptor* MTL4::InstanceAccelerationStructureDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL4::InstanceAccelerationStructureDescriptor::instanceCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceCount)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::InstanceAccelerationStructureDescriptor::instanceDescriptorBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::InstanceAccelerationStructureDescriptor::instanceDescriptorStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorStride)); +} + +_MTL_INLINE MTL::AccelerationStructureInstanceDescriptorType MTL4::InstanceAccelerationStructureDescriptor::instanceDescriptorType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorType)); +} + +_MTL_INLINE MTL::MatrixLayout MTL4::InstanceAccelerationStructureDescriptor::instanceTransformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceTransformationMatrixLayout)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::InstanceAccelerationStructureDescriptor::motionTransformBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::InstanceAccelerationStructureDescriptor::motionTransformCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformCount)); +} + +_MTL_INLINE NS::UInteger MTL4::InstanceAccelerationStructureDescriptor::motionTransformStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformStride)); +} + +_MTL_INLINE MTL::TransformType MTL4::InstanceAccelerationStructureDescriptor::motionTransformType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformType)); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setInstanceCount(NS::UInteger instanceCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceCount_), instanceCount); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setInstanceDescriptorBuffer(const MTL4::BufferRange instanceDescriptorBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBuffer_), instanceDescriptorBuffer); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorStride_), instanceDescriptorStride); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorType_), instanceDescriptorType); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceTransformationMatrixLayout_), instanceTransformationMatrixLayout); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setMotionTransformBuffer(const MTL4::BufferRange motionTransformBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformBuffer_), motionTransformBuffer); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setMotionTransformCount(NS::UInteger motionTransformCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformCount_), motionTransformCount); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setMotionTransformStride(NS::UInteger motionTransformStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformStride_), motionTransformStride); +} + +_MTL_INLINE void MTL4::InstanceAccelerationStructureDescriptor::setMotionTransformType(MTL::TransformType motionTransformType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformType_), motionTransformType); +} + +_MTL_INLINE MTL4::IndirectInstanceAccelerationStructureDescriptor* MTL4::IndirectInstanceAccelerationStructureDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4IndirectInstanceAccelerationStructureDescriptor)); +} + +_MTL_INLINE MTL4::IndirectInstanceAccelerationStructureDescriptor* MTL4::IndirectInstanceAccelerationStructureDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::BufferRange MTL4::IndirectInstanceAccelerationStructureDescriptor::instanceCountBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceCountBuffer)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorStride)); +} + +_MTL_INLINE MTL::AccelerationStructureInstanceDescriptorType MTL4::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorType)); +} + +_MTL_INLINE MTL::MatrixLayout MTL4::IndirectInstanceAccelerationStructureDescriptor::instanceTransformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceTransformationMatrixLayout)); +} + +_MTL_INLINE NS::UInteger MTL4::IndirectInstanceAccelerationStructureDescriptor::maxInstanceCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxInstanceCount)); +} + +_MTL_INLINE NS::UInteger MTL4::IndirectInstanceAccelerationStructureDescriptor::maxMotionTransformCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxMotionTransformCount)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::IndirectInstanceAccelerationStructureDescriptor::motionTransformBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBuffer)); +} + +_MTL_INLINE MTL4::BufferRange MTL4::IndirectInstanceAccelerationStructureDescriptor::motionTransformCountBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformCountBuffer)); +} + +_MTL_INLINE NS::UInteger MTL4::IndirectInstanceAccelerationStructureDescriptor::motionTransformStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformStride)); +} + +_MTL_INLINE MTL::TransformType MTL4::IndirectInstanceAccelerationStructureDescriptor::motionTransformType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformType)); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setInstanceCountBuffer(const MTL4::BufferRange instanceCountBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceCountBuffer_), instanceCountBuffer); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorBuffer(const MTL4::BufferRange instanceDescriptorBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBuffer_), instanceDescriptorBuffer); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorStride_), instanceDescriptorStride); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorType_), instanceDescriptorType); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceTransformationMatrixLayout_), instanceTransformationMatrixLayout); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setMaxInstanceCount(NS::UInteger maxInstanceCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxInstanceCount_), maxInstanceCount); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setMaxMotionTransformCount(NS::UInteger maxMotionTransformCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxMotionTransformCount_), maxMotionTransformCount); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformBuffer(const MTL4::BufferRange motionTransformBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformBuffer_), motionTransformBuffer); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformCountBuffer(const MTL4::BufferRange motionTransformCountBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformCountBuffer_), motionTransformCountBuffer); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformStride(NS::UInteger motionTransformStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformStride_), motionTransformStride); +} + +_MTL_INLINE void MTL4::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformType(MTL::TransformType motionTransformType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformType_), motionTransformType); +} diff --git a/vendor/metal-cpp/Metal/MTL4Archive.hpp b/vendor/metal-cpp/Metal/MTL4Archive.hpp new file mode 100644 index 000000000..c83ef6389 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4Archive.hpp @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4Archive.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL +{ +class ComputePipelineState; +class RenderPipelineState; +} + +namespace MTL4 +{ +class BinaryFunction; +class BinaryFunctionDescriptor; +class ComputePipelineDescriptor; +class PipelineDescriptor; +class PipelineStageDynamicLinkingDescriptor; +class RenderPipelineDynamicLinkingDescriptor; + +class Archive : public NS::Referencing +{ +public: + NS::String* label() const; + + BinaryFunction* newBinaryFunction(const MTL4::BinaryFunctionDescriptor* descriptor, NS::Error** error); + + MTL::ComputePipelineState* newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, NS::Error** error); + MTL::ComputePipelineState* newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::PipelineStageDynamicLinkingDescriptor* dynamicLinkingDescriptor, NS::Error** error); + + MTL::RenderPipelineState* newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, NS::Error** error); + MTL::RenderPipelineState* newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::RenderPipelineDynamicLinkingDescriptor* dynamicLinkingDescriptor, NS::Error** error); + + void setLabel(const NS::String* label); +}; + +} +_MTL_INLINE NS::String* MTL4::Archive::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::BinaryFunction* MTL4::Archive::newBinaryFunction(const MTL4::BinaryFunctionDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBinaryFunctionWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL4::Archive::newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL4::Archive::newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::PipelineStageDynamicLinkingDescriptor* dynamicLinkingDescriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_error_), descriptor, dynamicLinkingDescriptor, error); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL4::Archive::newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL4::Archive::newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::RenderPipelineDynamicLinkingDescriptor* dynamicLinkingDescriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_error_), descriptor, dynamicLinkingDescriptor, error); +} + +_MTL_INLINE void MTL4::Archive::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} diff --git a/vendor/metal-cpp/Metal/MTL4ArgumentTable.hpp b/vendor/metal-cpp/Metal/MTL4ArgumentTable.hpp new file mode 100644 index 000000000..7788ed94f --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4ArgumentTable.hpp @@ -0,0 +1,187 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4ArgumentTable.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLGPUAddress.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" + +namespace MTL +{ +class Device; +} + +namespace MTL4 +{ +class ArgumentTableDescriptor : public NS::Copying +{ +public: + static ArgumentTableDescriptor* alloc(); + + ArgumentTableDescriptor* init(); + bool initializeBindings() const; + + NS::String* label() const; + + NS::UInteger maxBufferBindCount() const; + + NS::UInteger maxSamplerStateBindCount() const; + + NS::UInteger maxTextureBindCount() const; + + void setInitializeBindings(bool initializeBindings); + + void setLabel(const NS::String* label); + + void setMaxBufferBindCount(NS::UInteger maxBufferBindCount); + + void setMaxSamplerStateBindCount(NS::UInteger maxSamplerStateBindCount); + + void setMaxTextureBindCount(NS::UInteger maxTextureBindCount); + + void setSupportAttributeStrides(bool supportAttributeStrides); + bool supportAttributeStrides() const; +}; +class ArgumentTable : public NS::Referencing +{ +public: + MTL::Device* device() const; + + NS::String* label() const; + + void setAddress(MTL::GPUAddress gpuAddress, NS::UInteger bindingIndex); + void setAddress(MTL::GPUAddress gpuAddress, NS::UInteger stride, NS::UInteger bindingIndex); + + void setResource(MTL::ResourceID resourceID, NS::UInteger bindingIndex); + + void setSamplerState(MTL::ResourceID resourceID, NS::UInteger bindingIndex); + + void setTexture(MTL::ResourceID resourceID, NS::UInteger bindingIndex); +}; + +} +_MTL_INLINE MTL4::ArgumentTableDescriptor* MTL4::ArgumentTableDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4ArgumentTableDescriptor)); +} + +_MTL_INLINE MTL4::ArgumentTableDescriptor* MTL4::ArgumentTableDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE bool MTL4::ArgumentTableDescriptor::initializeBindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initializeBindings)); +} + +_MTL_INLINE NS::String* MTL4::ArgumentTableDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL4::ArgumentTableDescriptor::maxBufferBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxBufferBindCount)); +} + +_MTL_INLINE NS::UInteger MTL4::ArgumentTableDescriptor::maxSamplerStateBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxSamplerStateBindCount)); +} + +_MTL_INLINE NS::UInteger MTL4::ArgumentTableDescriptor::maxTextureBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTextureBindCount)); +} + +_MTL_INLINE void MTL4::ArgumentTableDescriptor::setInitializeBindings(bool initializeBindings) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInitializeBindings_), initializeBindings); +} + +_MTL_INLINE void MTL4::ArgumentTableDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::ArgumentTableDescriptor::setMaxBufferBindCount(NS::UInteger maxBufferBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxBufferBindCount_), maxBufferBindCount); +} + +_MTL_INLINE void MTL4::ArgumentTableDescriptor::setMaxSamplerStateBindCount(NS::UInteger maxSamplerStateBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxSamplerStateBindCount_), maxSamplerStateBindCount); +} + +_MTL_INLINE void MTL4::ArgumentTableDescriptor::setMaxTextureBindCount(NS::UInteger maxTextureBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTextureBindCount_), maxTextureBindCount); +} + +_MTL_INLINE void MTL4::ArgumentTableDescriptor::setSupportAttributeStrides(bool supportAttributeStrides) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAttributeStrides_), supportAttributeStrides); +} + +_MTL_INLINE bool MTL4::ArgumentTableDescriptor::supportAttributeStrides() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAttributeStrides)); +} + +_MTL_INLINE MTL::Device* MTL4::ArgumentTable::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL4::ArgumentTable::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL4::ArgumentTable::setAddress(MTL::GPUAddress gpuAddress, NS::UInteger bindingIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAddress_atIndex_), gpuAddress, bindingIndex); +} + +_MTL_INLINE void MTL4::ArgumentTable::setAddress(MTL::GPUAddress gpuAddress, NS::UInteger stride, NS::UInteger bindingIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAddress_attributeStride_atIndex_), gpuAddress, stride, bindingIndex); +} + +_MTL_INLINE void MTL4::ArgumentTable::setResource(MTL::ResourceID resourceID, NS::UInteger bindingIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResource_atBufferIndex_), resourceID, bindingIndex); +} + +_MTL_INLINE void MTL4::ArgumentTable::setSamplerState(MTL::ResourceID resourceID, NS::UInteger bindingIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_atIndex_), resourceID, bindingIndex); +} + +_MTL_INLINE void MTL4::ArgumentTable::setTexture(MTL::ResourceID resourceID, NS::UInteger bindingIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_atIndex_), resourceID, bindingIndex); +} diff --git a/vendor/metal-cpp/Metal/MTL4BinaryFunction.hpp b/vendor/metal-cpp/Metal/MTL4BinaryFunction.hpp new file mode 100644 index 000000000..30d90a6b2 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4BinaryFunction.hpp @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4BinaryFunction.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLLibrary.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ + +class BinaryFunction : public NS::Referencing +{ +public: + MTL::FunctionType functionType() const; + + NS::String* name() const; +}; + +} + +_MTL_INLINE MTL::FunctionType MTL4::BinaryFunction::functionType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionType)); +} + +_MTL_INLINE NS::String* MTL4::BinaryFunction::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} diff --git a/vendor/metal-cpp/Metal/MTL4BinaryFunctionDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4BinaryFunctionDescriptor.hpp new file mode 100644 index 000000000..ce173ce00 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4BinaryFunctionDescriptor.hpp @@ -0,0 +1,97 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4BinaryFunctionDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class BinaryFunctionDescriptor; +class FunctionDescriptor; + +_MTL_OPTIONS(NS::UInteger, BinaryFunctionOptions) { + BinaryFunctionOptionNone = 0, + BinaryFunctionOptionPipelineIndependent = 1 << 1, +}; + +class BinaryFunctionDescriptor : public NS::Copying +{ +public: + static BinaryFunctionDescriptor* alloc(); + + FunctionDescriptor* functionDescriptor() const; + + BinaryFunctionDescriptor* init(); + + NS::String* name() const; + + BinaryFunctionOptions options() const; + + void setFunctionDescriptor(const MTL4::FunctionDescriptor* functionDescriptor); + + void setName(const NS::String* name); + + void setOptions(MTL4::BinaryFunctionOptions options); +}; + +} +_MTL_INLINE MTL4::BinaryFunctionDescriptor* MTL4::BinaryFunctionDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4BinaryFunctionDescriptor)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::BinaryFunctionDescriptor::functionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionDescriptor)); +} + +_MTL_INLINE MTL4::BinaryFunctionDescriptor* MTL4::BinaryFunctionDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL4::BinaryFunctionDescriptor::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE MTL4::BinaryFunctionOptions MTL4::BinaryFunctionDescriptor::options() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); +} + +_MTL_INLINE void MTL4::BinaryFunctionDescriptor::setFunctionDescriptor(const MTL4::FunctionDescriptor* functionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionDescriptor_), functionDescriptor); +} + +_MTL_INLINE void MTL4::BinaryFunctionDescriptor::setName(const NS::String* name) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); +} + +_MTL_INLINE void MTL4::BinaryFunctionDescriptor::setOptions(MTL4::BinaryFunctionOptions options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptions_), options); +} diff --git a/vendor/metal-cpp/Metal/MTL4CommandAllocator.hpp b/vendor/metal-cpp/Metal/MTL4CommandAllocator.hpp new file mode 100644 index 000000000..a36b05081 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4CommandAllocator.hpp @@ -0,0 +1,100 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4CommandAllocator.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include + +namespace MTL +{ +class Device; +} + +namespace MTL4 +{ + +class CommandAllocatorDescriptor : public NS::Copying +{ +public: + static CommandAllocatorDescriptor* alloc(); + + CommandAllocatorDescriptor* init(); + + NS::String* label() const; + void setLabel(const NS::String* label); +}; + +class CommandAllocator : public NS::Referencing +{ +public: + uint64_t allocatedSize(); + + MTL::Device* device() const; + + NS::String* label() const; + + void reset(); +}; + +} + +_MTL_INLINE MTL4::CommandAllocatorDescriptor* MTL4::CommandAllocatorDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CommandAllocatorDescriptor)); +} + +_MTL_INLINE MTL4::CommandAllocatorDescriptor* MTL4::CommandAllocatorDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL4::CommandAllocatorDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL4::CommandAllocatorDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE uint64_t MTL4::CommandAllocator::allocatedSize() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allocatedSize)); +} + +_MTL_INLINE MTL::Device* MTL4::CommandAllocator::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL4::CommandAllocator::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL4::CommandAllocator::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} diff --git a/vendor/metal-cpp/Metal/MTL4CommandBuffer.hpp b/vendor/metal-cpp/Metal/MTL4CommandBuffer.hpp new file mode 100644 index 000000000..a69cc9413 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4CommandBuffer.hpp @@ -0,0 +1,193 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4CommandBuffer.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4RenderCommandEncoder.hpp" +#include "MTLAccelerationStructureTypes.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class CommandAllocator; +class CommandBufferOptions; +class ComputeCommandEncoder; +class CounterHeap; +class MachineLearningCommandEncoder; +class RenderCommandEncoder; +class RenderPassDescriptor; +} + +namespace MTL +{ +class Device; +class Fence; +class LogState; +class ResidencySet; +} + +namespace MTL4 +{ +class CommandBufferOptions : public NS::Copying +{ +public: + static CommandBufferOptions* alloc(); + + CommandBufferOptions* init(); + + MTL::LogState* logState() const; + void setLogState(const MTL::LogState* logState); +}; +class CommandBuffer : public NS::Referencing +{ +public: + void beginCommandBuffer(const MTL4::CommandAllocator* allocator); + void beginCommandBuffer(const MTL4::CommandAllocator* allocator, const MTL4::CommandBufferOptions* options); + + ComputeCommandEncoder* computeCommandEncoder(); + + MTL::Device* device() const; + + void endCommandBuffer(); + + NS::String* label() const; + + MachineLearningCommandEncoder* machineLearningCommandEncoder(); + + void popDebugGroup(); + + void pushDebugGroup(const NS::String* string); + + RenderCommandEncoder* renderCommandEncoder(const MTL4::RenderPassDescriptor* descriptor); + RenderCommandEncoder* renderCommandEncoder(const MTL4::RenderPassDescriptor* descriptor, MTL4::RenderEncoderOptions options); + + void resolveCounterHeap(const MTL4::CounterHeap* counterHeap, NS::Range range, const MTL4::BufferRange bufferRange, const MTL::Fence* fenceToWait, const MTL::Fence* fenceToUpdate); + + void setLabel(const NS::String* label); + + void useResidencySet(const MTL::ResidencySet* residencySet); + void useResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count); + + void writeTimestampIntoHeap(const MTL4::CounterHeap* counterHeap, NS::UInteger index); +}; + +} +_MTL_INLINE MTL4::CommandBufferOptions* MTL4::CommandBufferOptions::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CommandBufferOptions)); +} + +_MTL_INLINE MTL4::CommandBufferOptions* MTL4::CommandBufferOptions::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::LogState* MTL4::CommandBufferOptions::logState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(logState)); +} + +_MTL_INLINE void MTL4::CommandBufferOptions::setLogState(const MTL::LogState* logState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLogState_), logState); +} + +_MTL_INLINE void MTL4::CommandBuffer::beginCommandBuffer(const MTL4::CommandAllocator* allocator) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(beginCommandBufferWithAllocator_), allocator); +} + +_MTL_INLINE void MTL4::CommandBuffer::beginCommandBuffer(const MTL4::CommandAllocator* allocator, const MTL4::CommandBufferOptions* options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(beginCommandBufferWithAllocator_options_), allocator, options); +} + +_MTL_INLINE MTL4::ComputeCommandEncoder* MTL4::CommandBuffer::computeCommandEncoder() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoder)); +} + +_MTL_INLINE MTL::Device* MTL4::CommandBuffer::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE void MTL4::CommandBuffer::endCommandBuffer() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(endCommandBuffer)); +} + +_MTL_INLINE NS::String* MTL4::CommandBuffer::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::MachineLearningCommandEncoder* MTL4::CommandBuffer::machineLearningCommandEncoder() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(machineLearningCommandEncoder)); +} + +_MTL_INLINE void MTL4::CommandBuffer::popDebugGroup() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); +} + +_MTL_INLINE void MTL4::CommandBuffer::pushDebugGroup(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); +} + +_MTL_INLINE MTL4::RenderCommandEncoder* MTL4::CommandBuffer::renderCommandEncoder(const MTL4::RenderPassDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderCommandEncoderWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL4::RenderCommandEncoder* MTL4::CommandBuffer::renderCommandEncoder(const MTL4::RenderPassDescriptor* descriptor, MTL4::RenderEncoderOptions options) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderCommandEncoderWithDescriptor_options_), descriptor, options); +} + +_MTL_INLINE void MTL4::CommandBuffer::resolveCounterHeap(const MTL4::CounterHeap* counterHeap, NS::Range range, const MTL4::BufferRange bufferRange, const MTL::Fence* fenceToWait, const MTL::Fence* fenceToUpdate) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveCounterHeap_withRange_intoBuffer_waitFence_updateFence_), counterHeap, range, bufferRange, fenceToWait, fenceToUpdate); +} + +_MTL_INLINE void MTL4::CommandBuffer::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::CommandBuffer::useResidencySet(const MTL::ResidencySet* residencySet) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResidencySet_), residencySet); +} + +_MTL_INLINE void MTL4::CommandBuffer::useResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResidencySets_count_), residencySets, count); +} + +_MTL_INLINE void MTL4::CommandBuffer::writeTimestampIntoHeap(const MTL4::CounterHeap* counterHeap, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(writeTimestampIntoHeap_atIndex_), counterHeap, index); +} diff --git a/vendor/metal-cpp/Metal/MTL4CommandEncoder.hpp b/vendor/metal-cpp/Metal/MTL4CommandEncoder.hpp new file mode 100644 index 000000000..2336021ee --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4CommandEncoder.hpp @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4CommandEncoder.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLCommandEncoder.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class CommandBuffer; +} + +namespace MTL +{ +class Fence; +} + +namespace MTL4 +{ +_MTL_OPTIONS(NS::UInteger, VisibilityOptions) { + VisibilityOptionNone = 0, + VisibilityOptionDevice = 1, + VisibilityOptionResourceAlias = 1 << 1, +}; + +class CommandEncoder : public NS::Referencing +{ +public: + void barrierAfterEncoderStages(MTL::Stages afterEncoderStages, MTL::Stages beforeEncoderStages, MTL4::VisibilityOptions visibilityOptions); + + void barrierAfterQueueStages(MTL::Stages afterQueueStages, MTL::Stages beforeStages, MTL4::VisibilityOptions visibilityOptions); + + void barrierAfterStages(MTL::Stages afterStages, MTL::Stages beforeQueueStages, MTL4::VisibilityOptions visibilityOptions); + + CommandBuffer* commandBuffer() const; + + void endEncoding(); + + void insertDebugSignpost(const NS::String* string); + + NS::String* label() const; + + void popDebugGroup(); + + void pushDebugGroup(const NS::String* string); + + void setLabel(const NS::String* label); + + void updateFence(const MTL::Fence* fence, MTL::Stages afterEncoderStages); + + void waitForFence(const MTL::Fence* fence, MTL::Stages beforeEncoderStages); +}; + +} +_MTL_INLINE void MTL4::CommandEncoder::barrierAfterEncoderStages(MTL::Stages afterEncoderStages, MTL::Stages beforeEncoderStages, MTL4::VisibilityOptions visibilityOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(barrierAfterEncoderStages_beforeEncoderStages_visibilityOptions_), afterEncoderStages, beforeEncoderStages, visibilityOptions); +} + +_MTL_INLINE void MTL4::CommandEncoder::barrierAfterQueueStages(MTL::Stages afterQueueStages, MTL::Stages beforeStages, MTL4::VisibilityOptions visibilityOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(barrierAfterQueueStages_beforeStages_visibilityOptions_), afterQueueStages, beforeStages, visibilityOptions); +} + +_MTL_INLINE void MTL4::CommandEncoder::barrierAfterStages(MTL::Stages afterStages, MTL::Stages beforeQueueStages, MTL4::VisibilityOptions visibilityOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(barrierAfterStages_beforeQueueStages_visibilityOptions_), afterStages, beforeQueueStages, visibilityOptions); +} + +_MTL_INLINE MTL4::CommandBuffer* MTL4::CommandEncoder::commandBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBuffer)); +} + +_MTL_INLINE void MTL4::CommandEncoder::endEncoding() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(endEncoding)); +} + +_MTL_INLINE void MTL4::CommandEncoder::insertDebugSignpost(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(insertDebugSignpost_), string); +} + +_MTL_INLINE NS::String* MTL4::CommandEncoder::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL4::CommandEncoder::popDebugGroup() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); +} + +_MTL_INLINE void MTL4::CommandEncoder::pushDebugGroup(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); +} + +_MTL_INLINE void MTL4::CommandEncoder::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::CommandEncoder::updateFence(const MTL::Fence* fence, MTL::Stages afterEncoderStages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_afterEncoderStages_), fence, afterEncoderStages); +} + +_MTL_INLINE void MTL4::CommandEncoder::waitForFence(const MTL::Fence* fence, MTL::Stages beforeEncoderStages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_beforeEncoderStages_), fence, beforeEncoderStages); +} diff --git a/vendor/metal-cpp/Metal/MTL4CommandQueue.hpp b/vendor/metal-cpp/Metal/MTL4CommandQueue.hpp new file mode 100644 index 000000000..cbd21c7a2 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4CommandQueue.hpp @@ -0,0 +1,283 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4CommandQueue.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4CommitFeedback.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLResourceStateCommandEncoder.hpp" +#include "MTLTypes.hpp" +#include +#include + +namespace MTL +{ +class Buffer; +class Device; +class Drawable; +class Event; +class Heap; +class ResidencySet; +class Texture; +} + +namespace MTL4 +{ +class CommandBuffer; +class CommandQueueDescriptor; +class CommitOptions; +struct CopySparseBufferMappingOperation; +struct CopySparseTextureMappingOperation; +struct UpdateSparseBufferMappingOperation; +struct UpdateSparseTextureMappingOperation; +_MTL_ENUM(NS::Integer, CommandQueueError) { + CommandQueueErrorNone = 0, + CommandQueueErrorTimeout = 1, + CommandQueueErrorNotPermitted = 2, + CommandQueueErrorOutOfMemory = 3, + CommandQueueErrorDeviceRemoved = 4, + CommandQueueErrorAccessRevoked = 5, + CommandQueueErrorInternal = 6, +}; + +struct UpdateSparseTextureMappingOperation +{ + MTL::SparseTextureMappingMode mode; + MTL::Region textureRegion; + NS::UInteger textureLevel; + NS::UInteger textureSlice; + NS::UInteger heapOffset; +} _MTL_PACKED; + +struct CopySparseTextureMappingOperation +{ + MTL::Region sourceRegion; + NS::UInteger sourceLevel; + NS::UInteger sourceSlice; + MTL::Origin destinationOrigin; + NS::UInteger destinationLevel; + NS::UInteger destinationSlice; +} _MTL_PACKED; + +struct UpdateSparseBufferMappingOperation +{ + MTL::SparseTextureMappingMode mode; + NS::Range bufferRange; + NS::UInteger heapOffset; +} _MTL_PACKED; + +struct CopySparseBufferMappingOperation +{ + NS::Range sourceRange; + NS::UInteger destinationOffset; +} _MTL_PACKED; + +class CommitOptions : public NS::Referencing +{ +public: + void addFeedbackHandler(const MTL4::CommitFeedbackHandler block); + void addFeedbackHandler(const MTL4::CommitFeedbackHandlerFunction& function); + + static CommitOptions* alloc(); + + CommitOptions* init(); +}; +class CommandQueueDescriptor : public NS::Copying +{ +public: + static CommandQueueDescriptor* alloc(); + + dispatch_queue_t feedbackQueue() const; + + CommandQueueDescriptor* init(); + + NS::String* label() const; + + void setFeedbackQueue(const dispatch_queue_t feedbackQueue); + + void setLabel(const NS::String* label); +}; +class CommandQueue : public NS::Referencing +{ +public: + void addResidencySet(const MTL::ResidencySet* residencySet); + void addResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count); + + void commit(const MTL4::CommandBuffer* const commandBuffers[], NS::UInteger count); + void commit(const MTL4::CommandBuffer* const commandBuffers[], NS::UInteger count, const MTL4::CommitOptions* options); + + void copyBufferMappingsFromBuffer(const MTL::Buffer* sourceBuffer, const MTL::Buffer* destinationBuffer, const MTL4::CopySparseBufferMappingOperation* operations, NS::UInteger count); + + void copyTextureMappingsFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture, const MTL4::CopySparseTextureMappingOperation* operations, NS::UInteger count); + + MTL::Device* device() const; + + NS::String* label() const; + + void removeResidencySet(const MTL::ResidencySet* residencySet); + void removeResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count); + + void signalDrawable(const MTL::Drawable* drawable); + + void signalEvent(const MTL::Event* event, uint64_t value); + + void updateBufferMappings(const MTL::Buffer* buffer, const MTL::Heap* heap, const MTL4::UpdateSparseBufferMappingOperation* operations, NS::UInteger count); + + void updateTextureMappings(const MTL::Texture* texture, const MTL::Heap* heap, const MTL4::UpdateSparseTextureMappingOperation* operations, NS::UInteger count); + + void wait(const MTL::Event* event, uint64_t value); + void wait(const MTL::Drawable* drawable); +}; + +} + +_MTL_INLINE void MTL4::CommitOptions::addFeedbackHandler(const MTL4::CommitFeedbackHandler block) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addFeedbackHandler_), block); +} + +_MTL_INLINE void MTL4::CommitOptions::addFeedbackHandler(const MTL4::CommitFeedbackHandlerFunction& function) +{ + __block MTL4::CommitFeedbackHandlerFunction blockFunction = function; + addFeedbackHandler(^(MTL4::CommitFeedback* pFeedback) { blockFunction(pFeedback); }); +} + +_MTL_INLINE MTL4::CommitOptions* MTL4::CommitOptions::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CommitOptions)); +} + +_MTL_INLINE MTL4::CommitOptions* MTL4::CommitOptions::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::CommandQueueDescriptor* MTL4::CommandQueueDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CommandQueueDescriptor)); +} + +_MTL_INLINE dispatch_queue_t MTL4::CommandQueueDescriptor::feedbackQueue() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(feedbackQueue)); +} + +_MTL_INLINE MTL4::CommandQueueDescriptor* MTL4::CommandQueueDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL4::CommandQueueDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL4::CommandQueueDescriptor::setFeedbackQueue(const dispatch_queue_t feedbackQueue) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFeedbackQueue_), feedbackQueue); +} + +_MTL_INLINE void MTL4::CommandQueueDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::CommandQueue::addResidencySet(const MTL::ResidencySet* residencySet) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addResidencySet_), residencySet); +} + +_MTL_INLINE void MTL4::CommandQueue::addResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addResidencySets_count_), residencySets, count); +} + +_MTL_INLINE void MTL4::CommandQueue::commit(const MTL4::CommandBuffer* const commandBuffers[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(commit_count_), commandBuffers, count); +} + +_MTL_INLINE void MTL4::CommandQueue::commit(const MTL4::CommandBuffer* const commandBuffers[], NS::UInteger count, const MTL4::CommitOptions* options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(commit_count_options_), commandBuffers, count, options); +} + +_MTL_INLINE void MTL4::CommandQueue::copyBufferMappingsFromBuffer(const MTL::Buffer* sourceBuffer, const MTL::Buffer* destinationBuffer, const MTL4::CopySparseBufferMappingOperation* operations, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyBufferMappingsFromBuffer_toBuffer_operations_count_), sourceBuffer, destinationBuffer, operations, count); +} + +_MTL_INLINE void MTL4::CommandQueue::copyTextureMappingsFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture, const MTL4::CopySparseTextureMappingOperation* operations, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyTextureMappingsFromTexture_toTexture_operations_count_), sourceTexture, destinationTexture, operations, count); +} + +_MTL_INLINE MTL::Device* MTL4::CommandQueue::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL4::CommandQueue::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL4::CommandQueue::removeResidencySet(const MTL::ResidencySet* residencySet) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeResidencySet_), residencySet); +} + +_MTL_INLINE void MTL4::CommandQueue::removeResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeResidencySets_count_), residencySets, count); +} + +_MTL_INLINE void MTL4::CommandQueue::signalDrawable(const MTL::Drawable* drawable) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(signalDrawable_), drawable); +} + +_MTL_INLINE void MTL4::CommandQueue::signalEvent(const MTL::Event* event, uint64_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(signalEvent_value_), event, value); +} + +_MTL_INLINE void MTL4::CommandQueue::updateBufferMappings(const MTL::Buffer* buffer, const MTL::Heap* heap, const MTL4::UpdateSparseBufferMappingOperation* operations, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateBufferMappings_heap_operations_count_), buffer, heap, operations, count); +} + +_MTL_INLINE void MTL4::CommandQueue::updateTextureMappings(const MTL::Texture* texture, const MTL::Heap* heap, const MTL4::UpdateSparseTextureMappingOperation* operations, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMappings_heap_operations_count_), texture, heap, operations, count); +} + +_MTL_INLINE void MTL4::CommandQueue::wait(const MTL::Event* event, uint64_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForEvent_value_), event, value); +} + +_MTL_INLINE void MTL4::CommandQueue::wait(const MTL::Drawable* drawable) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForDrawable_), drawable); +} diff --git a/vendor/metal-cpp/Metal/MTL4CommitFeedback.hpp b/vendor/metal-cpp/Metal/MTL4CommitFeedback.hpp new file mode 100644 index 000000000..6b8181f71 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4CommitFeedback.hpp @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4CommitFeedback.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include + +#include + +namespace MTL4 +{ +class CommitFeedback; + +using CommitFeedbackHandler = void (^)(MTL4::CommitFeedback*); +using CommitFeedbackHandlerFunction = std::function; + +class CommitFeedback : public NS::Referencing +{ +public: + CFTimeInterval GPUEndTime() const; + + CFTimeInterval GPUStartTime() const; + + NS::Error* error() const; +}; + +} +_MTL_INLINE CFTimeInterval MTL4::CommitFeedback::GPUEndTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(GPUEndTime)); +} + +_MTL_INLINE CFTimeInterval MTL4::CommitFeedback::GPUStartTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(GPUStartTime)); +} + +_MTL_INLINE NS::Error* MTL4::CommitFeedback::error() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(error)); +} diff --git a/vendor/metal-cpp/Metal/MTL4Compiler.hpp b/vendor/metal-cpp/Metal/MTL4Compiler.hpp new file mode 100644 index 000000000..94249b297 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4Compiler.hpp @@ -0,0 +1,345 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4Compiler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLDevice.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +#include + +namespace MTL4 +{ +class BinaryFunction; +class BinaryFunctionDescriptor; +class CompilerDescriptor; +class CompilerTask; +class CompilerTaskOptions; +class ComputePipelineDescriptor; +class LibraryDescriptor; +class MachineLearningPipelineDescriptor; +class MachineLearningPipelineState; +class PipelineDataSetSerializer; +class PipelineDescriptor; +class PipelineStageDynamicLinkingDescriptor; +class RenderPipelineDynamicLinkingDescriptor; +} + +namespace MTL +{ +class ComputePipelineState; +class Device; +class DynamicLibrary; +class Library; +class RenderPipelineState; + +using NewDynamicLibraryCompletionHandler = void (^)(MTL::DynamicLibrary*, NS::Error*); +using NewDynamicLibraryCompletionHandlerFunction = std::function; +} + +namespace MTL4 +{ +using NewComputePipelineStateCompletionHandler = void (^)(MTL::ComputePipelineState*, NS::Error*); +using NewComputePipelineStateCompletionHandlerFunction = std::function; +using NewRenderPipelineStateCompletionHandler = void (^)(MTL::RenderPipelineState*, NS::Error*); +using NewRenderPipelineStateCompletionHandlerFunction = std::function; +using NewBinaryFunctionCompletionHandler = void (^)(MTL4::BinaryFunction*, NS::Error*); +using NewBinaryFunctionCompletionHandlerFunction = std::function; +using NewMachineLearningPipelineStateCompletionHandler = void (^)(MTL4::MachineLearningPipelineState*, NS::Error*); +using NewMachineLearningPipelineStateCompletionHandlerFunction = std::function; + +class CompilerDescriptor : public NS::Copying +{ +public: + static CompilerDescriptor* alloc(); + + CompilerDescriptor* init(); + + NS::String* label() const; + + PipelineDataSetSerializer* pipelineDataSetSerializer() const; + + void setLabel(const NS::String* label); + + void setPipelineDataSetSerializer(const MTL4::PipelineDataSetSerializer* pipelineDataSetSerializer); +}; +class CompilerTaskOptions : public NS::Copying +{ +public: + static CompilerTaskOptions* alloc(); + + CompilerTaskOptions* init(); + + NS::Array* lookupArchives() const; + void setLookupArchives(const NS::Array* lookupArchives); +}; +class Compiler : public NS::Referencing +{ +public: + MTL::Device* device() const; + + NS::String* label() const; + + BinaryFunction* newBinaryFunction(const MTL4::BinaryFunctionDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error); + CompilerTask* newBinaryFunction(const MTL4::BinaryFunctionDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL4::NewBinaryFunctionCompletionHandler completionHandler); + + MTL::ComputePipelineState* newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error); + MTL::ComputePipelineState* newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::PipelineStageDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error); + CompilerTask* newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewComputePipelineStateCompletionHandler completionHandler); + CompilerTask* newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::PipelineStageDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewComputePipelineStateCompletionHandler completionHandler); + CompilerTask* newComputePipelineState(const MTL4::ComputePipelineDescriptor* pDescriptor, const MTL4::CompilerTaskOptions* options, const MTL4::NewComputePipelineStateCompletionHandlerFunction& function); + + MTL::DynamicLibrary* newDynamicLibrary(const MTL::Library* library, NS::Error** error); + MTL::DynamicLibrary* newDynamicLibrary(const NS::URL* url, NS::Error** error); + CompilerTask* newDynamicLibrary(const MTL::Library* library, const MTL::NewDynamicLibraryCompletionHandler completionHandler); + CompilerTask* newDynamicLibrary(const NS::URL* url, const MTL::NewDynamicLibraryCompletionHandler completionHandler); + CompilerTask* newDynamicLibrary(const MTL::Library* pLibrary, const MTL::NewDynamicLibraryCompletionHandlerFunction& function); + CompilerTask* newDynamicLibrary(const NS::URL* pURL, const MTL::NewDynamicLibraryCompletionHandlerFunction& function); + + MTL::Library* newLibrary(const MTL4::LibraryDescriptor* descriptor, NS::Error** error); + CompilerTask* newLibrary(const MTL4::LibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler); + CompilerTask* newLibrary(const MTL4::LibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& function); + + MachineLearningPipelineState* newMachineLearningPipelineState(const MTL4::MachineLearningPipelineDescriptor* descriptor, NS::Error** error); + CompilerTask* newMachineLearningPipelineState(const MTL4::MachineLearningPipelineDescriptor* descriptor, const MTL4::NewMachineLearningPipelineStateCompletionHandler completionHandler); + CompilerTask* newMachineLearningPipelineState(const MTL4::MachineLearningPipelineDescriptor* pDescriptor, const MTL4::NewMachineLearningPipelineStateCompletionHandlerFunction& function); + + MTL::RenderPipelineState* newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error); + MTL::RenderPipelineState* newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::RenderPipelineDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error); + CompilerTask* newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewRenderPipelineStateCompletionHandler completionHandler); + CompilerTask* newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::RenderPipelineDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewRenderPipelineStateCompletionHandler completionHandler); + CompilerTask* newRenderPipelineState(const MTL4::PipelineDescriptor* pDescriptor, const MTL4::CompilerTaskOptions* options, const MTL4::NewRenderPipelineStateCompletionHandlerFunction& function); + MTL::RenderPipelineState* newRenderPipelineStateBySpecialization(const MTL4::PipelineDescriptor* descriptor, const MTL::RenderPipelineState* pipeline, NS::Error** error); + CompilerTask* newRenderPipelineStateBySpecialization(const MTL4::PipelineDescriptor* descriptor, const MTL::RenderPipelineState* pipeline, const MTL::NewRenderPipelineStateCompletionHandler completionHandler); + CompilerTask* newRenderPipelineStateBySpecialization(const MTL4::PipelineDescriptor* pDescriptor, const MTL::RenderPipelineState* pPipeline, const MTL4::NewRenderPipelineStateCompletionHandlerFunction& function); + + PipelineDataSetSerializer* pipelineDataSetSerializer() const; +}; + +} +_MTL_INLINE MTL4::CompilerDescriptor* MTL4::CompilerDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CompilerDescriptor)); +} + +_MTL_INLINE MTL4::CompilerDescriptor* MTL4::CompilerDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL4::CompilerDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::PipelineDataSetSerializer* MTL4::CompilerDescriptor::pipelineDataSetSerializer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pipelineDataSetSerializer)); +} + +_MTL_INLINE void MTL4::CompilerDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::CompilerDescriptor::setPipelineDataSetSerializer(const MTL4::PipelineDataSetSerializer* pipelineDataSetSerializer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPipelineDataSetSerializer_), pipelineDataSetSerializer); +} + +_MTL_INLINE MTL4::CompilerTaskOptions* MTL4::CompilerTaskOptions::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CompilerTaskOptions)); +} + +_MTL_INLINE MTL4::CompilerTaskOptions* MTL4::CompilerTaskOptions::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::Array* MTL4::CompilerTaskOptions::lookupArchives() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(lookupArchives)); +} + +_MTL_INLINE void MTL4::CompilerTaskOptions::setLookupArchives(const NS::Array* lookupArchives) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLookupArchives_), lookupArchives); +} + +_MTL_INLINE MTL::Device* MTL4::Compiler::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL4::Compiler::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::BinaryFunction* MTL4::Compiler::newBinaryFunction(const MTL4::BinaryFunctionDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBinaryFunctionWithDescriptor_compilerTaskOptions_error_), descriptor, compilerTaskOptions, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newBinaryFunction(const MTL4::BinaryFunctionDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL4::NewBinaryFunctionCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBinaryFunctionWithDescriptor_compilerTaskOptions_completionHandler_), descriptor, compilerTaskOptions, completionHandler); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL4::Compiler::newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_compilerTaskOptions_error_), descriptor, compilerTaskOptions, error); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL4::Compiler::newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::PipelineStageDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error_), descriptor, dynamicLinkingDescriptor, compilerTaskOptions, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewComputePipelineStateCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_compilerTaskOptions_completionHandler_), descriptor, compilerTaskOptions, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newComputePipelineState(const MTL4::ComputePipelineDescriptor* descriptor, const MTL4::PipelineStageDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewComputePipelineStateCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler_), descriptor, dynamicLinkingDescriptor, compilerTaskOptions, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newComputePipelineState(const MTL4::ComputePipelineDescriptor* pDescriptor, const MTL4::CompilerTaskOptions* options, const MTL4::NewComputePipelineStateCompletionHandlerFunction& function) +{ + __block MTL4::NewComputePipelineStateCompletionHandlerFunction blockFunction = function; + return newComputePipelineState(pDescriptor, options, ^(MTL::ComputePipelineState* pPipeline, NS::Error* pError) { blockFunction(pPipeline, pError); }); +} + +_MTL_INLINE MTL::DynamicLibrary* MTL4::Compiler::newDynamicLibrary(const MTL::Library* library, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibrary_error_), library, error); +} + +_MTL_INLINE MTL::DynamicLibrary* MTL4::Compiler::newDynamicLibrary(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibraryWithURL_error_), url, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newDynamicLibrary(const MTL::Library* library, const MTL::NewDynamicLibraryCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibrary_completionHandler_), library, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newDynamicLibrary(const NS::URL* url, const MTL::NewDynamicLibraryCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibraryWithURL_completionHandler_), url, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newDynamicLibrary(const MTL::Library* pLibrary, const MTL::NewDynamicLibraryCompletionHandlerFunction& function) +{ + __block MTL::NewDynamicLibraryCompletionHandlerFunction blockFunction = function; + return newDynamicLibrary(pLibrary, ^(MTL::DynamicLibrary* pLibraryRef, NS::Error* pError) { blockFunction(pLibraryRef, pError); }); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newDynamicLibrary(const NS::URL* pURL, const MTL::NewDynamicLibraryCompletionHandlerFunction& function) +{ + __block MTL::NewDynamicLibraryCompletionHandlerFunction blockFunction = function; + return newDynamicLibrary(pURL, ^(MTL::DynamicLibrary* pLibrary, NS::Error* pError) { blockFunction(pLibrary, pError); }); +} + +_MTL_INLINE MTL::Library* MTL4::Compiler::newLibrary(const MTL4::LibraryDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newLibrary(const MTL4::LibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithDescriptor_completionHandler_), descriptor, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newLibrary(const MTL4::LibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& function) +{ + __block MTL::NewLibraryCompletionHandlerFunction blockFunction = function; + return newLibrary(pDescriptor, ^(MTL::Library* pLibrary, NS::Error* pError) { blockFunction(pLibrary, pError); }); +} + +_MTL_INLINE MTL4::MachineLearningPipelineState* MTL4::Compiler::newMachineLearningPipelineState(const MTL4::MachineLearningPipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newMachineLearningPipelineStateWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newMachineLearningPipelineState(const MTL4::MachineLearningPipelineDescriptor* descriptor, const MTL4::NewMachineLearningPipelineStateCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newMachineLearningPipelineStateWithDescriptor_completionHandler_), descriptor, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newMachineLearningPipelineState(const MTL4::MachineLearningPipelineDescriptor* pDescriptor, const MTL4::NewMachineLearningPipelineStateCompletionHandlerFunction& function) +{ + __block MTL4::NewMachineLearningPipelineStateCompletionHandlerFunction blockFunction = function; + return newMachineLearningPipelineState(pDescriptor, ^(MTL4::MachineLearningPipelineState* pPipeline, NS::Error* pError) { blockFunction(pPipeline, pError); }); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL4::Compiler::newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_compilerTaskOptions_error_), descriptor, compilerTaskOptions, error); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL4::Compiler::newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::RenderPipelineDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error_), descriptor, dynamicLinkingDescriptor, compilerTaskOptions, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewRenderPipelineStateCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_compilerTaskOptions_completionHandler_), descriptor, compilerTaskOptions, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newRenderPipelineState(const MTL4::PipelineDescriptor* descriptor, const MTL4::RenderPipelineDynamicLinkingDescriptor* dynamicLinkingDescriptor, const MTL4::CompilerTaskOptions* compilerTaskOptions, const MTL::NewRenderPipelineStateCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler_), descriptor, dynamicLinkingDescriptor, compilerTaskOptions, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newRenderPipelineState(const MTL4::PipelineDescriptor* pDescriptor, const MTL4::CompilerTaskOptions* options, const MTL4::NewRenderPipelineStateCompletionHandlerFunction& function) +{ + __block MTL4::NewRenderPipelineStateCompletionHandlerFunction blockFunction = function; + return newRenderPipelineState(pDescriptor, options, ^(MTL::RenderPipelineState* pPipeline, NS::Error* pError) { blockFunction(pPipeline, pError); }); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL4::Compiler::newRenderPipelineStateBySpecialization(const MTL4::PipelineDescriptor* descriptor, const MTL::RenderPipelineState* pipeline, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateBySpecializationWithDescriptor_pipeline_error_), descriptor, pipeline, error); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newRenderPipelineStateBySpecialization(const MTL4::PipelineDescriptor* descriptor, const MTL::RenderPipelineState* pipeline, const MTL::NewRenderPipelineStateCompletionHandler completionHandler) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateBySpecializationWithDescriptor_pipeline_completionHandler_), descriptor, pipeline, completionHandler); +} + +_MTL_INLINE MTL4::CompilerTask* MTL4::Compiler::newRenderPipelineStateBySpecialization(const MTL4::PipelineDescriptor* pDescriptor, const MTL::RenderPipelineState* pPipeline, const MTL4::NewRenderPipelineStateCompletionHandlerFunction& function) +{ + __block MTL4::NewRenderPipelineStateCompletionHandlerFunction blockFunction = function; + return newRenderPipelineStateBySpecialization(pDescriptor, pPipeline, ^(MTL::RenderPipelineState* pPipelineRef, NS::Error* pError) { blockFunction(pPipelineRef, pError); }); +} + +_MTL_INLINE MTL4::PipelineDataSetSerializer* MTL4::Compiler::pipelineDataSetSerializer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pipelineDataSetSerializer)); +} diff --git a/vendor/metal-cpp/Metal/MTL4CompilerTask.hpp b/vendor/metal-cpp/Metal/MTL4CompilerTask.hpp new file mode 100644 index 000000000..a1ee9cdf5 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4CompilerTask.hpp @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4CompilerTask.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class Compiler; +_MTL_ENUM(NS::Integer, CompilerTaskStatus) { + CompilerTaskStatusNone = 0, + CompilerTaskStatusScheduled = 1, + CompilerTaskStatusCompiling = 2, + CompilerTaskStatusFinished = 3, +}; + +class CompilerTask : public NS::Referencing +{ +public: + Compiler* compiler() const; + + CompilerTaskStatus status() const; + + void waitUntilCompleted(); +}; + +} + +_MTL_INLINE MTL4::Compiler* MTL4::CompilerTask::compiler() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(compiler)); +} + +_MTL_INLINE MTL4::CompilerTaskStatus MTL4::CompilerTask::status() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(status)); +} + +_MTL_INLINE void MTL4::CompilerTask::waitUntilCompleted() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilCompleted)); +} diff --git a/vendor/metal-cpp/Metal/MTL4ComputeCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTL4ComputeCommandEncoder.hpp new file mode 100644 index 000000000..7ef19da26 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4ComputeCommandEncoder.hpp @@ -0,0 +1,300 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4ComputeCommandEncoder.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4CommandEncoder.hpp" +#include "MTL4Counters.hpp" +#include "MTLAccelerationStructure.hpp" +#include "MTLAccelerationStructureTypes.hpp" +#include "MTLBlitCommandEncoder.hpp" +#include "MTLCommandEncoder.hpp" +#include "MTLDefines.hpp" +#include "MTLGPUAddress.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" +#include + +namespace MTL4 +{ +class AccelerationStructureDescriptor; +class ArgumentTable; +class CounterHeap; +} + +namespace MTL +{ +class AccelerationStructure; +class Buffer; +class ComputePipelineState; +class IndirectCommandBuffer; +class Tensor; +class TensorExtents; +class Texture; +} + +namespace MTL4 +{ +class ComputeCommandEncoder : public NS::Referencing +{ +public: + void buildAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, const MTL4::AccelerationStructureDescriptor* descriptor, const MTL4::BufferRange scratchBuffer); + + void copyAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure); + + void copyAndCompactAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure); + + void copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger size); + void copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin, MTL::BlitOption options); + + void copyFromTensor(const MTL::Tensor* sourceTensor, const MTL::TensorExtents* sourceOrigin, const MTL::TensorExtents* sourceDimensions, const MTL::Tensor* destinationTensor, const MTL::TensorExtents* destinationOrigin, const MTL::TensorExtents* destinationDimensions); + + void copyFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, NS::UInteger sliceCount, NS::UInteger levelCount); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage, MTL::BlitOption options); + + void copyIndirectCommandBuffer(const MTL::IndirectCommandBuffer* source, NS::Range sourceRange, const MTL::IndirectCommandBuffer* destination, NS::UInteger destinationIndex); + + void dispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup); + void dispatchThreadgroups(MTL::GPUAddress indirectBuffer, MTL::Size threadsPerThreadgroup); + + void dispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup); + void dispatchThreads(MTL::GPUAddress indirectBuffer); + + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange); + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandbuffer, MTL::GPUAddress indirectRangeBuffer); + + void fillBuffer(const MTL::Buffer* buffer, NS::Range range, uint8_t value); + + void generateMipmaps(const MTL::Texture* texture); + + void optimizeContentsForCPUAccess(const MTL::Texture* texture); + void optimizeContentsForCPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level); + + void optimizeContentsForGPUAccess(const MTL::Texture* texture); + void optimizeContentsForGPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level); + + void optimizeIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range range); + + void refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL4::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL4::BufferRange scratchBuffer); + void refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL4::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL4::BufferRange scratchBuffer, MTL::AccelerationStructureRefitOptions options); + + void resetCommandsInBuffer(const MTL::IndirectCommandBuffer* buffer, NS::Range range); + + void setArgumentTable(const MTL4::ArgumentTable* argumentTable); + + void setComputePipelineState(const MTL::ComputePipelineState* state); + + void setImageblockWidth(NS::UInteger width, NS::UInteger height); + + void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); + + MTL::Stages stages(); + + void writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL4::BufferRange buffer); + + void writeTimestamp(MTL4::TimestampGranularity granularity, const MTL4::CounterHeap* counterHeap, NS::UInteger index); +}; + +} +_MTL_INLINE void MTL4::ComputeCommandEncoder::buildAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, const MTL4::AccelerationStructureDescriptor* descriptor, const MTL4::BufferRange scratchBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(buildAccelerationStructure_descriptor_scratchBuffer_), accelerationStructure, descriptor, scratchBuffer); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyAccelerationStructure_toAccelerationStructure_), sourceAccelerationStructure, destinationAccelerationStructure); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyAndCompactAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyAndCompactAccelerationStructure_toAccelerationStructure_), sourceAccelerationStructure, destinationAccelerationStructure); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger size) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromBuffer_sourceOffset_toBuffer_destinationOffset_size_), sourceBuffer, sourceOffset, destinationBuffer, destinationOffset, size); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceBuffer, sourceOffset, sourceBytesPerRow, sourceBytesPerImage, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin, MTL::BlitOption options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_options_), sourceBuffer, sourceOffset, sourceBytesPerRow, sourceBytesPerImage, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin, options); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromTensor(const MTL::Tensor* sourceTensor, const MTL::TensorExtents* sourceOrigin, const MTL::TensorExtents* sourceDimensions, const MTL::Tensor* destinationTensor, const MTL::TensorExtents* destinationOrigin, const MTL::TensorExtents* destinationDimensions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTensor_sourceOrigin_sourceDimensions_toTensor_destinationOrigin_destinationDimensions_), sourceTensor, sourceOrigin, sourceDimensions, destinationTensor, destinationOrigin, destinationDimensions); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_toTexture_), sourceTexture, destinationTexture); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, NS::UInteger sliceCount, NS::UInteger levelCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_toTexture_destinationSlice_destinationLevel_sliceCount_levelCount_), sourceTexture, sourceSlice, sourceLevel, destinationTexture, destinationSlice, destinationLevel, sliceCount, levelCount); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationBuffer, destinationOffset, destinationBytesPerRow, destinationBytesPerImage); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage, MTL::BlitOption options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_options_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationBuffer, destinationOffset, destinationBytesPerRow, destinationBytesPerImage, options); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::copyIndirectCommandBuffer(const MTL::IndirectCommandBuffer* source, NS::Range sourceRange, const MTL::IndirectCommandBuffer* destination, NS::UInteger destinationIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyIndirectCommandBuffer_sourceRange_destination_destinationIndex_), source, sourceRange, destination, destinationIndex); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::dispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadgroups_threadsPerThreadgroup_), threadgroupsPerGrid, threadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::dispatchThreadgroups(MTL::GPUAddress indirectBuffer, MTL::Size threadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadgroupsWithIndirectBuffer_threadsPerThreadgroup_), indirectBuffer, threadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::dispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreads_threadsPerThreadgroup_), threadsPerGrid, threadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::dispatchThreads(MTL::GPUAddress indirectBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadsWithIndirectBuffer_), indirectBuffer); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_withRange_), indirectCommandBuffer, executionRange); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandbuffer, MTL::GPUAddress indirectRangeBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_indirectBuffer_), indirectCommandbuffer, indirectRangeBuffer); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::fillBuffer(const MTL::Buffer* buffer, NS::Range range, uint8_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(fillBuffer_range_value_), buffer, range, value); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::generateMipmaps(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(generateMipmapsForTexture_), texture); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::optimizeContentsForCPUAccess(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForCPUAccess_), texture); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::optimizeContentsForCPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForCPUAccess_slice_level_), texture, slice, level); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::optimizeContentsForGPUAccess(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForGPUAccess_), texture); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::optimizeContentsForGPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForGPUAccess_slice_level_), texture, slice, level); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::optimizeIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeIndirectCommandBuffer_withRange_), indirectCommandBuffer, range); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL4::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL4::BufferRange scratchBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_), sourceAccelerationStructure, descriptor, destinationAccelerationStructure, scratchBuffer); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL4::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL4::BufferRange scratchBuffer, MTL::AccelerationStructureRefitOptions options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_options_), sourceAccelerationStructure, descriptor, destinationAccelerationStructure, scratchBuffer, options); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::resetCommandsInBuffer(const MTL::IndirectCommandBuffer* buffer, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(resetCommandsInBuffer_withRange_), buffer, range); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::setArgumentTable(const MTL4::ArgumentTable* argumentTable) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentTable_), argumentTable); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::setComputePipelineState(const MTL::ComputePipelineState* state) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_), state); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::setImageblockWidth(NS::UInteger width, NS::UInteger height) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockWidth_height_), width, height); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_atIndex_), length, index); +} + +_MTL_INLINE MTL::Stages MTL4::ComputeCommandEncoder::stages() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stages)); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL4::BufferRange buffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(writeCompactedAccelerationStructureSize_toBuffer_), accelerationStructure, buffer); +} + +_MTL_INLINE void MTL4::ComputeCommandEncoder::writeTimestamp(MTL4::TimestampGranularity granularity, const MTL4::CounterHeap* counterHeap, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(writeTimestampWithGranularity_intoHeap_atIndex_), granularity, counterHeap, index); +} diff --git a/vendor/metal-cpp/Metal/MTL4ComputePipeline.hpp b/vendor/metal-cpp/Metal/MTL4ComputePipeline.hpp new file mode 100644 index 000000000..a808431aa --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4ComputePipeline.hpp @@ -0,0 +1,158 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4ComputePipeline.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4PipelineState.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" + +namespace MTL4 +{ +class ComputePipelineDescriptor; +class FunctionDescriptor; +class StaticLinkingDescriptor; + +class ComputePipelineDescriptor : public NS::Copying +{ +public: + static ComputePipelineDescriptor* alloc(); + + FunctionDescriptor* computeFunctionDescriptor() const; + + ComputePipelineDescriptor* init(); + + NS::UInteger maxTotalThreadsPerThreadgroup() const; + + MTL::Size requiredThreadsPerThreadgroup() const; + + void reset(); + + void setComputeFunctionDescriptor(const MTL4::FunctionDescriptor* computeFunctionDescriptor); + + void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + + void setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup); + + void setStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* staticLinkingDescriptor); + + void setSupportBinaryLinking(bool supportBinaryLinking); + + void setSupportIndirectCommandBuffers(MTL4::IndirectCommandBufferSupportState supportIndirectCommandBuffers); + + void setThreadGroupSizeIsMultipleOfThreadExecutionWidth(bool threadGroupSizeIsMultipleOfThreadExecutionWidth); + + StaticLinkingDescriptor* staticLinkingDescriptor() const; + + bool supportBinaryLinking() const; + + IndirectCommandBufferSupportState supportIndirectCommandBuffers() const; + + bool threadGroupSizeIsMultipleOfThreadExecutionWidth() const; +}; + +} +_MTL_INLINE MTL4::ComputePipelineDescriptor* MTL4::ComputePipelineDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4ComputePipelineDescriptor)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::ComputePipelineDescriptor::computeFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeFunctionDescriptor)); +} + +_MTL_INLINE MTL4::ComputePipelineDescriptor* MTL4::ComputePipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL4::ComputePipelineDescriptor::maxTotalThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); +} + +_MTL_INLINE MTL::Size MTL4::ComputePipelineDescriptor::requiredThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup)); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setComputeFunctionDescriptor(const MTL4::FunctionDescriptor* computeFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputeFunctionDescriptor_), computeFunctionDescriptor); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerThreadgroup_), requiredThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* staticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStaticLinkingDescriptor_), staticLinkingDescriptor); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setSupportBinaryLinking(bool supportBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportBinaryLinking_), supportBinaryLinking); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setSupportIndirectCommandBuffers(MTL4::IndirectCommandBufferSupportState supportIndirectCommandBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); +} + +_MTL_INLINE void MTL4::ComputePipelineDescriptor::setThreadGroupSizeIsMultipleOfThreadExecutionWidth(bool threadGroupSizeIsMultipleOfThreadExecutionWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadGroupSizeIsMultipleOfThreadExecutionWidth_), threadGroupSizeIsMultipleOfThreadExecutionWidth); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::ComputePipelineDescriptor::staticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(staticLinkingDescriptor)); +} + +_MTL_INLINE bool MTL4::ComputePipelineDescriptor::supportBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportBinaryLinking)); +} + +_MTL_INLINE MTL4::IndirectCommandBufferSupportState MTL4::ComputePipelineDescriptor::supportIndirectCommandBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE bool MTL4::ComputePipelineDescriptor::threadGroupSizeIsMultipleOfThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadGroupSizeIsMultipleOfThreadExecutionWidth)); +} diff --git a/vendor/metal-cpp/Metal/MTL4Counters.hpp b/vendor/metal-cpp/Metal/MTL4Counters.hpp new file mode 100644 index 000000000..b507b766c --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4Counters.hpp @@ -0,0 +1,138 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4Counters.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include + +#include + +namespace MTL4 +{ +class CounterHeapDescriptor; +_MTL_ENUM(NS::Integer, CounterHeapType) { + CounterHeapTypeInvalid, + CounterHeapTypeTimestamp, +}; + +_MTL_ENUM(NS::Integer, TimestampGranularity) { + TimestampGranularityRelaxed = 0, + TimestampGranularityPrecise = 1, +}; + +struct TimestampHeapEntry +{ + uint64_t timestamp; +} _MTL_PACKED; + +class CounterHeapDescriptor : public NS::Copying +{ +public: + static CounterHeapDescriptor* alloc(); + + NS::UInteger count() const; + + CounterHeapDescriptor* init(); + + void setCount(NS::UInteger count); + + void setType(MTL4::CounterHeapType type); + CounterHeapType type() const; +}; +class CounterHeap : public NS::Referencing +{ +public: + NS::UInteger count() const; + void invalidateCounterRange(NS::Range range); + + NS::String* label() const; + + NS::Data* resolveCounterRange(NS::Range range); + + void setLabel(const NS::String* label); + + CounterHeapType type() const; +}; + +} + +_MTL_INLINE MTL4::CounterHeapDescriptor* MTL4::CounterHeapDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4CounterHeapDescriptor)); +} + +_MTL_INLINE NS::UInteger MTL4::CounterHeapDescriptor::count() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(count)); +} + +_MTL_INLINE MTL4::CounterHeapDescriptor* MTL4::CounterHeapDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::CounterHeapDescriptor::setCount(NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCount_), count); +} + +_MTL_INLINE void MTL4::CounterHeapDescriptor::setType(MTL4::CounterHeapType type) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setType_), type); +} + +_MTL_INLINE MTL4::CounterHeapType MTL4::CounterHeapDescriptor::type() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); +} + +_MTL_INLINE NS::UInteger MTL4::CounterHeap::count() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(count)); +} + +_MTL_INLINE void MTL4::CounterHeap::invalidateCounterRange(NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(invalidateCounterRange_), range); +} + +_MTL_INLINE NS::String* MTL4::CounterHeap::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::Data* MTL4::CounterHeap::resolveCounterRange(NS::Range range) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveCounterRange_), range); +} + +_MTL_INLINE void MTL4::CounterHeap::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE MTL4::CounterHeapType MTL4::CounterHeap::type() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); +} diff --git a/vendor/metal-cpp/Metal/MTL4FunctionDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4FunctionDescriptor.hpp new file mode 100644 index 000000000..9049677eb --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4FunctionDescriptor.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal//MTL4FunctionDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class FunctionDescriptor; + +class FunctionDescriptor : public NS::Copying +{ +public: + static FunctionDescriptor* alloc(); + + FunctionDescriptor* init(); +}; + +} +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::FunctionDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4FunctionDescriptor)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::FunctionDescriptor::init() +{ + return NS::Object::init(); +} diff --git a/vendor/metal-cpp/Metal/MTL4LibraryDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4LibraryDescriptor.hpp new file mode 100644 index 000000000..bc491b693 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4LibraryDescriptor.hpp @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4LibraryDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class LibraryDescriptor; +} + +namespace MTL +{ +class CompileOptions; +} + +namespace MTL4 +{ +class LibraryDescriptor : public NS::Copying +{ +public: + static LibraryDescriptor* alloc(); + + LibraryDescriptor* init(); + + NS::String* name() const; + + MTL::CompileOptions* options() const; + + void setName(const NS::String* name); + + void setOptions(const MTL::CompileOptions* options); + + void setSource(const NS::String* source); + NS::String* source() const; +}; + +} +_MTL_INLINE MTL4::LibraryDescriptor* MTL4::LibraryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4LibraryDescriptor)); +} + +_MTL_INLINE MTL4::LibraryDescriptor* MTL4::LibraryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL4::LibraryDescriptor::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE MTL::CompileOptions* MTL4::LibraryDescriptor::options() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); +} + +_MTL_INLINE void MTL4::LibraryDescriptor::setName(const NS::String* name) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); +} + +_MTL_INLINE void MTL4::LibraryDescriptor::setOptions(const MTL::CompileOptions* options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptions_), options); +} + +_MTL_INLINE void MTL4::LibraryDescriptor::setSource(const NS::String* source) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSource_), source); +} + +_MTL_INLINE NS::String* MTL4::LibraryDescriptor::source() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(source)); +} diff --git a/vendor/metal-cpp/Metal/MTL4LibraryFunctionDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4LibraryFunctionDescriptor.hpp new file mode 100644 index 000000000..1dec4bf28 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4LibraryFunctionDescriptor.hpp @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4LibraryFunctionDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4FunctionDescriptor.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class LibraryFunctionDescriptor; +} + +namespace MTL +{ +class Library; +} + +namespace MTL4 +{ +class LibraryFunctionDescriptor : public NS::Copying +{ +public: + static LibraryFunctionDescriptor* alloc(); + + LibraryFunctionDescriptor* init(); + + MTL::Library* library() const; + + NS::String* name() const; + + void setLibrary(const MTL::Library* library); + + void setName(const NS::String* name); +}; + +} +_MTL_INLINE MTL4::LibraryFunctionDescriptor* MTL4::LibraryFunctionDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4LibraryFunctionDescriptor)); +} + +_MTL_INLINE MTL4::LibraryFunctionDescriptor* MTL4::LibraryFunctionDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::Library* MTL4::LibraryFunctionDescriptor::library() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(library)); +} + +_MTL_INLINE NS::String* MTL4::LibraryFunctionDescriptor::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE void MTL4::LibraryFunctionDescriptor::setLibrary(const MTL::Library* library) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLibrary_), library); +} + +_MTL_INLINE void MTL4::LibraryFunctionDescriptor::setName(const NS::String* name) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); +} diff --git a/vendor/metal-cpp/Metal/MTL4LinkingDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4LinkingDescriptor.hpp new file mode 100644 index 000000000..ef5900b1f --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4LinkingDescriptor.hpp @@ -0,0 +1,204 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4LinkingDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class PipelineStageDynamicLinkingDescriptor; +class RenderPipelineDynamicLinkingDescriptor; +class StaticLinkingDescriptor; + +class StaticLinkingDescriptor : public NS::Copying +{ +public: + static StaticLinkingDescriptor* alloc(); + + NS::Array* functionDescriptors() const; + + NS::Dictionary* groups() const; + + StaticLinkingDescriptor* init(); + + NS::Array* privateFunctionDescriptors() const; + + void setFunctionDescriptors(const NS::Array* functionDescriptors); + + void setGroups(const NS::Dictionary* groups); + + void setPrivateFunctionDescriptors(const NS::Array* privateFunctionDescriptors); +}; +class PipelineStageDynamicLinkingDescriptor : public NS::Copying +{ +public: + static PipelineStageDynamicLinkingDescriptor* alloc(); + + NS::Array* binaryLinkedFunctions() const; + + PipelineStageDynamicLinkingDescriptor* init(); + + NS::UInteger maxCallStackDepth() const; + + NS::Array* preloadedLibraries() const; + + void setBinaryLinkedFunctions(const NS::Array* binaryLinkedFunctions); + + void setMaxCallStackDepth(NS::UInteger maxCallStackDepth); + + void setPreloadedLibraries(const NS::Array* preloadedLibraries); +}; +class RenderPipelineDynamicLinkingDescriptor : public NS::Copying +{ +public: + static RenderPipelineDynamicLinkingDescriptor* alloc(); + + PipelineStageDynamicLinkingDescriptor* fragmentLinkingDescriptor() const; + + RenderPipelineDynamicLinkingDescriptor* init(); + + PipelineStageDynamicLinkingDescriptor* meshLinkingDescriptor() const; + + PipelineStageDynamicLinkingDescriptor* objectLinkingDescriptor() const; + + PipelineStageDynamicLinkingDescriptor* tileLinkingDescriptor() const; + + PipelineStageDynamicLinkingDescriptor* vertexLinkingDescriptor() const; +}; + +} +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::StaticLinkingDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4StaticLinkingDescriptor)); +} + +_MTL_INLINE NS::Array* MTL4::StaticLinkingDescriptor::functionDescriptors() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionDescriptors)); +} + +_MTL_INLINE NS::Dictionary* MTL4::StaticLinkingDescriptor::groups() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(groups)); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::StaticLinkingDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::Array* MTL4::StaticLinkingDescriptor::privateFunctionDescriptors() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(privateFunctionDescriptors)); +} + +_MTL_INLINE void MTL4::StaticLinkingDescriptor::setFunctionDescriptors(const NS::Array* functionDescriptors) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionDescriptors_), functionDescriptors); +} + +_MTL_INLINE void MTL4::StaticLinkingDescriptor::setGroups(const NS::Dictionary* groups) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setGroups_), groups); +} + +_MTL_INLINE void MTL4::StaticLinkingDescriptor::setPrivateFunctionDescriptors(const NS::Array* privateFunctionDescriptors) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrivateFunctionDescriptors_), privateFunctionDescriptors); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::PipelineStageDynamicLinkingDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4PipelineStageDynamicLinkingDescriptor)); +} + +_MTL_INLINE NS::Array* MTL4::PipelineStageDynamicLinkingDescriptor::binaryLinkedFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryLinkedFunctions)); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::PipelineStageDynamicLinkingDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL4::PipelineStageDynamicLinkingDescriptor::maxCallStackDepth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCallStackDepth)); +} + +_MTL_INLINE NS::Array* MTL4::PipelineStageDynamicLinkingDescriptor::preloadedLibraries() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(preloadedLibraries)); +} + +_MTL_INLINE void MTL4::PipelineStageDynamicLinkingDescriptor::setBinaryLinkedFunctions(const NS::Array* binaryLinkedFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryLinkedFunctions_), binaryLinkedFunctions); +} + +_MTL_INLINE void MTL4::PipelineStageDynamicLinkingDescriptor::setMaxCallStackDepth(NS::UInteger maxCallStackDepth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCallStackDepth_), maxCallStackDepth); +} + +_MTL_INLINE void MTL4::PipelineStageDynamicLinkingDescriptor::setPreloadedLibraries(const NS::Array* preloadedLibraries) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreloadedLibraries_), preloadedLibraries); +} + +_MTL_INLINE MTL4::RenderPipelineDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4RenderPipelineDynamicLinkingDescriptor)); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::fragmentLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentLinkingDescriptor)); +} + +_MTL_INLINE MTL4::RenderPipelineDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::meshLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshLinkingDescriptor)); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::objectLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectLinkingDescriptor)); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::tileLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileLinkingDescriptor)); +} + +_MTL_INLINE MTL4::PipelineStageDynamicLinkingDescriptor* MTL4::RenderPipelineDynamicLinkingDescriptor::vertexLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexLinkingDescriptor)); +} diff --git a/vendor/metal-cpp/Metal/MTL4MachineLearningCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTL4MachineLearningCommandEncoder.hpp new file mode 100644 index 000000000..4d3cff66e --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4MachineLearningCommandEncoder.hpp @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4MachineLearningCommandEncoder.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4CommandEncoder.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class ArgumentTable; +class MachineLearningPipelineState; +} + +namespace MTL +{ +class Heap; +} + +namespace MTL4 +{ +class MachineLearningCommandEncoder : public NS::Referencing +{ +public: + void dispatchNetwork(const MTL::Heap* heap); + + void setArgumentTable(const MTL4::ArgumentTable* argumentTable); + + void setPipelineState(const MTL4::MachineLearningPipelineState* pipelineState); +}; + +} +_MTL_INLINE void MTL4::MachineLearningCommandEncoder::dispatchNetwork(const MTL::Heap* heap) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchNetworkWithIntermediatesHeap_), heap); +} + +_MTL_INLINE void MTL4::MachineLearningCommandEncoder::setArgumentTable(const MTL4::ArgumentTable* argumentTable) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentTable_), argumentTable); +} + +_MTL_INLINE void MTL4::MachineLearningCommandEncoder::setPipelineState(const MTL4::MachineLearningPipelineState* pipelineState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPipelineState_), pipelineState); +} diff --git a/vendor/metal-cpp/Metal/MTL4MachineLearningPipeline.hpp b/vendor/metal-cpp/Metal/MTL4MachineLearningPipeline.hpp new file mode 100644 index 000000000..713569f94 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4MachineLearningPipeline.hpp @@ -0,0 +1,172 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4MachineLearningPipeline.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4PipelineState.hpp" +#include "MTLAllocation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class FunctionDescriptor; +class MachineLearningPipelineDescriptor; +class MachineLearningPipelineReflection; +} + +namespace MTL +{ +class Device; +class TensorExtents; +} + +namespace MTL4 +{ +class MachineLearningPipelineDescriptor : public NS::Copying +{ +public: + static MachineLearningPipelineDescriptor* alloc(); + + MachineLearningPipelineDescriptor* init(); + + MTL::TensorExtents* inputDimensionsAtBufferIndex(NS::Integer bufferIndex); + + NS::String* label() const; + + FunctionDescriptor* machineLearningFunctionDescriptor() const; + + void reset(); + + void setInputDimensions(const MTL::TensorExtents* dimensions, NS::Integer bufferIndex); + void setInputDimensions(const NS::Array* dimensions, NS::Range range); + + void setLabel(const NS::String* label); + + void setMachineLearningFunctionDescriptor(const MTL4::FunctionDescriptor* machineLearningFunctionDescriptor); +}; +class MachineLearningPipelineReflection : public NS::Referencing +{ +public: + static MachineLearningPipelineReflection* alloc(); + + NS::Array* bindings() const; + + MachineLearningPipelineReflection* init(); +}; +class MachineLearningPipelineState : public NS::Referencing +{ +public: + MTL::Device* device() const; + + NS::UInteger intermediatesHeapSize() const; + + NS::String* label() const; + + MachineLearningPipelineReflection* reflection() const; +}; + +} +_MTL_INLINE MTL4::MachineLearningPipelineDescriptor* MTL4::MachineLearningPipelineDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4MachineLearningPipelineDescriptor)); +} + +_MTL_INLINE MTL4::MachineLearningPipelineDescriptor* MTL4::MachineLearningPipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::TensorExtents* MTL4::MachineLearningPipelineDescriptor::inputDimensionsAtBufferIndex(NS::Integer bufferIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inputDimensionsAtBufferIndex_), bufferIndex); +} + +_MTL_INLINE NS::String* MTL4::MachineLearningPipelineDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::MachineLearningPipelineDescriptor::machineLearningFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(machineLearningFunctionDescriptor)); +} + +_MTL_INLINE void MTL4::MachineLearningPipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::MachineLearningPipelineDescriptor::setInputDimensions(const MTL::TensorExtents* dimensions, NS::Integer bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInputDimensions_atBufferIndex_), dimensions, bufferIndex); +} + +_MTL_INLINE void MTL4::MachineLearningPipelineDescriptor::setInputDimensions(const NS::Array* dimensions, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInputDimensions_withRange_), dimensions, range); +} + +_MTL_INLINE void MTL4::MachineLearningPipelineDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::MachineLearningPipelineDescriptor::setMachineLearningFunctionDescriptor(const MTL4::FunctionDescriptor* machineLearningFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMachineLearningFunctionDescriptor_), machineLearningFunctionDescriptor); +} + +_MTL_INLINE MTL4::MachineLearningPipelineReflection* MTL4::MachineLearningPipelineReflection::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4MachineLearningPipelineReflection)); +} + +_MTL_INLINE NS::Array* MTL4::MachineLearningPipelineReflection::bindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bindings)); +} + +_MTL_INLINE MTL4::MachineLearningPipelineReflection* MTL4::MachineLearningPipelineReflection::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::Device* MTL4::MachineLearningPipelineState::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::UInteger MTL4::MachineLearningPipelineState::intermediatesHeapSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(intermediatesHeapSize)); +} + +_MTL_INLINE NS::String* MTL4::MachineLearningPipelineState::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::MachineLearningPipelineReflection* MTL4::MachineLearningPipelineState::reflection() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(reflection)); +} diff --git a/vendor/metal-cpp/Metal/MTL4MeshRenderPipeline.hpp b/vendor/metal-cpp/Metal/MTL4MeshRenderPipeline.hpp new file mode 100644 index 000000000..f66dffe2b --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4MeshRenderPipeline.hpp @@ -0,0 +1,413 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4MeshRenderPipeline.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4PipelineState.hpp" +#include "MTL4RenderPipeline.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" + +namespace MTL4 +{ +class FunctionDescriptor; +class MeshRenderPipelineDescriptor; +class RenderPipelineColorAttachmentDescriptorArray; +class StaticLinkingDescriptor; + +class MeshRenderPipelineDescriptor : public NS::Copying +{ +public: + static MeshRenderPipelineDescriptor* alloc(); + + AlphaToCoverageState alphaToCoverageState() const; + + AlphaToOneState alphaToOneState() const; + + LogicalToPhysicalColorAttachmentMappingState colorAttachmentMappingState() const; + + RenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; + + FunctionDescriptor* fragmentFunctionDescriptor() const; + + StaticLinkingDescriptor* fragmentStaticLinkingDescriptor() const; + + MeshRenderPipelineDescriptor* init(); + + bool isRasterizationEnabled() const; + + NS::UInteger maxTotalThreadgroupsPerMeshGrid() const; + + NS::UInteger maxTotalThreadsPerMeshThreadgroup() const; + + NS::UInteger maxTotalThreadsPerObjectThreadgroup() const; + + NS::UInteger maxVertexAmplificationCount() const; + + FunctionDescriptor* meshFunctionDescriptor() const; + + StaticLinkingDescriptor* meshStaticLinkingDescriptor() const; + + bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth() const; + + FunctionDescriptor* objectFunctionDescriptor() const; + + StaticLinkingDescriptor* objectStaticLinkingDescriptor() const; + + bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth() const; + + NS::UInteger payloadMemoryLength() const; + + NS::UInteger rasterSampleCount() const; + + [[deprecated("please use isRasterizationEnabled instead")]] + bool rasterizationEnabled() const; + + MTL::Size requiredThreadsPerMeshThreadgroup() const; + + MTL::Size requiredThreadsPerObjectThreadgroup() const; + + void reset(); + + void setAlphaToCoverageState(MTL4::AlphaToCoverageState alphaToCoverageState); + + void setAlphaToOneState(MTL4::AlphaToOneState alphaToOneState); + + void setColorAttachmentMappingState(MTL4::LogicalToPhysicalColorAttachmentMappingState colorAttachmentMappingState); + + void setFragmentFunctionDescriptor(const MTL4::FunctionDescriptor* fragmentFunctionDescriptor); + + void setFragmentStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* fragmentStaticLinkingDescriptor); + + void setMaxTotalThreadgroupsPerMeshGrid(NS::UInteger maxTotalThreadgroupsPerMeshGrid); + + void setMaxTotalThreadsPerMeshThreadgroup(NS::UInteger maxTotalThreadsPerMeshThreadgroup); + + void setMaxTotalThreadsPerObjectThreadgroup(NS::UInteger maxTotalThreadsPerObjectThreadgroup); + + void setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount); + + void setMeshFunctionDescriptor(const MTL4::FunctionDescriptor* meshFunctionDescriptor); + + void setMeshStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* meshStaticLinkingDescriptor); + + void setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth); + + void setObjectFunctionDescriptor(const MTL4::FunctionDescriptor* objectFunctionDescriptor); + + void setObjectStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* objectStaticLinkingDescriptor); + + void setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth); + + void setPayloadMemoryLength(NS::UInteger payloadMemoryLength); + + void setRasterSampleCount(NS::UInteger rasterSampleCount); + + void setRasterizationEnabled(bool rasterizationEnabled); + + void setRequiredThreadsPerMeshThreadgroup(MTL::Size requiredThreadsPerMeshThreadgroup); + + void setRequiredThreadsPerObjectThreadgroup(MTL::Size requiredThreadsPerObjectThreadgroup); + + void setSupportFragmentBinaryLinking(bool supportFragmentBinaryLinking); + + void setSupportIndirectCommandBuffers(MTL4::IndirectCommandBufferSupportState supportIndirectCommandBuffers); + + void setSupportMeshBinaryLinking(bool supportMeshBinaryLinking); + + void setSupportObjectBinaryLinking(bool supportObjectBinaryLinking); + + bool supportFragmentBinaryLinking() const; + + IndirectCommandBufferSupportState supportIndirectCommandBuffers() const; + + bool supportMeshBinaryLinking() const; + + bool supportObjectBinaryLinking() const; +}; + +} +_MTL_INLINE MTL4::MeshRenderPipelineDescriptor* MTL4::MeshRenderPipelineDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4MeshRenderPipelineDescriptor)); +} + +_MTL_INLINE MTL4::AlphaToCoverageState MTL4::MeshRenderPipelineDescriptor::alphaToCoverageState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaToCoverageState)); +} + +_MTL_INLINE MTL4::AlphaToOneState MTL4::MeshRenderPipelineDescriptor::alphaToOneState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaToOneState)); +} + +_MTL_INLINE MTL4::LogicalToPhysicalColorAttachmentMappingState MTL4::MeshRenderPipelineDescriptor::colorAttachmentMappingState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachmentMappingState)); +} + +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptorArray* MTL4::MeshRenderPipelineDescriptor::colorAttachments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::MeshRenderPipelineDescriptor::fragmentFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentFunctionDescriptor)); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::MeshRenderPipelineDescriptor::fragmentStaticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentStaticLinkingDescriptor)); +} + +_MTL_INLINE MTL4::MeshRenderPipelineDescriptor* MTL4::MeshRenderPipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::isRasterizationEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); +} + +_MTL_INLINE NS::UInteger MTL4::MeshRenderPipelineDescriptor::maxTotalThreadgroupsPerMeshGrid() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadgroupsPerMeshGrid)); +} + +_MTL_INLINE NS::UInteger MTL4::MeshRenderPipelineDescriptor::maxTotalThreadsPerMeshThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerMeshThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL4::MeshRenderPipelineDescriptor::maxTotalThreadsPerObjectThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerObjectThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL4::MeshRenderPipelineDescriptor::maxVertexAmplificationCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexAmplificationCount)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::MeshRenderPipelineDescriptor::meshFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshFunctionDescriptor)); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::MeshRenderPipelineDescriptor::meshStaticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshStaticLinkingDescriptor)); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::meshThreadgroupSizeIsMultipleOfThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::MeshRenderPipelineDescriptor::objectFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectFunctionDescriptor)); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::MeshRenderPipelineDescriptor::objectStaticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectStaticLinkingDescriptor)); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::objectThreadgroupSizeIsMultipleOfThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth)); +} + +_MTL_INLINE NS::UInteger MTL4::MeshRenderPipelineDescriptor::payloadMemoryLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(payloadMemoryLength)); +} + +_MTL_INLINE NS::UInteger MTL4::MeshRenderPipelineDescriptor::rasterSampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::rasterizationEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); +} + +_MTL_INLINE MTL::Size MTL4::MeshRenderPipelineDescriptor::requiredThreadsPerMeshThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerMeshThreadgroup)); +} + +_MTL_INLINE MTL::Size MTL4::MeshRenderPipelineDescriptor::requiredThreadsPerObjectThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerObjectThreadgroup)); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setAlphaToCoverageState(MTL4::AlphaToCoverageState alphaToCoverageState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToCoverageState_), alphaToCoverageState); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setAlphaToOneState(MTL4::AlphaToOneState alphaToOneState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToOneState_), alphaToOneState); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setColorAttachmentMappingState(MTL4::LogicalToPhysicalColorAttachmentMappingState colorAttachmentMappingState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorAttachmentMappingState_), colorAttachmentMappingState); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setFragmentFunctionDescriptor(const MTL4::FunctionDescriptor* fragmentFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentFunctionDescriptor_), fragmentFunctionDescriptor); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setFragmentStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* fragmentStaticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentStaticLinkingDescriptor_), fragmentStaticLinkingDescriptor); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMaxTotalThreadgroupsPerMeshGrid(NS::UInteger maxTotalThreadgroupsPerMeshGrid) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadgroupsPerMeshGrid_), maxTotalThreadgroupsPerMeshGrid); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMaxTotalThreadsPerMeshThreadgroup(NS::UInteger maxTotalThreadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerMeshThreadgroup_), maxTotalThreadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMaxTotalThreadsPerObjectThreadgroup(NS::UInteger maxTotalThreadsPerObjectThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerObjectThreadgroup_), maxTotalThreadsPerObjectThreadgroup); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexAmplificationCount_), maxVertexAmplificationCount); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMeshFunctionDescriptor(const MTL4::FunctionDescriptor* meshFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshFunctionDescriptor_), meshFunctionDescriptor); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMeshStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* meshStaticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshStaticLinkingDescriptor_), meshStaticLinkingDescriptor); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth_), meshThreadgroupSizeIsMultipleOfThreadExecutionWidth); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setObjectFunctionDescriptor(const MTL4::FunctionDescriptor* objectFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectFunctionDescriptor_), objectFunctionDescriptor); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setObjectStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* objectStaticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectStaticLinkingDescriptor_), objectStaticLinkingDescriptor); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth_), objectThreadgroupSizeIsMultipleOfThreadExecutionWidth); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setPayloadMemoryLength(NS::UInteger payloadMemoryLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPayloadMemoryLength_), payloadMemoryLength); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setRasterizationEnabled(bool rasterizationEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationEnabled_), rasterizationEnabled); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setRequiredThreadsPerMeshThreadgroup(MTL::Size requiredThreadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerMeshThreadgroup_), requiredThreadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setRequiredThreadsPerObjectThreadgroup(MTL::Size requiredThreadsPerObjectThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerObjectThreadgroup_), requiredThreadsPerObjectThreadgroup); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setSupportFragmentBinaryLinking(bool supportFragmentBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportFragmentBinaryLinking_), supportFragmentBinaryLinking); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setSupportIndirectCommandBuffers(MTL4::IndirectCommandBufferSupportState supportIndirectCommandBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setSupportMeshBinaryLinking(bool supportMeshBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportMeshBinaryLinking_), supportMeshBinaryLinking); +} + +_MTL_INLINE void MTL4::MeshRenderPipelineDescriptor::setSupportObjectBinaryLinking(bool supportObjectBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportObjectBinaryLinking_), supportObjectBinaryLinking); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::supportFragmentBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportFragmentBinaryLinking)); +} + +_MTL_INLINE MTL4::IndirectCommandBufferSupportState MTL4::MeshRenderPipelineDescriptor::supportIndirectCommandBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::supportMeshBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportMeshBinaryLinking)); +} + +_MTL_INLINE bool MTL4::MeshRenderPipelineDescriptor::supportObjectBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportObjectBinaryLinking)); +} diff --git a/vendor/metal-cpp/Metal/MTL4PipelineDataSetSerializer.hpp b/vendor/metal-cpp/Metal/MTL4PipelineDataSetSerializer.hpp new file mode 100644 index 000000000..9dbd6103a --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4PipelineDataSetSerializer.hpp @@ -0,0 +1,85 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4PipelineDataSetSerializer.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class PipelineDataSetSerializerDescriptor; + +_MTL_OPTIONS(NS::UInteger, PipelineDataSetSerializerConfiguration) { + PipelineDataSetSerializerConfigurationCaptureDescriptors = 1, + PipelineDataSetSerializerConfigurationCaptureBinaries = 1 << 1, +}; + +class PipelineDataSetSerializerDescriptor : public NS::Copying +{ +public: + static PipelineDataSetSerializerDescriptor* alloc(); + + PipelineDataSetSerializerConfiguration configuration() const; + + PipelineDataSetSerializerDescriptor* init(); + + void setConfiguration(MTL4::PipelineDataSetSerializerConfiguration configuration); +}; +class PipelineDataSetSerializer : public NS::Referencing +{ +public: + bool serializeAsArchiveAndFlushToURL(const NS::URL* url, NS::Error** error); + + NS::Data* serializeAsPipelinesScript(NS::Error** error); +}; + +} +_MTL_INLINE MTL4::PipelineDataSetSerializerDescriptor* MTL4::PipelineDataSetSerializerDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4PipelineDataSetSerializerDescriptor)); +} + +_MTL_INLINE MTL4::PipelineDataSetSerializerConfiguration MTL4::PipelineDataSetSerializerDescriptor::configuration() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(configuration)); +} + +_MTL_INLINE MTL4::PipelineDataSetSerializerDescriptor* MTL4::PipelineDataSetSerializerDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::PipelineDataSetSerializerDescriptor::setConfiguration(MTL4::PipelineDataSetSerializerConfiguration configuration) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setConfiguration_), configuration); +} + +_MTL_INLINE bool MTL4::PipelineDataSetSerializer::serializeAsArchiveAndFlushToURL(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(serializeAsArchiveAndFlushToURL_error_), url, error); +} + +_MTL_INLINE NS::Data* MTL4::PipelineDataSetSerializer::serializeAsPipelinesScript(NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(serializeAsPipelinesScriptWithError_), error); +} diff --git a/vendor/metal-cpp/Metal/MTL4PipelineState.hpp b/vendor/metal-cpp/Metal/MTL4PipelineState.hpp new file mode 100644 index 000000000..cecefa8a1 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4PipelineState.hpp @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4PipelineState.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPipeline.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class PipelineDescriptor; +class PipelineOptions; +_MTL_ENUM(NS::Integer, AlphaToOneState) { + AlphaToOneStateDisabled = 0, + AlphaToOneStateEnabled = 1, +}; + +_MTL_ENUM(NS::Integer, AlphaToCoverageState) { + AlphaToCoverageStateDisabled = 0, + AlphaToCoverageStateEnabled = 1, +}; + +_MTL_ENUM(NS::Integer, BlendState) { + BlendStateDisabled = 0, + BlendStateEnabled = 1, + BlendStateUnspecialized = 2, +}; + +_MTL_ENUM(NS::Integer, IndirectCommandBufferSupportState) { + IndirectCommandBufferSupportStateDisabled = 0, + IndirectCommandBufferSupportStateEnabled = 1, +}; + +_MTL_OPTIONS(NS::UInteger, ShaderReflection) { + ShaderReflectionNone = 0, + ShaderReflectionBindingInfo = 1, + ShaderReflectionBufferTypeInfo = 1 << 1, +}; + +class PipelineOptions : public NS::Copying +{ +public: + static PipelineOptions* alloc(); + + PipelineOptions* init(); + + void setShaderReflection(MTL4::ShaderReflection shaderReflection); + + void setShaderValidation(MTL::ShaderValidation shaderValidation); + + ShaderReflection shaderReflection() const; + + MTL::ShaderValidation shaderValidation() const; +}; +class PipelineDescriptor : public NS::Copying +{ +public: + static PipelineDescriptor* alloc(); + + PipelineDescriptor* init(); + + NS::String* label() const; + + PipelineOptions* options() const; + + void setLabel(const NS::String* label); + + void setOptions(const MTL4::PipelineOptions* options); +}; + +} +_MTL_INLINE MTL4::PipelineOptions* MTL4::PipelineOptions::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4PipelineOptions)); +} + +_MTL_INLINE MTL4::PipelineOptions* MTL4::PipelineOptions::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::PipelineOptions::setShaderReflection(MTL4::ShaderReflection shaderReflection) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setShaderReflection_), shaderReflection); +} + +_MTL_INLINE void MTL4::PipelineOptions::setShaderValidation(MTL::ShaderValidation shaderValidation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setShaderValidation_), shaderValidation); +} + +_MTL_INLINE MTL4::ShaderReflection MTL4::PipelineOptions::shaderReflection() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderReflection)); +} + +_MTL_INLINE MTL::ShaderValidation MTL4::PipelineOptions::shaderValidation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE MTL4::PipelineDescriptor* MTL4::PipelineDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4PipelineDescriptor)); +} + +_MTL_INLINE MTL4::PipelineDescriptor* MTL4::PipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL4::PipelineDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL4::PipelineOptions* MTL4::PipelineDescriptor::options() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); +} + +_MTL_INLINE void MTL4::PipelineDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL4::PipelineDescriptor::setOptions(const MTL4::PipelineOptions* options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptions_), options); +} diff --git a/vendor/metal-cpp/Metal/MTL4RenderCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTL4RenderCommandEncoder.hpp new file mode 100644 index 000000000..0dd01f4d3 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4RenderCommandEncoder.hpp @@ -0,0 +1,340 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4RenderCommandEncoder.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4CommandEncoder.hpp" +#include "MTL4Counters.hpp" +#include "MTLArgument.hpp" +#include "MTLDefines.hpp" +#include "MTLGPUAddress.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLRenderCommandEncoder.hpp" +#include "MTLRenderPass.hpp" +#include "MTLTypes.hpp" +#include + +namespace MTL4 +{ +class ArgumentTable; +class CounterHeap; +} + +namespace MTL +{ +class DepthStencilState; +class IndirectCommandBuffer; +class LogicalToPhysicalColorAttachmentMap; +class RenderPipelineState; +struct ScissorRect; +struct VertexAmplificationViewMapping; +struct Viewport; + +} +namespace MTL4 +{ +_MTL_OPTIONS(NS::UInteger, RenderEncoderOptions) { + RenderEncoderOptionNone = 0, + RenderEncoderOptionSuspending = 1, + RenderEncoderOptionResuming = 1 << 1, +}; + +class RenderCommandEncoder : public NS::Referencing +{ +public: + void dispatchThreadsPerTile(MTL::Size threadsPerTile); + + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength, NS::UInteger instanceCount); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength, MTL::GPUAddress indirectBuffer); + + void drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); + void drawMeshThreadgroups(MTL::GPUAddress indirectBuffer, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); + + void drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); + + void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount); + void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount); + void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance); + void drawPrimitives(MTL::PrimitiveType primitiveType, MTL::GPUAddress indirectBuffer); + + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange); + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, MTL::GPUAddress indirectRangeBuffer); + + void setArgumentTable(const MTL4::ArgumentTable* argumentTable, MTL::RenderStages stages); + + void setBlendColor(float red, float green, float blue, float alpha); + + void setColorAttachmentMap(const MTL::LogicalToPhysicalColorAttachmentMap* mapping); + + void setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex); + + void setCullMode(MTL::CullMode cullMode); + + void setDepthBias(float depthBias, float slopeScale, float clamp); + + void setDepthClipMode(MTL::DepthClipMode depthClipMode); + + void setDepthStencilState(const MTL::DepthStencilState* depthStencilState); + + void setDepthStoreAction(MTL::StoreAction storeAction); + + void setDepthTestBounds(float minBound, float maxBound); + + void setFrontFacingWinding(MTL::Winding frontFacingWinding); + + void setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); + + void setRenderPipelineState(const MTL::RenderPipelineState* pipelineState); + + void setScissorRect(MTL::ScissorRect rect); + void setScissorRects(const MTL::ScissorRect* scissorRects, NS::UInteger count); + + void setStencilReferenceValue(uint32_t referenceValue); + void setStencilReferenceValues(uint32_t frontReferenceValue, uint32_t backReferenceValue); + + void setStencilStoreAction(MTL::StoreAction storeAction); + + void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger offset, NS::UInteger index); + + void setTriangleFillMode(MTL::TriangleFillMode fillMode); + + void setVertexAmplificationCount(NS::UInteger count, const MTL::VertexAmplificationViewMapping* viewMappings); + + void setViewport(MTL::Viewport viewport); + void setViewports(const MTL::Viewport* viewports, NS::UInteger count); + + void setVisibilityResultMode(MTL::VisibilityResultMode mode, NS::UInteger offset); + + NS::UInteger tileHeight() const; + + NS::UInteger tileWidth() const; + + void writeTimestamp(MTL4::TimestampGranularity granularity, MTL::RenderStages stage, const MTL4::CounterHeap* counterHeap, NS::UInteger index); +}; + +} +_MTL_INLINE void MTL4::RenderCommandEncoder::dispatchThreadsPerTile(MTL::Size threadsPerTile) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadsPerTile_), threadsPerTile); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferLength_), primitiveType, indexCount, indexType, indexBuffer, indexBufferLength); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength, NS::UInteger instanceCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferLength_instanceCount_), primitiveType, indexCount, indexType, indexBuffer, indexBufferLength, instanceCount); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferLength_instanceCount_baseVertex_baseInstance_), primitiveType, indexCount, indexType, indexBuffer, indexBufferLength, instanceCount, baseVertex, baseInstance); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, MTL::IndexType indexType, MTL::GPUAddress indexBuffer, NS::UInteger indexBufferLength, MTL::GPUAddress indirectBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexType_indexBuffer_indexBufferLength_indirectBuffer_), primitiveType, indexType, indexBuffer, indexBufferLength, indirectBuffer); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroups_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadgroupsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawMeshThreadgroups(MTL::GPUAddress indirectBuffer, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroupsWithIndirectBuffer_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), indirectBuffer, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreads_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_), primitiveType, vertexStart, vertexCount); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_), primitiveType, vertexStart, vertexCount, instanceCount); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_baseInstance_), primitiveType, vertexStart, vertexCount, instanceCount, baseInstance); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, MTL::GPUAddress indirectBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_indirectBuffer_), primitiveType, indirectBuffer); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_withRange_), indirectCommandBuffer, executionRange); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, MTL::GPUAddress indirectRangeBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_indirectBuffer_), indirectCommandBuffer, indirectRangeBuffer); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setArgumentTable(const MTL4::ArgumentTable* argumentTable, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentTable_atStages_), argumentTable, stages); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setBlendColor(float red, float green, float blue, float alpha) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBlendColorRed_green_blue_alpha_), red, green, blue, alpha); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setColorAttachmentMap(const MTL::LogicalToPhysicalColorAttachmentMap* mapping) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorAttachmentMap_), mapping); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreAction_atIndex_), storeAction, colorAttachmentIndex); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setCullMode(MTL::CullMode cullMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCullMode_), cullMode); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setDepthBias(float depthBias, float slopeScale, float clamp) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthBias_slopeScale_clamp_), depthBias, slopeScale, clamp); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setDepthClipMode(MTL::DepthClipMode depthClipMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthClipMode_), depthClipMode); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setDepthStencilState(const MTL::DepthStencilState* depthStencilState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilState_), depthStencilState); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setDepthStoreAction(MTL::StoreAction storeAction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreAction_), storeAction); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setDepthTestBounds(float minBound, float maxBound) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthTestMinBound_maxBound_), minBound, maxBound); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setFrontFacingWinding(MTL::Winding frontFacingWinding) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFrontFacingWinding_), frontFacingWinding); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupMemoryLength_atIndex_), length, index); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setRenderPipelineState(const MTL::RenderPipelineState* pipelineState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineState_), pipelineState); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setScissorRect(MTL::ScissorRect rect) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setScissorRect_), rect); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setScissorRects(const MTL::ScissorRect* scissorRects, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setScissorRects_count_), scissorRects, count); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setStencilReferenceValue(uint32_t referenceValue) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilReferenceValue_), referenceValue); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setStencilReferenceValues(uint32_t frontReferenceValue, uint32_t backReferenceValue) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilFrontReferenceValue_backReferenceValue_), frontReferenceValue, backReferenceValue); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setStencilStoreAction(MTL::StoreAction storeAction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreAction_), storeAction); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_offset_atIndex_), length, offset, index); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setTriangleFillMode(MTL::TriangleFillMode fillMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleFillMode_), fillMode); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setVertexAmplificationCount(NS::UInteger count, const MTL::VertexAmplificationViewMapping* viewMappings) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAmplificationCount_viewMappings_), count, viewMappings); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setViewport(MTL::Viewport viewport) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setViewport_), viewport); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setViewports(const MTL::Viewport* viewports, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setViewports_count_), viewports, count); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::setVisibilityResultMode(MTL::VisibilityResultMode mode, NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultMode_offset_), mode, offset); +} + +_MTL_INLINE NS::UInteger MTL4::RenderCommandEncoder::tileHeight() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileHeight)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderCommandEncoder::tileWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileWidth)); +} + +_MTL_INLINE void MTL4::RenderCommandEncoder::writeTimestamp(MTL4::TimestampGranularity granularity, MTL::RenderStages stage, const MTL4::CounterHeap* counterHeap, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(writeTimestampWithGranularity_afterStage_intoHeap_atIndex_), granularity, stage, counterHeap, index); +} diff --git a/vendor/metal-cpp/Metal/MTL4RenderPass.hpp b/vendor/metal-cpp/Metal/MTL4RenderPass.hpp new file mode 100644 index 000000000..c5aa9ed61 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4RenderPass.hpp @@ -0,0 +1,280 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4RenderPass.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLRenderPass.hpp" + +namespace MTL4 +{ +class RenderPassDescriptor; +} + +namespace MTL +{ +class Buffer; +class RasterizationRateMap; +class RenderPassColorAttachmentDescriptorArray; +class RenderPassDepthAttachmentDescriptor; +class RenderPassStencilAttachmentDescriptor; +struct SamplePosition; +} + +namespace MTL4 +{ +class RenderPassDescriptor : public NS::Copying +{ +public: + static RenderPassDescriptor* alloc(); + + MTL::RenderPassColorAttachmentDescriptorArray* colorAttachments() const; + + NS::UInteger defaultRasterSampleCount() const; + + MTL::RenderPassDepthAttachmentDescriptor* depthAttachment() const; + + NS::UInteger getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count); + + NS::UInteger imageblockSampleLength() const; + + RenderPassDescriptor* init(); + + MTL::RasterizationRateMap* rasterizationRateMap() const; + + NS::UInteger renderTargetArrayLength() const; + + NS::UInteger renderTargetHeight() const; + + NS::UInteger renderTargetWidth() const; + + void setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount); + + void setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment); + + void setImageblockSampleLength(NS::UInteger imageblockSampleLength); + + void setRasterizationRateMap(const MTL::RasterizationRateMap* rasterizationRateMap); + + void setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength); + + void setRenderTargetHeight(NS::UInteger renderTargetHeight); + + void setRenderTargetWidth(NS::UInteger renderTargetWidth); + + void setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count); + + void setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment); + + void setSupportColorAttachmentMapping(bool supportColorAttachmentMapping); + + void setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength); + + void setTileHeight(NS::UInteger tileHeight); + + void setTileWidth(NS::UInteger tileWidth); + + void setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer); + + void setVisibilityResultType(MTL::VisibilityResultType visibilityResultType); + + MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment() const; + + bool supportColorAttachmentMapping() const; + + NS::UInteger threadgroupMemoryLength() const; + + NS::UInteger tileHeight() const; + + NS::UInteger tileWidth() const; + + MTL::Buffer* visibilityResultBuffer() const; + + MTL::VisibilityResultType visibilityResultType() const; +}; + +} +_MTL_INLINE MTL4::RenderPassDescriptor* MTL4::RenderPassDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4RenderPassDescriptor)); +} + +_MTL_INLINE MTL::RenderPassColorAttachmentDescriptorArray* MTL4::RenderPassDescriptor::colorAttachments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::defaultRasterSampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(defaultRasterSampleCount)); +} + +_MTL_INLINE MTL::RenderPassDepthAttachmentDescriptor* MTL4::RenderPassDescriptor::depthAttachment() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthAttachment)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(getSamplePositions_count_), positions, count); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::imageblockSampleLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockSampleLength)); +} + +_MTL_INLINE MTL4::RenderPassDescriptor* MTL4::RenderPassDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::RasterizationRateMap* MTL4::RenderPassDescriptor::rasterizationRateMap() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterizationRateMap)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::renderTargetArrayLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetArrayLength)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::renderTargetHeight() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetHeight)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::renderTargetWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetWidth)); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDefaultRasterSampleCount_), defaultRasterSampleCount); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthAttachment_), depthAttachment); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setImageblockSampleLength(NS::UInteger imageblockSampleLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockSampleLength_), imageblockSampleLength); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setRasterizationRateMap(const MTL::RasterizationRateMap* rasterizationRateMap) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationRateMap_), rasterizationRateMap); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetArrayLength_), renderTargetArrayLength); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setRenderTargetHeight(NS::UInteger renderTargetHeight) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetHeight_), renderTargetHeight); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setRenderTargetWidth(NS::UInteger renderTargetWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetWidth_), renderTargetWidth); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplePositions_count_), positions, count); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilAttachment_), stencilAttachment); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setSupportColorAttachmentMapping(bool supportColorAttachmentMapping) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportColorAttachmentMapping_), supportColorAttachmentMapping); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_), threadgroupMemoryLength); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setTileHeight(NS::UInteger tileHeight) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileHeight_), tileHeight); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setTileWidth(NS::UInteger tileWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileWidth_), tileWidth); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultBuffer_), visibilityResultBuffer); +} + +_MTL_INLINE void MTL4::RenderPassDescriptor::setVisibilityResultType(MTL::VisibilityResultType visibilityResultType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultType_), visibilityResultType); +} + +_MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL4::RenderPassDescriptor::stencilAttachment() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachment)); +} + +_MTL_INLINE bool MTL4::RenderPassDescriptor::supportColorAttachmentMapping() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportColorAttachmentMapping)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::threadgroupMemoryLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryLength)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::tileHeight() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileHeight)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::tileWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileWidth)); +} + +_MTL_INLINE MTL::Buffer* MTL4::RenderPassDescriptor::visibilityResultBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(visibilityResultBuffer)); +} + +_MTL_INLINE MTL::VisibilityResultType MTL4::RenderPassDescriptor::visibilityResultType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(visibilityResultType)); +} diff --git a/vendor/metal-cpp/Metal/MTL4RenderPipeline.hpp b/vendor/metal-cpp/Metal/MTL4RenderPipeline.hpp new file mode 100644 index 000000000..fc2e5e6f6 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4RenderPipeline.hpp @@ -0,0 +1,587 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4RenderPipeline.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4PipelineState.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPixelFormat.hpp" +#include "MTLPrivate.hpp" +#include "MTLRenderPipeline.hpp" + +namespace MTL4 +{ +class FunctionDescriptor; +class RenderPipelineBinaryFunctionsDescriptor; +class RenderPipelineColorAttachmentDescriptor; +class RenderPipelineColorAttachmentDescriptorArray; +class RenderPipelineDescriptor; +class StaticLinkingDescriptor; +} + +namespace MTL +{ +class VertexDescriptor; +} + +namespace MTL4 +{ +_MTL_ENUM(NS::Integer, LogicalToPhysicalColorAttachmentMappingState) { + LogicalToPhysicalColorAttachmentMappingStateIdentity = 0, + LogicalToPhysicalColorAttachmentMappingStateInherited = 1, +}; + +class RenderPipelineColorAttachmentDescriptor : public NS::Copying +{ +public: + static RenderPipelineColorAttachmentDescriptor* alloc(); + + MTL::BlendOperation alphaBlendOperation() const; + + BlendState blendingState() const; + + MTL::BlendFactor destinationAlphaBlendFactor() const; + + MTL::BlendFactor destinationRGBBlendFactor() const; + + RenderPipelineColorAttachmentDescriptor* init(); + + MTL::PixelFormat pixelFormat() const; + + void reset(); + + MTL::BlendOperation rgbBlendOperation() const; + + void setAlphaBlendOperation(MTL::BlendOperation alphaBlendOperation); + + void setBlendingState(MTL4::BlendState blendingState); + + void setDestinationAlphaBlendFactor(MTL::BlendFactor destinationAlphaBlendFactor); + + void setDestinationRGBBlendFactor(MTL::BlendFactor destinationRGBBlendFactor); + + void setPixelFormat(MTL::PixelFormat pixelFormat); + + void setRgbBlendOperation(MTL::BlendOperation rgbBlendOperation); + + void setSourceAlphaBlendFactor(MTL::BlendFactor sourceAlphaBlendFactor); + + void setSourceRGBBlendFactor(MTL::BlendFactor sourceRGBBlendFactor); + + void setWriteMask(MTL::ColorWriteMask writeMask); + + MTL::BlendFactor sourceAlphaBlendFactor() const; + + MTL::BlendFactor sourceRGBBlendFactor() const; + + MTL::ColorWriteMask writeMask() const; +}; + +class RenderPipelineColorAttachmentDescriptorArray : public NS::Copying +{ +public: + static RenderPipelineColorAttachmentDescriptorArray* alloc(); + + RenderPipelineColorAttachmentDescriptorArray* init(); + + RenderPipelineColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); + + void reset(); + + void setObject(const MTL4::RenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); +}; + +class RenderPipelineBinaryFunctionsDescriptor : public NS::Copying +{ +public: + static RenderPipelineBinaryFunctionsDescriptor* alloc(); + + NS::Array* fragmentAdditionalBinaryFunctions() const; + + RenderPipelineBinaryFunctionsDescriptor* init(); + + NS::Array* meshAdditionalBinaryFunctions() const; + + NS::Array* objectAdditionalBinaryFunctions() const; + + void reset(); + + void setFragmentAdditionalBinaryFunctions(const NS::Array* fragmentAdditionalBinaryFunctions); + + void setMeshAdditionalBinaryFunctions(const NS::Array* meshAdditionalBinaryFunctions); + + void setObjectAdditionalBinaryFunctions(const NS::Array* objectAdditionalBinaryFunctions); + + void setTileAdditionalBinaryFunctions(const NS::Array* tileAdditionalBinaryFunctions); + + void setVertexAdditionalBinaryFunctions(const NS::Array* vertexAdditionalBinaryFunctions); + + NS::Array* tileAdditionalBinaryFunctions() const; + + NS::Array* vertexAdditionalBinaryFunctions() const; +}; + +class RenderPipelineDescriptor : public NS::Copying +{ +public: + static RenderPipelineDescriptor* alloc(); + + AlphaToCoverageState alphaToCoverageState() const; + + AlphaToOneState alphaToOneState() const; + + LogicalToPhysicalColorAttachmentMappingState colorAttachmentMappingState() const; + + RenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; + + FunctionDescriptor* fragmentFunctionDescriptor() const; + + StaticLinkingDescriptor* fragmentStaticLinkingDescriptor() const; + + RenderPipelineDescriptor* init(); + + MTL::PrimitiveTopologyClass inputPrimitiveTopology() const; + + bool isRasterizationEnabled() const; + + NS::UInteger maxVertexAmplificationCount() const; + + NS::UInteger rasterSampleCount() const; + + [[deprecated("please use isRasterizationEnabled instead")]] + bool rasterizationEnabled() const; + + void reset(); + + void setAlphaToCoverageState(MTL4::AlphaToCoverageState alphaToCoverageState); + + void setAlphaToOneState(MTL4::AlphaToOneState alphaToOneState); + + void setColorAttachmentMappingState(MTL4::LogicalToPhysicalColorAttachmentMappingState colorAttachmentMappingState); + + void setFragmentFunctionDescriptor(const MTL4::FunctionDescriptor* fragmentFunctionDescriptor); + + void setFragmentStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* fragmentStaticLinkingDescriptor); + + void setInputPrimitiveTopology(MTL::PrimitiveTopologyClass inputPrimitiveTopology); + + void setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount); + + void setRasterSampleCount(NS::UInteger rasterSampleCount); + + void setRasterizationEnabled(bool rasterizationEnabled); + + void setSupportFragmentBinaryLinking(bool supportFragmentBinaryLinking); + + void setSupportIndirectCommandBuffers(MTL4::IndirectCommandBufferSupportState supportIndirectCommandBuffers); + + void setSupportVertexBinaryLinking(bool supportVertexBinaryLinking); + + void setVertexDescriptor(const MTL::VertexDescriptor* vertexDescriptor); + + void setVertexFunctionDescriptor(const MTL4::FunctionDescriptor* vertexFunctionDescriptor); + + void setVertexStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* vertexStaticLinkingDescriptor); + + bool supportFragmentBinaryLinking() const; + + IndirectCommandBufferSupportState supportIndirectCommandBuffers() const; + + bool supportVertexBinaryLinking() const; + + MTL::VertexDescriptor* vertexDescriptor() const; + + FunctionDescriptor* vertexFunctionDescriptor() const; + + StaticLinkingDescriptor* vertexStaticLinkingDescriptor() const; +}; + +} +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptor* MTL4::RenderPipelineColorAttachmentDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4RenderPipelineColorAttachmentDescriptor)); +} + +_MTL_INLINE MTL::BlendOperation MTL4::RenderPipelineColorAttachmentDescriptor::alphaBlendOperation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaBlendOperation)); +} + +_MTL_INLINE MTL4::BlendState MTL4::RenderPipelineColorAttachmentDescriptor::blendingState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(blendingState)); +} + +_MTL_INLINE MTL::BlendFactor MTL4::RenderPipelineColorAttachmentDescriptor::destinationAlphaBlendFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(destinationAlphaBlendFactor)); +} + +_MTL_INLINE MTL::BlendFactor MTL4::RenderPipelineColorAttachmentDescriptor::destinationRGBBlendFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(destinationRGBBlendFactor)); +} + +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptor* MTL4::RenderPipelineColorAttachmentDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::PixelFormat MTL4::RenderPipelineColorAttachmentDescriptor::pixelFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE MTL::BlendOperation MTL4::RenderPipelineColorAttachmentDescriptor::rgbBlendOperation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rgbBlendOperation)); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setAlphaBlendOperation(MTL::BlendOperation alphaBlendOperation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaBlendOperation_), alphaBlendOperation); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setBlendingState(MTL4::BlendState blendingState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBlendingState_), blendingState); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setDestinationAlphaBlendFactor(MTL::BlendFactor destinationAlphaBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestinationAlphaBlendFactor_), destinationAlphaBlendFactor); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setDestinationRGBBlendFactor(MTL::BlendFactor destinationRGBBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestinationRGBBlendFactor_), destinationRGBBlendFactor); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setRgbBlendOperation(MTL::BlendOperation rgbBlendOperation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRgbBlendOperation_), rgbBlendOperation); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setSourceAlphaBlendFactor(MTL::BlendFactor sourceAlphaBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSourceAlphaBlendFactor_), sourceAlphaBlendFactor); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setSourceRGBBlendFactor(MTL::BlendFactor sourceRGBBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSourceRGBBlendFactor_), sourceRGBBlendFactor); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptor::setWriteMask(MTL::ColorWriteMask writeMask) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setWriteMask_), writeMask); +} + +_MTL_INLINE MTL::BlendFactor MTL4::RenderPipelineColorAttachmentDescriptor::sourceAlphaBlendFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sourceAlphaBlendFactor)); +} + +_MTL_INLINE MTL::BlendFactor MTL4::RenderPipelineColorAttachmentDescriptor::sourceRGBBlendFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sourceRGBBlendFactor)); +} + +_MTL_INLINE MTL::ColorWriteMask MTL4::RenderPipelineColorAttachmentDescriptor::writeMask() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(writeMask)); +} + +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptorArray* MTL4::RenderPipelineColorAttachmentDescriptorArray::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4RenderPipelineColorAttachmentDescriptorArray)); +} + +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptorArray* MTL4::RenderPipelineColorAttachmentDescriptorArray::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptor* MTL4::RenderPipelineColorAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptorArray::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::RenderPipelineColorAttachmentDescriptorArray::setObject(const MTL4::RenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); +} + +_MTL_INLINE MTL4::RenderPipelineBinaryFunctionsDescriptor* MTL4::RenderPipelineBinaryFunctionsDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4RenderPipelineBinaryFunctionsDescriptor)); +} + +_MTL_INLINE NS::Array* MTL4::RenderPipelineBinaryFunctionsDescriptor::fragmentAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentAdditionalBinaryFunctions)); +} + +_MTL_INLINE MTL4::RenderPipelineBinaryFunctionsDescriptor* MTL4::RenderPipelineBinaryFunctionsDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::Array* MTL4::RenderPipelineBinaryFunctionsDescriptor::meshAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshAdditionalBinaryFunctions)); +} + +_MTL_INLINE NS::Array* MTL4::RenderPipelineBinaryFunctionsDescriptor::objectAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAdditionalBinaryFunctions)); +} + +_MTL_INLINE void MTL4::RenderPipelineBinaryFunctionsDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::RenderPipelineBinaryFunctionsDescriptor::setFragmentAdditionalBinaryFunctions(const NS::Array* fragmentAdditionalBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentAdditionalBinaryFunctions_), fragmentAdditionalBinaryFunctions); +} + +_MTL_INLINE void MTL4::RenderPipelineBinaryFunctionsDescriptor::setMeshAdditionalBinaryFunctions(const NS::Array* meshAdditionalBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshAdditionalBinaryFunctions_), meshAdditionalBinaryFunctions); +} + +_MTL_INLINE void MTL4::RenderPipelineBinaryFunctionsDescriptor::setObjectAdditionalBinaryFunctions(const NS::Array* objectAdditionalBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectAdditionalBinaryFunctions_), objectAdditionalBinaryFunctions); +} + +_MTL_INLINE void MTL4::RenderPipelineBinaryFunctionsDescriptor::setTileAdditionalBinaryFunctions(const NS::Array* tileAdditionalBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileAdditionalBinaryFunctions_), tileAdditionalBinaryFunctions); +} + +_MTL_INLINE void MTL4::RenderPipelineBinaryFunctionsDescriptor::setVertexAdditionalBinaryFunctions(const NS::Array* vertexAdditionalBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAdditionalBinaryFunctions_), vertexAdditionalBinaryFunctions); +} + +_MTL_INLINE NS::Array* MTL4::RenderPipelineBinaryFunctionsDescriptor::tileAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileAdditionalBinaryFunctions)); +} + +_MTL_INLINE NS::Array* MTL4::RenderPipelineBinaryFunctionsDescriptor::vertexAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexAdditionalBinaryFunctions)); +} + +_MTL_INLINE MTL4::RenderPipelineDescriptor* MTL4::RenderPipelineDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4RenderPipelineDescriptor)); +} + +_MTL_INLINE MTL4::AlphaToCoverageState MTL4::RenderPipelineDescriptor::alphaToCoverageState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaToCoverageState)); +} + +_MTL_INLINE MTL4::AlphaToOneState MTL4::RenderPipelineDescriptor::alphaToOneState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaToOneState)); +} + +_MTL_INLINE MTL4::LogicalToPhysicalColorAttachmentMappingState MTL4::RenderPipelineDescriptor::colorAttachmentMappingState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachmentMappingState)); +} + +_MTL_INLINE MTL4::RenderPipelineColorAttachmentDescriptorArray* MTL4::RenderPipelineDescriptor::colorAttachments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::RenderPipelineDescriptor::fragmentFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentFunctionDescriptor)); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::RenderPipelineDescriptor::fragmentStaticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentStaticLinkingDescriptor)); +} + +_MTL_INLINE MTL4::RenderPipelineDescriptor* MTL4::RenderPipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::PrimitiveTopologyClass MTL4::RenderPipelineDescriptor::inputPrimitiveTopology() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inputPrimitiveTopology)); +} + +_MTL_INLINE bool MTL4::RenderPipelineDescriptor::isRasterizationEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPipelineDescriptor::maxVertexAmplificationCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexAmplificationCount)); +} + +_MTL_INLINE NS::UInteger MTL4::RenderPipelineDescriptor::rasterSampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); +} + +_MTL_INLINE bool MTL4::RenderPipelineDescriptor::rasterizationEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setAlphaToCoverageState(MTL4::AlphaToCoverageState alphaToCoverageState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToCoverageState_), alphaToCoverageState); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setAlphaToOneState(MTL4::AlphaToOneState alphaToOneState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToOneState_), alphaToOneState); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setColorAttachmentMappingState(MTL4::LogicalToPhysicalColorAttachmentMappingState colorAttachmentMappingState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorAttachmentMappingState_), colorAttachmentMappingState); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setFragmentFunctionDescriptor(const MTL4::FunctionDescriptor* fragmentFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentFunctionDescriptor_), fragmentFunctionDescriptor); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setFragmentStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* fragmentStaticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentStaticLinkingDescriptor_), fragmentStaticLinkingDescriptor); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setInputPrimitiveTopology(MTL::PrimitiveTopologyClass inputPrimitiveTopology) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInputPrimitiveTopology_), inputPrimitiveTopology); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexAmplificationCount_), maxVertexAmplificationCount); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setRasterizationEnabled(bool rasterizationEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationEnabled_), rasterizationEnabled); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setSupportFragmentBinaryLinking(bool supportFragmentBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportFragmentBinaryLinking_), supportFragmentBinaryLinking); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setSupportIndirectCommandBuffers(MTL4::IndirectCommandBufferSupportState supportIndirectCommandBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setSupportVertexBinaryLinking(bool supportVertexBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportVertexBinaryLinking_), supportVertexBinaryLinking); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setVertexDescriptor(const MTL::VertexDescriptor* vertexDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexDescriptor_), vertexDescriptor); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setVertexFunctionDescriptor(const MTL4::FunctionDescriptor* vertexFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFunctionDescriptor_), vertexFunctionDescriptor); +} + +_MTL_INLINE void MTL4::RenderPipelineDescriptor::setVertexStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* vertexStaticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStaticLinkingDescriptor_), vertexStaticLinkingDescriptor); +} + +_MTL_INLINE bool MTL4::RenderPipelineDescriptor::supportFragmentBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportFragmentBinaryLinking)); +} + +_MTL_INLINE MTL4::IndirectCommandBufferSupportState MTL4::RenderPipelineDescriptor::supportIndirectCommandBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE bool MTL4::RenderPipelineDescriptor::supportVertexBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportVertexBinaryLinking)); +} + +_MTL_INLINE MTL::VertexDescriptor* MTL4::RenderPipelineDescriptor::vertexDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexDescriptor)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::RenderPipelineDescriptor::vertexFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFunctionDescriptor)); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::RenderPipelineDescriptor::vertexStaticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStaticLinkingDescriptor)); +} diff --git a/vendor/metal-cpp/Metal/MTL4SpecializedFunctionDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4SpecializedFunctionDescriptor.hpp new file mode 100644 index 000000000..57c0094dd --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4SpecializedFunctionDescriptor.hpp @@ -0,0 +1,100 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4SpecializedFunctionDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4FunctionDescriptor.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class FunctionDescriptor; +class SpecializedFunctionDescriptor; +} + +namespace MTL +{ +class FunctionConstantValues; +} + +namespace MTL4 +{ +class SpecializedFunctionDescriptor : public NS::Copying +{ +public: + static SpecializedFunctionDescriptor* alloc(); + + MTL::FunctionConstantValues* constantValues() const; + + FunctionDescriptor* functionDescriptor() const; + + SpecializedFunctionDescriptor* init(); + + void setConstantValues(const MTL::FunctionConstantValues* constantValues); + + void setFunctionDescriptor(const MTL4::FunctionDescriptor* functionDescriptor); + + void setSpecializedName(const NS::String* specializedName); + NS::String* specializedName() const; +}; + +} +_MTL_INLINE MTL4::SpecializedFunctionDescriptor* MTL4::SpecializedFunctionDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4SpecializedFunctionDescriptor)); +} + +_MTL_INLINE MTL::FunctionConstantValues* MTL4::SpecializedFunctionDescriptor::constantValues() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(constantValues)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::SpecializedFunctionDescriptor::functionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionDescriptor)); +} + +_MTL_INLINE MTL4::SpecializedFunctionDescriptor* MTL4::SpecializedFunctionDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::SpecializedFunctionDescriptor::setConstantValues(const MTL::FunctionConstantValues* constantValues) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValues_), constantValues); +} + +_MTL_INLINE void MTL4::SpecializedFunctionDescriptor::setFunctionDescriptor(const MTL4::FunctionDescriptor* functionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionDescriptor_), functionDescriptor); +} + +_MTL_INLINE void MTL4::SpecializedFunctionDescriptor::setSpecializedName(const NS::String* specializedName) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSpecializedName_), specializedName); +} + +_MTL_INLINE NS::String* MTL4::SpecializedFunctionDescriptor::specializedName() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(specializedName)); +} diff --git a/vendor/metal-cpp/Metal/MTL4StitchedFunctionDescriptor.hpp b/vendor/metal-cpp/Metal/MTL4StitchedFunctionDescriptor.hpp new file mode 100644 index 000000000..ca8ea5cfd --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4StitchedFunctionDescriptor.hpp @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4StitchedFunctionDescriptor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4FunctionDescriptor.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL4 +{ +class StitchedFunctionDescriptor; +} + +namespace MTL +{ +class FunctionStitchingGraph; +} + +namespace MTL4 +{ +class StitchedFunctionDescriptor : public NS::Copying +{ +public: + static StitchedFunctionDescriptor* alloc(); + + NS::Array* functionDescriptors() const; + + MTL::FunctionStitchingGraph* functionGraph() const; + + StitchedFunctionDescriptor* init(); + + void setFunctionDescriptors(const NS::Array* functionDescriptors); + + void setFunctionGraph(const MTL::FunctionStitchingGraph* functionGraph); +}; + +} +_MTL_INLINE MTL4::StitchedFunctionDescriptor* MTL4::StitchedFunctionDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4StitchedFunctionDescriptor)); +} + +_MTL_INLINE NS::Array* MTL4::StitchedFunctionDescriptor::functionDescriptors() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionDescriptors)); +} + +_MTL_INLINE MTL::FunctionStitchingGraph* MTL4::StitchedFunctionDescriptor::functionGraph() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionGraph)); +} + +_MTL_INLINE MTL4::StitchedFunctionDescriptor* MTL4::StitchedFunctionDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL4::StitchedFunctionDescriptor::setFunctionDescriptors(const NS::Array* functionDescriptors) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionDescriptors_), functionDescriptors); +} + +_MTL_INLINE void MTL4::StitchedFunctionDescriptor::setFunctionGraph(const MTL::FunctionStitchingGraph* functionGraph) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionGraph_), functionGraph); +} diff --git a/vendor/metal-cpp/Metal/MTL4TileRenderPipeline.hpp b/vendor/metal-cpp/Metal/MTL4TileRenderPipeline.hpp new file mode 100644 index 000000000..dc74f484b --- /dev/null +++ b/vendor/metal-cpp/Metal/MTL4TileRenderPipeline.hpp @@ -0,0 +1,173 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTL4TileRenderPipeline.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTL4PipelineState.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" + +namespace MTL4 +{ +class FunctionDescriptor; +class StaticLinkingDescriptor; +class TileRenderPipelineDescriptor; +} + +namespace MTL +{ +class TileRenderPipelineColorAttachmentDescriptorArray; +} + +namespace MTL4 +{ +class TileRenderPipelineDescriptor : public NS::Copying +{ +public: + static TileRenderPipelineDescriptor* alloc(); + + MTL::TileRenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; + + TileRenderPipelineDescriptor* init(); + + NS::UInteger maxTotalThreadsPerThreadgroup() const; + + NS::UInteger rasterSampleCount() const; + + MTL::Size requiredThreadsPerThreadgroup() const; + + void reset(); + + void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + + void setRasterSampleCount(NS::UInteger rasterSampleCount); + + void setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup); + + void setStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* staticLinkingDescriptor); + + void setSupportBinaryLinking(bool supportBinaryLinking); + + void setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize); + + void setTileFunctionDescriptor(const MTL4::FunctionDescriptor* tileFunctionDescriptor); + + StaticLinkingDescriptor* staticLinkingDescriptor() const; + + bool supportBinaryLinking() const; + + bool threadgroupSizeMatchesTileSize() const; + + FunctionDescriptor* tileFunctionDescriptor() const; +}; + +} +_MTL_INLINE MTL4::TileRenderPipelineDescriptor* MTL4::TileRenderPipelineDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTL4TileRenderPipelineDescriptor)); +} + +_MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptorArray* MTL4::TileRenderPipelineDescriptor::colorAttachments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); +} + +_MTL_INLINE MTL4::TileRenderPipelineDescriptor* MTL4::TileRenderPipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL4::TileRenderPipelineDescriptor::maxTotalThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL4::TileRenderPipelineDescriptor::rasterSampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); +} + +_MTL_INLINE MTL::Size MTL4::TileRenderPipelineDescriptor::requiredThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup)); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerThreadgroup_), requiredThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* staticLinkingDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStaticLinkingDescriptor_), staticLinkingDescriptor); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setSupportBinaryLinking(bool supportBinaryLinking) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportBinaryLinking_), supportBinaryLinking); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupSizeMatchesTileSize_), threadgroupSizeMatchesTileSize); +} + +_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setTileFunctionDescriptor(const MTL4::FunctionDescriptor* tileFunctionDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileFunctionDescriptor_), tileFunctionDescriptor); +} + +_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::TileRenderPipelineDescriptor::staticLinkingDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(staticLinkingDescriptor)); +} + +_MTL_INLINE bool MTL4::TileRenderPipelineDescriptor::supportBinaryLinking() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportBinaryLinking)); +} + +_MTL_INLINE bool MTL4::TileRenderPipelineDescriptor::threadgroupSizeMatchesTileSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupSizeMatchesTileSize)); +} + +_MTL_INLINE MTL4::FunctionDescriptor* MTL4::TileRenderPipelineDescriptor::tileFunctionDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileFunctionDescriptor)); +} diff --git a/vendor/metal-cpp/Metal/MTLAccelerationStructure.hpp b/vendor/metal-cpp/Metal/MTLAccelerationStructure.hpp index 9d71fa3d3..d3457c392 100644 --- a/vendor/metal-cpp/Metal/MTLAccelerationStructure.hpp +++ b/vendor/metal-cpp/Metal/MTLAccelerationStructure.hpp @@ -2,7 +2,7 @@ // // Metal/MTLAccelerationStructure.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,76 +20,39 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLAccelerationStructureTypes.hpp" +#include "MTLArgument.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLAccelerationStructure.hpp" -#include "MTLAccelerationStructureTypes.hpp" #include "MTLResource.hpp" #include "MTLStageInputOutputDescriptor.hpp" #include "MTLTypes.hpp" +#include namespace MTL { -_MTL_OPTIONS(NS::UInteger, AccelerationStructureUsage) { - AccelerationStructureUsageNone = 0, - AccelerationStructureUsageRefit = 1, - AccelerationStructureUsagePreferFastBuild = 2, - AccelerationStructureUsageExtendedLimits = 4, -}; +class AccelerationStructureBoundingBoxGeometryDescriptor; +class AccelerationStructureCurveGeometryDescriptor; +class AccelerationStructureDescriptor; +class AccelerationStructureGeometryDescriptor; +class AccelerationStructureMotionBoundingBoxGeometryDescriptor; +class AccelerationStructureMotionCurveGeometryDescriptor; +class AccelerationStructureMotionTriangleGeometryDescriptor; +class AccelerationStructureTriangleGeometryDescriptor; +class Buffer; +class IndirectInstanceAccelerationStructureDescriptor; +class InstanceAccelerationStructureDescriptor; +class MotionKeyframeData; +class PrimitiveAccelerationStructureDescriptor; +} -_MTL_OPTIONS(uint32_t, AccelerationStructureInstanceOptions) { - AccelerationStructureInstanceOptionNone = 0, - AccelerationStructureInstanceOptionDisableTriangleCulling = 1, - AccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise = 2, - AccelerationStructureInstanceOptionOpaque = 4, - AccelerationStructureInstanceOptionNonOpaque = 8, -}; - -class AccelerationStructureDescriptor : public NS::Copying +namespace MTL { -public: - static class AccelerationStructureDescriptor* alloc(); - - class AccelerationStructureDescriptor* init(); - - MTL::AccelerationStructureUsage usage() const; - void setUsage(MTL::AccelerationStructureUsage usage); -}; - -class AccelerationStructureGeometryDescriptor : public NS::Copying -{ -public: - static class AccelerationStructureGeometryDescriptor* alloc(); - - class AccelerationStructureGeometryDescriptor* init(); - - NS::UInteger intersectionFunctionTableOffset() const; - void setIntersectionFunctionTableOffset(NS::UInteger intersectionFunctionTableOffset); - - bool opaque() const; - void setOpaque(bool opaque); - - bool allowDuplicateIntersectionFunctionInvocation() const; - void setAllowDuplicateIntersectionFunctionInvocation(bool allowDuplicateIntersectionFunctionInvocation); - - NS::String* label() const; - void setLabel(const NS::String* label); - - class Buffer* primitiveDataBuffer() const; - void setPrimitiveDataBuffer(const class Buffer* primitiveDataBuffer); - - NS::UInteger primitiveDataBufferOffset() const; - void setPrimitiveDataBufferOffset(NS::UInteger primitiveDataBufferOffset); - - NS::UInteger primitiveDataStride() const; - void setPrimitiveDataStride(NS::UInteger primitiveDataStride); - - NS::UInteger primitiveDataElementSize() const; - void setPrimitiveDataElementSize(NS::UInteger primitiveDataElementSize); +_MTL_ENUM(NS::Integer, MatrixLayout) { + MatrixLayoutColumnMajor = 0, + MatrixLayoutRowMajor = 1, }; _MTL_ENUM(uint32_t, MotionBorderMode) { @@ -97,166 +60,57 @@ _MTL_ENUM(uint32_t, MotionBorderMode) { MotionBorderModeVanish = 1, }; -class PrimitiveAccelerationStructureDescriptor : public NS::Copying -{ -public: - static class PrimitiveAccelerationStructureDescriptor* alloc(); - - class PrimitiveAccelerationStructureDescriptor* init(); - - NS::Array* geometryDescriptors() const; - void setGeometryDescriptors(const NS::Array* geometryDescriptors); - - MTL::MotionBorderMode motionStartBorderMode() const; - void setMotionStartBorderMode(MTL::MotionBorderMode motionStartBorderMode); - - MTL::MotionBorderMode motionEndBorderMode() const; - void setMotionEndBorderMode(MTL::MotionBorderMode motionEndBorderMode); - - float motionStartTime() const; - void setMotionStartTime(float motionStartTime); - - float motionEndTime() const; - void setMotionEndTime(float motionEndTime); - - NS::UInteger motionKeyframeCount() const; - void setMotionKeyframeCount(NS::UInteger motionKeyframeCount); - - static MTL::PrimitiveAccelerationStructureDescriptor* descriptor(); +_MTL_ENUM(NS::Integer, CurveType) { + CurveTypeRound = 0, + CurveTypeFlat = 1, }; -class AccelerationStructureTriangleGeometryDescriptor : public NS::Copying -{ -public: - static class AccelerationStructureTriangleGeometryDescriptor* alloc(); - - class AccelerationStructureTriangleGeometryDescriptor* init(); - - class Buffer* vertexBuffer() const; - void setVertexBuffer(const class Buffer* vertexBuffer); - - NS::UInteger vertexBufferOffset() const; - void setVertexBufferOffset(NS::UInteger vertexBufferOffset); - - MTL::AttributeFormat vertexFormat() const; - void setVertexFormat(MTL::AttributeFormat vertexFormat); - - NS::UInteger vertexStride() const; - void setVertexStride(NS::UInteger vertexStride); - - class Buffer* indexBuffer() const; - void setIndexBuffer(const class Buffer* indexBuffer); - - NS::UInteger indexBufferOffset() const; - void setIndexBufferOffset(NS::UInteger indexBufferOffset); - - MTL::IndexType indexType() const; - void setIndexType(MTL::IndexType indexType); - - NS::UInteger triangleCount() const; - void setTriangleCount(NS::UInteger triangleCount); - - class Buffer* transformationMatrixBuffer() const; - void setTransformationMatrixBuffer(const class Buffer* transformationMatrixBuffer); - - NS::UInteger transformationMatrixBufferOffset() const; - void setTransformationMatrixBufferOffset(NS::UInteger transformationMatrixBufferOffset); - - static MTL::AccelerationStructureTriangleGeometryDescriptor* descriptor(); +_MTL_ENUM(NS::Integer, CurveBasis) { + CurveBasisBSpline = 0, + CurveBasisCatmullRom = 1, + CurveBasisLinear = 2, + CurveBasisBezier = 3, }; -class AccelerationStructureBoundingBoxGeometryDescriptor : public NS::Copying -{ -public: - static class AccelerationStructureBoundingBoxGeometryDescriptor* alloc(); - - class AccelerationStructureBoundingBoxGeometryDescriptor* init(); - - class Buffer* boundingBoxBuffer() const; - void setBoundingBoxBuffer(const class Buffer* boundingBoxBuffer); - - NS::UInteger boundingBoxBufferOffset() const; - void setBoundingBoxBufferOffset(NS::UInteger boundingBoxBufferOffset); - - NS::UInteger boundingBoxStride() const; - void setBoundingBoxStride(NS::UInteger boundingBoxStride); - - NS::UInteger boundingBoxCount() const; - void setBoundingBoxCount(NS::UInteger boundingBoxCount); - - static MTL::AccelerationStructureBoundingBoxGeometryDescriptor* descriptor(); +_MTL_ENUM(NS::Integer, CurveEndCaps) { + CurveEndCapsNone = 0, + CurveEndCapsDisk = 1, + CurveEndCapsSphere = 2, }; -class MotionKeyframeData : public NS::Referencing -{ -public: - static class MotionKeyframeData* alloc(); - - class MotionKeyframeData* init(); - - class Buffer* buffer() const; - void setBuffer(const class Buffer* buffer); - - NS::UInteger offset() const; - void setOffset(NS::UInteger offset); - - static MTL::MotionKeyframeData* data(); +_MTL_ENUM(NS::UInteger, AccelerationStructureInstanceDescriptorType) { + AccelerationStructureInstanceDescriptorTypeDefault = 0, + AccelerationStructureInstanceDescriptorTypeUserID = 1, + AccelerationStructureInstanceDescriptorTypeMotion = 2, + AccelerationStructureInstanceDescriptorTypeIndirect = 3, + AccelerationStructureInstanceDescriptorTypeIndirectMotion = 4, }; -class AccelerationStructureMotionTriangleGeometryDescriptor : public NS::Copying -{ -public: - static class AccelerationStructureMotionTriangleGeometryDescriptor* alloc(); - - class AccelerationStructureMotionTriangleGeometryDescriptor* init(); - - NS::Array* vertexBuffers() const; - void setVertexBuffers(const NS::Array* vertexBuffers); - - MTL::AttributeFormat vertexFormat() const; - void setVertexFormat(MTL::AttributeFormat vertexFormat); - - NS::UInteger vertexStride() const; - void setVertexStride(NS::UInteger vertexStride); - - class Buffer* indexBuffer() const; - void setIndexBuffer(const class Buffer* indexBuffer); - - NS::UInteger indexBufferOffset() const; - void setIndexBufferOffset(NS::UInteger indexBufferOffset); - - MTL::IndexType indexType() const; - void setIndexType(MTL::IndexType indexType); - - NS::UInteger triangleCount() const; - void setTriangleCount(NS::UInteger triangleCount); - - class Buffer* transformationMatrixBuffer() const; - void setTransformationMatrixBuffer(const class Buffer* transformationMatrixBuffer); - - NS::UInteger transformationMatrixBufferOffset() const; - void setTransformationMatrixBufferOffset(NS::UInteger transformationMatrixBufferOffset); - - static MTL::AccelerationStructureMotionTriangleGeometryDescriptor* descriptor(); +_MTL_ENUM(NS::Integer, TransformType) { + TransformTypePackedFloat4x3 = 0, + TransformTypeComponent = 1, }; -class AccelerationStructureMotionBoundingBoxGeometryDescriptor : public NS::Copying -{ -public: - static class AccelerationStructureMotionBoundingBoxGeometryDescriptor* alloc(); +_MTL_OPTIONS(NS::UInteger, AccelerationStructureRefitOptions) { + AccelerationStructureRefitOptionVertexData = 1, + AccelerationStructureRefitOptionPerPrimitiveData = 1 << 1, +}; - class AccelerationStructureMotionBoundingBoxGeometryDescriptor* init(); +_MTL_OPTIONS(NS::UInteger, AccelerationStructureUsage) { + AccelerationStructureUsageNone = 0, + AccelerationStructureUsageRefit = 1, + AccelerationStructureUsagePreferFastBuild = 1 << 1, + AccelerationStructureUsageExtendedLimits = 1 << 2, + AccelerationStructureUsagePreferFastIntersection = 1 << 4, + AccelerationStructureUsageMinimizeMemory = 1 << 5, +}; - NS::Array* boundingBoxBuffers() const; - void setBoundingBoxBuffers(const NS::Array* boundingBoxBuffers); - - NS::UInteger boundingBoxStride() const; - void setBoundingBoxStride(NS::UInteger boundingBoxStride); - - NS::UInteger boundingBoxCount() const; - void setBoundingBoxCount(NS::UInteger boundingBoxCount); - - static MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor* descriptor(); +_MTL_OPTIONS(uint32_t, AccelerationStructureInstanceOptions) { + AccelerationStructureInstanceOptionNone = 0, + AccelerationStructureInstanceOptionDisableTriangleCulling = 1, + AccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise = 1 << 1, + AccelerationStructureInstanceOptionOpaque = 1 << 2, + AccelerationStructureInstanceOptionNonOpaque = 1 << 3, }; struct AccelerationStructureInstanceDescriptor @@ -278,12 +132,6 @@ struct AccelerationStructureUserIDInstanceDescriptor uint32_t userID; } _MTL_PACKED; -_MTL_ENUM(NS::UInteger, AccelerationStructureInstanceDescriptorType) { - AccelerationStructureInstanceDescriptorTypeDefault = 0, - AccelerationStructureInstanceDescriptorTypeUserID = 1, - AccelerationStructureInstanceDescriptorTypeMotion = 2, -}; - struct AccelerationStructureMotionInstanceDescriptor { MTL::AccelerationStructureInstanceOptions options; @@ -299,114 +147,593 @@ struct AccelerationStructureMotionInstanceDescriptor float motionEndTime; } _MTL_PACKED; -class InstanceAccelerationStructureDescriptor : public NS::Copying +struct IndirectAccelerationStructureInstanceDescriptor +{ + MTL::PackedFloat4x3 transformationMatrix; + MTL::AccelerationStructureInstanceOptions options; + uint32_t mask; + uint32_t intersectionFunctionTableOffset; + uint32_t userID; + MTL::ResourceID accelerationStructureID; +} _MTL_PACKED; + +struct IndirectAccelerationStructureMotionInstanceDescriptor +{ + MTL::AccelerationStructureInstanceOptions options; + uint32_t mask; + uint32_t intersectionFunctionTableOffset; + uint32_t userID; + MTL::ResourceID accelerationStructureID; + uint32_t motionTransformsStartIndex; + uint32_t motionTransformsCount; + MTL::MotionBorderMode motionStartBorderMode; + MTL::MotionBorderMode motionEndBorderMode; + float motionStartTime; + float motionEndTime; +} _MTL_PACKED; + +class AccelerationStructureDescriptor : public NS::Copying { public: - static class InstanceAccelerationStructureDescriptor* alloc(); + static AccelerationStructureDescriptor* alloc(); - class InstanceAccelerationStructureDescriptor* init(); + AccelerationStructureDescriptor* init(); - class Buffer* instanceDescriptorBuffer() const; - void setInstanceDescriptorBuffer(const class Buffer* instanceDescriptorBuffer); - - NS::UInteger instanceDescriptorBufferOffset() const; - void setInstanceDescriptorBufferOffset(NS::UInteger instanceDescriptorBufferOffset); - - NS::UInteger instanceDescriptorStride() const; - void setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride); - - NS::UInteger instanceCount() const; - void setInstanceCount(NS::UInteger instanceCount); - - NS::Array* instancedAccelerationStructures() const; - void setInstancedAccelerationStructures(const NS::Array* instancedAccelerationStructures); - - MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType() const; - void setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType); - - class Buffer* motionTransformBuffer() const; - void setMotionTransformBuffer(const class Buffer* motionTransformBuffer); - - NS::UInteger motionTransformBufferOffset() const; - void setMotionTransformBufferOffset(NS::UInteger motionTransformBufferOffset); - - NS::UInteger motionTransformCount() const; - void setMotionTransformCount(NS::UInteger motionTransformCount); - - static MTL::InstanceAccelerationStructureDescriptor* descriptor(); + void setUsage(MTL::AccelerationStructureUsage usage); + AccelerationStructureUsage usage() const; }; +class AccelerationStructureGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureGeometryDescriptor* alloc(); + bool allowDuplicateIntersectionFunctionInvocation() const; + + AccelerationStructureGeometryDescriptor* init(); + + NS::UInteger intersectionFunctionTableOffset() const; + + NS::String* label() const; + + bool opaque() const; + + Buffer* primitiveDataBuffer() const; + NS::UInteger primitiveDataBufferOffset() const; + + NS::UInteger primitiveDataElementSize() const; + + NS::UInteger primitiveDataStride() const; + + void setAllowDuplicateIntersectionFunctionInvocation(bool allowDuplicateIntersectionFunctionInvocation); + + void setIntersectionFunctionTableOffset(NS::UInteger intersectionFunctionTableOffset); + + void setLabel(const NS::String* label); + + void setOpaque(bool opaque); + + void setPrimitiveDataBuffer(const MTL::Buffer* primitiveDataBuffer); + void setPrimitiveDataBufferOffset(NS::UInteger primitiveDataBufferOffset); + + void setPrimitiveDataElementSize(NS::UInteger primitiveDataElementSize); + + void setPrimitiveDataStride(NS::UInteger primitiveDataStride); +}; +class PrimitiveAccelerationStructureDescriptor : public NS::Copying +{ +public: + static PrimitiveAccelerationStructureDescriptor* alloc(); + + static PrimitiveAccelerationStructureDescriptor* descriptor(); + NS::Array* geometryDescriptors() const; + + PrimitiveAccelerationStructureDescriptor* init(); + + MotionBorderMode motionEndBorderMode() const; + + float motionEndTime() const; + + NS::UInteger motionKeyframeCount() const; + + MotionBorderMode motionStartBorderMode() const; + + float motionStartTime() const; + + void setGeometryDescriptors(const NS::Array* geometryDescriptors); + + void setMotionEndBorderMode(MTL::MotionBorderMode motionEndBorderMode); + + void setMotionEndTime(float motionEndTime); + + void setMotionKeyframeCount(NS::UInteger motionKeyframeCount); + + void setMotionStartBorderMode(MTL::MotionBorderMode motionStartBorderMode); + + void setMotionStartTime(float motionStartTime); +}; +class AccelerationStructureTriangleGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureTriangleGeometryDescriptor* alloc(); + + static AccelerationStructureTriangleGeometryDescriptor* descriptor(); + + Buffer* indexBuffer() const; + NS::UInteger indexBufferOffset() const; + + IndexType indexType() const; + + AccelerationStructureTriangleGeometryDescriptor* init(); + + void setIndexBuffer(const MTL::Buffer* indexBuffer); + void setIndexBufferOffset(NS::UInteger indexBufferOffset); + + void setIndexType(MTL::IndexType indexType); + + void setTransformationMatrixBuffer(const MTL::Buffer* transformationMatrixBuffer); + void setTransformationMatrixBufferOffset(NS::UInteger transformationMatrixBufferOffset); + + void setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout); + + void setTriangleCount(NS::UInteger triangleCount); + + void setVertexBuffer(const MTL::Buffer* vertexBuffer); + void setVertexBufferOffset(NS::UInteger vertexBufferOffset); + + void setVertexFormat(MTL::AttributeFormat vertexFormat); + + void setVertexStride(NS::UInteger vertexStride); + + Buffer* transformationMatrixBuffer() const; + NS::UInteger transformationMatrixBufferOffset() const; + + MatrixLayout transformationMatrixLayout() const; + + NS::UInteger triangleCount() const; + + Buffer* vertexBuffer() const; + NS::UInteger vertexBufferOffset() const; + + AttributeFormat vertexFormat() const; + + NS::UInteger vertexStride() const; +}; +class AccelerationStructureBoundingBoxGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureBoundingBoxGeometryDescriptor* alloc(); + + Buffer* boundingBoxBuffer() const; + NS::UInteger boundingBoxBufferOffset() const; + + NS::UInteger boundingBoxCount() const; + + NS::UInteger boundingBoxStride() const; + + static AccelerationStructureBoundingBoxGeometryDescriptor* descriptor(); + + AccelerationStructureBoundingBoxGeometryDescriptor* init(); + + void setBoundingBoxBuffer(const MTL::Buffer* boundingBoxBuffer); + void setBoundingBoxBufferOffset(NS::UInteger boundingBoxBufferOffset); + + void setBoundingBoxCount(NS::UInteger boundingBoxCount); + + void setBoundingBoxStride(NS::UInteger boundingBoxStride); +}; +class MotionKeyframeData : public NS::Referencing +{ +public: + static MotionKeyframeData* alloc(); + + Buffer* buffer() const; + + static MotionKeyframeData* data(); + + MotionKeyframeData* init(); + + NS::UInteger offset() const; + + void setBuffer(const MTL::Buffer* buffer); + + void setOffset(NS::UInteger offset); +}; +class AccelerationStructureMotionTriangleGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureMotionTriangleGeometryDescriptor* alloc(); + + static AccelerationStructureMotionTriangleGeometryDescriptor* descriptor(); + + Buffer* indexBuffer() const; + NS::UInteger indexBufferOffset() const; + + IndexType indexType() const; + + AccelerationStructureMotionTriangleGeometryDescriptor* init(); + + void setIndexBuffer(const MTL::Buffer* indexBuffer); + void setIndexBufferOffset(NS::UInteger indexBufferOffset); + + void setIndexType(MTL::IndexType indexType); + + void setTransformationMatrixBuffer(const MTL::Buffer* transformationMatrixBuffer); + void setTransformationMatrixBufferOffset(NS::UInteger transformationMatrixBufferOffset); + + void setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout); + + void setTriangleCount(NS::UInteger triangleCount); + + void setVertexBuffers(const NS::Array* vertexBuffers); + + void setVertexFormat(MTL::AttributeFormat vertexFormat); + + void setVertexStride(NS::UInteger vertexStride); + + Buffer* transformationMatrixBuffer() const; + NS::UInteger transformationMatrixBufferOffset() const; + + MatrixLayout transformationMatrixLayout() const; + + NS::UInteger triangleCount() const; + + NS::Array* vertexBuffers() const; + + AttributeFormat vertexFormat() const; + + NS::UInteger vertexStride() const; +}; +class AccelerationStructureMotionBoundingBoxGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureMotionBoundingBoxGeometryDescriptor* alloc(); + + NS::Array* boundingBoxBuffers() const; + + NS::UInteger boundingBoxCount() const; + + NS::UInteger boundingBoxStride() const; + + static AccelerationStructureMotionBoundingBoxGeometryDescriptor* descriptor(); + + AccelerationStructureMotionBoundingBoxGeometryDescriptor* init(); + + void setBoundingBoxBuffers(const NS::Array* boundingBoxBuffers); + + void setBoundingBoxCount(NS::UInteger boundingBoxCount); + + void setBoundingBoxStride(NS::UInteger boundingBoxStride); +}; +class AccelerationStructureCurveGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureCurveGeometryDescriptor* alloc(); + + Buffer* controlPointBuffer() const; + NS::UInteger controlPointBufferOffset() const; + + NS::UInteger controlPointCount() const; + + AttributeFormat controlPointFormat() const; + + NS::UInteger controlPointStride() const; + + CurveBasis curveBasis() const; + + CurveEndCaps curveEndCaps() const; + + CurveType curveType() const; + + static AccelerationStructureCurveGeometryDescriptor* descriptor(); + + Buffer* indexBuffer() const; + NS::UInteger indexBufferOffset() const; + + IndexType indexType() const; + + AccelerationStructureCurveGeometryDescriptor* init(); + + Buffer* radiusBuffer() const; + NS::UInteger radiusBufferOffset() const; + + AttributeFormat radiusFormat() const; + + NS::UInteger radiusStride() const; + + NS::UInteger segmentControlPointCount() const; + + NS::UInteger segmentCount() const; + + void setControlPointBuffer(const MTL::Buffer* controlPointBuffer); + void setControlPointBufferOffset(NS::UInteger controlPointBufferOffset); + + void setControlPointCount(NS::UInteger controlPointCount); + + void setControlPointFormat(MTL::AttributeFormat controlPointFormat); + + void setControlPointStride(NS::UInteger controlPointStride); + + void setCurveBasis(MTL::CurveBasis curveBasis); + + void setCurveEndCaps(MTL::CurveEndCaps curveEndCaps); + + void setCurveType(MTL::CurveType curveType); + + void setIndexBuffer(const MTL::Buffer* indexBuffer); + void setIndexBufferOffset(NS::UInteger indexBufferOffset); + + void setIndexType(MTL::IndexType indexType); + + void setRadiusBuffer(const MTL::Buffer* radiusBuffer); + void setRadiusBufferOffset(NS::UInteger radiusBufferOffset); + + void setRadiusFormat(MTL::AttributeFormat radiusFormat); + + void setRadiusStride(NS::UInteger radiusStride); + + void setSegmentControlPointCount(NS::UInteger segmentControlPointCount); + + void setSegmentCount(NS::UInteger segmentCount); +}; +class AccelerationStructureMotionCurveGeometryDescriptor : public NS::Copying +{ +public: + static AccelerationStructureMotionCurveGeometryDescriptor* alloc(); + + NS::Array* controlPointBuffers() const; + + NS::UInteger controlPointCount() const; + + AttributeFormat controlPointFormat() const; + + NS::UInteger controlPointStride() const; + + CurveBasis curveBasis() const; + + CurveEndCaps curveEndCaps() const; + + CurveType curveType() const; + + static AccelerationStructureMotionCurveGeometryDescriptor* descriptor(); + + Buffer* indexBuffer() const; + NS::UInteger indexBufferOffset() const; + + IndexType indexType() const; + + AccelerationStructureMotionCurveGeometryDescriptor* init(); + + NS::Array* radiusBuffers() const; + + AttributeFormat radiusFormat() const; + + NS::UInteger radiusStride() const; + + NS::UInteger segmentControlPointCount() const; + + NS::UInteger segmentCount() const; + + void setControlPointBuffers(const NS::Array* controlPointBuffers); + + void setControlPointCount(NS::UInteger controlPointCount); + + void setControlPointFormat(MTL::AttributeFormat controlPointFormat); + + void setControlPointStride(NS::UInteger controlPointStride); + + void setCurveBasis(MTL::CurveBasis curveBasis); + + void setCurveEndCaps(MTL::CurveEndCaps curveEndCaps); + + void setCurveType(MTL::CurveType curveType); + + void setIndexBuffer(const MTL::Buffer* indexBuffer); + void setIndexBufferOffset(NS::UInteger indexBufferOffset); + + void setIndexType(MTL::IndexType indexType); + + void setRadiusBuffers(const NS::Array* radiusBuffers); + + void setRadiusFormat(MTL::AttributeFormat radiusFormat); + + void setRadiusStride(NS::UInteger radiusStride); + + void setSegmentControlPointCount(NS::UInteger segmentControlPointCount); + + void setSegmentCount(NS::UInteger segmentCount); +}; +class InstanceAccelerationStructureDescriptor : public NS::Copying +{ +public: + static InstanceAccelerationStructureDescriptor* alloc(); + + static InstanceAccelerationStructureDescriptor* descriptor(); + + InstanceAccelerationStructureDescriptor* init(); + + NS::UInteger instanceCount() const; + + Buffer* instanceDescriptorBuffer() const; + NS::UInteger instanceDescriptorBufferOffset() const; + + NS::UInteger instanceDescriptorStride() const; + + AccelerationStructureInstanceDescriptorType instanceDescriptorType() const; + + MatrixLayout instanceTransformationMatrixLayout() const; + + NS::Array* instancedAccelerationStructures() const; + + Buffer* motionTransformBuffer() const; + NS::UInteger motionTransformBufferOffset() const; + + NS::UInteger motionTransformCount() const; + + NS::UInteger motionTransformStride() const; + + TransformType motionTransformType() const; + + void setInstanceCount(NS::UInteger instanceCount); + + void setInstanceDescriptorBuffer(const MTL::Buffer* instanceDescriptorBuffer); + void setInstanceDescriptorBufferOffset(NS::UInteger instanceDescriptorBufferOffset); + + void setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride); + + void setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType); + + void setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout); + + void setInstancedAccelerationStructures(const NS::Array* instancedAccelerationStructures); + + void setMotionTransformBuffer(const MTL::Buffer* motionTransformBuffer); + void setMotionTransformBufferOffset(NS::UInteger motionTransformBufferOffset); + + void setMotionTransformCount(NS::UInteger motionTransformCount); + + void setMotionTransformStride(NS::UInteger motionTransformStride); + + void setMotionTransformType(MTL::TransformType motionTransformType); +}; +class IndirectInstanceAccelerationStructureDescriptor : public NS::Copying +{ +public: + static IndirectInstanceAccelerationStructureDescriptor* alloc(); + + static IndirectInstanceAccelerationStructureDescriptor* descriptor(); + + IndirectInstanceAccelerationStructureDescriptor* init(); + + Buffer* instanceCountBuffer() const; + NS::UInteger instanceCountBufferOffset() const; + + Buffer* instanceDescriptorBuffer() const; + NS::UInteger instanceDescriptorBufferOffset() const; + + NS::UInteger instanceDescriptorStride() const; + + AccelerationStructureInstanceDescriptorType instanceDescriptorType() const; + + MatrixLayout instanceTransformationMatrixLayout() const; + + NS::UInteger maxInstanceCount() const; + + NS::UInteger maxMotionTransformCount() const; + + Buffer* motionTransformBuffer() const; + NS::UInteger motionTransformBufferOffset() const; + + Buffer* motionTransformCountBuffer() const; + NS::UInteger motionTransformCountBufferOffset() const; + + NS::UInteger motionTransformStride() const; + + TransformType motionTransformType() const; + + void setInstanceCountBuffer(const MTL::Buffer* instanceCountBuffer); + void setInstanceCountBufferOffset(NS::UInteger instanceCountBufferOffset); + + void setInstanceDescriptorBuffer(const MTL::Buffer* instanceDescriptorBuffer); + void setInstanceDescriptorBufferOffset(NS::UInteger instanceDescriptorBufferOffset); + + void setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride); + + void setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType); + + void setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout); + + void setMaxInstanceCount(NS::UInteger maxInstanceCount); + + void setMaxMotionTransformCount(NS::UInteger maxMotionTransformCount); + + void setMotionTransformBuffer(const MTL::Buffer* motionTransformBuffer); + void setMotionTransformBufferOffset(NS::UInteger motionTransformBufferOffset); + + void setMotionTransformCountBuffer(const MTL::Buffer* motionTransformCountBuffer); + void setMotionTransformCountBufferOffset(NS::UInteger motionTransformCountBufferOffset); + + void setMotionTransformStride(NS::UInteger motionTransformStride); + + void setMotionTransformType(MTL::TransformType motionTransformType); +}; class AccelerationStructure : public NS::Referencing { public: - NS::UInteger size() const; + ResourceID gpuResourceID() const; - MTL::ResourceID gpuResourceID() const; + NS::UInteger size() const; }; } -// static method: alloc _MTL_INLINE MTL::AccelerationStructureDescriptor* MTL::AccelerationStructureDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureDescriptor)); } -// method: init _MTL_INLINE MTL::AccelerationStructureDescriptor* MTL::AccelerationStructureDescriptor::init() { return NS::Object::init(); } -// property: usage -_MTL_INLINE MTL::AccelerationStructureUsage MTL::AccelerationStructureDescriptor::usage() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); -} - _MTL_INLINE void MTL::AccelerationStructureDescriptor::setUsage(MTL::AccelerationStructureUsage usage) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setUsage_), usage); } -// static method: alloc +_MTL_INLINE MTL::AccelerationStructureUsage MTL::AccelerationStructureDescriptor::usage() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); +} + _MTL_INLINE MTL::AccelerationStructureGeometryDescriptor* MTL::AccelerationStructureGeometryDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureGeometryDescriptor)); } -// method: init +_MTL_INLINE bool MTL::AccelerationStructureGeometryDescriptor::allowDuplicateIntersectionFunctionInvocation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowDuplicateIntersectionFunctionInvocation)); +} + _MTL_INLINE MTL::AccelerationStructureGeometryDescriptor* MTL::AccelerationStructureGeometryDescriptor::init() { return NS::Object::init(); } -// property: intersectionFunctionTableOffset _MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::intersectionFunctionTableOffset() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(intersectionFunctionTableOffset)); } -_MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setIntersectionFunctionTableOffset(NS::UInteger intersectionFunctionTableOffset) +_MTL_INLINE NS::String* MTL::AccelerationStructureGeometryDescriptor::label() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTableOffset_), intersectionFunctionTableOffset); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -// property: opaque _MTL_INLINE bool MTL::AccelerationStructureGeometryDescriptor::opaque() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(opaque)); } -_MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setOpaque(bool opaque) +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureGeometryDescriptor::primitiveDataBuffer() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaque_), opaque); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataBuffer)); } -// property: allowDuplicateIntersectionFunctionInvocation -_MTL_INLINE bool MTL::AccelerationStructureGeometryDescriptor::allowDuplicateIntersectionFunctionInvocation() const +_MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::primitiveDataBufferOffset() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowDuplicateIntersectionFunctionInvocation)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataBufferOffset)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::primitiveDataElementSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataElementSize)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::primitiveDataStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataStride)); } _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setAllowDuplicateIntersectionFunctionInvocation(bool allowDuplicateIntersectionFunctionInvocation) @@ -414,10 +741,9 @@ _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setAllowDuplicate Object::sendMessage(this, _MTL_PRIVATE_SEL(setAllowDuplicateIntersectionFunctionInvocation_), allowDuplicateIntersectionFunctionInvocation); } -// property: label -_MTL_INLINE NS::String* MTL::AccelerationStructureGeometryDescriptor::label() const +_MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setIntersectionFunctionTableOffset(NS::UInteger intersectionFunctionTableOffset) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTableOffset_), intersectionFunctionTableOffset); } _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setLabel(const NS::String* label) @@ -425,10 +751,9 @@ _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setLabel(const NS Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: primitiveDataBuffer -_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureGeometryDescriptor::primitiveDataBuffer() const +_MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setOpaque(bool opaque) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataBuffer)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaque_), opaque); } _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setPrimitiveDataBuffer(const MTL::Buffer* primitiveDataBuffer) @@ -436,55 +761,64 @@ _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setPrimitiveDataB Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataBuffer_), primitiveDataBuffer); } -// property: primitiveDataBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::primitiveDataBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataBufferOffset)); -} - _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setPrimitiveDataBufferOffset(NS::UInteger primitiveDataBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataBufferOffset_), primitiveDataBufferOffset); } -// property: primitiveDataStride -_MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::primitiveDataStride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataStride)); -} - -_MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setPrimitiveDataStride(NS::UInteger primitiveDataStride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataStride_), primitiveDataStride); -} - -// property: primitiveDataElementSize -_MTL_INLINE NS::UInteger MTL::AccelerationStructureGeometryDescriptor::primitiveDataElementSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(primitiveDataElementSize)); -} - _MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setPrimitiveDataElementSize(NS::UInteger primitiveDataElementSize) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataElementSize_), primitiveDataElementSize); } -// static method: alloc +_MTL_INLINE void MTL::AccelerationStructureGeometryDescriptor::setPrimitiveDataStride(NS::UInteger primitiveDataStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrimitiveDataStride_), primitiveDataStride); +} + _MTL_INLINE MTL::PrimitiveAccelerationStructureDescriptor* MTL::PrimitiveAccelerationStructureDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLPrimitiveAccelerationStructureDescriptor)); } -// method: init +_MTL_INLINE MTL::PrimitiveAccelerationStructureDescriptor* MTL::PrimitiveAccelerationStructureDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLPrimitiveAccelerationStructureDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + +_MTL_INLINE NS::Array* MTL::PrimitiveAccelerationStructureDescriptor::geometryDescriptors() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(geometryDescriptors)); +} + _MTL_INLINE MTL::PrimitiveAccelerationStructureDescriptor* MTL::PrimitiveAccelerationStructureDescriptor::init() { return NS::Object::init(); } -// property: geometryDescriptors -_MTL_INLINE NS::Array* MTL::PrimitiveAccelerationStructureDescriptor::geometryDescriptors() const +_MTL_INLINE MTL::MotionBorderMode MTL::PrimitiveAccelerationStructureDescriptor::motionEndBorderMode() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(geometryDescriptors)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionEndBorderMode)); +} + +_MTL_INLINE float MTL::PrimitiveAccelerationStructureDescriptor::motionEndTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionEndTime)); +} + +_MTL_INLINE NS::UInteger MTL::PrimitiveAccelerationStructureDescriptor::motionKeyframeCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionKeyframeCount)); +} + +_MTL_INLINE MTL::MotionBorderMode MTL::PrimitiveAccelerationStructureDescriptor::motionStartBorderMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionStartBorderMode)); +} + +_MTL_INLINE float MTL::PrimitiveAccelerationStructureDescriptor::motionStartTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionStartTime)); } _MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setGeometryDescriptors(const NS::Array* geometryDescriptors) @@ -492,273 +826,234 @@ _MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setGeometryDescr Object::sendMessage(this, _MTL_PRIVATE_SEL(setGeometryDescriptors_), geometryDescriptors); } -// property: motionStartBorderMode -_MTL_INLINE MTL::MotionBorderMode MTL::PrimitiveAccelerationStructureDescriptor::motionStartBorderMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionStartBorderMode)); -} - -_MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionStartBorderMode(MTL::MotionBorderMode motionStartBorderMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionStartBorderMode_), motionStartBorderMode); -} - -// property: motionEndBorderMode -_MTL_INLINE MTL::MotionBorderMode MTL::PrimitiveAccelerationStructureDescriptor::motionEndBorderMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionEndBorderMode)); -} - _MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionEndBorderMode(MTL::MotionBorderMode motionEndBorderMode) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionEndBorderMode_), motionEndBorderMode); } -// property: motionStartTime -_MTL_INLINE float MTL::PrimitiveAccelerationStructureDescriptor::motionStartTime() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionStartTime)); -} - -_MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionStartTime(float motionStartTime) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionStartTime_), motionStartTime); -} - -// property: motionEndTime -_MTL_INLINE float MTL::PrimitiveAccelerationStructureDescriptor::motionEndTime() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionEndTime)); -} - _MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionEndTime(float motionEndTime) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionEndTime_), motionEndTime); } -// property: motionKeyframeCount -_MTL_INLINE NS::UInteger MTL::PrimitiveAccelerationStructureDescriptor::motionKeyframeCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionKeyframeCount)); -} - _MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionKeyframeCount(NS::UInteger motionKeyframeCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionKeyframeCount_), motionKeyframeCount); } -// static method: descriptor -_MTL_INLINE MTL::PrimitiveAccelerationStructureDescriptor* MTL::PrimitiveAccelerationStructureDescriptor::descriptor() +_MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionStartBorderMode(MTL::MotionBorderMode motionStartBorderMode) { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLPrimitiveAccelerationStructureDescriptor), _MTL_PRIVATE_SEL(descriptor)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionStartBorderMode_), motionStartBorderMode); +} + +_MTL_INLINE void MTL::PrimitiveAccelerationStructureDescriptor::setMotionStartTime(float motionStartTime) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionStartTime_), motionStartTime); } -// static method: alloc _MTL_INLINE MTL::AccelerationStructureTriangleGeometryDescriptor* MTL::AccelerationStructureTriangleGeometryDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureTriangleGeometryDescriptor)); } -// method: init -_MTL_INLINE MTL::AccelerationStructureTriangleGeometryDescriptor* MTL::AccelerationStructureTriangleGeometryDescriptor::init() +_MTL_INLINE MTL::AccelerationStructureTriangleGeometryDescriptor* MTL::AccelerationStructureTriangleGeometryDescriptor::descriptor() { - return NS::Object::init(); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureTriangleGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); } -// property: vertexBuffer -_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureTriangleGeometryDescriptor::vertexBuffer() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffer)); -} - -_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexBuffer(const MTL::Buffer* vertexBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_), vertexBuffer); -} - -// property: vertexBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::vertexBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBufferOffset)); -} - -_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexBufferOffset(NS::UInteger vertexBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBufferOffset_), vertexBufferOffset); -} - -// property: vertexFormat -_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureTriangleGeometryDescriptor::vertexFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFormat)); -} - -_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexFormat(MTL::AttributeFormat vertexFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFormat_), vertexFormat); -} - -// property: vertexStride -_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::vertexStride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStride)); -} - -_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexStride(NS::UInteger vertexStride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStride_), vertexStride); -} - -// property: indexBuffer _MTL_INLINE MTL::Buffer* MTL::AccelerationStructureTriangleGeometryDescriptor::indexBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); } +_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::indexBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferOffset)); +} + +_MTL_INLINE MTL::IndexType MTL::AccelerationStructureTriangleGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL::AccelerationStructureTriangleGeometryDescriptor* MTL::AccelerationStructureTriangleGeometryDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setIndexBuffer(const MTL::Buffer* indexBuffer) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); } -// property: indexBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::indexBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferOffset)); -} - _MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setIndexBufferOffset(NS::UInteger indexBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBufferOffset_), indexBufferOffset); } -// property: indexType -_MTL_INLINE MTL::IndexType MTL::AccelerationStructureTriangleGeometryDescriptor::indexType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); -} - _MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setIndexType(MTL::IndexType indexType) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); } -// property: triangleCount -_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::triangleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(triangleCount)); -} - -_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setTriangleCount(NS::UInteger triangleCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleCount_), triangleCount); -} - -// property: transformationMatrixBuffer -_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixBuffer() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBuffer)); -} - _MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setTransformationMatrixBuffer(const MTL::Buffer* transformationMatrixBuffer) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixBuffer_), transformationMatrixBuffer); } -// property: transformationMatrixBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBufferOffset)); -} - _MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setTransformationMatrixBufferOffset(NS::UInteger transformationMatrixBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixBufferOffset_), transformationMatrixBufferOffset); } -// static method: descriptor -_MTL_INLINE MTL::AccelerationStructureTriangleGeometryDescriptor* MTL::AccelerationStructureTriangleGeometryDescriptor::descriptor() +_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout) { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureTriangleGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixLayout_), transformationMatrixLayout); +} + +_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setTriangleCount(NS::UInteger triangleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleCount_), triangleCount); +} + +_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexBuffer(const MTL::Buffer* vertexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_), vertexBuffer); +} + +_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexBufferOffset(NS::UInteger vertexBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBufferOffset_), vertexBufferOffset); +} + +_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexFormat(MTL::AttributeFormat vertexFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFormat_), vertexFormat); +} + +_MTL_INLINE void MTL::AccelerationStructureTriangleGeometryDescriptor::setVertexStride(NS::UInteger vertexStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStride_), vertexStride); +} + +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBufferOffset)); +} + +_MTL_INLINE MTL::MatrixLayout MTL::AccelerationStructureTriangleGeometryDescriptor::transformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixLayout)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::triangleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(triangleCount)); +} + +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureTriangleGeometryDescriptor::vertexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::vertexBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBufferOffset)); +} + +_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureTriangleGeometryDescriptor::vertexFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFormat)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureTriangleGeometryDescriptor::vertexStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStride)); } -// static method: alloc _MTL_INLINE MTL::AccelerationStructureBoundingBoxGeometryDescriptor* MTL::AccelerationStructureBoundingBoxGeometryDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureBoundingBoxGeometryDescriptor)); } -// method: init -_MTL_INLINE MTL::AccelerationStructureBoundingBoxGeometryDescriptor* MTL::AccelerationStructureBoundingBoxGeometryDescriptor::init() -{ - return NS::Object::init(); -} - -// property: boundingBoxBuffer _MTL_INLINE MTL::Buffer* MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxBuffer)); } +_MTL_INLINE NS::UInteger MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxBufferOffset)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxCount)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxStride)); +} + +_MTL_INLINE MTL::AccelerationStructureBoundingBoxGeometryDescriptor* MTL::AccelerationStructureBoundingBoxGeometryDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureBoundingBoxGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + +_MTL_INLINE MTL::AccelerationStructureBoundingBoxGeometryDescriptor* MTL::AccelerationStructureBoundingBoxGeometryDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxBuffer(const MTL::Buffer* boundingBoxBuffer) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxBuffer_), boundingBoxBuffer); } -// property: boundingBoxBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxBufferOffset)); -} - _MTL_INLINE void MTL::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxBufferOffset(NS::UInteger boundingBoxBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxBufferOffset_), boundingBoxBufferOffset); } -// property: boundingBoxStride -_MTL_INLINE NS::UInteger MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxStride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxStride)); -} - -_MTL_INLINE void MTL::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxStride(NS::UInteger boundingBoxStride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxStride_), boundingBoxStride); -} - -// property: boundingBoxCount -_MTL_INLINE NS::UInteger MTL::AccelerationStructureBoundingBoxGeometryDescriptor::boundingBoxCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxCount)); -} - _MTL_INLINE void MTL::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxCount(NS::UInteger boundingBoxCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxCount_), boundingBoxCount); } -// static method: descriptor -_MTL_INLINE MTL::AccelerationStructureBoundingBoxGeometryDescriptor* MTL::AccelerationStructureBoundingBoxGeometryDescriptor::descriptor() +_MTL_INLINE void MTL::AccelerationStructureBoundingBoxGeometryDescriptor::setBoundingBoxStride(NS::UInteger boundingBoxStride) { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureBoundingBoxGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxStride_), boundingBoxStride); } -// static method: alloc _MTL_INLINE MTL::MotionKeyframeData* MTL::MotionKeyframeData::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLMotionKeyframeData)); } -// method: init +_MTL_INLINE MTL::Buffer* MTL::MotionKeyframeData::buffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffer)); +} + +_MTL_INLINE MTL::MotionKeyframeData* MTL::MotionKeyframeData::data() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLMotionKeyframeData), _MTL_PRIVATE_SEL(data)); +} + _MTL_INLINE MTL::MotionKeyframeData* MTL::MotionKeyframeData::init() { return NS::Object::init(); } -// property: buffer -_MTL_INLINE MTL::Buffer* MTL::MotionKeyframeData::buffer() const +_MTL_INLINE NS::UInteger MTL::MotionKeyframeData::offset() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffer)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(offset)); } _MTL_INLINE void MTL::MotionKeyframeData::setBuffer(const MTL::Buffer* buffer) @@ -766,167 +1061,164 @@ _MTL_INLINE void MTL::MotionKeyframeData::setBuffer(const MTL::Buffer* buffer) Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_), buffer); } -// property: offset -_MTL_INLINE NS::UInteger MTL::MotionKeyframeData::offset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(offset)); -} - _MTL_INLINE void MTL::MotionKeyframeData::setOffset(NS::UInteger offset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setOffset_), offset); } -// static method: data -_MTL_INLINE MTL::MotionKeyframeData* MTL::MotionKeyframeData::data() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLMotionKeyframeData), _MTL_PRIVATE_SEL(data)); -} - -// static method: alloc _MTL_INLINE MTL::AccelerationStructureMotionTriangleGeometryDescriptor* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionTriangleGeometryDescriptor)); } -// method: init -_MTL_INLINE MTL::AccelerationStructureMotionTriangleGeometryDescriptor* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::init() +_MTL_INLINE MTL::AccelerationStructureMotionTriangleGeometryDescriptor* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::descriptor() { - return NS::Object::init(); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionTriangleGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); } -// property: vertexBuffers -_MTL_INLINE NS::Array* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::vertexBuffers() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffers)); -} - -_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexBuffers(const NS::Array* vertexBuffers) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffers_), vertexBuffers); -} - -// property: vertexFormat -_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureMotionTriangleGeometryDescriptor::vertexFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFormat)); -} - -_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexFormat(MTL::AttributeFormat vertexFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFormat_), vertexFormat); -} - -// property: vertexStride -_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::vertexStride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStride)); -} - -_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexStride(NS::UInteger vertexStride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStride_), vertexStride); -} - -// property: indexBuffer _MTL_INLINE MTL::Buffer* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::indexBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); } +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::indexBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferOffset)); +} + +_MTL_INLINE MTL::IndexType MTL::AccelerationStructureMotionTriangleGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL::AccelerationStructureMotionTriangleGeometryDescriptor* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setIndexBuffer(const MTL::Buffer* indexBuffer) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); } -// property: indexBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::indexBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferOffset)); -} - _MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setIndexBufferOffset(NS::UInteger indexBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBufferOffset_), indexBufferOffset); } -// property: indexType -_MTL_INLINE MTL::IndexType MTL::AccelerationStructureMotionTriangleGeometryDescriptor::indexType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); -} - _MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setIndexType(MTL::IndexType indexType) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); } -// property: triangleCount -_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::triangleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(triangleCount)); -} - -_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setTriangleCount(NS::UInteger triangleCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleCount_), triangleCount); -} - -// property: transformationMatrixBuffer -_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixBuffer() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBuffer)); -} - _MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setTransformationMatrixBuffer(const MTL::Buffer* transformationMatrixBuffer) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixBuffer_), transformationMatrixBuffer); } -// property: transformationMatrixBufferOffset -_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBufferOffset)); -} - _MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setTransformationMatrixBufferOffset(NS::UInteger transformationMatrixBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixBufferOffset_), transformationMatrixBufferOffset); } -// static method: descriptor -_MTL_INLINE MTL::AccelerationStructureMotionTriangleGeometryDescriptor* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::descriptor() +_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setTransformationMatrixLayout(MTL::MatrixLayout transformationMatrixLayout) { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionTriangleGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTransformationMatrixLayout_), transformationMatrixLayout); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setTriangleCount(NS::UInteger triangleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleCount_), triangleCount); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexBuffers(const NS::Array* vertexBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffers_), vertexBuffers); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexFormat(MTL::AttributeFormat vertexFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFormat_), vertexFormat); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionTriangleGeometryDescriptor::setVertexStride(NS::UInteger vertexStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexStride_), vertexStride); +} + +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixBufferOffset)); +} + +_MTL_INLINE MTL::MatrixLayout MTL::AccelerationStructureMotionTriangleGeometryDescriptor::transformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(transformationMatrixLayout)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::triangleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(triangleCount)); +} + +_MTL_INLINE NS::Array* MTL::AccelerationStructureMotionTriangleGeometryDescriptor::vertexBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffers)); +} + +_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureMotionTriangleGeometryDescriptor::vertexFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFormat)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionTriangleGeometryDescriptor::vertexStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexStride)); } -// static method: alloc _MTL_INLINE MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor)); } -// method: init -_MTL_INLINE MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::init() -{ - return NS::Object::init(); -} - -// property: boundingBoxBuffers _MTL_INLINE NS::Array* MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxBuffers() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxBuffers)); } +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxCount)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxStride)); +} + +_MTL_INLINE MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + +_MTL_INLINE MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxBuffers(const NS::Array* boundingBoxBuffers) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxBuffers_), boundingBoxBuffers); } -// property: boundingBoxStride -_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxStride() const +_MTL_INLINE void MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxCount(NS::UInteger boundingBoxCount) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxStride)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxCount_), boundingBoxCount); } _MTL_INLINE void MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxStride(NS::UInteger boundingBoxStride) @@ -934,72 +1226,429 @@ _MTL_INLINE void MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor:: Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxStride_), boundingBoxStride); } -// property: boundingBoxCount -_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::boundingBoxCount() const +_MTL_INLINE MTL::AccelerationStructureCurveGeometryDescriptor* MTL::AccelerationStructureCurveGeometryDescriptor::alloc() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(boundingBoxCount)); + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureCurveGeometryDescriptor)); } -_MTL_INLINE void MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::setBoundingBoxCount(NS::UInteger boundingBoxCount) +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureCurveGeometryDescriptor::controlPointBuffer() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBoundingBoxCount_), boundingBoxCount); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointBuffer)); } -// static method: descriptor -_MTL_INLINE MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor* MTL::AccelerationStructureMotionBoundingBoxGeometryDescriptor::descriptor() +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::controlPointBufferOffset() const { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointBufferOffset)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::controlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointCount)); +} + +_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureCurveGeometryDescriptor::controlPointFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointFormat)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::controlPointStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointStride)); +} + +_MTL_INLINE MTL::CurveBasis MTL::AccelerationStructureCurveGeometryDescriptor::curveBasis() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveBasis)); +} + +_MTL_INLINE MTL::CurveEndCaps MTL::AccelerationStructureCurveGeometryDescriptor::curveEndCaps() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveEndCaps)); +} + +_MTL_INLINE MTL::CurveType MTL::AccelerationStructureCurveGeometryDescriptor::curveType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveType)); +} + +_MTL_INLINE MTL::AccelerationStructureCurveGeometryDescriptor* MTL::AccelerationStructureCurveGeometryDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureCurveGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureCurveGeometryDescriptor::indexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::indexBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferOffset)); +} + +_MTL_INLINE MTL::IndexType MTL::AccelerationStructureCurveGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL::AccelerationStructureCurveGeometryDescriptor* MTL::AccelerationStructureCurveGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureCurveGeometryDescriptor::radiusBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::radiusBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusBufferOffset)); +} + +_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureCurveGeometryDescriptor::radiusFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusFormat)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::radiusStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusStride)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::segmentControlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentControlPointCount)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureCurveGeometryDescriptor::segmentCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentCount)); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setControlPointBuffer(const MTL::Buffer* controlPointBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointBuffer_), controlPointBuffer); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setControlPointBufferOffset(NS::UInteger controlPointBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointBufferOffset_), controlPointBufferOffset); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setControlPointCount(NS::UInteger controlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointCount_), controlPointCount); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setControlPointFormat(MTL::AttributeFormat controlPointFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointFormat_), controlPointFormat); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setControlPointStride(NS::UInteger controlPointStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointStride_), controlPointStride); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setCurveBasis(MTL::CurveBasis curveBasis) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveBasis_), curveBasis); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setCurveEndCaps(MTL::CurveEndCaps curveEndCaps) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveEndCaps_), curveEndCaps); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setCurveType(MTL::CurveType curveType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveType_), curveType); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setIndexBuffer(const MTL::Buffer* indexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setIndexBufferOffset(NS::UInteger indexBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBufferOffset_), indexBufferOffset); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setIndexType(MTL::IndexType indexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setRadiusBuffer(const MTL::Buffer* radiusBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusBuffer_), radiusBuffer); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setRadiusBufferOffset(NS::UInteger radiusBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusBufferOffset_), radiusBufferOffset); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setRadiusFormat(MTL::AttributeFormat radiusFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusFormat_), radiusFormat); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setRadiusStride(NS::UInteger radiusStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusStride_), radiusStride); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setSegmentControlPointCount(NS::UInteger segmentControlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentControlPointCount_), segmentControlPointCount); +} + +_MTL_INLINE void MTL::AccelerationStructureCurveGeometryDescriptor::setSegmentCount(NS::UInteger segmentCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentCount_), segmentCount); +} + +_MTL_INLINE MTL::AccelerationStructureMotionCurveGeometryDescriptor* MTL::AccelerationStructureMotionCurveGeometryDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionCurveGeometryDescriptor)); +} + +_MTL_INLINE NS::Array* MTL::AccelerationStructureMotionCurveGeometryDescriptor::controlPointBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointBuffers)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionCurveGeometryDescriptor::controlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointCount)); +} + +_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureMotionCurveGeometryDescriptor::controlPointFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointFormat)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionCurveGeometryDescriptor::controlPointStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlPointStride)); +} + +_MTL_INLINE MTL::CurveBasis MTL::AccelerationStructureMotionCurveGeometryDescriptor::curveBasis() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveBasis)); +} + +_MTL_INLINE MTL::CurveEndCaps MTL::AccelerationStructureMotionCurveGeometryDescriptor::curveEndCaps() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveEndCaps)); +} + +_MTL_INLINE MTL::CurveType MTL::AccelerationStructureMotionCurveGeometryDescriptor::curveType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(curveType)); +} + +_MTL_INLINE MTL::AccelerationStructureMotionCurveGeometryDescriptor* MTL::AccelerationStructureMotionCurveGeometryDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructureMotionCurveGeometryDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + +_MTL_INLINE MTL::Buffer* MTL::AccelerationStructureMotionCurveGeometryDescriptor::indexBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionCurveGeometryDescriptor::indexBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferOffset)); +} + +_MTL_INLINE MTL::IndexType MTL::AccelerationStructureMotionCurveGeometryDescriptor::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL::AccelerationStructureMotionCurveGeometryDescriptor* MTL::AccelerationStructureMotionCurveGeometryDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::Array* MTL::AccelerationStructureMotionCurveGeometryDescriptor::radiusBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusBuffers)); +} + +_MTL_INLINE MTL::AttributeFormat MTL::AccelerationStructureMotionCurveGeometryDescriptor::radiusFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusFormat)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionCurveGeometryDescriptor::radiusStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(radiusStride)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionCurveGeometryDescriptor::segmentControlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentControlPointCount)); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructureMotionCurveGeometryDescriptor::segmentCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(segmentCount)); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointBuffers(const NS::Array* controlPointBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointBuffers_), controlPointBuffers); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointCount(NS::UInteger controlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointCount_), controlPointCount); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointFormat(MTL::AttributeFormat controlPointFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointFormat_), controlPointFormat); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setControlPointStride(NS::UInteger controlPointStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlPointStride_), controlPointStride); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setCurveBasis(MTL::CurveBasis curveBasis) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveBasis_), curveBasis); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setCurveEndCaps(MTL::CurveEndCaps curveEndCaps) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveEndCaps_), curveEndCaps); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setCurveType(MTL::CurveType curveType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCurveType_), curveType); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setIndexBuffer(const MTL::Buffer* indexBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBuffer_), indexBuffer); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setIndexBufferOffset(NS::UInteger indexBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBufferOffset_), indexBufferOffset); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setIndexType(MTL::IndexType indexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setRadiusBuffers(const NS::Array* radiusBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusBuffers_), radiusBuffers); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setRadiusFormat(MTL::AttributeFormat radiusFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusFormat_), radiusFormat); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setRadiusStride(NS::UInteger radiusStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRadiusStride_), radiusStride); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setSegmentControlPointCount(NS::UInteger segmentControlPointCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentControlPointCount_), segmentControlPointCount); +} + +_MTL_INLINE void MTL::AccelerationStructureMotionCurveGeometryDescriptor::setSegmentCount(NS::UInteger segmentCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSegmentCount_), segmentCount); } -// static method: alloc _MTL_INLINE MTL::InstanceAccelerationStructureDescriptor* MTL::InstanceAccelerationStructureDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLInstanceAccelerationStructureDescriptor)); } -// method: init +_MTL_INLINE MTL::InstanceAccelerationStructureDescriptor* MTL::InstanceAccelerationStructureDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLInstanceAccelerationStructureDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + _MTL_INLINE MTL::InstanceAccelerationStructureDescriptor* MTL::InstanceAccelerationStructureDescriptor::init() { return NS::Object::init(); } -// property: instanceDescriptorBuffer +_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::instanceCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceCount)); +} + _MTL_INLINE MTL::Buffer* MTL::InstanceAccelerationStructureDescriptor::instanceDescriptorBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorBuffer)); } -_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorBuffer(const MTL::Buffer* instanceDescriptorBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBuffer_), instanceDescriptorBuffer); -} - -// property: instanceDescriptorBufferOffset _MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::instanceDescriptorBufferOffset() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorBufferOffset)); } -_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorBufferOffset(NS::UInteger instanceDescriptorBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBufferOffset_), instanceDescriptorBufferOffset); -} - -// property: instanceDescriptorStride _MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::instanceDescriptorStride() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorStride)); } -_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride) +_MTL_INLINE MTL::AccelerationStructureInstanceDescriptorType MTL::InstanceAccelerationStructureDescriptor::instanceDescriptorType() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorStride_), instanceDescriptorStride); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorType)); } -// property: instanceCount -_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::instanceCount() const +_MTL_INLINE MTL::MatrixLayout MTL::InstanceAccelerationStructureDescriptor::instanceTransformationMatrixLayout() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceCount)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceTransformationMatrixLayout)); +} + +_MTL_INLINE NS::Array* MTL::InstanceAccelerationStructureDescriptor::instancedAccelerationStructures() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instancedAccelerationStructures)); +} + +_MTL_INLINE MTL::Buffer* MTL::InstanceAccelerationStructureDescriptor::motionTransformBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::motionTransformBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBufferOffset)); +} + +_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::motionTransformCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformCount)); +} + +_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::motionTransformStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformStride)); +} + +_MTL_INLINE MTL::TransformType MTL::InstanceAccelerationStructureDescriptor::motionTransformType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformType)); } _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceCount(NS::UInteger instanceCount) @@ -1007,21 +1656,19 @@ _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceCount( Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceCount_), instanceCount); } -// property: instancedAccelerationStructures -_MTL_INLINE NS::Array* MTL::InstanceAccelerationStructureDescriptor::instancedAccelerationStructures() const +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorBuffer(const MTL::Buffer* instanceDescriptorBuffer) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(instancedAccelerationStructures)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBuffer_), instanceDescriptorBuffer); } -_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstancedAccelerationStructures(const NS::Array* instancedAccelerationStructures) +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorBufferOffset(NS::UInteger instanceDescriptorBufferOffset) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstancedAccelerationStructures_), instancedAccelerationStructures); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBufferOffset_), instanceDescriptorBufferOffset); } -// property: instanceDescriptorType -_MTL_INLINE MTL::AccelerationStructureInstanceDescriptorType MTL::InstanceAccelerationStructureDescriptor::instanceDescriptorType() const +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorType)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorStride_), instanceDescriptorStride); } _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType) @@ -1029,10 +1676,14 @@ _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceDescri Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorType_), instanceDescriptorType); } -// property: motionTransformBuffer -_MTL_INLINE MTL::Buffer* MTL::InstanceAccelerationStructureDescriptor::motionTransformBuffer() const +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBuffer)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceTransformationMatrixLayout_), instanceTransformationMatrixLayout); +} + +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setInstancedAccelerationStructures(const NS::Array* instancedAccelerationStructures) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstancedAccelerationStructures_), instancedAccelerationStructures); } _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setMotionTransformBuffer(const MTL::Buffer* motionTransformBuffer) @@ -1040,42 +1691,197 @@ _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setMotionTransfor Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformBuffer_), motionTransformBuffer); } -// property: motionTransformBufferOffset -_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::motionTransformBufferOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBufferOffset)); -} - _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setMotionTransformBufferOffset(NS::UInteger motionTransformBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformBufferOffset_), motionTransformBufferOffset); } -// property: motionTransformCount -_MTL_INLINE NS::UInteger MTL::InstanceAccelerationStructureDescriptor::motionTransformCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformCount)); -} - _MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setMotionTransformCount(NS::UInteger motionTransformCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformCount_), motionTransformCount); } -// static method: descriptor -_MTL_INLINE MTL::InstanceAccelerationStructureDescriptor* MTL::InstanceAccelerationStructureDescriptor::descriptor() +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setMotionTransformStride(NS::UInteger motionTransformStride) { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLInstanceAccelerationStructureDescriptor), _MTL_PRIVATE_SEL(descriptor)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformStride_), motionTransformStride); } -// property: size -_MTL_INLINE NS::UInteger MTL::AccelerationStructure::size() const +_MTL_INLINE void MTL::InstanceAccelerationStructureDescriptor::setMotionTransformType(MTL::TransformType motionTransformType) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformType_), motionTransformType); +} + +_MTL_INLINE MTL::IndirectInstanceAccelerationStructureDescriptor* MTL::IndirectInstanceAccelerationStructureDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLIndirectInstanceAccelerationStructureDescriptor)); +} + +_MTL_INLINE MTL::IndirectInstanceAccelerationStructureDescriptor* MTL::IndirectInstanceAccelerationStructureDescriptor::descriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLIndirectInstanceAccelerationStructureDescriptor), _MTL_PRIVATE_SEL(descriptor)); +} + +_MTL_INLINE MTL::IndirectInstanceAccelerationStructureDescriptor* MTL::IndirectInstanceAccelerationStructureDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::Buffer* MTL::IndirectInstanceAccelerationStructureDescriptor::instanceCountBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceCountBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::instanceCountBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceCountBufferOffset)); +} + +_MTL_INLINE MTL::Buffer* MTL::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorBufferOffset)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorStride)); +} + +_MTL_INLINE MTL::AccelerationStructureInstanceDescriptorType MTL::IndirectInstanceAccelerationStructureDescriptor::instanceDescriptorType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceDescriptorType)); +} + +_MTL_INLINE MTL::MatrixLayout MTL::IndirectInstanceAccelerationStructureDescriptor::instanceTransformationMatrixLayout() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(instanceTransformationMatrixLayout)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::maxInstanceCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxInstanceCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::maxMotionTransformCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxMotionTransformCount)); +} + +_MTL_INLINE MTL::Buffer* MTL::IndirectInstanceAccelerationStructureDescriptor::motionTransformBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::motionTransformBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformBufferOffset)); +} + +_MTL_INLINE MTL::Buffer* MTL::IndirectInstanceAccelerationStructureDescriptor::motionTransformCountBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformCountBuffer)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::motionTransformCountBufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformCountBufferOffset)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectInstanceAccelerationStructureDescriptor::motionTransformStride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformStride)); +} + +_MTL_INLINE MTL::TransformType MTL::IndirectInstanceAccelerationStructureDescriptor::motionTransformType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(motionTransformType)); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceCountBuffer(const MTL::Buffer* instanceCountBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceCountBuffer_), instanceCountBuffer); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceCountBufferOffset(NS::UInteger instanceCountBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceCountBufferOffset_), instanceCountBufferOffset); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorBuffer(const MTL::Buffer* instanceDescriptorBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBuffer_), instanceDescriptorBuffer); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorBufferOffset(NS::UInteger instanceDescriptorBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorBufferOffset_), instanceDescriptorBufferOffset); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorStride(NS::UInteger instanceDescriptorStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorStride_), instanceDescriptorStride); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceDescriptorType(MTL::AccelerationStructureInstanceDescriptorType instanceDescriptorType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceDescriptorType_), instanceDescriptorType); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setInstanceTransformationMatrixLayout(MTL::MatrixLayout instanceTransformationMatrixLayout) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstanceTransformationMatrixLayout_), instanceTransformationMatrixLayout); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMaxInstanceCount(NS::UInteger maxInstanceCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxInstanceCount_), maxInstanceCount); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMaxMotionTransformCount(NS::UInteger maxMotionTransformCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxMotionTransformCount_), maxMotionTransformCount); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformBuffer(const MTL::Buffer* motionTransformBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformBuffer_), motionTransformBuffer); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformBufferOffset(NS::UInteger motionTransformBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformBufferOffset_), motionTransformBufferOffset); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformCountBuffer(const MTL::Buffer* motionTransformCountBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformCountBuffer_), motionTransformCountBuffer); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformCountBufferOffset(NS::UInteger motionTransformCountBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformCountBufferOffset_), motionTransformCountBufferOffset); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformStride(NS::UInteger motionTransformStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformStride_), motionTransformStride); +} + +_MTL_INLINE void MTL::IndirectInstanceAccelerationStructureDescriptor::setMotionTransformType(MTL::TransformType motionTransformType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMotionTransformType_), motionTransformType); } -// property: gpuResourceID _MTL_INLINE MTL::ResourceID MTL::AccelerationStructure::gpuResourceID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); } + +_MTL_INLINE NS::UInteger MTL::AccelerationStructure::size() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); +} diff --git a/vendor/metal-cpp/Metal/MTLAccelerationStructureCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLAccelerationStructureCommandEncoder.hpp index e0b4ccd97..5f82344ae 100644 --- a/vendor/metal-cpp/Metal/MTLAccelerationStructureCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLAccelerationStructureCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLAccelerationStructureCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,270 +20,240 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLAccelerationStructure.hpp" +#include "MTLCommandEncoder.hpp" +#include "MTLDataType.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLAccelerationStructureCommandEncoder.hpp" -#include "MTLArgument.hpp" -#include "MTLCommandEncoder.hpp" - namespace MTL { -_MTL_OPTIONS(NS::UInteger, AccelerationStructureRefitOptions) { - AccelerationStructureRefitOptionVertexData = 1, - AccelerationStructureRefitOptionPerPrimitiveData = 2, -}; +class AccelerationStructure; +class AccelerationStructureDescriptor; +class AccelerationStructurePassDescriptor; +class AccelerationStructurePassSampleBufferAttachmentDescriptor; +class AccelerationStructurePassSampleBufferAttachmentDescriptorArray; +class Buffer; +class CounterSampleBuffer; +class Fence; +class Heap; +class Resource; class AccelerationStructureCommandEncoder : public NS::Referencing { public: - void buildAccelerationStructure(const class AccelerationStructure* accelerationStructure, const class AccelerationStructureDescriptor* descriptor, const class Buffer* scratchBuffer, NS::UInteger scratchBufferOffset); + void buildAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset); - void refitAccelerationStructure(const class AccelerationStructure* sourceAccelerationStructure, const class AccelerationStructureDescriptor* descriptor, const class AccelerationStructure* destinationAccelerationStructure, const class Buffer* scratchBuffer, NS::UInteger scratchBufferOffset); + void copyAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure); - void refitAccelerationStructure(const class AccelerationStructure* sourceAccelerationStructure, const class AccelerationStructureDescriptor* descriptor, const class AccelerationStructure* destinationAccelerationStructure, const class Buffer* scratchBuffer, NS::UInteger scratchBufferOffset, MTL::AccelerationStructureRefitOptions options); + void copyAndCompactAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure); - void copyAccelerationStructure(const class AccelerationStructure* sourceAccelerationStructure, const class AccelerationStructure* destinationAccelerationStructure); + void refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset); + void refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset, MTL::AccelerationStructureRefitOptions options); - void writeCompactedAccelerationStructureSize(const class AccelerationStructure* accelerationStructure, const class Buffer* buffer, NS::UInteger offset); + void sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); - void writeCompactedAccelerationStructureSize(const class AccelerationStructure* accelerationStructure, const class Buffer* buffer, NS::UInteger offset, MTL::DataType sizeDataType); + void updateFence(const MTL::Fence* fence); - void copyAndCompactAccelerationStructure(const class AccelerationStructure* sourceAccelerationStructure, const class AccelerationStructure* destinationAccelerationStructure); + void useHeap(const MTL::Heap* heap); + void useHeaps(const MTL::Heap* const heaps[], NS::UInteger count); - void updateFence(const class Fence* fence); + void useResource(const MTL::Resource* resource, MTL::ResourceUsage usage); + void useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage); - void waitForFence(const class Fence* fence); + void waitForFence(const MTL::Fence* fence); - void useResource(const class Resource* resource, MTL::ResourceUsage usage); - - void useResources(const class Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage); - - void useHeap(const class Heap* heap); - - void useHeaps(const class Heap* const heaps[], NS::UInteger count); - - void sampleCountersInBuffer(const class CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); + void writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL::Buffer* buffer, NS::UInteger offset); + void writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL::Buffer* buffer, NS::UInteger offset, MTL::DataType sizeDataType); }; - class AccelerationStructurePassSampleBufferAttachmentDescriptor : public NS::Copying { public: - static class AccelerationStructurePassSampleBufferAttachmentDescriptor* alloc(); + static AccelerationStructurePassSampleBufferAttachmentDescriptor* alloc(); - class AccelerationStructurePassSampleBufferAttachmentDescriptor* init(); + NS::UInteger endOfEncoderSampleIndex() const; - class CounterSampleBuffer* sampleBuffer() const; - void setSampleBuffer(const class CounterSampleBuffer* sampleBuffer); + AccelerationStructurePassSampleBufferAttachmentDescriptor* init(); - NS::UInteger startOfEncoderSampleIndex() const; - void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + CounterSampleBuffer* sampleBuffer() const; - NS::UInteger endOfEncoderSampleIndex() const; - void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + + void setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer); + + void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + NS::UInteger startOfEncoderSampleIndex() const; }; - class AccelerationStructurePassSampleBufferAttachmentDescriptorArray : public NS::Referencing { public: - static class AccelerationStructurePassSampleBufferAttachmentDescriptorArray* alloc(); + static AccelerationStructurePassSampleBufferAttachmentDescriptorArray* alloc(); - class AccelerationStructurePassSampleBufferAttachmentDescriptorArray* init(); + AccelerationStructurePassSampleBufferAttachmentDescriptorArray* init(); - class AccelerationStructurePassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class AccelerationStructurePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + AccelerationStructurePassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class AccelerationStructurePassDescriptor : public NS::Copying { public: - static class AccelerationStructurePassDescriptor* alloc(); + static AccelerationStructurePassDescriptor* accelerationStructurePassDescriptor(); - class AccelerationStructurePassDescriptor* init(); + static AccelerationStructurePassDescriptor* alloc(); - static class AccelerationStructurePassDescriptor* accelerationStructurePassDescriptor(); + AccelerationStructurePassDescriptor* init(); - class AccelerationStructurePassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; + AccelerationStructurePassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; }; } - -// method: buildAccelerationStructure:descriptor:scratchBuffer:scratchBufferOffset: _MTL_INLINE void MTL::AccelerationStructureCommandEncoder::buildAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(buildAccelerationStructure_descriptor_scratchBuffer_scratchBufferOffset_), accelerationStructure, descriptor, scratchBuffer, scratchBufferOffset); } -// method: refitAccelerationStructure:descriptor:destination:scratchBuffer:scratchBufferOffset: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_), sourceAccelerationStructure, descriptor, destinationAccelerationStructure, scratchBuffer, scratchBufferOffset); -} - -// method: refitAccelerationStructure:descriptor:destination:scratchBuffer:scratchBufferOffset:options: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset, MTL::AccelerationStructureRefitOptions options) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_options_), sourceAccelerationStructure, descriptor, destinationAccelerationStructure, scratchBuffer, scratchBufferOffset, options); -} - -// method: copyAccelerationStructure:toAccelerationStructure: _MTL_INLINE void MTL::AccelerationStructureCommandEncoder::copyAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyAccelerationStructure_toAccelerationStructure_), sourceAccelerationStructure, destinationAccelerationStructure); } -// method: writeCompactedAccelerationStructureSize:toBuffer:offset: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL::Buffer* buffer, NS::UInteger offset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(writeCompactedAccelerationStructureSize_toBuffer_offset_), accelerationStructure, buffer, offset); -} - -// method: writeCompactedAccelerationStructureSize:toBuffer:offset:sizeDataType: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL::Buffer* buffer, NS::UInteger offset, MTL::DataType sizeDataType) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(writeCompactedAccelerationStructureSize_toBuffer_offset_sizeDataType_), accelerationStructure, buffer, offset, sizeDataType); -} - -// method: copyAndCompactAccelerationStructure:toAccelerationStructure: _MTL_INLINE void MTL::AccelerationStructureCommandEncoder::copyAndCompactAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructure* destinationAccelerationStructure) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyAndCompactAccelerationStructure_toAccelerationStructure_), sourceAccelerationStructure, destinationAccelerationStructure); } -// method: updateFence: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::updateFence(const MTL::Fence* fence) +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); + Object::sendMessage(this, _MTL_PRIVATE_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_), sourceAccelerationStructure, descriptor, destinationAccelerationStructure, scratchBuffer, scratchBufferOffset); } -// method: waitForFence: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::waitForFence(const MTL::Fence* fence) +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::refitAccelerationStructure(const MTL::AccelerationStructure* sourceAccelerationStructure, const MTL::AccelerationStructureDescriptor* descriptor, const MTL::AccelerationStructure* destinationAccelerationStructure, const MTL::Buffer* scratchBuffer, NS::UInteger scratchBufferOffset, MTL::AccelerationStructureRefitOptions options) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); + Object::sendMessage(this, _MTL_PRIVATE_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_options_), sourceAccelerationStructure, descriptor, destinationAccelerationStructure, scratchBuffer, scratchBufferOffset, options); } -// method: useResource:usage: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_), resource, usage); -} - -// method: useResources:count:usage: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_), resources, count, usage); -} - -// method: useHeap: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useHeap(const MTL::Heap* heap) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_), heap); -} - -// method: useHeaps:count: -_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_), heaps, count); -} - -// method: sampleCountersInBuffer:atSampleIndex:withBarrier: _MTL_INLINE void MTL::AccelerationStructureCommandEncoder::sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier) { Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCountersInBuffer_atSampleIndex_withBarrier_), sampleBuffer, sampleIndex, barrier); } -// static method: alloc +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::updateFence(const MTL::Fence* fence) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useHeap(const MTL::Heap* heap) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_), heap); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_), heaps, count); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_), resource, usage); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_), resources, count, usage); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::waitForFence(const MTL::Fence* fence) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL::Buffer* buffer, NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(writeCompactedAccelerationStructureSize_toBuffer_offset_), accelerationStructure, buffer, offset); +} + +_MTL_INLINE void MTL::AccelerationStructureCommandEncoder::writeCompactedAccelerationStructureSize(const MTL::AccelerationStructure* accelerationStructure, const MTL::Buffer* buffer, NS::UInteger offset, MTL::DataType sizeDataType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(writeCompactedAccelerationStructureSize_toBuffer_offset_sizeDataType_), accelerationStructure, buffer, offset, sizeDataType); +} + _MTL_INLINE MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor* MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructurePassSampleBufferAttachmentDescriptor)); } -// method: init +_MTL_INLINE NS::UInteger MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor* MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::init() { return NS::Object::init(); } -// property: sampleBuffer _MTL_INLINE MTL::CounterSampleBuffer* MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::sampleBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBuffer)); } -_MTL_INLINE void MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); -} - -// property: startOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); -} - -_MTL_INLINE void MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); -} - -// property: endOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); -} - _MTL_INLINE void MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfEncoderSampleIndex_), endOfEncoderSampleIndex); } -// static method: alloc +_MTL_INLINE void MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); +} + +_MTL_INLINE void MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); +} + +_MTL_INLINE NS::UInteger MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray* MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray* MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor* MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray::setObject(const MTL::AccelerationStructurePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc -_MTL_INLINE MTL::AccelerationStructurePassDescriptor* MTL::AccelerationStructurePassDescriptor::alloc() -{ - return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructurePassDescriptor)); -} - -// method: init -_MTL_INLINE MTL::AccelerationStructurePassDescriptor* MTL::AccelerationStructurePassDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: accelerationStructurePassDescriptor _MTL_INLINE MTL::AccelerationStructurePassDescriptor* MTL::AccelerationStructurePassDescriptor::accelerationStructurePassDescriptor() { return Object::sendMessage(_MTL_PRIVATE_CLS(MTLAccelerationStructurePassDescriptor), _MTL_PRIVATE_SEL(accelerationStructurePassDescriptor)); } -// property: sampleBufferAttachments +_MTL_INLINE MTL::AccelerationStructurePassDescriptor* MTL::AccelerationStructurePassDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAccelerationStructurePassDescriptor)); +} + +_MTL_INLINE MTL::AccelerationStructurePassDescriptor* MTL::AccelerationStructurePassDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE MTL::AccelerationStructurePassSampleBufferAttachmentDescriptorArray* MTL::AccelerationStructurePassDescriptor::sampleBufferAttachments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); diff --git a/vendor/metal-cpp/Metal/MTLAccelerationStructureTypes.hpp b/vendor/metal-cpp/Metal/MTLAccelerationStructureTypes.hpp index 146ffc207..a08b1e962 100644 --- a/vendor/metal-cpp/Metal/MTLAccelerationStructureTypes.hpp +++ b/vendor/metal-cpp/Metal/MTLAccelerationStructureTypes.hpp @@ -2,7 +2,7 @@ // // Metal/MTLAccelerationStructureTypes.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,12 +27,16 @@ #include "MTLResource.hpp" #include "MTLStageInputOutputDescriptor.hpp" -#include "../Foundation/NSRange.hpp" +#include "../Foundation/Foundation.hpp" +#include //------------------------------------------------------------------------------------------------------------------------------------------------------------- namespace MTL { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnested-anon-types" struct PackedFloat3 { PackedFloat3(); @@ -53,6 +57,7 @@ struct PackedFloat3 float elements[3]; }; } _MTL_PACKED; +#pragma clang diagnostic pop struct PackedFloat4x3 { @@ -74,6 +79,59 @@ struct AxisAlignedBoundingBox PackedFloat3 min; PackedFloat3 max; } _MTL_PACKED; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnested-anon-types" +struct PackedFloatQuaternion +{ + PackedFloatQuaternion(); + PackedFloatQuaternion(float x, float y, float z, float w); + + float& operator[](int idx); + const float& operator[](int idx) const; + + union + { + struct + { + float x; + float y; + float z; + float w; + }; + + float elements[4]; + }; + +} _MTL_PACKED; +#pragma clang diagnostic pop + +struct ComponentTransform +{ + PackedFloat3 scale; + PackedFloat3 shear; + PackedFloat3 pivot; + PackedFloatQuaternion rotation; + PackedFloat3 translation; +} _MTL_PACKED; + +} + +namespace MTL4 +{ + +struct BufferRange +{ + BufferRange() = default; + BufferRange(uint64_t bufferAddress); + BufferRange(uint64_t bufferAddress, uint64_t length); + + static MTL4::BufferRange Make(uint64_t bufferAddress, uint64_t length); + + uint64_t bufferAddress; + uint64_t length; +} _MTL_PACKED; + } //------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -144,11 +202,18 @@ _MTL_INLINE const MTL::PackedFloat3& MTL::PackedFloat4x3::operator[](int idx) co //------------------------------------------------------------------------------------------------------------------------------------------------------------- +#if __apple_build_version__ > 16000026 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnan-infinity-disabled" +#endif // __apple_build_version__ > 16000026 _MTL_INLINE MTL::AxisAlignedBoundingBox::AxisAlignedBoundingBox() : min(INFINITY, INFINITY, INFINITY) , max(-INFINITY, -INFINITY, -INFINITY) { } +#if __apple_build_version__ > 16000026 +#pragma clang diagnostic pop +#endif // if __apple_build_version__ > 16000026 //------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -167,3 +232,61 @@ _MTL_INLINE MTL::AxisAlignedBoundingBox::AxisAlignedBoundingBox(PackedFloat3 _mi } //------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE MTL::PackedFloatQuaternion::PackedFloatQuaternion() + : x(0.0f) + , y(0.0f) + , z(0.0f) + , w(0.0f) +{ +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE MTL::PackedFloatQuaternion::PackedFloatQuaternion(float x, float y, float z, float w) + : x(x) + , y(y) + , z(z) + , w(w) +{ +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE float& MTL::PackedFloatQuaternion::operator[](int idx) +{ + return elements[idx]; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE const float& MTL::PackedFloatQuaternion::operator[](int idx) const +{ + return elements[idx]; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE MTL4::BufferRange::BufferRange(uint64_t bufferAddress) +: bufferAddress(bufferAddress) +, length(-1) +{ +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE MTL4::BufferRange::BufferRange(uint64_t bufferAddress, uint64_t length) +: bufferAddress(bufferAddress) +, length(length) +{ +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTL_INLINE MTL4::BufferRange MTL4::BufferRange::Make(uint64_t bufferAddress, uint64_t length) +{ + return MTL4::BufferRange(bufferAddress, length); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + diff --git a/vendor/metal-cpp/Metal/MTLAllocation.hpp b/vendor/metal-cpp/Metal/MTLAllocation.hpp new file mode 100644 index 000000000..ba2010588 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLAllocation.hpp @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLAllocation.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL +{ +class Allocation : public NS::Referencing +{ +public: + NS::UInteger allocatedSize() const; +}; + +} +_MTL_INLINE NS::UInteger MTL::Allocation::allocatedSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allocatedSize)); +} diff --git a/vendor/metal-cpp/Metal/MTLArgument.hpp b/vendor/metal-cpp/Metal/MTLArgument.hpp index 730b21351..f91bd917d 100644 --- a/vendor/metal-cpp/Metal/MTLArgument.hpp +++ b/vendor/metal-cpp/Metal/MTLArgument.hpp @@ -2,7 +2,7 @@ // // Metal/MTLArgument.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,109 +20,28 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLDataType.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLArgument.hpp" +#include "MTLTensor.hpp" #include "MTLTexture.hpp" namespace MTL { -_MTL_ENUM(NS::UInteger, DataType) { - DataTypeNone = 0, - DataTypeStruct = 1, - DataTypeArray = 2, - DataTypeFloat = 3, - DataTypeFloat2 = 4, - DataTypeFloat3 = 5, - DataTypeFloat4 = 6, - DataTypeFloat2x2 = 7, - DataTypeFloat2x3 = 8, - DataTypeFloat2x4 = 9, - DataTypeFloat3x2 = 10, - DataTypeFloat3x3 = 11, - DataTypeFloat3x4 = 12, - DataTypeFloat4x2 = 13, - DataTypeFloat4x3 = 14, - DataTypeFloat4x4 = 15, - DataTypeHalf = 16, - DataTypeHalf2 = 17, - DataTypeHalf3 = 18, - DataTypeHalf4 = 19, - DataTypeHalf2x2 = 20, - DataTypeHalf2x3 = 21, - DataTypeHalf2x4 = 22, - DataTypeHalf3x2 = 23, - DataTypeHalf3x3 = 24, - DataTypeHalf3x4 = 25, - DataTypeHalf4x2 = 26, - DataTypeHalf4x3 = 27, - DataTypeHalf4x4 = 28, - DataTypeInt = 29, - DataTypeInt2 = 30, - DataTypeInt3 = 31, - DataTypeInt4 = 32, - DataTypeUInt = 33, - DataTypeUInt2 = 34, - DataTypeUInt3 = 35, - DataTypeUInt4 = 36, - DataTypeShort = 37, - DataTypeShort2 = 38, - DataTypeShort3 = 39, - DataTypeShort4 = 40, - DataTypeUShort = 41, - DataTypeUShort2 = 42, - DataTypeUShort3 = 43, - DataTypeUShort4 = 44, - DataTypeChar = 45, - DataTypeChar2 = 46, - DataTypeChar3 = 47, - DataTypeChar4 = 48, - DataTypeUChar = 49, - DataTypeUChar2 = 50, - DataTypeUChar3 = 51, - DataTypeUChar4 = 52, - DataTypeBool = 53, - DataTypeBool2 = 54, - DataTypeBool3 = 55, - DataTypeBool4 = 56, - DataTypeTexture = 58, - DataTypeSampler = 59, - DataTypePointer = 60, - DataTypeR8Unorm = 62, - DataTypeR8Snorm = 63, - DataTypeR16Unorm = 64, - DataTypeR16Snorm = 65, - DataTypeRG8Unorm = 66, - DataTypeRG8Snorm = 67, - DataTypeRG16Unorm = 68, - DataTypeRG16Snorm = 69, - DataTypeRGBA8Unorm = 70, - DataTypeRGBA8Unorm_sRGB = 71, - DataTypeRGBA8Snorm = 72, - DataTypeRGBA16Unorm = 73, - DataTypeRGBA16Snorm = 74, - DataTypeRGB10A2Unorm = 75, - DataTypeRG11B10Float = 76, - DataTypeRGB9E5Float = 77, - DataTypeRenderPipeline = 78, - DataTypeComputePipeline = 79, - DataTypeIndirectCommandBuffer = 80, - DataTypeLong = 81, - DataTypeLong2 = 82, - DataTypeLong3 = 83, - DataTypeLong4 = 84, - DataTypeULong = 85, - DataTypeULong2 = 86, - DataTypeULong3 = 87, - DataTypeULong4 = 88, - DataTypeVisibleFunctionTable = 115, - DataTypeIntersectionFunctionTable = 116, - DataTypePrimitiveAccelerationStructure = 117, - DataTypeInstanceAccelerationStructure = 118, +class Argument; +class ArrayType; +class PointerType; +class StructMember; +class StructType; +class TensorExtents; +class TensorReferenceType; +class TextureReferenceType; +class Type; +_MTL_ENUM(NS::UInteger, IndexType) { + IndexTypeUInt16 = 0, + IndexTypeUInt32 = 1, }; _MTL_ENUM(NS::Integer, BindingType) { @@ -137,6 +56,7 @@ _MTL_ENUM(NS::Integer, BindingType) { BindingTypeInstanceAccelerationStructure = 26, BindingTypeIntersectionFunctionTable = 27, BindingTypeObjectPayload = 34, + BindingTypeTensor = 37, }; _MTL_ENUM(NS::UInteger, ArgumentType) { @@ -152,7 +72,10 @@ _MTL_ENUM(NS::UInteger, ArgumentType) { ArgumentTypeIntersectionFunctionTable = 27, }; -_MTL_ENUM(NS::UInteger, ArgumentAccess) { +_MTL_ENUM(NS::UInteger, BindingAccess) { + BindingAccessReadOnly = 0, + BindingAccessReadWrite = 1, + BindingAccessWriteOnly = 2, ArgumentAccessReadOnly = 0, ArgumentAccessReadWrite = 1, ArgumentAccessWriteOnly = 2, @@ -161,181 +84,200 @@ _MTL_ENUM(NS::UInteger, ArgumentAccess) { class Type : public NS::Referencing { public: - static class Type* alloc(); + static Type* alloc(); - class Type* init(); + DataType dataType() const; - MTL::DataType dataType() const; + Type* init(); }; - class StructMember : public NS::Referencing { public: - static class StructMember* alloc(); + static StructMember* alloc(); - class StructMember* init(); + NS::UInteger argumentIndex() const; - NS::String* name() const; + ArrayType* arrayType(); - NS::UInteger offset() const; + DataType dataType() const; - MTL::DataType dataType() const; + StructMember* init(); - class StructType* structType(); + NS::String* name() const; - class ArrayType* arrayType(); + NS::UInteger offset() const; - class TextureReferenceType* textureReferenceType(); + PointerType* pointerType(); - class PointerType* pointerType(); + StructType* structType(); - NS::UInteger argumentIndex() const; + TensorReferenceType* tensorReferenceType(); + + TextureReferenceType* textureReferenceType(); }; - class StructType : public NS::Referencing { public: - static class StructType* alloc(); + static StructType* alloc(); - class StructType* init(); + StructType* init(); - NS::Array* members() const; + StructMember* memberByName(const NS::String* name); - class StructMember* memberByName(const NS::String* name); + NS::Array* members() const; }; - class ArrayType : public NS::Referencing { public: - static class ArrayType* alloc(); + static ArrayType* alloc(); - class ArrayType* init(); + NS::UInteger argumentIndexStride() const; - MTL::DataType elementType() const; + NS::UInteger arrayLength() const; - NS::UInteger arrayLength() const; + ArrayType* elementArrayType(); - NS::UInteger stride() const; + PointerType* elementPointerType(); - NS::UInteger argumentIndexStride() const; + StructType* elementStructType(); - class StructType* elementStructType(); + TensorReferenceType* elementTensorReferenceType(); - class ArrayType* elementArrayType(); + TextureReferenceType* elementTextureReferenceType(); - class TextureReferenceType* elementTextureReferenceType(); + DataType elementType() const; - class PointerType* elementPointerType(); + ArrayType* init(); + + NS::UInteger stride() const; }; - class PointerType : public NS::Referencing { public: - static class PointerType* alloc(); + BindingAccess access() const; - class PointerType* init(); + NS::UInteger alignment() const; - MTL::DataType elementType() const; + static PointerType* alloc(); - MTL::ArgumentAccess access() const; + NS::UInteger dataSize() const; - NS::UInteger alignment() const; + ArrayType* elementArrayType(); - NS::UInteger dataSize() const; + bool elementIsArgumentBuffer() const; - bool elementIsArgumentBuffer() const; + StructType* elementStructType(); - class StructType* elementStructType(); + DataType elementType() const; - class ArrayType* elementArrayType(); + PointerType* init(); }; - class TextureReferenceType : public NS::Referencing { public: - static class TextureReferenceType* alloc(); + BindingAccess access() const; - class TextureReferenceType* init(); + static TextureReferenceType* alloc(); - MTL::DataType textureDataType() const; + TextureReferenceType* init(); - MTL::TextureType textureType() const; + bool isDepthTexture() const; - MTL::ArgumentAccess access() const; + DataType textureDataType() const; - bool isDepthTexture() const; + TextureType textureType() const; }; +class TensorReferenceType : public NS::Referencing +{ +public: + BindingAccess access() const; + static TensorReferenceType* alloc(); + + TensorExtents* dimensions() const; + + DataType indexType() const; + + TensorReferenceType* init(); + + TensorDataType tensorDataType() const; +}; class Argument : public NS::Referencing { public: - static class Argument* alloc(); + BindingAccess access() const; - class Argument* init(); + [[deprecated("please use isActive instead")]] + bool active() const; - NS::String* name() const; + static Argument* alloc(); - MTL::ArgumentType type() const; + NS::UInteger arrayLength() const; - MTL::ArgumentAccess access() const; + NS::UInteger bufferAlignment() const; - NS::UInteger index() const; + NS::UInteger bufferDataSize() const; - bool active() const; + DataType bufferDataType() const; - NS::UInteger bufferAlignment() const; + PointerType* bufferPointerType() const; - NS::UInteger bufferDataSize() const; + StructType* bufferStructType() const; - MTL::DataType bufferDataType() const; + NS::UInteger index() const; - class StructType* bufferStructType() const; + Argument* init(); - class PointerType* bufferPointerType() const; + bool isActive() const; - NS::UInteger threadgroupMemoryAlignment() const; + bool isDepthTexture() const; - NS::UInteger threadgroupMemoryDataSize() const; + NS::String* name() const; - MTL::TextureType textureType() const; + DataType textureDataType() const; - MTL::DataType textureDataType() const; + TextureType textureType() const; - bool isDepthTexture() const; + NS::UInteger threadgroupMemoryAlignment() const; - NS::UInteger arrayLength() const; + NS::UInteger threadgroupMemoryDataSize() const; + + ArgumentType type() const; }; - class Binding : public NS::Referencing { public: - NS::String* name() const; + BindingAccess access() const; - MTL::BindingType type() const; + [[deprecated("please use isArgument instead")]] + bool argument() const; - MTL::ArgumentAccess access() const; + NS::UInteger index() const; - NS::UInteger index() const; + bool isArgument() const; - bool used() const; + bool isUsed() const; - bool argument() const; + NS::String* name() const; + + BindingType type() const; + + [[deprecated("please use isUsed instead")]] + bool used() const; }; - class BufferBinding : public NS::Referencing { public: - NS::UInteger bufferAlignment() const; + NS::UInteger bufferAlignment() const; - NS::UInteger bufferDataSize() const; + NS::UInteger bufferDataSize() const; - MTL::DataType bufferDataType() const; + DataType bufferDataType() const; - class StructType* bufferStructType() const; + PointerType* bufferPointerType() const; - class PointerType* bufferPointerType() const; + StructType* bufferStructType() const; }; - class ThreadgroupBinding : public NS::Referencing { public: @@ -343,19 +285,19 @@ public: NS::UInteger threadgroupMemoryDataSize() const; }; - class TextureBinding : public NS::Referencing { public: - MTL::TextureType textureType() const; + NS::UInteger arrayLength() const; - MTL::DataType textureDataType() const; + [[deprecated("please use isDepthTexture instead")]] + bool depthTexture() const; + bool isDepthTexture() const; - bool depthTexture() const; + DataType textureDataType() const; - NS::UInteger arrayLength() const; + TextureType textureType() const; }; - class ObjectPayloadBinding : public NS::Referencing { public: @@ -363,479 +305,483 @@ public: NS::UInteger objectPayloadDataSize() const; }; +class TensorBinding : public NS::Referencing +{ +public: + TensorExtents* dimensions() const; + + DataType indexType() const; + + TensorDataType tensorDataType() const; +}; } - -// static method: alloc _MTL_INLINE MTL::Type* MTL::Type::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLType)); } -// method: init -_MTL_INLINE MTL::Type* MTL::Type::init() -{ - return NS::Object::init(); -} - -// property: dataType _MTL_INLINE MTL::DataType MTL::Type::dataType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); } -// static method: alloc +_MTL_INLINE MTL::Type* MTL::Type::init() +{ + return NS::Object::init(); +} + _MTL_INLINE MTL::StructMember* MTL::StructMember::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLStructMember)); } -// method: init -_MTL_INLINE MTL::StructMember* MTL::StructMember::init() -{ - return NS::Object::init(); -} - -// property: name -_MTL_INLINE NS::String* MTL::StructMember::name() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); -} - -// property: offset -_MTL_INLINE NS::UInteger MTL::StructMember::offset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(offset)); -} - -// property: dataType -_MTL_INLINE MTL::DataType MTL::StructMember::dataType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); -} - -// method: structType -_MTL_INLINE MTL::StructType* MTL::StructMember::structType() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(structType)); -} - -// method: arrayType -_MTL_INLINE MTL::ArrayType* MTL::StructMember::arrayType() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayType)); -} - -// method: textureReferenceType -_MTL_INLINE MTL::TextureReferenceType* MTL::StructMember::textureReferenceType() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureReferenceType)); -} - -// method: pointerType -_MTL_INLINE MTL::PointerType* MTL::StructMember::pointerType() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(pointerType)); -} - -// property: argumentIndex _MTL_INLINE NS::UInteger MTL::StructMember::argumentIndex() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(argumentIndex)); } -// static method: alloc +_MTL_INLINE MTL::ArrayType* MTL::StructMember::arrayType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayType)); +} + +_MTL_INLINE MTL::DataType MTL::StructMember::dataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); +} + +_MTL_INLINE MTL::StructMember* MTL::StructMember::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL::StructMember::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE NS::UInteger MTL::StructMember::offset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(offset)); +} + +_MTL_INLINE MTL::PointerType* MTL::StructMember::pointerType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pointerType)); +} + +_MTL_INLINE MTL::StructType* MTL::StructMember::structType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(structType)); +} + +_MTL_INLINE MTL::TensorReferenceType* MTL::StructMember::tensorReferenceType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tensorReferenceType)); +} + +_MTL_INLINE MTL::TextureReferenceType* MTL::StructMember::textureReferenceType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureReferenceType)); +} + _MTL_INLINE MTL::StructType* MTL::StructType::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLStructType)); } -// method: init _MTL_INLINE MTL::StructType* MTL::StructType::init() { return NS::Object::init(); } -// property: members -_MTL_INLINE NS::Array* MTL::StructType::members() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(members)); -} - -// method: memberByName: _MTL_INLINE MTL::StructMember* MTL::StructType::memberByName(const NS::String* name) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(memberByName_), name); } -// static method: alloc +_MTL_INLINE NS::Array* MTL::StructType::members() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(members)); +} + _MTL_INLINE MTL::ArrayType* MTL::ArrayType::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLArrayType)); } -// method: init -_MTL_INLINE MTL::ArrayType* MTL::ArrayType::init() -{ - return NS::Object::init(); -} - -// property: elementType -_MTL_INLINE MTL::DataType MTL::ArrayType::elementType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementType)); -} - -// property: arrayLength -_MTL_INLINE NS::UInteger MTL::ArrayType::arrayLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); -} - -// property: stride -_MTL_INLINE NS::UInteger MTL::ArrayType::stride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stride)); -} - -// property: argumentIndexStride _MTL_INLINE NS::UInteger MTL::ArrayType::argumentIndexStride() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(argumentIndexStride)); } -// method: elementStructType -_MTL_INLINE MTL::StructType* MTL::ArrayType::elementStructType() +_MTL_INLINE NS::UInteger MTL::ArrayType::arrayLength() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementStructType)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); } -// method: elementArrayType _MTL_INLINE MTL::ArrayType* MTL::ArrayType::elementArrayType() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementArrayType)); } -// method: elementTextureReferenceType -_MTL_INLINE MTL::TextureReferenceType* MTL::ArrayType::elementTextureReferenceType() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementTextureReferenceType)); -} - -// method: elementPointerType _MTL_INLINE MTL::PointerType* MTL::ArrayType::elementPointerType() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementPointerType)); } -// static method: alloc -_MTL_INLINE MTL::PointerType* MTL::PointerType::alloc() +_MTL_INLINE MTL::StructType* MTL::ArrayType::elementStructType() { - return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLPointerType)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementStructType)); } -// method: init -_MTL_INLINE MTL::PointerType* MTL::PointerType::init() +_MTL_INLINE MTL::TensorReferenceType* MTL::ArrayType::elementTensorReferenceType() { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementTensorReferenceType)); } -// property: elementType -_MTL_INLINE MTL::DataType MTL::PointerType::elementType() const +_MTL_INLINE MTL::TextureReferenceType* MTL::ArrayType::elementTextureReferenceType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementTextureReferenceType)); +} + +_MTL_INLINE MTL::DataType MTL::ArrayType::elementType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementType)); } -// property: access -_MTL_INLINE MTL::ArgumentAccess MTL::PointerType::access() const +_MTL_INLINE MTL::ArrayType* MTL::ArrayType::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL::ArrayType::stride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stride)); +} + +_MTL_INLINE MTL::BindingAccess MTL::PointerType::access() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); } -// property: alignment _MTL_INLINE NS::UInteger MTL::PointerType::alignment() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(alignment)); } -// property: dataSize +_MTL_INLINE MTL::PointerType* MTL::PointerType::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLPointerType)); +} + _MTL_INLINE NS::UInteger MTL::PointerType::dataSize() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataSize)); } -// property: elementIsArgumentBuffer -_MTL_INLINE bool MTL::PointerType::elementIsArgumentBuffer() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementIsArgumentBuffer)); -} - -// method: elementStructType -_MTL_INLINE MTL::StructType* MTL::PointerType::elementStructType() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementStructType)); -} - -// method: elementArrayType _MTL_INLINE MTL::ArrayType* MTL::PointerType::elementArrayType() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementArrayType)); } -// static method: alloc +_MTL_INLINE bool MTL::PointerType::elementIsArgumentBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementIsArgumentBuffer)); +} + +_MTL_INLINE MTL::StructType* MTL::PointerType::elementStructType() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementStructType)); +} + +_MTL_INLINE MTL::DataType MTL::PointerType::elementType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(elementType)); +} + +_MTL_INLINE MTL::PointerType* MTL::PointerType::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::BindingAccess MTL::TextureReferenceType::access() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); +} + _MTL_INLINE MTL::TextureReferenceType* MTL::TextureReferenceType::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTextureReferenceType)); } -// method: init _MTL_INLINE MTL::TextureReferenceType* MTL::TextureReferenceType::init() { return NS::Object::init(); } -// property: textureDataType -_MTL_INLINE MTL::DataType MTL::TextureReferenceType::textureDataType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureDataType)); -} - -// property: textureType -_MTL_INLINE MTL::TextureType MTL::TextureReferenceType::textureType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); -} - -// property: access -_MTL_INLINE MTL::ArgumentAccess MTL::TextureReferenceType::access() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); -} - -// property: isDepthTexture _MTL_INLINE bool MTL::TextureReferenceType::isDepthTexture() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthTexture)); } -// static method: alloc -_MTL_INLINE MTL::Argument* MTL::Argument::alloc() +_MTL_INLINE MTL::DataType MTL::TextureReferenceType::textureDataType() const { - return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLArgument)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureDataType)); } -// method: init -_MTL_INLINE MTL::Argument* MTL::Argument::init() +_MTL_INLINE MTL::TextureType MTL::TextureReferenceType::textureType() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); } -// property: name -_MTL_INLINE NS::String* MTL::Argument::name() const +_MTL_INLINE MTL::BindingAccess MTL::TensorReferenceType::access() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); } -// property: type -_MTL_INLINE MTL::ArgumentType MTL::Argument::type() const +_MTL_INLINE MTL::TensorReferenceType* MTL::TensorReferenceType::alloc() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTensorReferenceType)); } -// property: access -_MTL_INLINE MTL::ArgumentAccess MTL::Argument::access() const +_MTL_INLINE MTL::TensorExtents* MTL::TensorReferenceType::dimensions() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dimensions)); } -// property: index -_MTL_INLINE NS::UInteger MTL::Argument::index() const +_MTL_INLINE MTL::DataType MTL::TensorReferenceType::indexType() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(index)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL::TensorReferenceType* MTL::TensorReferenceType::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::TensorDataType MTL::TensorReferenceType::tensorDataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tensorDataType)); +} + +_MTL_INLINE MTL::BindingAccess MTL::Argument::access() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); } -// property: active _MTL_INLINE bool MTL::Argument::active() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isActive)); } -// property: bufferAlignment -_MTL_INLINE NS::UInteger MTL::Argument::bufferAlignment() const +_MTL_INLINE MTL::Argument* MTL::Argument::alloc() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferAlignment)); + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLArgument)); } -// property: bufferDataSize -_MTL_INLINE NS::UInteger MTL::Argument::bufferDataSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferDataSize)); -} - -// property: bufferDataType -_MTL_INLINE MTL::DataType MTL::Argument::bufferDataType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferDataType)); -} - -// property: bufferStructType -_MTL_INLINE MTL::StructType* MTL::Argument::bufferStructType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferStructType)); -} - -// property: bufferPointerType -_MTL_INLINE MTL::PointerType* MTL::Argument::bufferPointerType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferPointerType)); -} - -// property: threadgroupMemoryAlignment -_MTL_INLINE NS::UInteger MTL::Argument::threadgroupMemoryAlignment() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryAlignment)); -} - -// property: threadgroupMemoryDataSize -_MTL_INLINE NS::UInteger MTL::Argument::threadgroupMemoryDataSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryDataSize)); -} - -// property: textureType -_MTL_INLINE MTL::TextureType MTL::Argument::textureType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); -} - -// property: textureDataType -_MTL_INLINE MTL::DataType MTL::Argument::textureDataType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureDataType)); -} - -// property: isDepthTexture -_MTL_INLINE bool MTL::Argument::isDepthTexture() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthTexture)); -} - -// property: arrayLength _MTL_INLINE NS::UInteger MTL::Argument::arrayLength() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); } -// property: name -_MTL_INLINE NS::String* MTL::Binding::name() const +_MTL_INLINE NS::UInteger MTL::Argument::bufferAlignment() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferAlignment)); } -// property: type -_MTL_INLINE MTL::BindingType MTL::Binding::type() const +_MTL_INLINE NS::UInteger MTL::Argument::bufferDataSize() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferDataSize)); } -// property: access -_MTL_INLINE MTL::ArgumentAccess MTL::Binding::access() const +_MTL_INLINE MTL::DataType MTL::Argument::bufferDataType() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferDataType)); } -// property: index -_MTL_INLINE NS::UInteger MTL::Binding::index() const +_MTL_INLINE MTL::PointerType* MTL::Argument::bufferPointerType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferPointerType)); +} + +_MTL_INLINE MTL::StructType* MTL::Argument::bufferStructType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferStructType)); +} + +_MTL_INLINE NS::UInteger MTL::Argument::index() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(index)); } -// property: used -_MTL_INLINE bool MTL::Binding::used() const +_MTL_INLINE MTL::Argument* MTL::Argument::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isUsed)); + return NS::Object::init(); +} + +_MTL_INLINE bool MTL::Argument::isActive() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isActive)); +} + +_MTL_INLINE bool MTL::Argument::isDepthTexture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthTexture)); +} + +_MTL_INLINE NS::String* MTL::Argument::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE MTL::DataType MTL::Argument::textureDataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureDataType)); +} + +_MTL_INLINE MTL::TextureType MTL::Argument::textureType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); +} + +_MTL_INLINE NS::UInteger MTL::Argument::threadgroupMemoryAlignment() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryAlignment)); +} + +_MTL_INLINE NS::UInteger MTL::Argument::threadgroupMemoryDataSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryDataSize)); +} + +_MTL_INLINE MTL::ArgumentType MTL::Argument::type() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); +} + +_MTL_INLINE MTL::BindingAccess MTL::Binding::access() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); } -// property: argument _MTL_INLINE bool MTL::Binding::argument() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isArgument)); } -// property: bufferAlignment +_MTL_INLINE NS::UInteger MTL::Binding::index() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(index)); +} + +_MTL_INLINE bool MTL::Binding::isArgument() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isArgument)); +} + +_MTL_INLINE bool MTL::Binding::isUsed() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isUsed)); +} + +_MTL_INLINE NS::String* MTL::Binding::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE MTL::BindingType MTL::Binding::type() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); +} + +_MTL_INLINE bool MTL::Binding::used() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isUsed)); +} + _MTL_INLINE NS::UInteger MTL::BufferBinding::bufferAlignment() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferAlignment)); } -// property: bufferDataSize _MTL_INLINE NS::UInteger MTL::BufferBinding::bufferDataSize() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferDataSize)); } -// property: bufferDataType _MTL_INLINE MTL::DataType MTL::BufferBinding::bufferDataType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferDataType)); } -// property: bufferStructType -_MTL_INLINE MTL::StructType* MTL::BufferBinding::bufferStructType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferStructType)); -} - -// property: bufferPointerType _MTL_INLINE MTL::PointerType* MTL::BufferBinding::bufferPointerType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferPointerType)); } -// property: threadgroupMemoryAlignment +_MTL_INLINE MTL::StructType* MTL::BufferBinding::bufferStructType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferStructType)); +} + _MTL_INLINE NS::UInteger MTL::ThreadgroupBinding::threadgroupMemoryAlignment() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryAlignment)); } -// property: threadgroupMemoryDataSize _MTL_INLINE NS::UInteger MTL::ThreadgroupBinding::threadgroupMemoryDataSize() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryDataSize)); } -// property: textureType -_MTL_INLINE MTL::TextureType MTL::TextureBinding::textureType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); -} - -// property: textureDataType -_MTL_INLINE MTL::DataType MTL::TextureBinding::textureDataType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureDataType)); -} - -// property: depthTexture -_MTL_INLINE bool MTL::TextureBinding::depthTexture() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthTexture)); -} - -// property: arrayLength _MTL_INLINE NS::UInteger MTL::TextureBinding::arrayLength() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); } -// property: objectPayloadAlignment +_MTL_INLINE bool MTL::TextureBinding::depthTexture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthTexture)); +} + +_MTL_INLINE bool MTL::TextureBinding::isDepthTexture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthTexture)); +} + +_MTL_INLINE MTL::DataType MTL::TextureBinding::textureDataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureDataType)); +} + +_MTL_INLINE MTL::TextureType MTL::TextureBinding::textureType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); +} + _MTL_INLINE NS::UInteger MTL::ObjectPayloadBinding::objectPayloadAlignment() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectPayloadAlignment)); } -// property: objectPayloadDataSize _MTL_INLINE NS::UInteger MTL::ObjectPayloadBinding::objectPayloadDataSize() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectPayloadDataSize)); } + +_MTL_INLINE MTL::TensorExtents* MTL::TensorBinding::dimensions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dimensions)); +} + +_MTL_INLINE MTL::DataType MTL::TensorBinding::indexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); +} + +_MTL_INLINE MTL::TensorDataType MTL::TensorBinding::tensorDataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tensorDataType)); +} diff --git a/vendor/metal-cpp/Metal/MTLArgumentEncoder.hpp b/vendor/metal-cpp/Metal/MTLArgumentEncoder.hpp index 12ea5b6fb..83dbbc201 100644 --- a/vendor/metal-cpp/Metal/MTLArgumentEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLArgumentEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLArgumentEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,222 +20,216 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include +#include "MTLDepthStencil.hpp" namespace MTL { +class AccelerationStructure; +class ArgumentEncoder; +class Buffer; +class ComputePipelineState; +class Device; +class IndirectCommandBuffer; +class IntersectionFunctionTable; +class RenderPipelineState; +class SamplerState; +class Texture; +class VisibleFunctionTable; + +static const NS::UInteger AttributeStrideStatic = NS::UIntegerMax; + class ArgumentEncoder : public NS::Referencing { public: - class Device* device() const; + NS::UInteger alignment() const; - NS::String* label() const; - void setLabel(const NS::String* label); + void* constantData(NS::UInteger index); - NS::UInteger encodedLength() const; + Device* device() const; - NS::UInteger alignment() const; + NS::UInteger encodedLength() const; - void setArgumentBuffer(const class Buffer* argumentBuffer, NS::UInteger offset); + NS::String* label() const; - void setArgumentBuffer(const class Buffer* argumentBuffer, NS::UInteger startOffset, NS::UInteger arrayElement); + ArgumentEncoder* newArgumentEncoder(NS::UInteger index); - void setBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger index); - void setBuffers(const class Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); + void setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger offset); + void setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger startOffset, NS::UInteger arrayElement); - void setTexture(const class Texture* texture, NS::UInteger index); + void setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); - void setTextures(const class Texture* const textures[], NS::Range range); + void setComputePipelineState(const MTL::ComputePipelineState* pipeline, NS::UInteger index); + void setComputePipelineStates(const MTL::ComputePipelineState* const pipelines[], NS::Range range); - void setSamplerState(const class SamplerState* sampler, NS::UInteger index); + void setDepthStencilState(const MTL::DepthStencilState* depthStencilState, NS::UInteger index); + void setDepthStencilStates(const MTL::DepthStencilState* const depthStencilStates[], NS::Range range); - void setSamplerStates(const class SamplerState* const samplers[], NS::Range range); + void setIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::UInteger index); + void setIndirectCommandBuffers(const MTL::IndirectCommandBuffer* const buffers[], NS::Range range); - void* constantData(NS::UInteger index); + void setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger index); + void setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); - void setRenderPipelineState(const class RenderPipelineState* pipeline, NS::UInteger index); + void setLabel(const NS::String* label); - void setRenderPipelineStates(const class RenderPipelineState* const pipelines[], NS::Range range); + void setRenderPipelineState(const MTL::RenderPipelineState* pipeline, NS::UInteger index); + void setRenderPipelineStates(const MTL::RenderPipelineState* const pipelines[], NS::Range range); - void setComputePipelineState(const class ComputePipelineState* pipeline, NS::UInteger index); + void setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); - void setComputePipelineStates(const class ComputePipelineState* const pipelines[], NS::Range range); + void setTexture(const MTL::Texture* texture, NS::UInteger index); + void setTextures(const MTL::Texture* const textures[], NS::Range range); - void setIndirectCommandBuffer(const class IndirectCommandBuffer* indirectCommandBuffer, NS::UInteger index); - - void setIndirectCommandBuffers(const class IndirectCommandBuffer* const buffers[], NS::Range range); - - void setAccelerationStructure(const class AccelerationStructure* accelerationStructure, NS::UInteger index); - - class ArgumentEncoder* newArgumentEncoder(NS::UInteger index); - - void setVisibleFunctionTable(const class VisibleFunctionTable* visibleFunctionTable, NS::UInteger index); - - void setVisibleFunctionTables(const class VisibleFunctionTable* const visibleFunctionTables[], NS::Range range); - - void setIntersectionFunctionTable(const class IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger index); - - void setIntersectionFunctionTables(const class IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); + void setVisibleFunctionTable(const MTL::VisibleFunctionTable* visibleFunctionTable, NS::UInteger index); + void setVisibleFunctionTables(const MTL::VisibleFunctionTable* const visibleFunctionTables[], NS::Range range); }; } -// property: device +_MTL_INLINE NS::UInteger MTL::ArgumentEncoder::alignment() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alignment)); +} + +_MTL_INLINE void* MTL::ArgumentEncoder::constantData(NS::UInteger index) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(constantDataAtIndex_), index); +} + _MTL_INLINE MTL::Device* MTL::ArgumentEncoder::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: label +_MTL_INLINE NS::UInteger MTL::ArgumentEncoder::encodedLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(encodedLength)); +} + _MTL_INLINE NS::String* MTL::ArgumentEncoder::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE MTL::ArgumentEncoder* MTL::ArgumentEncoder::newArgumentEncoder(NS::UInteger index) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderForBufferAtIndex_), index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAccelerationStructure_atIndex_), accelerationStructure, index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentBuffer_offset_), argumentBuffer, offset); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger startOffset, NS::UInteger arrayElement) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentBuffer_startOffset_arrayElement_), argumentBuffer, startOffset, arrayElement); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setComputePipelineState(const MTL::ComputePipelineState* pipeline, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_atIndex_), pipeline, index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setComputePipelineStates(const MTL::ComputePipelineState* const pipelines[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineStates_withRange_), pipelines, range); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setDepthStencilState(const MTL::DepthStencilState* depthStencilState, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilState_atIndex_), depthStencilState, index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setDepthStencilStates(const MTL::DepthStencilState* const depthStencilStates[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilStates_withRange_), depthStencilStates, range); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndirectCommandBuffer_atIndex_), indirectCommandBuffer, index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setIndirectCommandBuffers(const MTL::IndirectCommandBuffer* const buffers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndirectCommandBuffers_withRange_), buffers, range); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTable_atIndex_), intersectionFunctionTable, index); +} + +_MTL_INLINE void MTL::ArgumentEncoder::setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTables_withRange_), intersectionFunctionTables, range); +} + _MTL_INLINE void MTL::ArgumentEncoder::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: encodedLength -_MTL_INLINE NS::UInteger MTL::ArgumentEncoder::encodedLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(encodedLength)); -} - -// property: alignment -_MTL_INLINE NS::UInteger MTL::ArgumentEncoder::alignment() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(alignment)); -} - -// method: setArgumentBuffer:offset: -_MTL_INLINE void MTL::ArgumentEncoder::setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger offset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentBuffer_offset_), argumentBuffer, offset); -} - -// method: setArgumentBuffer:startOffset:arrayElement: -_MTL_INLINE void MTL::ArgumentEncoder::setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger startOffset, NS::UInteger arrayElement) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentBuffer_startOffset_arrayElement_), argumentBuffer, startOffset, arrayElement); -} - -// method: setBuffer:offset:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setBuffers:offsets:withRange: -_MTL_INLINE void MTL::ArgumentEncoder::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setTexture:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_atIndex_), texture, index); -} - -// method: setTextures:withRange: -_MTL_INLINE void MTL::ArgumentEncoder::setTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextures_withRange_), textures, range); -} - -// method: setSamplerState:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_atIndex_), sampler, index); -} - -// method: setSamplerStates:withRange: -_MTL_INLINE void MTL::ArgumentEncoder::setSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerStates_withRange_), samplers, range); -} - -// method: constantDataAtIndex: -_MTL_INLINE void* MTL::ArgumentEncoder::constantData(NS::UInteger index) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(constantDataAtIndex_), index); -} - -// method: setRenderPipelineState:atIndex: _MTL_INLINE void MTL::ArgumentEncoder::setRenderPipelineState(const MTL::RenderPipelineState* pipeline, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineState_atIndex_), pipeline, index); } -// method: setRenderPipelineStates:withRange: _MTL_INLINE void MTL::ArgumentEncoder::setRenderPipelineStates(const MTL::RenderPipelineState* const pipelines[], NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineStates_withRange_), pipelines, range); } -// method: setComputePipelineState:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setComputePipelineState(const MTL::ComputePipelineState* pipeline, NS::UInteger index) +_MTL_INLINE void MTL::ArgumentEncoder::setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_atIndex_), pipeline, index); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_atIndex_), sampler, index); } -// method: setComputePipelineStates:withRange: -_MTL_INLINE void MTL::ArgumentEncoder::setComputePipelineStates(const MTL::ComputePipelineState* const pipelines[], NS::Range range) +_MTL_INLINE void MTL::ArgumentEncoder::setSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineStates_withRange_), pipelines, range); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerStates_withRange_), samplers, range); } -// method: setIndirectCommandBuffer:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::UInteger index) +_MTL_INLINE void MTL::ArgumentEncoder::setTexture(const MTL::Texture* texture, NS::UInteger index) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndirectCommandBuffer_atIndex_), indirectCommandBuffer, index); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_atIndex_), texture, index); } -// method: setIndirectCommandBuffers:withRange: -_MTL_INLINE void MTL::ArgumentEncoder::setIndirectCommandBuffers(const MTL::IndirectCommandBuffer* const buffers[], NS::Range range) +_MTL_INLINE void MTL::ArgumentEncoder::setTextures(const MTL::Texture* const textures[], NS::Range range) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndirectCommandBuffers_withRange_), buffers, range); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextures_withRange_), textures, range); } -// method: setAccelerationStructure:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setAccelerationStructure_atIndex_), accelerationStructure, index); -} - -// method: newArgumentEncoderForBufferAtIndex: -_MTL_INLINE MTL::ArgumentEncoder* MTL::ArgumentEncoder::newArgumentEncoder(NS::UInteger index) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderForBufferAtIndex_), index); -} - -// method: setVisibleFunctionTable:atIndex: _MTL_INLINE void MTL::ArgumentEncoder::setVisibleFunctionTable(const MTL::VisibleFunctionTable* visibleFunctionTable, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTable_atIndex_), visibleFunctionTable, index); } -// method: setVisibleFunctionTables:withRange: _MTL_INLINE void MTL::ArgumentEncoder::setVisibleFunctionTables(const MTL::VisibleFunctionTable* const visibleFunctionTables[], NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTables_withRange_), visibleFunctionTables, range); } - -// method: setIntersectionFunctionTable:atIndex: -_MTL_INLINE void MTL::ArgumentEncoder::setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTable_atIndex_), intersectionFunctionTable, index); -} - -// method: setIntersectionFunctionTables:withRange: -_MTL_INLINE void MTL::ArgumentEncoder::setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTables_withRange_), intersectionFunctionTables, range); -} diff --git a/vendor/metal-cpp/Metal/MTLBinaryArchive.hpp b/vendor/metal-cpp/Metal/MTLBinaryArchive.hpp index 1c77c0781..c3f168958 100644 --- a/vendor/metal-cpp/Metal/MTLBinaryArchive.hpp +++ b/vendor/metal-cpp/Metal/MTLBinaryArchive.hpp @@ -2,7 +2,7 @@ // // Metal/MTLBinaryArchive.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,14 +20,22 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class BinaryArchiveDescriptor; +class ComputePipelineDescriptor; +class Device; +class FunctionDescriptor; +class Library; +class MeshRenderPipelineDescriptor; +class RenderPipelineDescriptor; +class StitchedLibraryDescriptor; +class TileRenderPipelineDescriptor; _MTL_ENUM(NS::UInteger, BinaryArchiveError) { BinaryArchiveErrorNone = 0, BinaryArchiveErrorInvalidFile = 1, @@ -36,104 +44,109 @@ _MTL_ENUM(NS::UInteger, BinaryArchiveError) { BinaryArchiveErrorInternalError = 4, }; +_MTL_CONST(NS::ErrorDomain, BinaryArchiveDomain); class BinaryArchiveDescriptor : public NS::Copying { public: - static class BinaryArchiveDescriptor* alloc(); + static BinaryArchiveDescriptor* alloc(); - class BinaryArchiveDescriptor* init(); + BinaryArchiveDescriptor* init(); - NS::URL* url() const; - void setUrl(const NS::URL* url); + void setUrl(const NS::URL* url); + NS::URL* url() const; }; - class BinaryArchive : public NS::Referencing { public: - NS::String* label() const; - void setLabel(const NS::String* label); + bool addComputePipelineFunctions(const MTL::ComputePipelineDescriptor* descriptor, NS::Error** error); - class Device* device() const; + bool addFunction(const MTL::FunctionDescriptor* descriptor, const MTL::Library* library, NS::Error** error); - bool addComputePipelineFunctions(const class ComputePipelineDescriptor* descriptor, NS::Error** error); + bool addLibrary(const MTL::StitchedLibraryDescriptor* descriptor, NS::Error** error); - bool addRenderPipelineFunctions(const class RenderPipelineDescriptor* descriptor, NS::Error** error); + bool addMeshRenderPipelineFunctions(const MTL::MeshRenderPipelineDescriptor* descriptor, NS::Error** error); - bool addTileRenderPipelineFunctions(const class TileRenderPipelineDescriptor* descriptor, NS::Error** error); + bool addRenderPipelineFunctions(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error); - bool serializeToURL(const NS::URL* url, NS::Error** error); + bool addTileRenderPipelineFunctions(const MTL::TileRenderPipelineDescriptor* descriptor, NS::Error** error); - bool addFunction(const class FunctionDescriptor* descriptor, const class Library* library, NS::Error** error); + Device* device() const; + + NS::String* label() const; + + bool serializeToURL(const NS::URL* url, NS::Error** error); + + void setLabel(const NS::String* label); }; } - -// static method: alloc +_MTL_PRIVATE_DEF_CONST(NS::ErrorDomain, BinaryArchiveDomain); _MTL_INLINE MTL::BinaryArchiveDescriptor* MTL::BinaryArchiveDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLBinaryArchiveDescriptor)); } -// method: init _MTL_INLINE MTL::BinaryArchiveDescriptor* MTL::BinaryArchiveDescriptor::init() { return NS::Object::init(); } -// property: url -_MTL_INLINE NS::URL* MTL::BinaryArchiveDescriptor::url() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(url)); -} - _MTL_INLINE void MTL::BinaryArchiveDescriptor::setUrl(const NS::URL* url) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setUrl_), url); } -// property: label +_MTL_INLINE NS::URL* MTL::BinaryArchiveDescriptor::url() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(url)); +} + +_MTL_INLINE bool MTL::BinaryArchive::addComputePipelineFunctions(const MTL::ComputePipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(addComputePipelineFunctionsWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE bool MTL::BinaryArchive::addFunction(const MTL::FunctionDescriptor* descriptor, const MTL::Library* library, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(addFunctionWithDescriptor_library_error_), descriptor, library, error); +} + +_MTL_INLINE bool MTL::BinaryArchive::addLibrary(const MTL::StitchedLibraryDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(addLibraryWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE bool MTL::BinaryArchive::addMeshRenderPipelineFunctions(const MTL::MeshRenderPipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(addMeshRenderPipelineFunctionsWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE bool MTL::BinaryArchive::addRenderPipelineFunctions(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(addRenderPipelineFunctionsWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE bool MTL::BinaryArchive::addTileRenderPipelineFunctions(const MTL::TileRenderPipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(addTileRenderPipelineFunctionsWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::Device* MTL::BinaryArchive::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + _MTL_INLINE NS::String* MTL::BinaryArchive::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE bool MTL::BinaryArchive::serializeToURL(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(serializeToURL_error_), url, error); +} + _MTL_INLINE void MTL::BinaryArchive::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } - -// property: device -_MTL_INLINE MTL::Device* MTL::BinaryArchive::device() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); -} - -// method: addComputePipelineFunctionsWithDescriptor:error: -_MTL_INLINE bool MTL::BinaryArchive::addComputePipelineFunctions(const MTL::ComputePipelineDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(addComputePipelineFunctionsWithDescriptor_error_), descriptor, error); -} - -// method: addRenderPipelineFunctionsWithDescriptor:error: -_MTL_INLINE bool MTL::BinaryArchive::addRenderPipelineFunctions(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(addRenderPipelineFunctionsWithDescriptor_error_), descriptor, error); -} - -// method: addTileRenderPipelineFunctionsWithDescriptor:error: -_MTL_INLINE bool MTL::BinaryArchive::addTileRenderPipelineFunctions(const MTL::TileRenderPipelineDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(addTileRenderPipelineFunctionsWithDescriptor_error_), descriptor, error); -} - -// method: serializeToURL:error: -_MTL_INLINE bool MTL::BinaryArchive::serializeToURL(const NS::URL* url, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(serializeToURL_error_), url, error); -} - -// method: addFunctionWithDescriptor:library:error: -_MTL_INLINE bool MTL::BinaryArchive::addFunction(const MTL::FunctionDescriptor* descriptor, const MTL::Library* library, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(addFunctionWithDescriptor_library_error_), descriptor, library, error); -} diff --git a/vendor/metal-cpp/Metal/MTLBlitCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLBlitCommandEncoder.hpp index 8d4845a82..319f05ef5 100644 --- a/vendor/metal-cpp/Metal/MTLBlitCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLBlitCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLBlitCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,227 +20,207 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLCommandEncoder.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLBlitCommandEncoder.hpp" -#include "MTLCommandEncoder.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class Buffer; +class CounterSampleBuffer; +class Fence; +class IndirectCommandBuffer; +class Resource; +class Tensor; +class TensorExtents; +class Texture; + _MTL_OPTIONS(NS::UInteger, BlitOption) { BlitOptionNone = 0, BlitOptionDepthFromDepthStencil = 1, - BlitOptionStencilFromDepthStencil = 2, - BlitOptionRowLinearPVRTC = 4, + BlitOptionStencilFromDepthStencil = 1 << 1, + BlitOptionRowLinearPVRTC = 1 << 2, }; class BlitCommandEncoder : public NS::Referencing { public: - void synchronizeResource(const class Resource* resource); + void copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin, MTL::BlitOption options); + void copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger size); - void synchronizeTexture(const class Texture* texture, NS::UInteger slice, NS::UInteger level); + void copyFromTensor(const MTL::Tensor* sourceTensor, const MTL::TensorExtents* sourceOrigin, const MTL::TensorExtents* sourceDimensions, const MTL::Tensor* destinationTensor, const MTL::TensorExtents* destinationOrigin, const MTL::TensorExtents* destinationDimensions); - void copyFromTexture(const class Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const class Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage, MTL::BlitOption options); + void copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, NS::UInteger sliceCount, NS::UInteger levelCount); + void copyFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture); - void copyFromBuffer(const class Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const class Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void copyIndirectCommandBuffer(const MTL::IndirectCommandBuffer* source, NS::Range sourceRange, const MTL::IndirectCommandBuffer* destination, NS::UInteger destinationIndex); - void copyFromBuffer(const class Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const class Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin, MTL::BlitOption options); + void fillBuffer(const MTL::Buffer* buffer, NS::Range range, uint8_t value); - void copyFromTexture(const class Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const class Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage); + void generateMipmaps(const MTL::Texture* texture); - void copyFromTexture(const class Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const class Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage, MTL::BlitOption options); + void getTextureAccessCounters(const MTL::Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice, bool resetCounters, const MTL::Buffer* countersBuffer, NS::UInteger countersBufferOffset); - void generateMipmaps(const class Texture* texture); + void optimizeContentsForCPUAccess(const MTL::Texture* texture); + void optimizeContentsForCPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level); - void fillBuffer(const class Buffer* buffer, NS::Range range, uint8_t value); + void optimizeContentsForGPUAccess(const MTL::Texture* texture); + void optimizeContentsForGPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level); - void copyFromTexture(const class Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, const class Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, NS::UInteger sliceCount, NS::UInteger levelCount); + void optimizeIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range range); - void copyFromTexture(const class Texture* sourceTexture, const class Texture* destinationTexture); + void resetCommandsInBuffer(const MTL::IndirectCommandBuffer* buffer, NS::Range range); - void copyFromBuffer(const class Buffer* sourceBuffer, NS::UInteger sourceOffset, const class Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger size); + void resetTextureAccessCounters(const MTL::Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice); - void updateFence(const class Fence* fence); + void resolveCounters(const MTL::CounterSampleBuffer* sampleBuffer, NS::Range range, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset); - void waitForFence(const class Fence* fence); + void sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); - void getTextureAccessCounters(const class Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice, bool resetCounters, const class Buffer* countersBuffer, NS::UInteger countersBufferOffset); + void synchronizeResource(const MTL::Resource* resource); - void resetTextureAccessCounters(const class Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice); + void synchronizeTexture(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level); - void optimizeContentsForGPUAccess(const class Texture* texture); + void updateFence(const MTL::Fence* fence); - void optimizeContentsForGPUAccess(const class Texture* texture, NS::UInteger slice, NS::UInteger level); - - void optimizeContentsForCPUAccess(const class Texture* texture); - - void optimizeContentsForCPUAccess(const class Texture* texture, NS::UInteger slice, NS::UInteger level); - - void resetCommandsInBuffer(const class IndirectCommandBuffer* buffer, NS::Range range); - - void copyIndirectCommandBuffer(const class IndirectCommandBuffer* source, NS::Range sourceRange, const class IndirectCommandBuffer* destination, NS::UInteger destinationIndex); - - void optimizeIndirectCommandBuffer(const class IndirectCommandBuffer* indirectCommandBuffer, NS::Range range); - - void sampleCountersInBuffer(const class CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); - - void resolveCounters(const class CounterSampleBuffer* sampleBuffer, NS::Range range, const class Buffer* destinationBuffer, NS::UInteger destinationOffset); + void waitForFence(const MTL::Fence* fence); }; } - -// method: synchronizeResource: -_MTL_INLINE void MTL::BlitCommandEncoder::synchronizeResource(const MTL::Resource* resource) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(synchronizeResource_), resource); -} - -// method: synchronizeTexture:slice:level: -_MTL_INLINE void MTL::BlitCommandEncoder::synchronizeTexture(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(synchronizeTexture_slice_level_), texture, slice, level); -} - -// method: copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin: -_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); -} - -// method: copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin: _MTL_INLINE void MTL::BlitCommandEncoder::copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceBuffer, sourceOffset, sourceBytesPerRow, sourceBytesPerImage, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); } -// method: copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options: _MTL_INLINE void MTL::BlitCommandEncoder::copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin, MTL::BlitOption options) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_options_), sourceBuffer, sourceOffset, sourceBytesPerRow, sourceBytesPerImage, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin, options); } -// method: copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage: -_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationBuffer, destinationOffset, destinationBytesPerRow, destinationBytesPerImage); -} - -// method: copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options: -_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage, MTL::BlitOption options) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_options_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationBuffer, destinationOffset, destinationBytesPerRow, destinationBytesPerImage, options); -} - -// method: generateMipmapsForTexture: -_MTL_INLINE void MTL::BlitCommandEncoder::generateMipmaps(const MTL::Texture* texture) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(generateMipmapsForTexture_), texture); -} - -// method: fillBuffer:range:value: -_MTL_INLINE void MTL::BlitCommandEncoder::fillBuffer(const MTL::Buffer* buffer, NS::Range range, uint8_t value) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(fillBuffer_range_value_), buffer, range, value); -} - -// method: copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount: -_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, NS::UInteger sliceCount, NS::UInteger levelCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_toTexture_destinationSlice_destinationLevel_sliceCount_levelCount_), sourceTexture, sourceSlice, sourceLevel, destinationTexture, destinationSlice, destinationLevel, sliceCount, levelCount); -} - -// method: copyFromTexture:toTexture: -_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_toTexture_), sourceTexture, destinationTexture); -} - -// method: copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size: _MTL_INLINE void MTL::BlitCommandEncoder::copyFromBuffer(const MTL::Buffer* sourceBuffer, NS::UInteger sourceOffset, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger size) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromBuffer_sourceOffset_toBuffer_destinationOffset_size_), sourceBuffer, sourceOffset, destinationBuffer, destinationOffset, size); } -// method: updateFence: -_MTL_INLINE void MTL::BlitCommandEncoder::updateFence(const MTL::Fence* fence) +_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTensor(const MTL::Tensor* sourceTensor, const MTL::TensorExtents* sourceOrigin, const MTL::TensorExtents* sourceDimensions, const MTL::Tensor* destinationTensor, const MTL::TensorExtents* destinationOrigin, const MTL::TensorExtents* destinationDimensions) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTensor_sourceOrigin_sourceDimensions_toTensor_destinationOrigin_destinationDimensions_), sourceTensor, sourceOrigin, sourceDimensions, destinationTensor, destinationOrigin, destinationDimensions); } -// method: waitForFence: -_MTL_INLINE void MTL::BlitCommandEncoder::waitForFence(const MTL::Fence* fence) +_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); } -// method: getTextureAccessCounters:region:mipLevel:slice:resetCounters:countersBuffer:countersBufferOffset: -_MTL_INLINE void MTL::BlitCommandEncoder::getTextureAccessCounters(const MTL::Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice, bool resetCounters, const MTL::Buffer* countersBuffer, NS::UInteger countersBufferOffset) +_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(getTextureAccessCounters_region_mipLevel_slice_resetCounters_countersBuffer_countersBufferOffset_), texture, region, mipLevel, slice, resetCounters, countersBuffer, countersBufferOffset); + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationBuffer, destinationOffset, destinationBytesPerRow, destinationBytesPerImage); } -// method: resetTextureAccessCounters:region:mipLevel:slice: -_MTL_INLINE void MTL::BlitCommandEncoder::resetTextureAccessCounters(const MTL::Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice) +_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset, NS::UInteger destinationBytesPerRow, NS::UInteger destinationBytesPerImage, MTL::BlitOption options) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(resetTextureAccessCounters_region_mipLevel_slice_), texture, region, mipLevel, slice); + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_options_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationBuffer, destinationOffset, destinationBytesPerRow, destinationBytesPerImage, options); } -// method: optimizeContentsForGPUAccess: -_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForGPUAccess(const MTL::Texture* texture) +_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, NS::UInteger sliceCount, NS::UInteger levelCount) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForGPUAccess_), texture); + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_sourceSlice_sourceLevel_toTexture_destinationSlice_destinationLevel_sliceCount_levelCount_), sourceTexture, sourceSlice, sourceLevel, destinationTexture, destinationSlice, destinationLevel, sliceCount, levelCount); } -// method: optimizeContentsForGPUAccess:slice:level: -_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForGPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) +_MTL_INLINE void MTL::BlitCommandEncoder::copyFromTexture(const MTL::Texture* sourceTexture, const MTL::Texture* destinationTexture) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForGPUAccess_slice_level_), texture, slice, level); + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyFromTexture_toTexture_), sourceTexture, destinationTexture); } -// method: optimizeContentsForCPUAccess: -_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForCPUAccess(const MTL::Texture* texture) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForCPUAccess_), texture); -} - -// method: optimizeContentsForCPUAccess:slice:level: -_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForCPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForCPUAccess_slice_level_), texture, slice, level); -} - -// method: resetCommandsInBuffer:withRange: -_MTL_INLINE void MTL::BlitCommandEncoder::resetCommandsInBuffer(const MTL::IndirectCommandBuffer* buffer, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(resetCommandsInBuffer_withRange_), buffer, range); -} - -// method: copyIndirectCommandBuffer:sourceRange:destination:destinationIndex: _MTL_INLINE void MTL::BlitCommandEncoder::copyIndirectCommandBuffer(const MTL::IndirectCommandBuffer* source, NS::Range sourceRange, const MTL::IndirectCommandBuffer* destination, NS::UInteger destinationIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyIndirectCommandBuffer_sourceRange_destination_destinationIndex_), source, sourceRange, destination, destinationIndex); } -// method: optimizeIndirectCommandBuffer:withRange: +_MTL_INLINE void MTL::BlitCommandEncoder::fillBuffer(const MTL::Buffer* buffer, NS::Range range, uint8_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(fillBuffer_range_value_), buffer, range, value); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::generateMipmaps(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(generateMipmapsForTexture_), texture); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::getTextureAccessCounters(const MTL::Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice, bool resetCounters, const MTL::Buffer* countersBuffer, NS::UInteger countersBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(getTextureAccessCounters_region_mipLevel_slice_resetCounters_countersBuffer_countersBufferOffset_), texture, region, mipLevel, slice, resetCounters, countersBuffer, countersBufferOffset); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForCPUAccess(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForCPUAccess_), texture); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForCPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForCPUAccess_slice_level_), texture, slice, level); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForGPUAccess(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForGPUAccess_), texture); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::optimizeContentsForGPUAccess(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeContentsForGPUAccess_slice_level_), texture, slice, level); +} + _MTL_INLINE void MTL::BlitCommandEncoder::optimizeIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizeIndirectCommandBuffer_withRange_), indirectCommandBuffer, range); } -// method: sampleCountersInBuffer:atSampleIndex:withBarrier: +_MTL_INLINE void MTL::BlitCommandEncoder::resetCommandsInBuffer(const MTL::IndirectCommandBuffer* buffer, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(resetCommandsInBuffer_withRange_), buffer, range); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::resetTextureAccessCounters(const MTL::Texture* texture, MTL::Region region, NS::UInteger mipLevel, NS::UInteger slice) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(resetTextureAccessCounters_region_mipLevel_slice_), texture, region, mipLevel, slice); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::resolveCounters(const MTL::CounterSampleBuffer* sampleBuffer, NS::Range range, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveCounters_inRange_destinationBuffer_destinationOffset_), sampleBuffer, range, destinationBuffer, destinationOffset); +} + _MTL_INLINE void MTL::BlitCommandEncoder::sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier) { Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCountersInBuffer_atSampleIndex_withBarrier_), sampleBuffer, sampleIndex, barrier); } -// method: resolveCounters:inRange:destinationBuffer:destinationOffset: -_MTL_INLINE void MTL::BlitCommandEncoder::resolveCounters(const MTL::CounterSampleBuffer* sampleBuffer, NS::Range range, const MTL::Buffer* destinationBuffer, NS::UInteger destinationOffset) +_MTL_INLINE void MTL::BlitCommandEncoder::synchronizeResource(const MTL::Resource* resource) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveCounters_inRange_destinationBuffer_destinationOffset_), sampleBuffer, range, destinationBuffer, destinationOffset); + Object::sendMessage(this, _MTL_PRIVATE_SEL(synchronizeResource_), resource); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::synchronizeTexture(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(synchronizeTexture_slice_level_), texture, slice, level); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::updateFence(const MTL::Fence* fence) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); +} + +_MTL_INLINE void MTL::BlitCommandEncoder::waitForFence(const MTL::Fence* fence) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); } diff --git a/vendor/metal-cpp/Metal/MTLBlitPass.hpp b/vendor/metal-cpp/Metal/MTLBlitPass.hpp index 849875259..6b15e0b5d 100644 --- a/vendor/metal-cpp/Metal/MTLBlitPass.hpp +++ b/vendor/metal-cpp/Metal/MTLBlitPass.hpp @@ -2,7 +2,7 @@ // // Metal/MTLBlitPass.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,145 +20,134 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class BlitPassDescriptor; +class BlitPassSampleBufferAttachmentDescriptor; +class BlitPassSampleBufferAttachmentDescriptorArray; +class CounterSampleBuffer; + class BlitPassSampleBufferAttachmentDescriptor : public NS::Copying { public: - static class BlitPassSampleBufferAttachmentDescriptor* alloc(); + static BlitPassSampleBufferAttachmentDescriptor* alloc(); - class BlitPassSampleBufferAttachmentDescriptor* init(); + NS::UInteger endOfEncoderSampleIndex() const; - class CounterSampleBuffer* sampleBuffer() const; - void setSampleBuffer(const class CounterSampleBuffer* sampleBuffer); + BlitPassSampleBufferAttachmentDescriptor* init(); - NS::UInteger startOfEncoderSampleIndex() const; - void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + CounterSampleBuffer* sampleBuffer() const; - NS::UInteger endOfEncoderSampleIndex() const; - void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + + void setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer); + + void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + NS::UInteger startOfEncoderSampleIndex() const; }; - class BlitPassSampleBufferAttachmentDescriptorArray : public NS::Referencing { public: - static class BlitPassSampleBufferAttachmentDescriptorArray* alloc(); + static BlitPassSampleBufferAttachmentDescriptorArray* alloc(); - class BlitPassSampleBufferAttachmentDescriptorArray* init(); + BlitPassSampleBufferAttachmentDescriptorArray* init(); - class BlitPassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class BlitPassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + BlitPassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::BlitPassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class BlitPassDescriptor : public NS::Copying { public: - static class BlitPassDescriptor* alloc(); + static BlitPassDescriptor* alloc(); - class BlitPassDescriptor* init(); + static BlitPassDescriptor* blitPassDescriptor(); - static class BlitPassDescriptor* blitPassDescriptor(); + BlitPassDescriptor* init(); - class BlitPassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; + BlitPassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; }; } - -// static method: alloc _MTL_INLINE MTL::BlitPassSampleBufferAttachmentDescriptor* MTL::BlitPassSampleBufferAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLBlitPassSampleBufferAttachmentDescriptor)); } -// method: init +_MTL_INLINE NS::UInteger MTL::BlitPassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::BlitPassSampleBufferAttachmentDescriptor* MTL::BlitPassSampleBufferAttachmentDescriptor::init() { return NS::Object::init(); } -// property: sampleBuffer _MTL_INLINE MTL::CounterSampleBuffer* MTL::BlitPassSampleBufferAttachmentDescriptor::sampleBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBuffer)); } -_MTL_INLINE void MTL::BlitPassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); -} - -// property: startOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::BlitPassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); -} - -_MTL_INLINE void MTL::BlitPassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); -} - -// property: endOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::BlitPassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); -} - _MTL_INLINE void MTL::BlitPassSampleBufferAttachmentDescriptor::setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfEncoderSampleIndex_), endOfEncoderSampleIndex); } -// static method: alloc +_MTL_INLINE void MTL::BlitPassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); +} + +_MTL_INLINE void MTL::BlitPassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); +} + +_MTL_INLINE NS::UInteger MTL::BlitPassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::BlitPassSampleBufferAttachmentDescriptorArray* MTL::BlitPassSampleBufferAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLBlitPassSampleBufferAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::BlitPassSampleBufferAttachmentDescriptorArray* MTL::BlitPassSampleBufferAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::BlitPassSampleBufferAttachmentDescriptor* MTL::BlitPassSampleBufferAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::BlitPassSampleBufferAttachmentDescriptorArray::setObject(const MTL::BlitPassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::BlitPassDescriptor* MTL::BlitPassDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLBlitPassDescriptor)); } -// method: init -_MTL_INLINE MTL::BlitPassDescriptor* MTL::BlitPassDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: blitPassDescriptor _MTL_INLINE MTL::BlitPassDescriptor* MTL::BlitPassDescriptor::blitPassDescriptor() { return Object::sendMessage(_MTL_PRIVATE_CLS(MTLBlitPassDescriptor), _MTL_PRIVATE_SEL(blitPassDescriptor)); } -// property: sampleBufferAttachments +_MTL_INLINE MTL::BlitPassDescriptor* MTL::BlitPassDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE MTL::BlitPassSampleBufferAttachmentDescriptorArray* MTL::BlitPassDescriptor::sampleBufferAttachments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); diff --git a/vendor/metal-cpp/Metal/MTLBuffer.hpp b/vendor/metal-cpp/Metal/MTLBuffer.hpp index 684ee8e24..a93be1b06 100644 --- a/vendor/metal-cpp/Metal/MTLBuffer.hpp +++ b/vendor/metal-cpp/Metal/MTLBuffer.hpp @@ -2,7 +2,7 @@ // // Metal/MTLBuffer.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,90 +20,100 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" +#include "MTLGPUAddress.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - #include "MTLResource.hpp" namespace MTL { +class Buffer; +class Device; +class Tensor; +class TensorDescriptor; +class Texture; +class TextureDescriptor; + class Buffer : public NS::Referencing { public: - NS::UInteger length() const; + void addDebugMarker(const NS::String* marker, NS::Range range); - void* contents(); + void* contents(); - void didModifyRange(NS::Range range); + void didModifyRange(NS::Range range); - class Texture* newTexture(const class TextureDescriptor* descriptor, NS::UInteger offset, NS::UInteger bytesPerRow); + GPUAddress gpuAddress() const; - void addDebugMarker(const NS::String* marker, NS::Range range); + NS::UInteger length() const; - void removeAllDebugMarkers(); + Buffer* newRemoteBufferViewForDevice(const MTL::Device* device); - class Buffer* remoteStorageBuffer() const; + Tensor* newTensor(const MTL::TensorDescriptor* descriptor, NS::UInteger offset, NS::Error** error); - class Buffer* newRemoteBufferViewForDevice(const class Device* device); + Texture* newTexture(const MTL::TextureDescriptor* descriptor, NS::UInteger offset, NS::UInteger bytesPerRow); - uint64_t gpuAddress() const; + Buffer* remoteStorageBuffer() const; + + void removeAllDebugMarkers(); + + BufferSparseTier sparseBufferTier() const; }; } - -// property: length -_MTL_INLINE NS::UInteger MTL::Buffer::length() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(length)); -} - -// method: contents -_MTL_INLINE void* MTL::Buffer::contents() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(contents)); -} - -// method: didModifyRange: -_MTL_INLINE void MTL::Buffer::didModifyRange(NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(didModifyRange_), range); -} - -// method: newTextureWithDescriptor:offset:bytesPerRow: -_MTL_INLINE MTL::Texture* MTL::Buffer::newTexture(const MTL::TextureDescriptor* descriptor, NS::UInteger offset, NS::UInteger bytesPerRow) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_offset_bytesPerRow_), descriptor, offset, bytesPerRow); -} - -// method: addDebugMarker:range: _MTL_INLINE void MTL::Buffer::addDebugMarker(const NS::String* marker, NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(addDebugMarker_range_), marker, range); } -// method: removeAllDebugMarkers -_MTL_INLINE void MTL::Buffer::removeAllDebugMarkers() +_MTL_INLINE void* MTL::Buffer::contents() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(removeAllDebugMarkers)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(contents)); } -// property: remoteStorageBuffer -_MTL_INLINE MTL::Buffer* MTL::Buffer::remoteStorageBuffer() const +_MTL_INLINE void MTL::Buffer::didModifyRange(NS::Range range) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(remoteStorageBuffer)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(didModifyRange_), range); +} + +_MTL_INLINE MTL::GPUAddress MTL::Buffer::gpuAddress() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuAddress)); +} + +_MTL_INLINE NS::UInteger MTL::Buffer::length() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(length)); } -// method: newRemoteBufferViewForDevice: _MTL_INLINE MTL::Buffer* MTL::Buffer::newRemoteBufferViewForDevice(const MTL::Device* device) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRemoteBufferViewForDevice_), device); } -// property: gpuAddress -_MTL_INLINE uint64_t MTL::Buffer::gpuAddress() const +_MTL_INLINE MTL::Tensor* MTL::Buffer::newTensor(const MTL::TensorDescriptor* descriptor, NS::UInteger offset, NS::Error** error) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuAddress)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTensorWithDescriptor_offset_error_), descriptor, offset, error); +} + +_MTL_INLINE MTL::Texture* MTL::Buffer::newTexture(const MTL::TextureDescriptor* descriptor, NS::UInteger offset, NS::UInteger bytesPerRow) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_offset_bytesPerRow_), descriptor, offset, bytesPerRow); +} + +_MTL_INLINE MTL::Buffer* MTL::Buffer::remoteStorageBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(remoteStorageBuffer)); +} + +_MTL_INLINE void MTL::Buffer::removeAllDebugMarkers() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeAllDebugMarkers)); +} + +_MTL_INLINE MTL::BufferSparseTier MTL::Buffer::sparseBufferTier() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseBufferTier)); } diff --git a/vendor/metal-cpp/Metal/MTLCaptureManager.hpp b/vendor/metal-cpp/Metal/MTLCaptureManager.hpp index ebe7ddd2a..a76224183 100644 --- a/vendor/metal-cpp/Metal/MTLCaptureManager.hpp +++ b/vendor/metal-cpp/Metal/MTLCaptureManager.hpp @@ -2,7 +2,7 @@ // // Metal/MTLCaptureManager.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,13 +20,24 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include +namespace MTL +{ +class CaptureDescriptor; +class CaptureManager; +class CaptureScope; +class CommandQueue; +class Device; +} -#include "MTLCaptureManager.hpp" +namespace MTL4 +{ +class CommandQueue; +} namespace MTL { @@ -44,168 +55,125 @@ _MTL_ENUM(NS::Integer, CaptureDestination) { class CaptureDescriptor : public NS::Copying { public: - static class CaptureDescriptor* alloc(); + static CaptureDescriptor* alloc(); - class CaptureDescriptor* init(); + NS::Object* captureObject() const; - id captureObject() const; - void setCaptureObject(id captureObject); + CaptureDestination destination() const; - MTL::CaptureDestination destination() const; - void setDestination(MTL::CaptureDestination destination); + CaptureDescriptor* init(); - NS::URL* outputURL() const; - void setOutputURL(const NS::URL* outputURL); + NS::URL* outputURL() const; + + void setCaptureObject(NS::Object* captureObject); + + void setDestination(MTL::CaptureDestination destination); + + void setOutputURL(const NS::URL* outputURL); }; - class CaptureManager : public NS::Referencing { public: - static class CaptureManager* alloc(); + static CaptureManager* alloc(); - static class CaptureManager* sharedCaptureManager(); + CaptureScope* defaultCaptureScope() const; - MTL::CaptureManager* init(); + CaptureManager* init(); - class CaptureScope* newCaptureScope(const class Device* device); + bool isCapturing() const; - class CaptureScope* newCaptureScope(const class CommandQueue* commandQueue); + CaptureScope* newCaptureScope(const MTL::Device* device); + CaptureScope* newCaptureScope(const MTL::CommandQueue* commandQueue); + CaptureScope* newCaptureScope(const MTL4::CommandQueue* commandQueue); - bool supportsDestination(MTL::CaptureDestination destination); + void setDefaultCaptureScope(const MTL::CaptureScope* defaultCaptureScope); - bool startCapture(const class CaptureDescriptor* descriptor, NS::Error** error); + static CaptureManager* sharedCaptureManager(); - void startCapture(const class Device* device); + bool startCapture(const MTL::CaptureDescriptor* descriptor, NS::Error** error); + void startCapture(const MTL::Device* device); + void startCapture(const MTL::CommandQueue* commandQueue); + void startCapture(const MTL::CaptureScope* captureScope); - void startCapture(const class CommandQueue* commandQueue); + void stopCapture(); - void startCapture(const class CaptureScope* captureScope); - - void stopCapture(); - - class CaptureScope* defaultCaptureScope() const; - void setDefaultCaptureScope(const class CaptureScope* defaultCaptureScope); - - bool isCapturing() const; + bool supportsDestination(MTL::CaptureDestination destination); }; } - -// static method: alloc _MTL_INLINE MTL::CaptureDescriptor* MTL::CaptureDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLCaptureDescriptor)); } -// method: init +_MTL_INLINE NS::Object* MTL::CaptureDescriptor::captureObject() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(captureObject)); +} + +_MTL_INLINE MTL::CaptureDestination MTL::CaptureDescriptor::destination() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(destination)); +} + _MTL_INLINE MTL::CaptureDescriptor* MTL::CaptureDescriptor::init() { return NS::Object::init(); } -// property: captureObject -_MTL_INLINE id MTL::CaptureDescriptor::captureObject() const +_MTL_INLINE NS::URL* MTL::CaptureDescriptor::outputURL() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(captureObject)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(outputURL)); } -_MTL_INLINE void MTL::CaptureDescriptor::setCaptureObject(id captureObject) +_MTL_INLINE void MTL::CaptureDescriptor::setCaptureObject(NS::Object* captureObject) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setCaptureObject_), captureObject); } -// property: destination -_MTL_INLINE MTL::CaptureDestination MTL::CaptureDescriptor::destination() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(destination)); -} - _MTL_INLINE void MTL::CaptureDescriptor::setDestination(MTL::CaptureDestination destination) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestination_), destination); } -// property: outputURL -_MTL_INLINE NS::URL* MTL::CaptureDescriptor::outputURL() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(outputURL)); -} - _MTL_INLINE void MTL::CaptureDescriptor::setOutputURL(const NS::URL* outputURL) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setOutputURL_), outputURL); } -// static method: alloc _MTL_INLINE MTL::CaptureManager* MTL::CaptureManager::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLCaptureManager)); } -// static method: sharedCaptureManager -_MTL_INLINE MTL::CaptureManager* MTL::CaptureManager::sharedCaptureManager() +_MTL_INLINE MTL::CaptureScope* MTL::CaptureManager::defaultCaptureScope() const { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLCaptureManager), _MTL_PRIVATE_SEL(sharedCaptureManager)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(defaultCaptureScope)); } -// method: init _MTL_INLINE MTL::CaptureManager* MTL::CaptureManager::init() { return NS::Object::init(); } -// method: newCaptureScopeWithDevice: +_MTL_INLINE bool MTL::CaptureManager::isCapturing() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isCapturing)); +} + _MTL_INLINE MTL::CaptureScope* MTL::CaptureManager::newCaptureScope(const MTL::Device* device) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCaptureScopeWithDevice_), device); } -// method: newCaptureScopeWithCommandQueue: _MTL_INLINE MTL::CaptureScope* MTL::CaptureManager::newCaptureScope(const MTL::CommandQueue* commandQueue) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCaptureScopeWithCommandQueue_), commandQueue); } -// method: supportsDestination: -_MTL_INLINE bool MTL::CaptureManager::supportsDestination(MTL::CaptureDestination destination) +_MTL_INLINE MTL::CaptureScope* MTL::CaptureManager::newCaptureScope(const MTL4::CommandQueue* commandQueue) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsDestination_), destination); -} - -// method: startCaptureWithDescriptor:error: -_MTL_INLINE bool MTL::CaptureManager::startCapture(const MTL::CaptureDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithDescriptor_error_), descriptor, error); -} - -// method: startCaptureWithDevice: -_MTL_INLINE void MTL::CaptureManager::startCapture(const MTL::Device* device) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithDevice_), device); -} - -// method: startCaptureWithCommandQueue: -_MTL_INLINE void MTL::CaptureManager::startCapture(const MTL::CommandQueue* commandQueue) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithCommandQueue_), commandQueue); -} - -// method: startCaptureWithScope: -_MTL_INLINE void MTL::CaptureManager::startCapture(const MTL::CaptureScope* captureScope) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithScope_), captureScope); -} - -// method: stopCapture -_MTL_INLINE void MTL::CaptureManager::stopCapture() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(stopCapture)); -} - -// property: defaultCaptureScope -_MTL_INLINE MTL::CaptureScope* MTL::CaptureManager::defaultCaptureScope() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(defaultCaptureScope)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCaptureScopeWithMTL4CommandQueue_), commandQueue); } _MTL_INLINE void MTL::CaptureManager::setDefaultCaptureScope(const MTL::CaptureScope* defaultCaptureScope) @@ -213,8 +181,37 @@ _MTL_INLINE void MTL::CaptureManager::setDefaultCaptureScope(const MTL::CaptureS Object::sendMessage(this, _MTL_PRIVATE_SEL(setDefaultCaptureScope_), defaultCaptureScope); } -// property: isCapturing -_MTL_INLINE bool MTL::CaptureManager::isCapturing() const +_MTL_INLINE MTL::CaptureManager* MTL::CaptureManager::sharedCaptureManager() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isCapturing)); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLCaptureManager), _MTL_PRIVATE_SEL(sharedCaptureManager)); +} + +_MTL_INLINE bool MTL::CaptureManager::startCapture(const MTL::CaptureDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE void MTL::CaptureManager::startCapture(const MTL::Device* device) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithDevice_), device); +} + +_MTL_INLINE void MTL::CaptureManager::startCapture(const MTL::CommandQueue* commandQueue) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithCommandQueue_), commandQueue); +} + +_MTL_INLINE void MTL::CaptureManager::startCapture(const MTL::CaptureScope* captureScope) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(startCaptureWithScope_), captureScope); +} + +_MTL_INLINE void MTL::CaptureManager::stopCapture() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(stopCapture)); +} + +_MTL_INLINE bool MTL::CaptureManager::supportsDestination(MTL::CaptureDestination destination) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsDestination_), destination); } diff --git a/vendor/metal-cpp/Metal/MTLCaptureScope.hpp b/vendor/metal-cpp/Metal/MTLCaptureScope.hpp index 6d5d1d6fd..96ade67d4 100644 --- a/vendor/metal-cpp/Metal/MTLCaptureScope.hpp +++ b/vendor/metal-cpp/Metal/MTLCaptureScope.hpp @@ -2,7 +2,7 @@ // // Metal/MTLCaptureScope.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,8 +25,7 @@ #include "MTLDefines.hpp" #include "MTLPrivate.hpp" -#include "../Foundation/NSObject.hpp" -#include "../Foundation/NSString.hpp" +#include "../Foundation/Foundation.hpp" //------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/Metal/MTLCommandBuffer.hpp b/vendor/metal-cpp/Metal/MTLCommandBuffer.hpp index f8e2bfb68..c504573d3 100644 --- a/vendor/metal-cpp/Metal/MTLCommandBuffer.hpp +++ b/vendor/metal-cpp/Metal/MTLCommandBuffer.hpp @@ -2,7 +2,7 @@ // // Metal/MTLCommandBuffer.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,17 +20,37 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" +#include +#include -#include - -#include "MTLCommandBuffer.hpp" #include namespace MTL { +class AccelerationStructureCommandEncoder; +class AccelerationStructurePassDescriptor; +class BlitCommandEncoder; +class BlitPassDescriptor; +class CommandBuffer; +class CommandBufferDescriptor; +class CommandQueue; +class ComputeCommandEncoder; +class ComputePassDescriptor; +class Device; +class Drawable; +class Event; +class LogContainer; +class LogState; +class ParallelRenderCommandEncoder; +class RenderCommandEncoder; +class RenderPassDescriptor; +class ResidencySet; +class ResourceStateCommandEncoder; +class ResourceStatePassDescriptor; _MTL_ENUM(NS::UInteger, CommandBufferStatus) { CommandBufferStatusNotEnqueued = 0, CommandBufferStatusEnqueued = 1, @@ -45,8 +65,8 @@ _MTL_ENUM(NS::UInteger, CommandBufferError) { CommandBufferErrorInternal = 1, CommandBufferErrorTimeout = 2, CommandBufferErrorPageFault = 3, - CommandBufferErrorAccessRevoked = 4, CommandBufferErrorBlacklisted = 4, + CommandBufferErrorAccessRevoked = 4, CommandBufferErrorNotPermitted = 7, CommandBufferErrorOutOfMemory = 8, CommandBufferErrorInvalidResource = 9, @@ -55,11 +75,6 @@ _MTL_ENUM(NS::UInteger, CommandBufferError) { CommandBufferErrorStackOverflow = 12, }; -_MTL_OPTIONS(NS::UInteger, CommandBufferErrorOption) { - CommandBufferErrorOptionNone = 0, - CommandBufferErrorOptionEncoderExecutionStatus = 1, -}; - _MTL_ENUM(NS::Integer, CommandEncoderErrorState) { CommandEncoderErrorStateUnknown = 0, CommandEncoderErrorStateCompleted = 1, @@ -68,407 +83,382 @@ _MTL_ENUM(NS::Integer, CommandEncoderErrorState) { CommandEncoderErrorStateFaulted = 4, }; -class CommandBufferDescriptor : public NS::Copying -{ -public: - static class CommandBufferDescriptor* alloc(); - - class CommandBufferDescriptor* init(); - - bool retainedReferences() const; - void setRetainedReferences(bool retainedReferences); - - MTL::CommandBufferErrorOption errorOptions() const; - void setErrorOptions(MTL::CommandBufferErrorOption errorOptions); -}; - -class CommandBufferEncoderInfo : public NS::Referencing -{ -public: - NS::String* label() const; - - NS::Array* debugSignposts() const; - - MTL::CommandEncoderErrorState errorState() const; -}; - _MTL_ENUM(NS::UInteger, DispatchType) { DispatchTypeSerial = 0, DispatchTypeConcurrent = 1, }; -class CommandBuffer; +_MTL_OPTIONS(NS::UInteger, CommandBufferErrorOption) { + CommandBufferErrorOptionNone = 0, + CommandBufferErrorOptionEncoderExecutionStatus = 1, +}; using CommandBufferHandler = void (^)(CommandBuffer*); - using HandlerFunction = std::function; +class CommandBufferDescriptor : public NS::Copying +{ +public: + static CommandBufferDescriptor* alloc(); + + CommandBufferErrorOption errorOptions() const; + + CommandBufferDescriptor* init(); + + LogState* logState() const; + + bool retainedReferences() const; + + void setErrorOptions(MTL::CommandBufferErrorOption errorOptions); + + void setLogState(const MTL::LogState* logState); + + void setRetainedReferences(bool retainedReferences); +}; +class CommandBufferEncoderInfo : public NS::Referencing +{ +public: + NS::Array* debugSignposts() const; + + CommandEncoderErrorState errorState() const; + + NS::String* label() const; +}; class CommandBuffer : public NS::Referencing { public: - void addScheduledHandler(const HandlerFunction& function); + CFTimeInterval GPUEndTime() const; - void addCompletedHandler(const HandlerFunction& function); + CFTimeInterval GPUStartTime() const; - class Device* device() const; + AccelerationStructureCommandEncoder* accelerationStructureCommandEncoder(); + AccelerationStructureCommandEncoder* accelerationStructureCommandEncoder(const MTL::AccelerationStructurePassDescriptor* descriptor); - class CommandQueue* commandQueue() const; + void addCompletedHandler(const MTL::CommandBufferHandler block); + void addCompletedHandler(const MTL::HandlerFunction& function); - bool retainedReferences() const; + void addScheduledHandler(const MTL::CommandBufferHandler block); + void addScheduledHandler(const MTL::HandlerFunction& function); - MTL::CommandBufferErrorOption errorOptions() const; + BlitCommandEncoder* blitCommandEncoder(); + BlitCommandEncoder* blitCommandEncoder(const MTL::BlitPassDescriptor* blitPassDescriptor); - NS::String* label() const; - void setLabel(const NS::String* label); + CommandQueue* commandQueue() const; - CFTimeInterval kernelStartTime() const; + void commit(); - CFTimeInterval kernelEndTime() const; + ComputeCommandEncoder* computeCommandEncoder(const MTL::ComputePassDescriptor* computePassDescriptor); + ComputeCommandEncoder* computeCommandEncoder(); + ComputeCommandEncoder* computeCommandEncoder(MTL::DispatchType dispatchType); - class LogContainer* logs() const; + Device* device() const; - CFTimeInterval GPUStartTime() const; + void encodeSignalEvent(const MTL::Event* event, uint64_t value); - CFTimeInterval GPUEndTime() const; + void encodeWait(const MTL::Event* event, uint64_t value); - void enqueue(); + void enqueue(); - void commit(); + NS::Error* error() const; + CommandBufferErrorOption errorOptions() const; - void addScheduledHandler(const MTL::CommandBufferHandler block); + CFTimeInterval kernelEndTime() const; - void presentDrawable(const class Drawable* drawable); + CFTimeInterval kernelStartTime() const; - void presentDrawableAtTime(const class Drawable* drawable, CFTimeInterval presentationTime); + NS::String* label() const; - void presentDrawableAfterMinimumDuration(const class Drawable* drawable, CFTimeInterval duration); + LogContainer* logs() const; - void waitUntilScheduled(); + ParallelRenderCommandEncoder* parallelRenderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor); - void addCompletedHandler(const MTL::CommandBufferHandler block); + void popDebugGroup(); - void waitUntilCompleted(); + void presentDrawable(const MTL::Drawable* drawable); + void presentDrawableAfterMinimumDuration(const MTL::Drawable* drawable, CFTimeInterval duration); - MTL::CommandBufferStatus status() const; + void presentDrawableAtTime(const MTL::Drawable* drawable, CFTimeInterval presentationTime); - NS::Error* error() const; + void pushDebugGroup(const NS::String* string); - class BlitCommandEncoder* blitCommandEncoder(); + RenderCommandEncoder* renderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor); - class RenderCommandEncoder* renderCommandEncoder(const class RenderPassDescriptor* renderPassDescriptor); + ResourceStateCommandEncoder* resourceStateCommandEncoder(); + ResourceStateCommandEncoder* resourceStateCommandEncoder(const MTL::ResourceStatePassDescriptor* resourceStatePassDescriptor); - class ComputeCommandEncoder* computeCommandEncoder(const class ComputePassDescriptor* computePassDescriptor); + bool retainedReferences() const; - class BlitCommandEncoder* blitCommandEncoder(const class BlitPassDescriptor* blitPassDescriptor); + void setLabel(const NS::String* label); - class ComputeCommandEncoder* computeCommandEncoder(); + CommandBufferStatus status() const; - class ComputeCommandEncoder* computeCommandEncoder(MTL::DispatchType dispatchType); + void useResidencySet(const MTL::ResidencySet* residencySet); + void useResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count); - void encodeWait(const class Event* event, uint64_t value); + void waitUntilCompleted(); - void encodeSignalEvent(const class Event* event, uint64_t value); - - class ParallelRenderCommandEncoder* parallelRenderCommandEncoder(const class RenderPassDescriptor* renderPassDescriptor); - - class ResourceStateCommandEncoder* resourceStateCommandEncoder(); - - class ResourceStateCommandEncoder* resourceStateCommandEncoder(const class ResourceStatePassDescriptor* resourceStatePassDescriptor); - - class AccelerationStructureCommandEncoder* accelerationStructureCommandEncoder(); - - class AccelerationStructureCommandEncoder* accelerationStructureCommandEncoder(const class AccelerationStructurePassDescriptor* descriptor); - - void pushDebugGroup(const NS::String* string); - - void popDebugGroup(); + void waitUntilScheduled(); }; } - -// static method: alloc _MTL_INLINE MTL::CommandBufferDescriptor* MTL::CommandBufferDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLCommandBufferDescriptor)); } -// method: init +_MTL_INLINE MTL::CommandBufferErrorOption MTL::CommandBufferDescriptor::errorOptions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(errorOptions)); +} + _MTL_INLINE MTL::CommandBufferDescriptor* MTL::CommandBufferDescriptor::init() { return NS::Object::init(); } -// property: retainedReferences +_MTL_INLINE MTL::LogState* MTL::CommandBufferDescriptor::logState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(logState)); +} + _MTL_INLINE bool MTL::CommandBufferDescriptor::retainedReferences() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(retainedReferences)); } -_MTL_INLINE void MTL::CommandBufferDescriptor::setRetainedReferences(bool retainedReferences) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRetainedReferences_), retainedReferences); -} - -// property: errorOptions -_MTL_INLINE MTL::CommandBufferErrorOption MTL::CommandBufferDescriptor::errorOptions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(errorOptions)); -} - _MTL_INLINE void MTL::CommandBufferDescriptor::setErrorOptions(MTL::CommandBufferErrorOption errorOptions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setErrorOptions_), errorOptions); } -// property: label -_MTL_INLINE NS::String* MTL::CommandBufferEncoderInfo::label() const +_MTL_INLINE void MTL::CommandBufferDescriptor::setLogState(const MTL::LogState* logState) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLogState_), logState); +} + +_MTL_INLINE void MTL::CommandBufferDescriptor::setRetainedReferences(bool retainedReferences) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRetainedReferences_), retainedReferences); } -// property: debugSignposts _MTL_INLINE NS::Array* MTL::CommandBufferEncoderInfo::debugSignposts() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(debugSignposts)); } -// property: errorState _MTL_INLINE MTL::CommandEncoderErrorState MTL::CommandBufferEncoderInfo::errorState() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(errorState)); } -_MTL_INLINE void MTL::CommandBuffer::addScheduledHandler(const HandlerFunction& function) +_MTL_INLINE NS::String* MTL::CommandBufferEncoderInfo::label() const { - __block HandlerFunction blockFunction = function; - - addScheduledHandler(^(MTL::CommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); }); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -_MTL_INLINE void MTL::CommandBuffer::addCompletedHandler(const HandlerFunction& function) +_MTL_INLINE CFTimeInterval MTL::CommandBuffer::GPUEndTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(GPUEndTime)); +} + +_MTL_INLINE CFTimeInterval MTL::CommandBuffer::GPUStartTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(GPUStartTime)); +} + +_MTL_INLINE MTL::AccelerationStructureCommandEncoder* MTL::CommandBuffer::accelerationStructureCommandEncoder() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(accelerationStructureCommandEncoder)); +} + +_MTL_INLINE MTL::AccelerationStructureCommandEncoder* MTL::CommandBuffer::accelerationStructureCommandEncoder(const MTL::AccelerationStructurePassDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(accelerationStructureCommandEncoderWithDescriptor_), descriptor); +} + +_MTL_INLINE void MTL::CommandBuffer::addCompletedHandler(const MTL::CommandBufferHandler block) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addCompletedHandler_), block); +} + +_MTL_INLINE void MTL::CommandBuffer::addCompletedHandler(const MTL::HandlerFunction& function) { __block HandlerFunction blockFunction = function; - addCompletedHandler(^(MTL::CommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); }); } -// property: device -_MTL_INLINE MTL::Device* MTL::CommandBuffer::device() const +_MTL_INLINE void MTL::CommandBuffer::addScheduledHandler(const MTL::CommandBufferHandler block) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(addScheduledHandler_), block); +} + +_MTL_INLINE void MTL::CommandBuffer::addScheduledHandler(const MTL::HandlerFunction& function) +{ + __block HandlerFunction blockFunction = function; + addScheduledHandler(^(MTL::CommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); }); +} + +_MTL_INLINE MTL::BlitCommandEncoder* MTL::CommandBuffer::blitCommandEncoder() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(blitCommandEncoder)); +} + +_MTL_INLINE MTL::BlitCommandEncoder* MTL::CommandBuffer::blitCommandEncoder(const MTL::BlitPassDescriptor* blitPassDescriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(blitCommandEncoderWithDescriptor_), blitPassDescriptor); } -// property: commandQueue _MTL_INLINE MTL::CommandQueue* MTL::CommandBuffer::commandQueue() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandQueue)); } -// property: retainedReferences -_MTL_INLINE bool MTL::CommandBuffer::retainedReferences() const +_MTL_INLINE void MTL::CommandBuffer::commit() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(retainedReferences)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(commit)); +} + +_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder(const MTL::ComputePassDescriptor* computePassDescriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoderWithDescriptor_), computePassDescriptor); +} + +_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoder)); +} + +_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder(MTL::DispatchType dispatchType) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoderWithDispatchType_), dispatchType); +} + +_MTL_INLINE MTL::Device* MTL::CommandBuffer::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE void MTL::CommandBuffer::encodeSignalEvent(const MTL::Event* event, uint64_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(encodeSignalEvent_value_), event, value); +} + +_MTL_INLINE void MTL::CommandBuffer::encodeWait(const MTL::Event* event, uint64_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(encodeWaitForEvent_value_), event, value); +} + +_MTL_INLINE void MTL::CommandBuffer::enqueue() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(enqueue)); +} + +_MTL_INLINE NS::Error* MTL::CommandBuffer::error() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(error)); } -// property: errorOptions _MTL_INLINE MTL::CommandBufferErrorOption MTL::CommandBuffer::errorOptions() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(errorOptions)); } -// property: label +_MTL_INLINE CFTimeInterval MTL::CommandBuffer::kernelEndTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(kernelEndTime)); +} + +_MTL_INLINE CFTimeInterval MTL::CommandBuffer::kernelStartTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(kernelStartTime)); +} + _MTL_INLINE NS::String* MTL::CommandBuffer::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE MTL::LogContainer* MTL::CommandBuffer::logs() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(logs)); +} + +_MTL_INLINE MTL::ParallelRenderCommandEncoder* MTL::CommandBuffer::parallelRenderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(parallelRenderCommandEncoderWithDescriptor_), renderPassDescriptor); +} + +_MTL_INLINE void MTL::CommandBuffer::popDebugGroup() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); +} + +_MTL_INLINE void MTL::CommandBuffer::presentDrawable(const MTL::Drawable* drawable) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(presentDrawable_), drawable); +} + +_MTL_INLINE void MTL::CommandBuffer::presentDrawableAfterMinimumDuration(const MTL::Drawable* drawable, CFTimeInterval duration) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(presentDrawable_afterMinimumDuration_), drawable, duration); +} + +_MTL_INLINE void MTL::CommandBuffer::presentDrawableAtTime(const MTL::Drawable* drawable, CFTimeInterval presentationTime) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(presentDrawable_atTime_), drawable, presentationTime); +} + +_MTL_INLINE void MTL::CommandBuffer::pushDebugGroup(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); +} + +_MTL_INLINE MTL::RenderCommandEncoder* MTL::CommandBuffer::renderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderCommandEncoderWithDescriptor_), renderPassDescriptor); +} + +_MTL_INLINE MTL::ResourceStateCommandEncoder* MTL::CommandBuffer::resourceStateCommandEncoder() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceStateCommandEncoder)); +} + +_MTL_INLINE MTL::ResourceStateCommandEncoder* MTL::CommandBuffer::resourceStateCommandEncoder(const MTL::ResourceStatePassDescriptor* resourceStatePassDescriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceStateCommandEncoderWithDescriptor_), resourceStatePassDescriptor); +} + +_MTL_INLINE bool MTL::CommandBuffer::retainedReferences() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(retainedReferences)); +} + _MTL_INLINE void MTL::CommandBuffer::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: kernelStartTime -_MTL_INLINE CFTimeInterval MTL::CommandBuffer::kernelStartTime() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(kernelStartTime)); -} - -// property: kernelEndTime -_MTL_INLINE CFTimeInterval MTL::CommandBuffer::kernelEndTime() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(kernelEndTime)); -} - -// property: logs -_MTL_INLINE MTL::LogContainer* MTL::CommandBuffer::logs() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(logs)); -} - -// property: GPUStartTime -_MTL_INLINE CFTimeInterval MTL::CommandBuffer::GPUStartTime() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(GPUStartTime)); -} - -// property: GPUEndTime -_MTL_INLINE CFTimeInterval MTL::CommandBuffer::GPUEndTime() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(GPUEndTime)); -} - -// method: enqueue -_MTL_INLINE void MTL::CommandBuffer::enqueue() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(enqueue)); -} - -// method: commit -_MTL_INLINE void MTL::CommandBuffer::commit() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(commit)); -} - -// method: addScheduledHandler: -_MTL_INLINE void MTL::CommandBuffer::addScheduledHandler(const MTL::CommandBufferHandler block) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(addScheduledHandler_), block); -} - -// method: presentDrawable: -_MTL_INLINE void MTL::CommandBuffer::presentDrawable(const MTL::Drawable* drawable) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(presentDrawable_), drawable); -} - -// method: presentDrawable:atTime: -_MTL_INLINE void MTL::CommandBuffer::presentDrawableAtTime(const MTL::Drawable* drawable, CFTimeInterval presentationTime) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(presentDrawable_atTime_), drawable, presentationTime); -} - -// method: presentDrawable:afterMinimumDuration: -_MTL_INLINE void MTL::CommandBuffer::presentDrawableAfterMinimumDuration(const MTL::Drawable* drawable, CFTimeInterval duration) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(presentDrawable_afterMinimumDuration_), drawable, duration); -} - -// method: waitUntilScheduled -_MTL_INLINE void MTL::CommandBuffer::waitUntilScheduled() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilScheduled)); -} - -// method: addCompletedHandler: -_MTL_INLINE void MTL::CommandBuffer::addCompletedHandler(const MTL::CommandBufferHandler block) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(addCompletedHandler_), block); -} - -// method: waitUntilCompleted -_MTL_INLINE void MTL::CommandBuffer::waitUntilCompleted() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilCompleted)); -} - -// property: status _MTL_INLINE MTL::CommandBufferStatus MTL::CommandBuffer::status() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(status)); } -// property: error -_MTL_INLINE NS::Error* MTL::CommandBuffer::error() const +_MTL_INLINE void MTL::CommandBuffer::useResidencySet(const MTL::ResidencySet* residencySet) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(error)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResidencySet_), residencySet); } -// method: blitCommandEncoder -_MTL_INLINE MTL::BlitCommandEncoder* MTL::CommandBuffer::blitCommandEncoder() +_MTL_INLINE void MTL::CommandBuffer::useResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(blitCommandEncoder)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResidencySets_count_), residencySets, count); } -// method: renderCommandEncoderWithDescriptor: -_MTL_INLINE MTL::RenderCommandEncoder* MTL::CommandBuffer::renderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor) +_MTL_INLINE void MTL::CommandBuffer::waitUntilCompleted() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderCommandEncoderWithDescriptor_), renderPassDescriptor); + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilCompleted)); } -// method: computeCommandEncoderWithDescriptor: -_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder(const MTL::ComputePassDescriptor* computePassDescriptor) +_MTL_INLINE void MTL::CommandBuffer::waitUntilScheduled() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoderWithDescriptor_), computePassDescriptor); -} - -// method: blitCommandEncoderWithDescriptor: -_MTL_INLINE MTL::BlitCommandEncoder* MTL::CommandBuffer::blitCommandEncoder(const MTL::BlitPassDescriptor* blitPassDescriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(blitCommandEncoderWithDescriptor_), blitPassDescriptor); -} - -// method: computeCommandEncoder -_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoder)); -} - -// method: computeCommandEncoderWithDispatchType: -_MTL_INLINE MTL::ComputeCommandEncoder* MTL::CommandBuffer::computeCommandEncoder(MTL::DispatchType dispatchType) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeCommandEncoderWithDispatchType_), dispatchType); -} - -// method: encodeWaitForEvent:value: -_MTL_INLINE void MTL::CommandBuffer::encodeWait(const MTL::Event* event, uint64_t value) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(encodeWaitForEvent_value_), event, value); -} - -// method: encodeSignalEvent:value: -_MTL_INLINE void MTL::CommandBuffer::encodeSignalEvent(const MTL::Event* event, uint64_t value) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(encodeSignalEvent_value_), event, value); -} - -// method: parallelRenderCommandEncoderWithDescriptor: -_MTL_INLINE MTL::ParallelRenderCommandEncoder* MTL::CommandBuffer::parallelRenderCommandEncoder(const MTL::RenderPassDescriptor* renderPassDescriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(parallelRenderCommandEncoderWithDescriptor_), renderPassDescriptor); -} - -// method: resourceStateCommandEncoder -_MTL_INLINE MTL::ResourceStateCommandEncoder* MTL::CommandBuffer::resourceStateCommandEncoder() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceStateCommandEncoder)); -} - -// method: resourceStateCommandEncoderWithDescriptor: -_MTL_INLINE MTL::ResourceStateCommandEncoder* MTL::CommandBuffer::resourceStateCommandEncoder(const MTL::ResourceStatePassDescriptor* resourceStatePassDescriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceStateCommandEncoderWithDescriptor_), resourceStatePassDescriptor); -} - -// method: accelerationStructureCommandEncoder -_MTL_INLINE MTL::AccelerationStructureCommandEncoder* MTL::CommandBuffer::accelerationStructureCommandEncoder() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(accelerationStructureCommandEncoder)); -} - -// method: accelerationStructureCommandEncoderWithDescriptor: -_MTL_INLINE MTL::AccelerationStructureCommandEncoder* MTL::CommandBuffer::accelerationStructureCommandEncoder(const MTL::AccelerationStructurePassDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(accelerationStructureCommandEncoderWithDescriptor_), descriptor); -} - -// method: pushDebugGroup: -_MTL_INLINE void MTL::CommandBuffer::pushDebugGroup(const NS::String* string) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); -} - -// method: popDebugGroup -_MTL_INLINE void MTL::CommandBuffer::popDebugGroup() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilScheduled)); } diff --git a/vendor/metal-cpp/Metal/MTLCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLCommandEncoder.hpp index 9a4d97c78..a230ff5df 100644 --- a/vendor/metal-cpp/Metal/MTLCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,82 +20,98 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class Device; + _MTL_OPTIONS(NS::UInteger, ResourceUsage) { ResourceUsageRead = 1, - ResourceUsageWrite = 2, - ResourceUsageSample = 4, + ResourceUsageWrite = 1 << 1, + ResourceUsageSample = 1 << 2, }; _MTL_OPTIONS(NS::UInteger, BarrierScope) { BarrierScopeBuffers = 1, - BarrierScopeTextures = 2, - BarrierScopeRenderTargets = 4, + BarrierScopeTextures = 1 << 1, + BarrierScopeRenderTargets = 1 << 2, +}; + +_MTL_OPTIONS(NS::UInteger, Stages) { + StageVertex = 1, + StageFragment = 1 << 1, + StageTile = 1 << 2, + StageObject = 1 << 3, + StageMesh = 1 << 4, + StageResourceState = 1 << 26, + StageDispatch = 1 << 27, + StageBlit = 1 << 28, + StageAccelerationStructure = 1 << 29, + StageMachineLearning = 1 << 30, + StageAll = 9223372036854775807, }; class CommandEncoder : public NS::Referencing { public: - class Device* device() const; + void barrierAfterQueueStages(MTL::Stages afterQueueStages, MTL::Stages beforeStages); - NS::String* label() const; - void setLabel(const NS::String* label); + Device* device() const; - void endEncoding(); + void endEncoding(); - void insertDebugSignpost(const NS::String* string); + void insertDebugSignpost(const NS::String* string); - void pushDebugGroup(const NS::String* string); + NS::String* label() const; - void popDebugGroup(); + void popDebugGroup(); + + void pushDebugGroup(const NS::String* string); + + void setLabel(const NS::String* label); }; } +_MTL_INLINE void MTL::CommandEncoder::barrierAfterQueueStages(MTL::Stages afterQueueStages, MTL::Stages beforeStages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(barrierAfterQueueStages_beforeStages_), afterQueueStages, beforeStages); +} -// property: device _MTL_INLINE MTL::Device* MTL::CommandEncoder::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: label +_MTL_INLINE void MTL::CommandEncoder::endEncoding() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(endEncoding)); +} + +_MTL_INLINE void MTL::CommandEncoder::insertDebugSignpost(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(insertDebugSignpost_), string); +} + _MTL_INLINE NS::String* MTL::CommandEncoder::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE void MTL::CommandEncoder::popDebugGroup() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); +} + +_MTL_INLINE void MTL::CommandEncoder::pushDebugGroup(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); +} + _MTL_INLINE void MTL::CommandEncoder::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } - -// method: endEncoding -_MTL_INLINE void MTL::CommandEncoder::endEncoding() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(endEncoding)); -} - -// method: insertDebugSignpost: -_MTL_INLINE void MTL::CommandEncoder::insertDebugSignpost(const NS::String* string) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(insertDebugSignpost_), string); -} - -// method: pushDebugGroup: -_MTL_INLINE void MTL::CommandEncoder::pushDebugGroup(const NS::String* string) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); -} - -// method: popDebugGroup -_MTL_INLINE void MTL::CommandEncoder::popDebugGroup() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); -} diff --git a/vendor/metal-cpp/Metal/MTLCommandQueue.hpp b/vendor/metal-cpp/Metal/MTLCommandQueue.hpp index 07b298448..5d3bf164a 100644 --- a/vendor/metal-cpp/Metal/MTLCommandQueue.hpp +++ b/vendor/metal-cpp/Metal/MTLCommandQueue.hpp @@ -2,7 +2,7 @@ // // Metal/MTLCommandQueue.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,70 +20,139 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class CommandBuffer; +class CommandBufferDescriptor; +class CommandQueueDescriptor; +class Device; +class LogState; +class ResidencySet; + class CommandQueue : public NS::Referencing { public: - NS::String* label() const; - void setLabel(const NS::String* label); + void addResidencySet(const MTL::ResidencySet* residencySet); + void addResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count); - class Device* device() const; + CommandBuffer* commandBuffer(); + CommandBuffer* commandBuffer(const MTL::CommandBufferDescriptor* descriptor); + CommandBuffer* commandBufferWithUnretainedReferences(); - class CommandBuffer* commandBuffer(); + Device* device() const; - class CommandBuffer* commandBuffer(const class CommandBufferDescriptor* descriptor); + void insertDebugCaptureBoundary(); - class CommandBuffer* commandBufferWithUnretainedReferences(); + NS::String* label() const; - void insertDebugCaptureBoundary(); + void removeResidencySet(const MTL::ResidencySet* residencySet); + void removeResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count); + + void setLabel(const NS::String* label); +}; +class CommandQueueDescriptor : public NS::Copying +{ +public: + static CommandQueueDescriptor* alloc(); + + CommandQueueDescriptor* init(); + + LogState* logState() const; + + NS::UInteger maxCommandBufferCount() const; + + void setLogState(const MTL::LogState* logState); + + void setMaxCommandBufferCount(NS::UInteger maxCommandBufferCount); }; } +_MTL_INLINE void MTL::CommandQueue::addResidencySet(const MTL::ResidencySet* residencySet) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addResidencySet_), residencySet); +} + +_MTL_INLINE void MTL::CommandQueue::addResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addResidencySets_count_), residencySets, count); +} + +_MTL_INLINE MTL::CommandBuffer* MTL::CommandQueue::commandBuffer() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBuffer)); +} + +_MTL_INLINE MTL::CommandBuffer* MTL::CommandQueue::commandBuffer(const MTL::CommandBufferDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBufferWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::CommandBuffer* MTL::CommandQueue::commandBufferWithUnretainedReferences() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBufferWithUnretainedReferences)); +} + +_MTL_INLINE MTL::Device* MTL::CommandQueue::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE void MTL::CommandQueue::insertDebugCaptureBoundary() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(insertDebugCaptureBoundary)); +} -// property: label _MTL_INLINE NS::String* MTL::CommandQueue::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE void MTL::CommandQueue::removeResidencySet(const MTL::ResidencySet* residencySet) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeResidencySet_), residencySet); +} + +_MTL_INLINE void MTL::CommandQueue::removeResidencySets(const MTL::ResidencySet* const residencySets[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeResidencySets_count_), residencySets, count); +} + _MTL_INLINE void MTL::CommandQueue::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: device -_MTL_INLINE MTL::Device* MTL::CommandQueue::device() const +_MTL_INLINE MTL::CommandQueueDescriptor* MTL::CommandQueueDescriptor::alloc() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLCommandQueueDescriptor)); } -// method: commandBuffer -_MTL_INLINE MTL::CommandBuffer* MTL::CommandQueue::commandBuffer() +_MTL_INLINE MTL::CommandQueueDescriptor* MTL::CommandQueueDescriptor::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBuffer)); + return NS::Object::init(); } -// method: commandBufferWithDescriptor: -_MTL_INLINE MTL::CommandBuffer* MTL::CommandQueue::commandBuffer(const MTL::CommandBufferDescriptor* descriptor) +_MTL_INLINE MTL::LogState* MTL::CommandQueueDescriptor::logState() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBufferWithDescriptor_), descriptor); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(logState)); } -// method: commandBufferWithUnretainedReferences -_MTL_INLINE MTL::CommandBuffer* MTL::CommandQueue::commandBufferWithUnretainedReferences() +_MTL_INLINE NS::UInteger MTL::CommandQueueDescriptor::maxCommandBufferCount() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBufferWithUnretainedReferences)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCommandBufferCount)); } -// method: insertDebugCaptureBoundary -_MTL_INLINE void MTL::CommandQueue::insertDebugCaptureBoundary() +_MTL_INLINE void MTL::CommandQueueDescriptor::setLogState(const MTL::LogState* logState) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(insertDebugCaptureBoundary)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLogState_), logState); +} + +_MTL_INLINE void MTL::CommandQueueDescriptor::setMaxCommandBufferCount(NS::UInteger maxCommandBufferCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCommandBufferCount_), maxCommandBufferCount); } diff --git a/vendor/metal-cpp/Metal/MTLComputeCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLComputeCommandEncoder.hpp index 2b30a1dd7..2f555e572 100644 --- a/vendor/metal-cpp/Metal/MTLComputeCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLComputeCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLComputeCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,23 +20,41 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLCommandBuffer.hpp" +#include "MTLCommandEncoder.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLCommandBuffer.hpp" -#include "MTLCommandEncoder.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class AccelerationStructure; +class Buffer; +class ComputePipelineState; +class CounterSampleBuffer; +class Fence; +class Heap; +class IndirectCommandBuffer; +class IntersectionFunctionTable; +class Resource; +class SamplerState; +class Texture; +class VisibleFunctionTable; + struct DispatchThreadgroupsIndirectArguments { uint32_t threadgroupsPerGrid[3]; } _MTL_PACKED; +struct DispatchThreadsIndirectArguments +{ + uint32_t threadsPerGrid[3]; + uint32_t threadsPerThreadgroup[3]; +} _MTL_PACKED; + struct StageInRegionIndirectArguments { uint32_t stageInOrigin[3]; @@ -46,285 +64,261 @@ struct StageInRegionIndirectArguments class ComputeCommandEncoder : public NS::Referencing { public: - MTL::DispatchType dispatchType() const; + void dispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup); + void dispatchThreadgroups(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerThreadgroup); - void setComputePipelineState(const class ComputePipelineState* state); + void dispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup); - void setBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + DispatchType dispatchType() const; - void setBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange); + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandbuffer, const MTL::Buffer* indirectRangeBuffer, NS::UInteger indirectBufferOffset); - void setBufferOffset(NS::UInteger offset, NS::UInteger index); + void memoryBarrier(MTL::BarrierScope scope); + void memoryBarrier(const MTL::Resource* const resources[], NS::UInteger count); - void setBuffers(const class Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); + void sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); - void setVisibleFunctionTable(const class VisibleFunctionTable* visibleFunctionTable, NS::UInteger bufferIndex); + void setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); - void setVisibleFunctionTables(const class VisibleFunctionTable* const visibleFunctionTables[], NS::Range range); + void setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index); + void setBufferOffset(NS::UInteger offset, NS::UInteger index); + void setBufferOffset(NS::UInteger offset, NS::UInteger stride, NS::UInteger index); - void setIntersectionFunctionTable(const class IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); + void setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); + void setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, const NS::UInteger* strides, NS::Range range); - void setIntersectionFunctionTables(const class IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); + void setBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + void setBytes(const void* bytes, NS::UInteger length, NS::UInteger stride, NS::UInteger index); - void setAccelerationStructure(const class AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); + void setComputePipelineState(const MTL::ComputePipelineState* state); - void setTexture(const class Texture* texture, NS::UInteger index); + void setImageblockWidth(NS::UInteger width, NS::UInteger height); - void setTextures(const class Texture* const textures[], NS::Range range); + void setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); + void setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); - void setSamplerState(const class SamplerState* sampler, NS::UInteger index); + void setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); + void setSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); - void setSamplerStates(const class SamplerState* const samplers[], NS::Range range); + void setStageInRegion(MTL::Region region); + void setStageInRegion(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); - void setSamplerState(const class SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setTexture(const MTL::Texture* texture, NS::UInteger index); + void setTextures(const MTL::Texture* const textures[], NS::Range range); - void setSamplerStates(const class SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); + void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); - void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); + void setVisibleFunctionTable(const MTL::VisibleFunctionTable* visibleFunctionTable, NS::UInteger bufferIndex); + void setVisibleFunctionTables(const MTL::VisibleFunctionTable* const visibleFunctionTables[], NS::Range range); - void setImageblockWidth(NS::UInteger width, NS::UInteger height); + void updateFence(const MTL::Fence* fence); - void setStageInRegion(MTL::Region region); + void useHeap(const MTL::Heap* heap); + void useHeaps(const MTL::Heap* const heaps[], NS::UInteger count); - void setStageInRegion(const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); + void useResource(const MTL::Resource* resource, MTL::ResourceUsage usage); + void useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage); - void dispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup); - - void dispatchThreadgroups(const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerThreadgroup); - - void dispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup); - - void updateFence(const class Fence* fence); - - void waitForFence(const class Fence* fence); - - void useResource(const class Resource* resource, MTL::ResourceUsage usage); - - void useResources(const class Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage); - - void useHeap(const class Heap* heap); - - void useHeaps(const class Heap* const heaps[], NS::UInteger count); - - void executeCommandsInBuffer(const class IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange); - - void executeCommandsInBuffer(const class IndirectCommandBuffer* indirectCommandbuffer, const class Buffer* indirectRangeBuffer, NS::UInteger indirectBufferOffset); - - void memoryBarrier(MTL::BarrierScope scope); - - void memoryBarrier(const class Resource* const resources[], NS::UInteger count); - - void sampleCountersInBuffer(const class CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); + void waitForFence(const MTL::Fence* fence); }; } -// property: dispatchType -_MTL_INLINE MTL::DispatchType MTL::ComputeCommandEncoder::dispatchType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchType)); -} - -// method: setComputePipelineState: -_MTL_INLINE void MTL::ComputeCommandEncoder::setComputePipelineState(const MTL::ComputePipelineState* state) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_), state); -} - -// method: setBytes:length:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setBytes(const void* bytes, NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBytes_length_atIndex_), bytes, length, index); -} - -// method: setBuffer:offset:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setBufferOffset:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setBufferOffset(NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBufferOffset_atIndex_), offset, index); -} - -// method: setBuffers:offsets:withRange: -_MTL_INLINE void MTL::ComputeCommandEncoder::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setVisibleFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setVisibleFunctionTable(const MTL::VisibleFunctionTable* visibleFunctionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTable_atBufferIndex_), visibleFunctionTable, bufferIndex); -} - -// method: setVisibleFunctionTables:withBufferRange: -_MTL_INLINE void MTL::ComputeCommandEncoder::setVisibleFunctionTables(const MTL::VisibleFunctionTable* const visibleFunctionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTables_withBufferRange_), visibleFunctionTables, range); -} - -// method: setIntersectionFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); -} - -// method: setIntersectionFunctionTables:withBufferRange: -_MTL_INLINE void MTL::ComputeCommandEncoder::setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); -} - -// method: setAccelerationStructure:atBufferIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); -} - -// method: setTexture:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_atIndex_), texture, index); -} - -// method: setTextures:withRange: -_MTL_INLINE void MTL::ComputeCommandEncoder::setTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextures_withRange_), textures, range); -} - -// method: setSamplerState:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_atIndex_), sampler, index); -} - -// method: setSamplerStates:withRange: -_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerStates_withRange_), samplers, range); -} - -// method: setSamplerState:lodMinClamp:lodMaxClamp:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); -} - -// method: setSamplerStates:lodMinClamps:lodMaxClamps:withRange: -_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); -} - -// method: setThreadgroupMemoryLength:atIndex: -_MTL_INLINE void MTL::ComputeCommandEncoder::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_atIndex_), length, index); -} - -// method: setImageblockWidth:height: -_MTL_INLINE void MTL::ComputeCommandEncoder::setImageblockWidth(NS::UInteger width, NS::UInteger height) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockWidth_height_), width, height); -} - -// method: setStageInRegion: -_MTL_INLINE void MTL::ComputeCommandEncoder::setStageInRegion(MTL::Region region) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInRegion_), region); -} - -// method: setStageInRegionWithIndirectBuffer:indirectBufferOffset: -_MTL_INLINE void MTL::ComputeCommandEncoder::setStageInRegion(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInRegionWithIndirectBuffer_indirectBufferOffset_), indirectBuffer, indirectBufferOffset); -} - -// method: dispatchThreadgroups:threadsPerThreadgroup: _MTL_INLINE void MTL::ComputeCommandEncoder::dispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup) { Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadgroups_threadsPerThreadgroup_), threadgroupsPerGrid, threadsPerThreadgroup); } -// method: dispatchThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerThreadgroup: _MTL_INLINE void MTL::ComputeCommandEncoder::dispatchThreadgroups(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerThreadgroup) { Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerThreadgroup_), indirectBuffer, indirectBufferOffset, threadsPerThreadgroup); } -// method: dispatchThreads:threadsPerThreadgroup: _MTL_INLINE void MTL::ComputeCommandEncoder::dispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup) { Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreads_threadsPerThreadgroup_), threadsPerGrid, threadsPerThreadgroup); } -// method: updateFence: -_MTL_INLINE void MTL::ComputeCommandEncoder::updateFence(const MTL::Fence* fence) +_MTL_INLINE MTL::DispatchType MTL::ComputeCommandEncoder::dispatchType() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchType)); } -// method: waitForFence: -_MTL_INLINE void MTL::ComputeCommandEncoder::waitForFence(const MTL::Fence* fence) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); -} - -// method: useResource:usage: -_MTL_INLINE void MTL::ComputeCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_), resource, usage); -} - -// method: useResources:count:usage: -_MTL_INLINE void MTL::ComputeCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_), resources, count, usage); -} - -// method: useHeap: -_MTL_INLINE void MTL::ComputeCommandEncoder::useHeap(const MTL::Heap* heap) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_), heap); -} - -// method: useHeaps:count: -_MTL_INLINE void MTL::ComputeCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_), heaps, count); -} - -// method: executeCommandsInBuffer:withRange: _MTL_INLINE void MTL::ComputeCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange) { Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_withRange_), indirectCommandBuffer, executionRange); } -// method: executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: _MTL_INLINE void MTL::ComputeCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandbuffer, const MTL::Buffer* indirectRangeBuffer, NS::UInteger indirectBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_indirectBuffer_indirectBufferOffset_), indirectCommandbuffer, indirectRangeBuffer, indirectBufferOffset); } -// method: memoryBarrierWithScope: _MTL_INLINE void MTL::ComputeCommandEncoder::memoryBarrier(MTL::BarrierScope scope) { Object::sendMessage(this, _MTL_PRIVATE_SEL(memoryBarrierWithScope_), scope); } -// method: memoryBarrierWithResources:count: _MTL_INLINE void MTL::ComputeCommandEncoder::memoryBarrier(const MTL::Resource* const resources[], NS::UInteger count) { Object::sendMessage(this, _MTL_PRIVATE_SEL(memoryBarrierWithResources_count_), resources, count); } -// method: sampleCountersInBuffer:atSampleIndex:withBarrier: _MTL_INLINE void MTL::ComputeCommandEncoder::sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier) { Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCountersInBuffer_atSampleIndex_withBarrier_), sampleBuffer, sampleIndex, barrier); } + +_MTL_INLINE void MTL::ComputeCommandEncoder::setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_attributeStride_atIndex_), buffer, offset, stride, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBufferOffset(NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBufferOffset_atIndex_), offset, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBufferOffset(NS::UInteger offset, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBufferOffset_attributeStride_atIndex_), offset, stride, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, const NS::UInteger* strides, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_attributeStrides_withRange_), buffers, offsets, strides, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBytes(const void* bytes, NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBytes_length_atIndex_), bytes, length, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setBytes(const void* bytes, NS::UInteger length, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBytes_length_attributeStride_atIndex_), bytes, length, stride, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setComputePipelineState(const MTL::ComputePipelineState* state) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_), state); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setImageblockWidth(NS::UInteger width, NS::UInteger height) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockWidth_height_), width, height); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_atIndex_), sampler, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerStates_withRange_), samplers, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setStageInRegion(MTL::Region region) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInRegion_), region); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setStageInRegion(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInRegionWithIndirectBuffer_indirectBufferOffset_), indirectBuffer, indirectBufferOffset); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setTexture(const MTL::Texture* texture, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_atIndex_), texture, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setTextures(const MTL::Texture* const textures[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextures_withRange_), textures, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_atIndex_), length, index); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setVisibleFunctionTable(const MTL::VisibleFunctionTable* visibleFunctionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTable_atBufferIndex_), visibleFunctionTable, bufferIndex); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::setVisibleFunctionTables(const MTL::VisibleFunctionTable* const visibleFunctionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTables_withBufferRange_), visibleFunctionTables, range); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::updateFence(const MTL::Fence* fence) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::useHeap(const MTL::Heap* heap) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_), heap); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_), heaps, count); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_), resource, usage); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_), resources, count, usage); +} + +_MTL_INLINE void MTL::ComputeCommandEncoder::waitForFence(const MTL::Fence* fence) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); +} diff --git a/vendor/metal-cpp/Metal/MTLComputePass.hpp b/vendor/metal-cpp/Metal/MTLComputePass.hpp index bbc718418..fb34f7d84 100644 --- a/vendor/metal-cpp/Metal/MTLComputePass.hpp +++ b/vendor/metal-cpp/Metal/MTLComputePass.hpp @@ -2,7 +2,7 @@ // // Metal/MTLComputePass.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,162 +20,150 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLCommandBuffer.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLCommandBuffer.hpp" - namespace MTL { +class ComputePassDescriptor; +class ComputePassSampleBufferAttachmentDescriptor; +class ComputePassSampleBufferAttachmentDescriptorArray; +class CounterSampleBuffer; + class ComputePassSampleBufferAttachmentDescriptor : public NS::Copying { public: - static class ComputePassSampleBufferAttachmentDescriptor* alloc(); + static ComputePassSampleBufferAttachmentDescriptor* alloc(); - class ComputePassSampleBufferAttachmentDescriptor* init(); + NS::UInteger endOfEncoderSampleIndex() const; - class CounterSampleBuffer* sampleBuffer() const; - void setSampleBuffer(const class CounterSampleBuffer* sampleBuffer); + ComputePassSampleBufferAttachmentDescriptor* init(); - NS::UInteger startOfEncoderSampleIndex() const; - void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + CounterSampleBuffer* sampleBuffer() const; - NS::UInteger endOfEncoderSampleIndex() const; - void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + + void setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer); + + void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + NS::UInteger startOfEncoderSampleIndex() const; }; - class ComputePassSampleBufferAttachmentDescriptorArray : public NS::Referencing { public: - static class ComputePassSampleBufferAttachmentDescriptorArray* alloc(); + static ComputePassSampleBufferAttachmentDescriptorArray* alloc(); - class ComputePassSampleBufferAttachmentDescriptorArray* init(); + ComputePassSampleBufferAttachmentDescriptorArray* init(); - class ComputePassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class ComputePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + ComputePassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::ComputePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class ComputePassDescriptor : public NS::Copying { public: - static class ComputePassDescriptor* alloc(); + static ComputePassDescriptor* alloc(); - class ComputePassDescriptor* init(); + static ComputePassDescriptor* computePassDescriptor(); - static class ComputePassDescriptor* computePassDescriptor(); + DispatchType dispatchType() const; - MTL::DispatchType dispatchType() const; - void setDispatchType(MTL::DispatchType dispatchType); + ComputePassDescriptor* init(); - class ComputePassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; + ComputePassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; + + void setDispatchType(MTL::DispatchType dispatchType); }; } - -// static method: alloc _MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptor* MTL::ComputePassSampleBufferAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLComputePassSampleBufferAttachmentDescriptor)); } -// method: init +_MTL_INLINE NS::UInteger MTL::ComputePassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptor* MTL::ComputePassSampleBufferAttachmentDescriptor::init() { return NS::Object::init(); } -// property: sampleBuffer _MTL_INLINE MTL::CounterSampleBuffer* MTL::ComputePassSampleBufferAttachmentDescriptor::sampleBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBuffer)); } -_MTL_INLINE void MTL::ComputePassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); -} - -// property: startOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::ComputePassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); -} - -_MTL_INLINE void MTL::ComputePassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); -} - -// property: endOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::ComputePassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); -} - _MTL_INLINE void MTL::ComputePassSampleBufferAttachmentDescriptor::setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfEncoderSampleIndex_), endOfEncoderSampleIndex); } -// static method: alloc +_MTL_INLINE void MTL::ComputePassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); +} + +_MTL_INLINE void MTL::ComputePassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); +} + +_MTL_INLINE NS::UInteger MTL::ComputePassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptorArray* MTL::ComputePassSampleBufferAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLComputePassSampleBufferAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptorArray* MTL::ComputePassSampleBufferAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptor* MTL::ComputePassSampleBufferAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::ComputePassSampleBufferAttachmentDescriptorArray::setObject(const MTL::ComputePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::ComputePassDescriptor* MTL::ComputePassDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLComputePassDescriptor)); } -// method: init -_MTL_INLINE MTL::ComputePassDescriptor* MTL::ComputePassDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: computePassDescriptor _MTL_INLINE MTL::ComputePassDescriptor* MTL::ComputePassDescriptor::computePassDescriptor() { return Object::sendMessage(_MTL_PRIVATE_CLS(MTLComputePassDescriptor), _MTL_PRIVATE_SEL(computePassDescriptor)); } -// property: dispatchType _MTL_INLINE MTL::DispatchType MTL::ComputePassDescriptor::dispatchType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchType)); } +_MTL_INLINE MTL::ComputePassDescriptor* MTL::ComputePassDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptorArray* MTL::ComputePassDescriptor::sampleBufferAttachments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); +} + _MTL_INLINE void MTL::ComputePassDescriptor::setDispatchType(MTL::DispatchType dispatchType) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setDispatchType_), dispatchType); } - -// property: sampleBufferAttachments -_MTL_INLINE MTL::ComputePassSampleBufferAttachmentDescriptorArray* MTL::ComputePassDescriptor::sampleBufferAttachments() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); -} diff --git a/vendor/metal-cpp/Metal/MTLComputePipeline.hpp b/vendor/metal-cpp/Metal/MTLComputePipeline.hpp index 3065b8f27..d200af75b 100644 --- a/vendor/metal-cpp/Metal/MTLComputePipeline.hpp +++ b/vendor/metal-cpp/Metal/MTLComputePipeline.hpp @@ -2,7 +2,7 @@ // // Metal/MTLComputePipeline.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,240 +20,237 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLAllocation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" +#include "MTLPipeline.hpp" #include "MTLPrivate.hpp" - -#include - #include "MTLTypes.hpp" +namespace MTL +{ +class ComputePipelineDescriptor; +class ComputePipelineReflection; +class ComputePipelineState; +class Device; +class Function; +class FunctionHandle; +class IntersectionFunctionTable; +class IntersectionFunctionTableDescriptor; +class LinkedFunctions; +class PipelineBufferDescriptorArray; +class StageInputOutputDescriptor; +class VisibleFunctionTable; +class VisibleFunctionTableDescriptor; + +} +namespace MTL4 +{ +class BinaryFunction; + +} namespace MTL { class ComputePipelineReflection : public NS::Referencing { public: - static class ComputePipelineReflection* alloc(); + static ComputePipelineReflection* alloc(); - class ComputePipelineReflection* init(); + NS::Array* arguments() const; - NS::Array* bindings() const; + NS::Array* bindings() const; - NS::Array* arguments() const; + ComputePipelineReflection* init(); }; - class ComputePipelineDescriptor : public NS::Copying { public: - static class ComputePipelineDescriptor* alloc(); + static ComputePipelineDescriptor* alloc(); - class ComputePipelineDescriptor* init(); + NS::Array* binaryArchives() const; - NS::String* label() const; - void setLabel(const NS::String* label); + PipelineBufferDescriptorArray* buffers() const; - class Function* computeFunction() const; - void setComputeFunction(const class Function* computeFunction); + Function* computeFunction() const; - bool threadGroupSizeIsMultipleOfThreadExecutionWidth() const; - void setThreadGroupSizeIsMultipleOfThreadExecutionWidth(bool threadGroupSizeIsMultipleOfThreadExecutionWidth); + ComputePipelineDescriptor* init(); - NS::UInteger maxTotalThreadsPerThreadgroup() const; - void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + NS::Array* insertLibraries() const; - class StageInputOutputDescriptor* stageInputDescriptor() const; - void setStageInputDescriptor(const class StageInputOutputDescriptor* stageInputDescriptor); + NS::String* label() const; - class PipelineBufferDescriptorArray* buffers() const; + LinkedFunctions* linkedFunctions() const; - bool supportIndirectCommandBuffers() const; - void setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers); + NS::UInteger maxCallStackDepth() const; - NS::Array* insertLibraries() const; - void setInsertLibraries(const NS::Array* insertLibraries); + NS::UInteger maxTotalThreadsPerThreadgroup() const; - NS::Array* preloadedLibraries() const; - void setPreloadedLibraries(const NS::Array* preloadedLibraries); + NS::Array* preloadedLibraries() const; - NS::Array* binaryArchives() const; - void setBinaryArchives(const NS::Array* binaryArchives); + Size requiredThreadsPerThreadgroup() const; - void reset(); + void reset(); - class LinkedFunctions* linkedFunctions() const; - void setLinkedFunctions(const class LinkedFunctions* linkedFunctions); + void setBinaryArchives(const NS::Array* binaryArchives); - bool supportAddingBinaryFunctions() const; - void setSupportAddingBinaryFunctions(bool supportAddingBinaryFunctions); + void setComputeFunction(const MTL::Function* computeFunction); - NS::UInteger maxCallStackDepth() const; - void setMaxCallStackDepth(NS::UInteger maxCallStackDepth); + void setInsertLibraries(const NS::Array* insertLibraries); + + void setLabel(const NS::String* label); + + void setLinkedFunctions(const MTL::LinkedFunctions* linkedFunctions); + + void setMaxCallStackDepth(NS::UInteger maxCallStackDepth); + + void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + + void setPreloadedLibraries(const NS::Array* preloadedLibraries); + + void setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup); + + void setShaderValidation(MTL::ShaderValidation shaderValidation); + + void setStageInputDescriptor(const MTL::StageInputOutputDescriptor* stageInputDescriptor); + + void setSupportAddingBinaryFunctions(bool supportAddingBinaryFunctions); + + void setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers); + + void setThreadGroupSizeIsMultipleOfThreadExecutionWidth(bool threadGroupSizeIsMultipleOfThreadExecutionWidth); + + ShaderValidation shaderValidation() const; + + StageInputOutputDescriptor* stageInputDescriptor() const; + + bool supportAddingBinaryFunctions() const; + + bool supportIndirectCommandBuffers() const; + + bool threadGroupSizeIsMultipleOfThreadExecutionWidth() const; }; - -class ComputePipelineState : public NS::Referencing +class ComputePipelineState : public NS::Referencing { public: - NS::String* label() const; + Device* device() const; - class Device* device() const; + FunctionHandle* functionHandle(const NS::String* name); + FunctionHandle* functionHandle(const MTL4::BinaryFunction* function); + FunctionHandle* functionHandle(const MTL::Function* function); - NS::UInteger maxTotalThreadsPerThreadgroup() const; + ResourceID gpuResourceID() const; - NS::UInteger threadExecutionWidth() const; + NS::UInteger imageblockMemoryLength(MTL::Size imageblockDimensions); - NS::UInteger staticThreadgroupMemoryLength() const; + NS::String* label() const; - NS::UInteger imageblockMemoryLength(MTL::Size imageblockDimensions); + NS::UInteger maxTotalThreadsPerThreadgroup() const; - bool supportIndirectCommandBuffers() const; + ComputePipelineState* newComputePipelineStateWithBinaryFunctions(const NS::Array* additionalBinaryFunctions, NS::Error** error); + ComputePipelineState* newComputePipelineState(const NS::Array* functions, NS::Error** error); - MTL::ResourceID gpuResourceID() const; + IntersectionFunctionTable* newIntersectionFunctionTable(const MTL::IntersectionFunctionTableDescriptor* descriptor); - class FunctionHandle* functionHandle(const class Function* function); + VisibleFunctionTable* newVisibleFunctionTable(const MTL::VisibleFunctionTableDescriptor* descriptor); - class ComputePipelineState* newComputePipelineState(const NS::Array* functions, NS::Error** error); + ComputePipelineReflection* reflection() const; - class VisibleFunctionTable* newVisibleFunctionTable(const class VisibleFunctionTableDescriptor* descriptor); + Size requiredThreadsPerThreadgroup() const; - class IntersectionFunctionTable* newIntersectionFunctionTable(const class IntersectionFunctionTableDescriptor* descriptor); + ShaderValidation shaderValidation() const; + + NS::UInteger staticThreadgroupMemoryLength() const; + + bool supportIndirectCommandBuffers() const; + + NS::UInteger threadExecutionWidth() const; }; } - -// static method: alloc _MTL_INLINE MTL::ComputePipelineReflection* MTL::ComputePipelineReflection::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLComputePipelineReflection)); } -// method: init -_MTL_INLINE MTL::ComputePipelineReflection* MTL::ComputePipelineReflection::init() -{ - return NS::Object::init(); -} - -// property: bindings -_MTL_INLINE NS::Array* MTL::ComputePipelineReflection::bindings() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bindings)); -} - -// property: arguments _MTL_INLINE NS::Array* MTL::ComputePipelineReflection::arguments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(arguments)); } -// static method: alloc +_MTL_INLINE NS::Array* MTL::ComputePipelineReflection::bindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bindings)); +} + +_MTL_INLINE MTL::ComputePipelineReflection* MTL::ComputePipelineReflection::init() +{ + return NS::Object::init(); +} + _MTL_INLINE MTL::ComputePipelineDescriptor* MTL::ComputePipelineDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLComputePipelineDescriptor)); } -// method: init -_MTL_INLINE MTL::ComputePipelineDescriptor* MTL::ComputePipelineDescriptor::init() +_MTL_INLINE NS::Array* MTL::ComputePipelineDescriptor::binaryArchives() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); } -// property: label -_MTL_INLINE NS::String* MTL::ComputePipelineDescriptor::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - -_MTL_INLINE void MTL::ComputePipelineDescriptor::setLabel(const NS::String* label) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); -} - -// property: computeFunction -_MTL_INLINE MTL::Function* MTL::ComputePipelineDescriptor::computeFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeFunction)); -} - -_MTL_INLINE void MTL::ComputePipelineDescriptor::setComputeFunction(const MTL::Function* computeFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputeFunction_), computeFunction); -} - -// property: threadGroupSizeIsMultipleOfThreadExecutionWidth -_MTL_INLINE bool MTL::ComputePipelineDescriptor::threadGroupSizeIsMultipleOfThreadExecutionWidth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadGroupSizeIsMultipleOfThreadExecutionWidth)); -} - -_MTL_INLINE void MTL::ComputePipelineDescriptor::setThreadGroupSizeIsMultipleOfThreadExecutionWidth(bool threadGroupSizeIsMultipleOfThreadExecutionWidth) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadGroupSizeIsMultipleOfThreadExecutionWidth_), threadGroupSizeIsMultipleOfThreadExecutionWidth); -} - -// property: maxTotalThreadsPerThreadgroup -_MTL_INLINE NS::UInteger MTL::ComputePipelineDescriptor::maxTotalThreadsPerThreadgroup() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); -} - -_MTL_INLINE void MTL::ComputePipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); -} - -// property: stageInputDescriptor -_MTL_INLINE MTL::StageInputOutputDescriptor* MTL::ComputePipelineDescriptor::stageInputDescriptor() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stageInputDescriptor)); -} - -_MTL_INLINE void MTL::ComputePipelineDescriptor::setStageInputDescriptor(const MTL::StageInputOutputDescriptor* stageInputDescriptor) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInputDescriptor_), stageInputDescriptor); -} - -// property: buffers _MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::ComputePipelineDescriptor::buffers() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffers)); } -// property: supportIndirectCommandBuffers -_MTL_INLINE bool MTL::ComputePipelineDescriptor::supportIndirectCommandBuffers() const +_MTL_INLINE MTL::Function* MTL::ComputePipelineDescriptor::computeFunction() const { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(computeFunction)); } -_MTL_INLINE void MTL::ComputePipelineDescriptor::setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers) +_MTL_INLINE MTL::ComputePipelineDescriptor* MTL::ComputePipelineDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); + return NS::Object::init(); } -// property: insertLibraries _MTL_INLINE NS::Array* MTL::ComputePipelineDescriptor::insertLibraries() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(insertLibraries)); } -_MTL_INLINE void MTL::ComputePipelineDescriptor::setInsertLibraries(const NS::Array* insertLibraries) +_MTL_INLINE NS::String* MTL::ComputePipelineDescriptor::label() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInsertLibraries_), insertLibraries); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE MTL::LinkedFunctions* MTL::ComputePipelineDescriptor::linkedFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(linkedFunctions)); +} + +_MTL_INLINE NS::UInteger MTL::ComputePipelineDescriptor::maxCallStackDepth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCallStackDepth)); +} + +_MTL_INLINE NS::UInteger MTL::ComputePipelineDescriptor::maxTotalThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); } -// property: preloadedLibraries _MTL_INLINE NS::Array* MTL::ComputePipelineDescriptor::preloadedLibraries() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(preloadedLibraries)); } -_MTL_INLINE void MTL::ComputePipelineDescriptor::setPreloadedLibraries(const NS::Array* preloadedLibraries) +_MTL_INLINE MTL::Size MTL::ComputePipelineDescriptor::requiredThreadsPerThreadgroup() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreloadedLibraries_), preloadedLibraries); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup)); } -// property: binaryArchives -_MTL_INLINE NS::Array* MTL::ComputePipelineDescriptor::binaryArchives() const +_MTL_INLINE void MTL::ComputePipelineDescriptor::reset() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } _MTL_INLINE void MTL::ComputePipelineDescriptor::setBinaryArchives(const NS::Array* binaryArchives) @@ -261,16 +258,19 @@ _MTL_INLINE void MTL::ComputePipelineDescriptor::setBinaryArchives(const NS::Arr Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryArchives_), binaryArchives); } -// method: reset -_MTL_INLINE void MTL::ComputePipelineDescriptor::reset() +_MTL_INLINE void MTL::ComputePipelineDescriptor::setComputeFunction(const MTL::Function* computeFunction) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputeFunction_), computeFunction); } -// property: linkedFunctions -_MTL_INLINE MTL::LinkedFunctions* MTL::ComputePipelineDescriptor::linkedFunctions() const +_MTL_INLINE void MTL::ComputePipelineDescriptor::setInsertLibraries(const NS::Array* insertLibraries) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(linkedFunctions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInsertLibraries_), insertLibraries); +} + +_MTL_INLINE void MTL::ComputePipelineDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } _MTL_INLINE void MTL::ComputePipelineDescriptor::setLinkedFunctions(const MTL::LinkedFunctions* linkedFunctions) @@ -278,10 +278,34 @@ _MTL_INLINE void MTL::ComputePipelineDescriptor::setLinkedFunctions(const MTL::L Object::sendMessage(this, _MTL_PRIVATE_SEL(setLinkedFunctions_), linkedFunctions); } -// property: supportAddingBinaryFunctions -_MTL_INLINE bool MTL::ComputePipelineDescriptor::supportAddingBinaryFunctions() const +_MTL_INLINE void MTL::ComputePipelineDescriptor::setMaxCallStackDepth(NS::UInteger maxCallStackDepth) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingBinaryFunctions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCallStackDepth_), maxCallStackDepth); +} + +_MTL_INLINE void MTL::ComputePipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL::ComputePipelineDescriptor::setPreloadedLibraries(const NS::Array* preloadedLibraries) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreloadedLibraries_), preloadedLibraries); +} + +_MTL_INLINE void MTL::ComputePipelineDescriptor::setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerThreadgroup_), requiredThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL::ComputePipelineDescriptor::setShaderValidation(MTL::ShaderValidation shaderValidation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setShaderValidation_), shaderValidation); +} + +_MTL_INLINE void MTL::ComputePipelineDescriptor::setStageInputDescriptor(const MTL::StageInputOutputDescriptor* stageInputDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInputDescriptor_), stageInputDescriptor); } _MTL_INLINE void MTL::ComputePipelineDescriptor::setSupportAddingBinaryFunctions(bool supportAddingBinaryFunctions) @@ -289,85 +313,127 @@ _MTL_INLINE void MTL::ComputePipelineDescriptor::setSupportAddingBinaryFunctions Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAddingBinaryFunctions_), supportAddingBinaryFunctions); } -// property: maxCallStackDepth -_MTL_INLINE NS::UInteger MTL::ComputePipelineDescriptor::maxCallStackDepth() const +_MTL_INLINE void MTL::ComputePipelineDescriptor::setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCallStackDepth)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); } -_MTL_INLINE void MTL::ComputePipelineDescriptor::setMaxCallStackDepth(NS::UInteger maxCallStackDepth) +_MTL_INLINE void MTL::ComputePipelineDescriptor::setThreadGroupSizeIsMultipleOfThreadExecutionWidth(bool threadGroupSizeIsMultipleOfThreadExecutionWidth) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCallStackDepth_), maxCallStackDepth); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadGroupSizeIsMultipleOfThreadExecutionWidth_), threadGroupSizeIsMultipleOfThreadExecutionWidth); } -// property: label -_MTL_INLINE NS::String* MTL::ComputePipelineState::label() const +_MTL_INLINE MTL::ShaderValidation MTL::ComputePipelineDescriptor::shaderValidation() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE MTL::StageInputOutputDescriptor* MTL::ComputePipelineDescriptor::stageInputDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stageInputDescriptor)); +} + +_MTL_INLINE bool MTL::ComputePipelineDescriptor::supportAddingBinaryFunctions() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingBinaryFunctions)); +} + +_MTL_INLINE bool MTL::ComputePipelineDescriptor::supportIndirectCommandBuffers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE bool MTL::ComputePipelineDescriptor::threadGroupSizeIsMultipleOfThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadGroupSizeIsMultipleOfThreadExecutionWidth)); } -// property: device _MTL_INLINE MTL::Device* MTL::ComputePipelineState::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: maxTotalThreadsPerThreadgroup -_MTL_INLINE NS::UInteger MTL::ComputePipelineState::maxTotalThreadsPerThreadgroup() const +_MTL_INLINE MTL::FunctionHandle* MTL::ComputePipelineState::functionHandle(const NS::String* name) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithName_), name); } -// property: threadExecutionWidth -_MTL_INLINE NS::UInteger MTL::ComputePipelineState::threadExecutionWidth() const +_MTL_INLINE MTL::FunctionHandle* MTL::ComputePipelineState::functionHandle(const MTL4::BinaryFunction* function) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadExecutionWidth)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithBinaryFunction_), function); } -// property: staticThreadgroupMemoryLength -_MTL_INLINE NS::UInteger MTL::ComputePipelineState::staticThreadgroupMemoryLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(staticThreadgroupMemoryLength)); -} - -// method: imageblockMemoryLengthForDimensions: -_MTL_INLINE NS::UInteger MTL::ComputePipelineState::imageblockMemoryLength(MTL::Size imageblockDimensions) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockMemoryLengthForDimensions_), imageblockDimensions); -} - -// property: supportIndirectCommandBuffers -_MTL_INLINE bool MTL::ComputePipelineState::supportIndirectCommandBuffers() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); -} - -// property: gpuResourceID -_MTL_INLINE MTL::ResourceID MTL::ComputePipelineState::gpuResourceID() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); -} - -// method: functionHandleWithFunction: _MTL_INLINE MTL::FunctionHandle* MTL::ComputePipelineState::functionHandle(const MTL::Function* function) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithFunction_), function); } -// method: newComputePipelineStateWithAdditionalBinaryFunctions:error: +_MTL_INLINE MTL::ResourceID MTL::ComputePipelineState::gpuResourceID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); +} + +_MTL_INLINE NS::UInteger MTL::ComputePipelineState::imageblockMemoryLength(MTL::Size imageblockDimensions) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockMemoryLengthForDimensions_), imageblockDimensions); +} + +_MTL_INLINE NS::String* MTL::ComputePipelineState::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::ComputePipelineState::maxTotalThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL::ComputePipelineState::newComputePipelineStateWithBinaryFunctions(const NS::Array* additionalBinaryFunctions, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithBinaryFunctions_error_), additionalBinaryFunctions, error); +} + _MTL_INLINE MTL::ComputePipelineState* MTL::ComputePipelineState::newComputePipelineState(const NS::Array* functions, NS::Error** error) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithAdditionalBinaryFunctions_error_), functions, error); } -// method: newVisibleFunctionTableWithDescriptor: +_MTL_INLINE MTL::IntersectionFunctionTable* MTL::ComputePipelineState::newIntersectionFunctionTable(const MTL::IntersectionFunctionTableDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionTableWithDescriptor_), descriptor); +} + _MTL_INLINE MTL::VisibleFunctionTable* MTL::ComputePipelineState::newVisibleFunctionTable(const MTL::VisibleFunctionTableDescriptor* descriptor) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newVisibleFunctionTableWithDescriptor_), descriptor); } -// method: newIntersectionFunctionTableWithDescriptor: -_MTL_INLINE MTL::IntersectionFunctionTable* MTL::ComputePipelineState::newIntersectionFunctionTable(const MTL::IntersectionFunctionTableDescriptor* descriptor) +_MTL_INLINE MTL::ComputePipelineReflection* MTL::ComputePipelineState::reflection() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionTableWithDescriptor_), descriptor); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(reflection)); +} + +_MTL_INLINE MTL::Size MTL::ComputePipelineState::requiredThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup)); +} + +_MTL_INLINE MTL::ShaderValidation MTL::ComputePipelineState::shaderValidation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE NS::UInteger MTL::ComputePipelineState::staticThreadgroupMemoryLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(staticThreadgroupMemoryLength)); +} + +_MTL_INLINE bool MTL::ComputePipelineState::supportIndirectCommandBuffers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE NS::UInteger MTL::ComputePipelineState::threadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadExecutionWidth)); } diff --git a/vendor/metal-cpp/Metal/MTLCounters.hpp b/vendor/metal-cpp/Metal/MTLCounters.hpp index c552f7ed4..6d655f158 100644 --- a/vendor/metal-cpp/Metal/MTLCounters.hpp +++ b/vendor/metal-cpp/Metal/MTLCounters.hpp @@ -2,7 +2,7 @@ // // Metal/MTLCounters.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,48 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - #include "MTLResource.hpp" +#include namespace MTL { +class CounterSampleBufferDescriptor; +class CounterSet; +class Device; +_MTL_ENUM(NS::Integer, CounterSampleBufferError) { + CounterSampleBufferErrorOutOfMemory = 0, + CounterSampleBufferErrorInvalid = 1, + CounterSampleBufferErrorInternal = 2, +}; + +using CommonCounter = NS::String*; +using CommonCounterSet = NS::String*; + +static const NS::UInteger CounterErrorValue = static_cast(~0ULL); +static const NS::UInteger CounterDontSample = static_cast(-1); +_MTL_CONST(NS::ErrorDomain, CounterErrorDomain); +_MTL_CONST(CommonCounter, CommonCounterTimestamp); +_MTL_CONST(CommonCounter, CommonCounterTessellationInputPatches); +_MTL_CONST(CommonCounter, CommonCounterVertexInvocations); +_MTL_CONST(CommonCounter, CommonCounterPostTessellationVertexInvocations); +_MTL_CONST(CommonCounter, CommonCounterClipperInvocations); +_MTL_CONST(CommonCounter, CommonCounterClipperPrimitivesOut); +_MTL_CONST(CommonCounter, CommonCounterFragmentInvocations); +_MTL_CONST(CommonCounter, CommonCounterFragmentsPassed); +_MTL_CONST(CommonCounter, CommonCounterComputeKernelInvocations); +_MTL_CONST(CommonCounter, CommonCounterTotalCycles); +_MTL_CONST(CommonCounter, CommonCounterVertexCycles); +_MTL_CONST(CommonCounter, CommonCounterTessellationCycles); +_MTL_CONST(CommonCounter, CommonCounterPostTessellationVertexCycles); +_MTL_CONST(CommonCounter, CommonCounterFragmentCycles); +_MTL_CONST(CommonCounter, CommonCounterRenderTargetWriteCycles); +_MTL_CONST(CommonCounterSet, CommonCounterSetTimestamp); +_MTL_CONST(CommonCounterSet, CommonCounterSetStageUtilization); +_MTL_CONST(CommonCounterSet, CommonCounterSetStatistic); struct CounterResultTimestamp { uint64_t timestamp; @@ -57,142 +89,112 @@ struct CounterResultStatistic uint64_t computeKernelInvocations; } _MTL_PACKED; -_MTL_CONST(NS::ErrorDomain, CounterErrorDomain); - -using CommonCounter = NS::String*; - -_MTL_CONST(CommonCounter, CommonCounterTimestamp); -_MTL_CONST(CommonCounter, CommonCounterTessellationInputPatches); -_MTL_CONST(CommonCounter, CommonCounterVertexInvocations); -_MTL_CONST(CommonCounter, CommonCounterPostTessellationVertexInvocations); -_MTL_CONST(CommonCounter, CommonCounterClipperInvocations); -_MTL_CONST(CommonCounter, CommonCounterClipperPrimitivesOut); -_MTL_CONST(CommonCounter, CommonCounterFragmentInvocations); -_MTL_CONST(CommonCounter, CommonCounterFragmentsPassed); -_MTL_CONST(CommonCounter, CommonCounterComputeKernelInvocations); -_MTL_CONST(CommonCounter, CommonCounterTotalCycles); -_MTL_CONST(CommonCounter, CommonCounterVertexCycles); -_MTL_CONST(CommonCounter, CommonCounterTessellationCycles); -_MTL_CONST(CommonCounter, CommonCounterPostTessellationVertexCycles); -_MTL_CONST(CommonCounter, CommonCounterFragmentCycles); -_MTL_CONST(CommonCounter, CommonCounterRenderTargetWriteCycles); - -using CommonCounterSet = NS::String*; - -_MTL_CONST(CommonCounterSet, CommonCounterSetTimestamp); -_MTL_CONST(CommonCounterSet, CommonCounterSetStageUtilization); -_MTL_CONST(CommonCounterSet, CommonCounterSetStatistic); - class Counter : public NS::Referencing { public: NS::String* name() const; }; - class CounterSet : public NS::Referencing { public: - NS::String* name() const; - NS::Array* counters() const; -}; + NS::String* name() const; +}; class CounterSampleBufferDescriptor : public NS::Copying { public: - static class CounterSampleBufferDescriptor* alloc(); + static CounterSampleBufferDescriptor* alloc(); - class CounterSampleBufferDescriptor* init(); + CounterSet* counterSet() const; - class CounterSet* counterSet() const; - void setCounterSet(const class CounterSet* counterSet); + CounterSampleBufferDescriptor* init(); - NS::String* label() const; - void setLabel(const NS::String* label); + NS::String* label() const; - MTL::StorageMode storageMode() const; - void setStorageMode(MTL::StorageMode storageMode); + NS::UInteger sampleCount() const; - NS::UInteger sampleCount() const; - void setSampleCount(NS::UInteger sampleCount); + void setCounterSet(const MTL::CounterSet* counterSet); + + void setLabel(const NS::String* label); + + void setSampleCount(NS::UInteger sampleCount); + + void setStorageMode(MTL::StorageMode storageMode); + StorageMode storageMode() const; }; - class CounterSampleBuffer : public NS::Referencing { public: - class Device* device() const; + Device* device() const; - NS::String* label() const; + NS::String* label() const; - NS::UInteger sampleCount() const; + NS::Data* resolveCounterRange(NS::Range range); - NS::Data* resolveCounterRange(NS::Range range); -}; - -_MTL_ENUM(NS::Integer, CounterSampleBufferError) { - CounterSampleBufferErrorOutOfMemory = 0, - CounterSampleBufferErrorInvalid = 1, - CounterSampleBufferErrorInternal = 2, + NS::UInteger sampleCount() const; }; } -_MTL_PRIVATE_DEF_STR(NS::ErrorDomain, CounterErrorDomain); +_MTL_PRIVATE_DEF_CONST(NS::ErrorDomain, CounterErrorDomain); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterTimestamp); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterTessellationInputPatches); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterVertexInvocations); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterPostTessellationVertexInvocations); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterClipperInvocations); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterClipperPrimitivesOut); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterFragmentInvocations); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterFragmentsPassed); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterComputeKernelInvocations); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterTotalCycles); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterVertexCycles); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterTessellationCycles); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterPostTessellationVertexCycles); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterFragmentCycles); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounter, CommonCounterRenderTargetWriteCycles); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounterSet, CommonCounterSetTimestamp); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounterSet, CommonCounterSetStageUtilization); +_MTL_PRIVATE_DEF_CONST(MTL::CommonCounterSet, CommonCounterSetStatistic); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterTimestamp); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterTessellationInputPatches); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterVertexInvocations); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterPostTessellationVertexInvocations); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterClipperInvocations); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterClipperPrimitivesOut); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterFragmentInvocations); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterFragmentsPassed); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterComputeKernelInvocations); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterTotalCycles); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterVertexCycles); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterTessellationCycles); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterPostTessellationVertexCycles); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterFragmentCycles); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounter, CommonCounterRenderTargetWriteCycles); - -_MTL_PRIVATE_DEF_STR(MTL::CommonCounterSet, CommonCounterSetTimestamp); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounterSet, CommonCounterSetStageUtilization); -_MTL_PRIVATE_DEF_STR(MTL::CommonCounterSet, CommonCounterSetStatistic); - -// property: name _MTL_INLINE NS::String* MTL::Counter::name() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); } -// property: name -_MTL_INLINE NS::String* MTL::CounterSet::name() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); -} - -// property: counters _MTL_INLINE NS::Array* MTL::CounterSet::counters() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(counters)); } -// static method: alloc +_MTL_INLINE NS::String* MTL::CounterSet::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + _MTL_INLINE MTL::CounterSampleBufferDescriptor* MTL::CounterSampleBufferDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLCounterSampleBufferDescriptor)); } -// method: init +_MTL_INLINE MTL::CounterSet* MTL::CounterSampleBufferDescriptor::counterSet() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(counterSet)); +} + _MTL_INLINE MTL::CounterSampleBufferDescriptor* MTL::CounterSampleBufferDescriptor::init() { return NS::Object::init(); } -// property: counterSet -_MTL_INLINE MTL::CounterSet* MTL::CounterSampleBufferDescriptor::counterSet() const +_MTL_INLINE NS::String* MTL::CounterSampleBufferDescriptor::label() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(counterSet)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::CounterSampleBufferDescriptor::sampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); } _MTL_INLINE void MTL::CounterSampleBufferDescriptor::setCounterSet(const MTL::CounterSet* counterSet) @@ -200,59 +202,42 @@ _MTL_INLINE void MTL::CounterSampleBufferDescriptor::setCounterSet(const MTL::Co Object::sendMessage(this, _MTL_PRIVATE_SEL(setCounterSet_), counterSet); } -// property: label -_MTL_INLINE NS::String* MTL::CounterSampleBufferDescriptor::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - _MTL_INLINE void MTL::CounterSampleBufferDescriptor::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: storageMode -_MTL_INLINE MTL::StorageMode MTL::CounterSampleBufferDescriptor::storageMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); -} - -_MTL_INLINE void MTL::CounterSampleBufferDescriptor::setStorageMode(MTL::StorageMode storageMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); -} - -// property: sampleCount -_MTL_INLINE NS::UInteger MTL::CounterSampleBufferDescriptor::sampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); -} - _MTL_INLINE void MTL::CounterSampleBufferDescriptor::setSampleCount(NS::UInteger sampleCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount); } -// property: device +_MTL_INLINE void MTL::CounterSampleBufferDescriptor::setStorageMode(MTL::StorageMode storageMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); +} + +_MTL_INLINE MTL::StorageMode MTL::CounterSampleBufferDescriptor::storageMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); +} + _MTL_INLINE MTL::Device* MTL::CounterSampleBuffer::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: label _MTL_INLINE NS::String* MTL::CounterSampleBuffer::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -// property: sampleCount -_MTL_INLINE NS::UInteger MTL::CounterSampleBuffer::sampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); -} - -// method: resolveCounterRange: _MTL_INLINE NS::Data* MTL::CounterSampleBuffer::resolveCounterRange(NS::Range range) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveCounterRange_), range); } + +_MTL_INLINE NS::UInteger MTL::CounterSampleBuffer::sampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); +} diff --git a/vendor/metal-cpp/Metal/MTLDataType.hpp b/vendor/metal-cpp/Metal/MTLDataType.hpp new file mode 100644 index 000000000..f0e9b25ad --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLDataType.hpp @@ -0,0 +1,129 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLDataType.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL +{ +_MTL_ENUM(NS::UInteger, DataType) { + DataTypeNone = 0, + DataTypeStruct = 1, + DataTypeArray = 2, + DataTypeFloat = 3, + DataTypeFloat2 = 4, + DataTypeFloat3 = 5, + DataTypeFloat4 = 6, + DataTypeFloat2x2 = 7, + DataTypeFloat2x3 = 8, + DataTypeFloat2x4 = 9, + DataTypeFloat3x2 = 10, + DataTypeFloat3x3 = 11, + DataTypeFloat3x4 = 12, + DataTypeFloat4x2 = 13, + DataTypeFloat4x3 = 14, + DataTypeFloat4x4 = 15, + DataTypeHalf = 16, + DataTypeHalf2 = 17, + DataTypeHalf3 = 18, + DataTypeHalf4 = 19, + DataTypeHalf2x2 = 20, + DataTypeHalf2x3 = 21, + DataTypeHalf2x4 = 22, + DataTypeHalf3x2 = 23, + DataTypeHalf3x3 = 24, + DataTypeHalf3x4 = 25, + DataTypeHalf4x2 = 26, + DataTypeHalf4x3 = 27, + DataTypeHalf4x4 = 28, + DataTypeInt = 29, + DataTypeInt2 = 30, + DataTypeInt3 = 31, + DataTypeInt4 = 32, + DataTypeUInt = 33, + DataTypeUInt2 = 34, + DataTypeUInt3 = 35, + DataTypeUInt4 = 36, + DataTypeShort = 37, + DataTypeShort2 = 38, + DataTypeShort3 = 39, + DataTypeShort4 = 40, + DataTypeUShort = 41, + DataTypeUShort2 = 42, + DataTypeUShort3 = 43, + DataTypeUShort4 = 44, + DataTypeChar = 45, + DataTypeChar2 = 46, + DataTypeChar3 = 47, + DataTypeChar4 = 48, + DataTypeUChar = 49, + DataTypeUChar2 = 50, + DataTypeUChar3 = 51, + DataTypeUChar4 = 52, + DataTypeBool = 53, + DataTypeBool2 = 54, + DataTypeBool3 = 55, + DataTypeBool4 = 56, + DataTypeTexture = 58, + DataTypeSampler = 59, + DataTypePointer = 60, + DataTypeR8Unorm = 62, + DataTypeR8Snorm = 63, + DataTypeR16Unorm = 64, + DataTypeR16Snorm = 65, + DataTypeRG8Unorm = 66, + DataTypeRG8Snorm = 67, + DataTypeRG16Unorm = 68, + DataTypeRG16Snorm = 69, + DataTypeRGBA8Unorm = 70, + DataTypeRGBA8Unorm_sRGB = 71, + DataTypeRGBA8Snorm = 72, + DataTypeRGBA16Unorm = 73, + DataTypeRGBA16Snorm = 74, + DataTypeRGB10A2Unorm = 75, + DataTypeRG11B10Float = 76, + DataTypeRGB9E5Float = 77, + DataTypeRenderPipeline = 78, + DataTypeComputePipeline = 79, + DataTypeIndirectCommandBuffer = 80, + DataTypeLong = 81, + DataTypeLong2 = 82, + DataTypeLong3 = 83, + DataTypeLong4 = 84, + DataTypeULong = 85, + DataTypeULong2 = 86, + DataTypeULong3 = 87, + DataTypeULong4 = 88, + DataTypeVisibleFunctionTable = 115, + DataTypeIntersectionFunctionTable = 116, + DataTypePrimitiveAccelerationStructure = 117, + DataTypeInstanceAccelerationStructure = 118, + DataTypeBFloat = 121, + DataTypeBFloat2 = 122, + DataTypeBFloat3 = 123, + DataTypeBFloat4 = 124, + DataTypeDepthStencilState = 139, + DataTypeTensor = 140, +}; + +} diff --git a/vendor/metal-cpp/Metal/MTLDefines.hpp b/vendor/metal-cpp/Metal/MTLDefines.hpp index 7dd8ff95d..4260a2b1f 100644 --- a/vendor/metal-cpp/Metal/MTLDefines.hpp +++ b/vendor/metal-cpp/Metal/MTLDefines.hpp @@ -2,7 +2,7 @@ // // Metal/MTLDefines.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/Metal/MTLDepthStencil.hpp b/vendor/metal-cpp/Metal/MTLDepthStencil.hpp index ba8bd8b00..e1116175e 100644 --- a/vendor/metal-cpp/Metal/MTLDepthStencil.hpp +++ b/vendor/metal-cpp/Metal/MTLDepthStencil.hpp @@ -2,7 +2,7 @@ // // Metal/MTLDepthStencil.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,18 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLDepthStencil.hpp" +#include "MTLTypes.hpp" +#include namespace MTL { +class DepthStencilDescriptor; +class Device; +class StencilDescriptor; _MTL_ENUM(NS::UInteger, CompareFunction) { CompareFunctionNever = 0, CompareFunctionLess = 1, @@ -55,100 +57,98 @@ _MTL_ENUM(NS::UInteger, StencilOperation) { class StencilDescriptor : public NS::Copying { public: - static class StencilDescriptor* alloc(); + static StencilDescriptor* alloc(); - class StencilDescriptor* init(); + StencilOperation depthFailureOperation() const; - MTL::CompareFunction stencilCompareFunction() const; - void setStencilCompareFunction(MTL::CompareFunction stencilCompareFunction); + StencilOperation depthStencilPassOperation() const; - MTL::StencilOperation stencilFailureOperation() const; - void setStencilFailureOperation(MTL::StencilOperation stencilFailureOperation); + StencilDescriptor* init(); - MTL::StencilOperation depthFailureOperation() const; - void setDepthFailureOperation(MTL::StencilOperation depthFailureOperation); + uint32_t readMask() const; - MTL::StencilOperation depthStencilPassOperation() const; - void setDepthStencilPassOperation(MTL::StencilOperation depthStencilPassOperation); + void setDepthFailureOperation(MTL::StencilOperation depthFailureOperation); - uint32_t readMask() const; - void setReadMask(uint32_t readMask); + void setDepthStencilPassOperation(MTL::StencilOperation depthStencilPassOperation); - uint32_t writeMask() const; - void setWriteMask(uint32_t writeMask); + void setReadMask(uint32_t readMask); + + void setStencilCompareFunction(MTL::CompareFunction stencilCompareFunction); + + void setStencilFailureOperation(MTL::StencilOperation stencilFailureOperation); + + void setWriteMask(uint32_t writeMask); + + CompareFunction stencilCompareFunction() const; + + StencilOperation stencilFailureOperation() const; + + uint32_t writeMask() const; }; - class DepthStencilDescriptor : public NS::Copying { public: - static class DepthStencilDescriptor* alloc(); + static DepthStencilDescriptor* alloc(); - class DepthStencilDescriptor* init(); + StencilDescriptor* backFaceStencil() const; - MTL::CompareFunction depthCompareFunction() const; - void setDepthCompareFunction(MTL::CompareFunction depthCompareFunction); + CompareFunction depthCompareFunction() const; - bool depthWriteEnabled() const; - void setDepthWriteEnabled(bool depthWriteEnabled); + [[deprecated("please use isDepthWriteEnabled instead")]] + bool depthWriteEnabled() const; - class StencilDescriptor* frontFaceStencil() const; - void setFrontFaceStencil(const class StencilDescriptor* frontFaceStencil); + StencilDescriptor* frontFaceStencil() const; - class StencilDescriptor* backFaceStencil() const; - void setBackFaceStencil(const class StencilDescriptor* backFaceStencil); + DepthStencilDescriptor* init(); - NS::String* label() const; - void setLabel(const NS::String* label); + bool isDepthWriteEnabled() const; + + NS::String* label() const; + + void setBackFaceStencil(const MTL::StencilDescriptor* backFaceStencil); + + void setDepthCompareFunction(MTL::CompareFunction depthCompareFunction); + + void setDepthWriteEnabled(bool depthWriteEnabled); + + void setFrontFaceStencil(const MTL::StencilDescriptor* frontFaceStencil); + + void setLabel(const NS::String* label); }; - class DepthStencilState : public NS::Referencing { public: - NS::String* label() const; + Device* device() const; - class Device* device() const; + ResourceID gpuResourceID() const; + + NS::String* label() const; }; } - -// static method: alloc _MTL_INLINE MTL::StencilDescriptor* MTL::StencilDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLStencilDescriptor)); } -// method: init +_MTL_INLINE MTL::StencilOperation MTL::StencilDescriptor::depthFailureOperation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthFailureOperation)); +} + +_MTL_INLINE MTL::StencilOperation MTL::StencilDescriptor::depthStencilPassOperation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthStencilPassOperation)); +} + _MTL_INLINE MTL::StencilDescriptor* MTL::StencilDescriptor::init() { return NS::Object::init(); } -// property: stencilCompareFunction -_MTL_INLINE MTL::CompareFunction MTL::StencilDescriptor::stencilCompareFunction() const +_MTL_INLINE uint32_t MTL::StencilDescriptor::readMask() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilCompareFunction)); -} - -_MTL_INLINE void MTL::StencilDescriptor::setStencilCompareFunction(MTL::CompareFunction stencilCompareFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilCompareFunction_), stencilCompareFunction); -} - -// property: stencilFailureOperation -_MTL_INLINE MTL::StencilOperation MTL::StencilDescriptor::stencilFailureOperation() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilFailureOperation)); -} - -_MTL_INLINE void MTL::StencilDescriptor::setStencilFailureOperation(MTL::StencilOperation stencilFailureOperation) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilFailureOperation_), stencilFailureOperation); -} - -// property: depthFailureOperation -_MTL_INLINE MTL::StencilOperation MTL::StencilDescriptor::depthFailureOperation() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthFailureOperation)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(readMask)); } _MTL_INLINE void MTL::StencilDescriptor::setDepthFailureOperation(MTL::StencilOperation depthFailureOperation) @@ -156,32 +156,24 @@ _MTL_INLINE void MTL::StencilDescriptor::setDepthFailureOperation(MTL::StencilOp Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthFailureOperation_), depthFailureOperation); } -// property: depthStencilPassOperation -_MTL_INLINE MTL::StencilOperation MTL::StencilDescriptor::depthStencilPassOperation() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthStencilPassOperation)); -} - _MTL_INLINE void MTL::StencilDescriptor::setDepthStencilPassOperation(MTL::StencilOperation depthStencilPassOperation) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilPassOperation_), depthStencilPassOperation); } -// property: readMask -_MTL_INLINE uint32_t MTL::StencilDescriptor::readMask() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(readMask)); -} - _MTL_INLINE void MTL::StencilDescriptor::setReadMask(uint32_t readMask) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setReadMask_), readMask); } -// property: writeMask -_MTL_INLINE uint32_t MTL::StencilDescriptor::writeMask() const +_MTL_INLINE void MTL::StencilDescriptor::setStencilCompareFunction(MTL::CompareFunction stencilCompareFunction) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(writeMask)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilCompareFunction_), stencilCompareFunction); +} + +_MTL_INLINE void MTL::StencilDescriptor::setStencilFailureOperation(MTL::StencilOperation stencilFailureOperation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilFailureOperation_), stencilFailureOperation); } _MTL_INLINE void MTL::StencilDescriptor::setWriteMask(uint32_t writeMask) @@ -189,55 +181,59 @@ _MTL_INLINE void MTL::StencilDescriptor::setWriteMask(uint32_t writeMask) Object::sendMessage(this, _MTL_PRIVATE_SEL(setWriteMask_), writeMask); } -// static method: alloc +_MTL_INLINE MTL::CompareFunction MTL::StencilDescriptor::stencilCompareFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilCompareFunction)); +} + +_MTL_INLINE MTL::StencilOperation MTL::StencilDescriptor::stencilFailureOperation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilFailureOperation)); +} + +_MTL_INLINE uint32_t MTL::StencilDescriptor::writeMask() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(writeMask)); +} + _MTL_INLINE MTL::DepthStencilDescriptor* MTL::DepthStencilDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLDepthStencilDescriptor)); } -// method: init -_MTL_INLINE MTL::DepthStencilDescriptor* MTL::DepthStencilDescriptor::init() +_MTL_INLINE MTL::StencilDescriptor* MTL::DepthStencilDescriptor::backFaceStencil() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(backFaceStencil)); } -// property: depthCompareFunction _MTL_INLINE MTL::CompareFunction MTL::DepthStencilDescriptor::depthCompareFunction() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthCompareFunction)); } -_MTL_INLINE void MTL::DepthStencilDescriptor::setDepthCompareFunction(MTL::CompareFunction depthCompareFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthCompareFunction_), depthCompareFunction); -} - -// property: depthWriteEnabled _MTL_INLINE bool MTL::DepthStencilDescriptor::depthWriteEnabled() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthWriteEnabled)); } -_MTL_INLINE void MTL::DepthStencilDescriptor::setDepthWriteEnabled(bool depthWriteEnabled) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthWriteEnabled_), depthWriteEnabled); -} - -// property: frontFaceStencil _MTL_INLINE MTL::StencilDescriptor* MTL::DepthStencilDescriptor::frontFaceStencil() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(frontFaceStencil)); } -_MTL_INLINE void MTL::DepthStencilDescriptor::setFrontFaceStencil(const MTL::StencilDescriptor* frontFaceStencil) +_MTL_INLINE MTL::DepthStencilDescriptor* MTL::DepthStencilDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFrontFaceStencil_), frontFaceStencil); + return NS::Object::init(); } -// property: backFaceStencil -_MTL_INLINE MTL::StencilDescriptor* MTL::DepthStencilDescriptor::backFaceStencil() const +_MTL_INLINE bool MTL::DepthStencilDescriptor::isDepthWriteEnabled() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(backFaceStencil)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isDepthWriteEnabled)); +} + +_MTL_INLINE NS::String* MTL::DepthStencilDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } _MTL_INLINE void MTL::DepthStencilDescriptor::setBackFaceStencil(const MTL::StencilDescriptor* backFaceStencil) @@ -245,10 +241,19 @@ _MTL_INLINE void MTL::DepthStencilDescriptor::setBackFaceStencil(const MTL::Sten Object::sendMessage(this, _MTL_PRIVATE_SEL(setBackFaceStencil_), backFaceStencil); } -// property: label -_MTL_INLINE NS::String* MTL::DepthStencilDescriptor::label() const +_MTL_INLINE void MTL::DepthStencilDescriptor::setDepthCompareFunction(MTL::CompareFunction depthCompareFunction) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthCompareFunction_), depthCompareFunction); +} + +_MTL_INLINE void MTL::DepthStencilDescriptor::setDepthWriteEnabled(bool depthWriteEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthWriteEnabled_), depthWriteEnabled); +} + +_MTL_INLINE void MTL::DepthStencilDescriptor::setFrontFaceStencil(const MTL::StencilDescriptor* frontFaceStencil) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFrontFaceStencil_), frontFaceStencil); } _MTL_INLINE void MTL::DepthStencilDescriptor::setLabel(const NS::String* label) @@ -256,14 +261,17 @@ _MTL_INLINE void MTL::DepthStencilDescriptor::setLabel(const NS::String* label) Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: label -_MTL_INLINE NS::String* MTL::DepthStencilState::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - -// property: device _MTL_INLINE MTL::Device* MTL::DepthStencilState::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } + +_MTL_INLINE MTL::ResourceID MTL::DepthStencilState::gpuResourceID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); +} + +_MTL_INLINE NS::String* MTL::DepthStencilState::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} diff --git a/vendor/metal-cpp/Metal/MTLDevice.hpp b/vendor/metal-cpp/Metal/MTLDevice.hpp index 7628ddb60..0e867397b 100644 --- a/vendor/metal-cpp/Metal/MTLDevice.hpp +++ b/vendor/metal-cpp/Metal/MTLDevice.hpp @@ -2,7 +2,7 @@ // // Metal/MTLDevice.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,21 +20,107 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTL4Counters.hpp" +#include "MTLArgument.hpp" +#include "MTLDataType.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" -#include "MTLPrivate.hpp" - -#include - -#include "MTLArgument.hpp" -#include "MTLDevice.hpp" #include "MTLPixelFormat.hpp" +#include "MTLPrivate.hpp" #include "MTLResource.hpp" #include "MTLTexture.hpp" #include "MTLTypes.hpp" #include +#include +#include + +#include +#include #include +namespace MTL +{ +class AccelerationStructure; +class AccelerationStructureDescriptor; +class Architecture; +class ArgumentDescriptor; +class ArgumentEncoder; +class BinaryArchive; +class BinaryArchiveDescriptor; +class Buffer; +class BufferBinding; +class CommandQueue; +class CommandQueueDescriptor; +class CompileOptions; +class ComputePipelineDescriptor; +class ComputePipelineReflection; +class ComputePipelineState; +class CounterSampleBuffer; +class CounterSampleBufferDescriptor; +class DepthStencilDescriptor; +class DepthStencilState; +class Device; +class DynamicLibrary; +class Event; +class Fence; +class Function; +class FunctionConstantValues; +class FunctionHandle; +class Heap; +class HeapDescriptor; +class IOCommandQueue; +class IOCommandQueueDescriptor; +class IOFileHandle; +class IndirectCommandBuffer; +class IndirectCommandBufferDescriptor; +class Library; +class LogState; +class LogStateDescriptor; +class MeshRenderPipelineDescriptor; +class RasterizationRateMap; +class RasterizationRateMapDescriptor; +struct Region; +class RenderPipelineDescriptor; +class RenderPipelineReflection; +class RenderPipelineState; +class ResidencySet; +class ResidencySetDescriptor; +class ResourceViewPoolDescriptor; +struct SamplePosition; +class SamplerDescriptor; +class SamplerState; +class SharedEvent; +class SharedEventHandle; +class SharedTextureHandle; +class StitchedLibraryDescriptor; +class Tensor; +class TensorDescriptor; +class Texture; +class TextureDescriptor; +class TextureViewPool; +class TileRenderPipelineDescriptor; + +} +namespace MTL4 +{ +class Archive; +class ArgumentTable; +class ArgumentTableDescriptor; +class BinaryFunction; +class CommandAllocator; +class CommandAllocatorDescriptor; +class CommandBuffer; +class CommandQueue; +class CommandQueueDescriptor; +class Compiler; +class CompilerDescriptor; +class CounterHeap; +class CounterHeapDescriptor; +class PipelineDataSetSerializer; +class PipelineDataSetSerializerDescriptor; + +} namespace MTL { _MTL_ENUM(NS::Integer, IOCompressionMethod) { @@ -67,8 +153,8 @@ _MTL_ENUM(NS::UInteger, FeatureSet) { FeatureSet_OSX_GPUFamily1_v1 = 10000, FeatureSet_macOS_GPUFamily1_v2 = 10001, FeatureSet_OSX_GPUFamily1_v2 = 10001, - FeatureSet_OSX_ReadWriteTextureTier2 = 10002, FeatureSet_macOS_ReadWriteTextureTier2 = 10002, + FeatureSet_OSX_ReadWriteTextureTier2 = 10002, FeatureSet_macOS_GPUFamily1_v3 = 10003, FeatureSet_macOS_GPUFamily1_v4 = 10004, FeatureSet_macOS_GPUFamily2_v1 = 10005, @@ -94,6 +180,8 @@ _MTL_ENUM(NS::Integer, GPUFamily) { GPUFamilyApple6 = 1006, GPUFamilyApple7 = 1007, GPUFamilyApple8 = 1008, + GPUFamilyApple9 = 1009, + GPUFamilyApple10 = 1010, GPUFamilyMac1 = 2001, GPUFamilyMac2 = 2002, GPUFamilyCommon1 = 3001, @@ -102,6 +190,7 @@ _MTL_ENUM(NS::Integer, GPUFamily) { GPUFamilyMacCatalyst1 = 4001, GPUFamilyMacCatalyst2 = 4002, GPUFamilyMetal3 = 5001, + GPUFamilyMetal4 = 5002, }; _MTL_ENUM(NS::UInteger, DeviceLocation) { @@ -111,13 +200,6 @@ _MTL_ENUM(NS::UInteger, DeviceLocation) { DeviceLocationUnspecified = NS::UIntegerMax, }; -_MTL_OPTIONS(NS::UInteger, PipelineOption) { - PipelineOptionNone = 0, - PipelineOptionArgumentInfo = 1, - PipelineOptionBufferTypeInfo = 2, - PipelineOptionFailOnBinaryArchiveMiss = 4, -}; - _MTL_ENUM(NS::UInteger, ReadWriteTextureTier) { ReadWriteTextureTierNone = 0, ReadWriteTextureTier1 = 1, @@ -134,19 +216,6 @@ _MTL_ENUM(NS::UInteger, SparseTextureRegionAlignmentMode) { SparseTextureRegionAlignmentModeInward = 1, }; -_MTL_ENUM(NS::Integer, SparsePageSize) { - SparsePageSize16 = 101, - SparsePageSize64 = 102, - SparsePageSize256 = 103, -}; - -struct AccelerationStructureSizes -{ - NS::UInteger accelerationStructureSize; - NS::UInteger buildScratchBufferSize; - NS::UInteger refitScratchBufferSize; -} _MTL_PACKED; - _MTL_ENUM(NS::UInteger, CounterSamplingPoint) { CounterSamplingPointAtStageBoundary = 0, CounterSamplingPointAtDrawBoundary = 1, @@ -155,6 +224,47 @@ _MTL_ENUM(NS::UInteger, CounterSamplingPoint) { CounterSamplingPointAtBlitBoundary = 4, }; +_MTL_OPTIONS(NS::UInteger, PipelineOption) { + PipelineOptionNone = 0, + PipelineOptionArgumentInfo = 1, + PipelineOptionBindingInfo = 1, + PipelineOptionBufferTypeInfo = 1 << 1, + PipelineOptionFailOnBinaryArchiveMiss = 1 << 2, +}; + +using DeviceNotificationName = NS::String*; +using DeviceNotificationHandlerBlock = void (^)(MTL::Device* pDevice, MTL::DeviceNotificationName notifyName); +using DeviceNotificationHandlerFunction = std::function; +using AutoreleasedComputePipelineReflection = MTL::ComputePipelineReflection*; +using AutoreleasedRenderPipelineReflection = MTL::RenderPipelineReflection*; +using NewLibraryCompletionHandler = void (^)(MTL::Library*, NS::Error*); +using NewLibraryCompletionHandlerFunction = std::function; +using NewRenderPipelineStateCompletionHandler = void (^)(MTL::RenderPipelineState*, NS::Error*); +using NewRenderPipelineStateCompletionHandlerFunction = std::function; +using NewRenderPipelineStateWithReflectionCompletionHandler = void (^)(MTL::RenderPipelineState*, MTL::RenderPipelineReflection*, NS::Error*); +using NewRenderPipelineStateWithReflectionCompletionHandlerFunction = std::function; +using NewComputePipelineStateCompletionHandler = void (^)(MTL::ComputePipelineState*, NS::Error*); +using NewComputePipelineStateCompletionHandlerFunction = std::function; +using NewComputePipelineStateWithReflectionCompletionHandler = void (^)(MTL::ComputePipelineState*, MTL::ComputePipelineReflection*, NS::Error*); +using NewComputePipelineStateWithReflectionCompletionHandlerFunction = std::function; +using Timestamp = std::uint64_t; + +_MTL_CONST(DeviceNotificationName, DeviceWasAddedNotification); +_MTL_CONST(DeviceNotificationName, DeviceRemovalRequestedNotification); +_MTL_CONST(DeviceNotificationName, DeviceWasRemovedNotification); +_MTL_CONST(NS::ErrorUserInfoKey, CommandBufferEncoderInfoErrorKey); +Device* CreateSystemDefaultDevice(); +NS::Array* CopyAllDevices(); +NS::Array* CopyAllDevicesWithObserver(NS::Object** pOutObserver, MTL::DeviceNotificationHandlerBlock handler); +NS::Array* CopyAllDevicesWithObserver(NS::Object** pOutObserver, const MTL::DeviceNotificationHandlerFunction& handler); +void RemoveDeviceObserver(const NS::Object* pObserver); +struct AccelerationStructureSizes +{ + NS::UInteger accelerationStructureSize; + NS::UInteger buildScratchBufferSize; + NS::UInteger refitScratchBufferSize; +} _MTL_PACKED; + struct SizeAndAlign { NS::UInteger size; @@ -164,429 +274,320 @@ struct SizeAndAlign class ArgumentDescriptor : public NS::Copying { public: - static class ArgumentDescriptor* alloc(); + BindingAccess access() const; - class ArgumentDescriptor* init(); + static ArgumentDescriptor* alloc(); - static class ArgumentDescriptor* argumentDescriptor(); + static ArgumentDescriptor* argumentDescriptor(); - MTL::DataType dataType() const; - void setDataType(MTL::DataType dataType); + NS::UInteger arrayLength() const; - NS::UInteger index() const; - void setIndex(NS::UInteger index); + NS::UInteger constantBlockAlignment() const; - NS::UInteger arrayLength() const; - void setArrayLength(NS::UInteger arrayLength); + DataType dataType() const; - MTL::ArgumentAccess access() const; - void setAccess(MTL::ArgumentAccess access); + NS::UInteger index() const; - MTL::TextureType textureType() const; - void setTextureType(MTL::TextureType textureType); + ArgumentDescriptor* init(); - NS::UInteger constantBlockAlignment() const; - void setConstantBlockAlignment(NS::UInteger constantBlockAlignment); + void setAccess(MTL::BindingAccess access); + + void setArrayLength(NS::UInteger arrayLength); + + void setConstantBlockAlignment(NS::UInteger constantBlockAlignment); + + void setDataType(MTL::DataType dataType); + + void setIndex(NS::UInteger index); + + void setTextureType(MTL::TextureType textureType); + TextureType textureType() const; }; +class Architecture : public NS::Copying +{ +public: + static Architecture* alloc(); -using DeviceNotificationName = NS::String*; -_MTL_CONST(DeviceNotificationName, DeviceWasAddedNotification); -_MTL_CONST(DeviceNotificationName, DeviceRemovalRequestedNotification); -_MTL_CONST(DeviceNotificationName, DeviceWasRemovedNotification); -_MTL_CONST(NS::ErrorUserInfoKey, CommandBufferEncoderInfoErrorKey); - -using DeviceNotificationHandlerBlock = void (^)(class Device* pDevice, DeviceNotificationName notifyName); - -using DeviceNotificationHandlerFunction = std::function; - -using AutoreleasedComputePipelineReflection = class ComputePipelineReflection*; - -using AutoreleasedRenderPipelineReflection = class RenderPipelineReflection*; - -using NewLibraryCompletionHandler = void (^)(class Library*, NS::Error*); - -using NewLibraryCompletionHandlerFunction = std::function; - -using NewRenderPipelineStateCompletionHandler = void (^)(class RenderPipelineState*, NS::Error*); - -using NewRenderPipelineStateCompletionHandlerFunction = std::function; - -using NewRenderPipelineStateWithReflectionCompletionHandler = void (^)(class RenderPipelineState*, class RenderPipelineReflection*, NS::Error*); - -using NewRenderPipelineStateWithReflectionCompletionHandlerFunction = std::function; - -using NewComputePipelineStateCompletionHandler = void (^)(class ComputePipelineState*, NS::Error*); - -using NewComputePipelineStateCompletionHandlerFunction = std::function; - -using NewComputePipelineStateWithReflectionCompletionHandler = void (^)(class ComputePipelineState*, class ComputePipelineReflection*, NS::Error*); - -using NewComputePipelineStateWithReflectionCompletionHandlerFunction = std::function; - -using Timestamp = std::uint64_t; - -MTL::Device* CreateSystemDefaultDevice(); - -NS::Array* CopyAllDevices(); - -NS::Array* CopyAllDevicesWithObserver(NS::Object** pOutObserver, DeviceNotificationHandlerBlock handler); - -NS::Array* CopyAllDevicesWithObserver(NS::Object** pOutObserver, const DeviceNotificationHandlerFunction& handler); - -void RemoveDeviceObserver(const NS::Object* pObserver); + Architecture* init(); + NS::String* name() const; +}; class Device : public NS::Referencing { public: - void newLibrary(const NS::String* pSource, const class CompileOptions* pOptions, const NewLibraryCompletionHandlerFunction& completionHandler); + AccelerationStructureSizes accelerationStructureSizes(const MTL::AccelerationStructureDescriptor* descriptor); - void newLibrary(const class StitchedLibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& completionHandler); + Architecture* architecture() const; - void newRenderPipelineState(const class RenderPipelineDescriptor* pDescriptor, const NewRenderPipelineStateCompletionHandlerFunction& completionHandler); + bool areBarycentricCoordsSupported() const; - void newRenderPipelineState(const class RenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler); + bool areProgrammableSamplePositionsSupported() const; - void newRenderPipelineState(const class TileRenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler); + bool areRasterOrderGroupsSupported() const; - void newComputePipelineState(const class Function* pFunction, const NewComputePipelineStateCompletionHandlerFunction& completionHandler); + ArgumentBuffersTier argumentBuffersSupport() const; - void newComputePipelineState(const class Function* pFunction, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler); + [[deprecated("please use areBarycentricCoordsSupported instead")]] + bool barycentricCoordsSupported() const; - void newComputePipelineState(const class ComputePipelineDescriptor* pDescriptor, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler); + void convertSparsePixelRegions(const MTL::Region* pixelRegions, MTL::Region* tileRegions, MTL::Size tileSize, MTL::SparseTextureRegionAlignmentMode mode, NS::UInteger numRegions); - bool isHeadless() const; + void convertSparseTileRegions(const MTL::Region* tileRegions, MTL::Region* pixelRegions, MTL::Size tileSize, NS::UInteger numRegions); - NS::String* name() const; + NS::Array* counterSets() const; - uint64_t registryID() const; + NS::UInteger currentAllocatedSize() const; - MTL::Size maxThreadsPerThreadgroup() const; + [[deprecated("please use isDepth24Stencil8PixelFormatSupported instead")]] + bool depth24Stencil8PixelFormatSupported() const; - bool lowPower() const; + FunctionHandle* functionHandle(const MTL::Function* function); + FunctionHandle* functionHandle(const MTL4::BinaryFunction* function); - bool headless() const; + void getDefaultSamplePositions(MTL::SamplePosition* positions, NS::UInteger count); - bool removable() const; + bool hasUnifiedMemory() const; - bool hasUnifiedMemory() const; + [[deprecated("please use isHeadless instead")]] + bool headless() const; - uint64_t recommendedMaxWorkingSetSize() const; + SizeAndAlign heapAccelerationStructureSizeAndAlign(NS::UInteger size); + SizeAndAlign heapAccelerationStructureSizeAndAlign(const MTL::AccelerationStructureDescriptor* descriptor); - MTL::DeviceLocation location() const; + SizeAndAlign heapBufferSizeAndAlign(NS::UInteger length, MTL::ResourceOptions options); - NS::UInteger locationNumber() const; + SizeAndAlign heapTextureSizeAndAlign(const MTL::TextureDescriptor* desc); - uint64_t maxTransferRate() const; + bool isDepth24Stencil8PixelFormatSupported() const; - bool depth24Stencil8PixelFormatSupported() const; + bool isHeadless() const; - MTL::ReadWriteTextureTier readWriteTextureSupport() const; + bool isLowPower() const; - MTL::ArgumentBuffersTier argumentBuffersSupport() const; + bool isRemovable() const; - bool rasterOrderGroupsSupported() const; + DeviceLocation location() const; + NS::UInteger locationNumber() const; - bool supports32BitFloatFiltering() const; + [[deprecated("please use isLowPower instead")]] + bool lowPower() const; - bool supports32BitMSAA() const; + NS::UInteger maxArgumentBufferSamplerCount() const; - bool supportsQueryTextureLOD() const; + NS::UInteger maxBufferLength() const; - bool supportsBCTextureCompression() const; + NS::UInteger maxThreadgroupMemoryLength() const; - bool supportsPullModelInterpolation() const; + Size maxThreadsPerThreadgroup() const; - bool barycentricCoordsSupported() const; + uint64_t maxTransferRate() const; - bool supportsShaderBarycentricCoordinates() const; + NS::UInteger maximumConcurrentCompilationTaskCount() const; - NS::UInteger currentAllocatedSize() const; + NS::UInteger minimumLinearTextureAlignmentForPixelFormat(MTL::PixelFormat format); - class CommandQueue* newCommandQueue(); + NS::UInteger minimumTextureBufferAlignmentForPixelFormat(MTL::PixelFormat format); - class CommandQueue* newCommandQueue(NS::UInteger maxCommandBufferCount); + NS::String* name() const; - MTL::SizeAndAlign heapTextureSizeAndAlign(const class TextureDescriptor* desc); + AccelerationStructure* newAccelerationStructure(NS::UInteger size); + AccelerationStructure* newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor); - MTL::SizeAndAlign heapBufferSizeAndAlign(NS::UInteger length, MTL::ResourceOptions options); + MTL4::Archive* newArchive(const NS::URL* url, NS::Error** error); - class Heap* newHeap(const class HeapDescriptor* descriptor); + ArgumentEncoder* newArgumentEncoder(const NS::Array* arguments); + ArgumentEncoder* newArgumentEncoder(const MTL::BufferBinding* bufferBinding); - class Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options); + MTL4::ArgumentTable* newArgumentTable(const MTL4::ArgumentTableDescriptor* descriptor, NS::Error** error); - class Buffer* newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options); + BinaryArchive* newBinaryArchive(const MTL::BinaryArchiveDescriptor* descriptor, NS::Error** error); - class Buffer* newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options, void (^deallocator)(void*, NS::UInteger)); + Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options); + Buffer* newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options); + Buffer* newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options, void (^deallocator)(void*, NS::UInteger)); + Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options, MTL::SparsePageSize placementSparsePageSize); - class DepthStencilState* newDepthStencilState(const class DepthStencilDescriptor* descriptor); + MTL4::CommandAllocator* newCommandAllocator(); + MTL4::CommandAllocator* newCommandAllocator(const MTL4::CommandAllocatorDescriptor* descriptor, NS::Error** error); - class Texture* newTexture(const class TextureDescriptor* descriptor); + MTL4::CommandBuffer* newCommandBuffer(); - class Texture* newTexture(const class TextureDescriptor* descriptor, const IOSurfaceRef iosurface, NS::UInteger plane); + CommandQueue* newCommandQueue(); + CommandQueue* newCommandQueue(NS::UInteger maxCommandBufferCount); + CommandQueue* newCommandQueue(const MTL::CommandQueueDescriptor* descriptor); - class Texture* newSharedTexture(const class TextureDescriptor* descriptor); + MTL4::Compiler* newCompiler(const MTL4::CompilerDescriptor* descriptor, NS::Error** error); - class Texture* newSharedTexture(const class SharedTextureHandle* sharedHandle); + ComputePipelineState* newComputePipelineState(const MTL::Function* computeFunction, NS::Error** error); + ComputePipelineState* newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error); + void newComputePipelineState(const MTL::Function* computeFunction, const MTL::NewComputePipelineStateCompletionHandler completionHandler); + void newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler); + ComputePipelineState* newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error); + void newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler); + void newComputePipelineState(const MTL::Function* pFunction, const MTL::NewComputePipelineStateCompletionHandlerFunction& completionHandler); + void newComputePipelineState(const MTL::Function* pFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler); + void newComputePipelineState(const MTL::ComputePipelineDescriptor* pDescriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler); - class SamplerState* newSamplerState(const class SamplerDescriptor* descriptor); + MTL4::CounterHeap* newCounterHeap(const MTL4::CounterHeapDescriptor* descriptor, NS::Error** error); - class Library* newDefaultLibrary(); + CounterSampleBuffer* newCounterSampleBuffer(const MTL::CounterSampleBufferDescriptor* descriptor, NS::Error** error); - class Library* newDefaultLibrary(const NS::Bundle* bundle, NS::Error** error); + Library* newDefaultLibrary(); + Library* newDefaultLibrary(const NS::Bundle* bundle, NS::Error** error); - class Library* newLibrary(const NS::String* filepath, NS::Error** error); + DepthStencilState* newDepthStencilState(const MTL::DepthStencilDescriptor* descriptor); - class Library* newLibrary(const NS::URL* url, NS::Error** error); + DynamicLibrary* newDynamicLibrary(const MTL::Library* library, NS::Error** error); + DynamicLibrary* newDynamicLibrary(const NS::URL* url, NS::Error** error); - class Library* newLibrary(const dispatch_data_t data, NS::Error** error); + Event* newEvent(); - class Library* newLibrary(const NS::String* source, const class CompileOptions* options, NS::Error** error); + Fence* newFence(); - void newLibrary(const NS::String* source, const class CompileOptions* options, const MTL::NewLibraryCompletionHandler completionHandler); + Heap* newHeap(const MTL::HeapDescriptor* descriptor); - class Library* newLibrary(const class StitchedLibraryDescriptor* descriptor, NS::Error** error); + IOCommandQueue* newIOCommandQueue(const MTL::IOCommandQueueDescriptor* descriptor, NS::Error** error); - void newLibrary(const class StitchedLibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler); + IOFileHandle* newIOFileHandle(const NS::URL* url, NS::Error** error); + IOFileHandle* newIOFileHandle(const NS::URL* url, MTL::IOCompressionMethod compressionMethod, NS::Error** error); - class RenderPipelineState* newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, NS::Error** error); + IOFileHandle* newIOHandle(const NS::URL* url, NS::Error** error); + IOFileHandle* newIOHandle(const NS::URL* url, MTL::IOCompressionMethod compressionMethod, NS::Error** error); - class RenderPipelineState* newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error); + IndirectCommandBuffer* newIndirectCommandBuffer(const MTL::IndirectCommandBufferDescriptor* descriptor, NS::UInteger maxCount, MTL::ResourceOptions options); - void newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, const MTL::NewRenderPipelineStateCompletionHandler completionHandler); + Library* newLibrary(const NS::String* filepath, NS::Error** error); + Library* newLibrary(const NS::URL* url, NS::Error** error); + Library* newLibrary(const dispatch_data_t data, NS::Error** error); + Library* newLibrary(const NS::String* source, const MTL::CompileOptions* options, NS::Error** error); + void newLibrary(const NS::String* source, const MTL::CompileOptions* options, const MTL::NewLibraryCompletionHandler completionHandler); + Library* newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, NS::Error** error); + void newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler); + void newLibrary(const NS::String* pSource, const MTL::CompileOptions* pOptions, const MTL::NewLibraryCompletionHandlerFunction& completionHandler); + void newLibrary(const MTL::StitchedLibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& completionHandler); - void newRenderPipelineState(const class RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + LogState* newLogState(const MTL::LogStateDescriptor* descriptor, NS::Error** error); - class ComputePipelineState* newComputePipelineState(const class Function* computeFunction, NS::Error** error); + MTL4::CommandQueue* newMTL4CommandQueue(); + MTL4::CommandQueue* newMTL4CommandQueue(const MTL4::CommandQueueDescriptor* descriptor, NS::Error** error); - class ComputePipelineState* newComputePipelineState(const class Function* computeFunction, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error); + MTL4::PipelineDataSetSerializer* newPipelineDataSetSerializer(const MTL4::PipelineDataSetSerializerDescriptor* descriptor); - void newComputePipelineState(const class Function* computeFunction, const MTL::NewComputePipelineStateCompletionHandler completionHandler); + RasterizationRateMap* newRasterizationRateMap(const MTL::RasterizationRateMapDescriptor* descriptor); - void newComputePipelineState(const class Function* computeFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler); + RenderPipelineState* newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error); + RenderPipelineState* newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error); + void newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, const MTL::NewRenderPipelineStateCompletionHandler completionHandler); + void newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + RenderPipelineState* newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error); + void newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + RenderPipelineState* newRenderPipelineState(const MTL::MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error); + void newRenderPipelineState(const MTL::MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + void newRenderPipelineState(const MTL::RenderPipelineDescriptor* pDescriptor, const MTL::NewRenderPipelineStateCompletionHandlerFunction& completionHandler); + void newRenderPipelineState(const MTL::RenderPipelineDescriptor* pDescriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler); + void newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* pDescriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler); - class ComputePipelineState* newComputePipelineState(const class ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error); + ResidencySet* newResidencySet(const MTL::ResidencySetDescriptor* desc, NS::Error** error); - void newComputePipelineState(const class ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler); + SamplerState* newSamplerState(const MTL::SamplerDescriptor* descriptor); - class Fence* newFence(); + SharedEvent* newSharedEvent(); + SharedEvent* newSharedEvent(const MTL::SharedEventHandle* sharedEventHandle); - bool supportsFeatureSet(MTL::FeatureSet featureSet); + Texture* newSharedTexture(const MTL::TextureDescriptor* descriptor); + Texture* newSharedTexture(const MTL::SharedTextureHandle* sharedHandle); - bool supportsFamily(MTL::GPUFamily gpuFamily); + Tensor* newTensor(const MTL::TensorDescriptor* descriptor, NS::Error** error); - bool supportsTextureSampleCount(NS::UInteger sampleCount); + Texture* newTexture(const MTL::TextureDescriptor* descriptor); + Texture* newTexture(const MTL::TextureDescriptor* descriptor, const IOSurfaceRef iosurface, NS::UInteger plane); + TextureViewPool* newTextureViewPool(const MTL::ResourceViewPoolDescriptor* descriptor, NS::Error** error); - NS::UInteger minimumLinearTextureAlignmentForPixelFormat(MTL::PixelFormat format); + uint32_t peerCount() const; - NS::UInteger minimumTextureBufferAlignmentForPixelFormat(MTL::PixelFormat format); + uint64_t peerGroupID() const; - class RenderPipelineState* newRenderPipelineState(const class TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error); + uint32_t peerIndex() const; - void newRenderPipelineState(const class TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + [[deprecated("please use areProgrammableSamplePositionsSupported instead")]] + bool programmableSamplePositionsSupported() const; - class RenderPipelineState* newRenderPipelineState(const class MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error); + uint64_t queryTimestampFrequency(); - void newRenderPipelineState(const class MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + [[deprecated("please use areRasterOrderGroupsSupported instead")]] + bool rasterOrderGroupsSupported() const; - NS::UInteger maxThreadgroupMemoryLength() const; + ReadWriteTextureTier readWriteTextureSupport() const; - NS::UInteger maxArgumentBufferSamplerCount() const; + uint64_t recommendedMaxWorkingSetSize() const; - bool programmableSamplePositionsSupported() const; + uint64_t registryID() const; - void getDefaultSamplePositions(MTL::SamplePosition* positions, NS::UInteger count); + [[deprecated("please use isRemovable instead")]] + bool removable() const; - class ArgumentEncoder* newArgumentEncoder(const NS::Array* arguments); + void sampleTimestamps(MTL::Timestamp* cpuTimestamp, MTL::Timestamp* gpuTimestamp); - bool supportsRasterizationRateMap(NS::UInteger layerCount); + void setShouldMaximizeConcurrentCompilation(bool shouldMaximizeConcurrentCompilation); + bool shouldMaximizeConcurrentCompilation() const; - class RasterizationRateMap* newRasterizationRateMap(const class RasterizationRateMapDescriptor* descriptor); + NS::UInteger sizeOfCounterHeapEntry(MTL4::CounterHeapType type); - class IndirectCommandBuffer* newIndirectCommandBuffer(const class IndirectCommandBufferDescriptor* descriptor, NS::UInteger maxCount, MTL::ResourceOptions options); + Size sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount); + Size sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount, MTL::SparsePageSize sparsePageSize); + NS::UInteger sparseTileSizeInBytes() const; + NS::UInteger sparseTileSizeInBytes(MTL::SparsePageSize sparsePageSize); - class Event* newEvent(); + bool supports32BitFloatFiltering() const; - class SharedEvent* newSharedEvent(); + bool supports32BitMSAA() const; - class SharedEvent* newSharedEvent(const class SharedEventHandle* sharedEventHandle); + bool supportsBCTextureCompression() const; - uint64_t peerGroupID() const; + bool supportsCounterSampling(MTL::CounterSamplingPoint samplingPoint); - uint32_t peerIndex() const; + bool supportsDynamicLibraries() const; - uint32_t peerCount() const; + bool supportsFamily(MTL::GPUFamily gpuFamily); - class IOFileHandle* newIOHandle(const NS::URL* url, NS::Error** error); + bool supportsFeatureSet(MTL::FeatureSet featureSet); - class IOCommandQueue* newIOCommandQueue(const class IOCommandQueueDescriptor* descriptor, NS::Error** error); + bool supportsFunctionPointers() const; + bool supportsFunctionPointersFromRender() const; - class IOFileHandle* newIOHandle(const NS::URL* url, MTL::IOCompressionMethod compressionMethod, NS::Error** error); + bool supportsPrimitiveMotionBlur() const; - MTL::Size sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount); + bool supportsPullModelInterpolation() const; - NS::UInteger sparseTileSizeInBytes() const; + bool supportsQueryTextureLOD() const; - void convertSparsePixelRegions(const MTL::Region* pixelRegions, MTL::Region* tileRegions, MTL::Size tileSize, MTL::SparseTextureRegionAlignmentMode mode, NS::UInteger numRegions); + bool supportsRasterizationRateMap(NS::UInteger layerCount); - void convertSparseTileRegions(const MTL::Region* tileRegions, MTL::Region* pixelRegions, MTL::Size tileSize, NS::UInteger numRegions); + bool supportsRaytracing() const; + bool supportsRaytracingFromRender() const; - NS::UInteger sparseTileSizeInBytes(MTL::SparsePageSize sparsePageSize); + bool supportsRenderDynamicLibraries() const; - MTL::Size sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount, MTL::SparsePageSize sparsePageSize); + bool supportsShaderBarycentricCoordinates() const; - NS::UInteger maxBufferLength() const; + bool supportsTextureSampleCount(NS::UInteger sampleCount); - NS::Array* counterSets() const; + bool supportsVertexAmplificationCount(NS::UInteger count); - class CounterSampleBuffer* newCounterSampleBuffer(const class CounterSampleBufferDescriptor* descriptor, NS::Error** error); - - void sampleTimestamps(MTL::Timestamp* cpuTimestamp, MTL::Timestamp* gpuTimestamp); - - class ArgumentEncoder* newArgumentEncoder(const class BufferBinding* bufferBinding); - - bool supportsCounterSampling(MTL::CounterSamplingPoint samplingPoint); - - bool supportsVertexAmplificationCount(NS::UInteger count); - - bool supportsDynamicLibraries() const; - - bool supportsRenderDynamicLibraries() const; - - class DynamicLibrary* newDynamicLibrary(const class Library* library, NS::Error** error); - - class DynamicLibrary* newDynamicLibrary(const NS::URL* url, NS::Error** error); - - class BinaryArchive* newBinaryArchive(const class BinaryArchiveDescriptor* descriptor, NS::Error** error); - - bool supportsRaytracing() const; - - MTL::AccelerationStructureSizes accelerationStructureSizes(const class AccelerationStructureDescriptor* descriptor); - - class AccelerationStructure* newAccelerationStructure(NS::UInteger size); - - class AccelerationStructure* newAccelerationStructure(const class AccelerationStructureDescriptor* descriptor); - - MTL::SizeAndAlign heapAccelerationStructureSizeAndAlign(NS::UInteger size); - - MTL::SizeAndAlign heapAccelerationStructureSizeAndAlign(const class AccelerationStructureDescriptor* descriptor); - - bool supportsFunctionPointers() const; - - bool supportsFunctionPointersFromRender() const; - - bool supportsRaytracingFromRender() const; - - bool supportsPrimitiveMotionBlur() const; - - bool shouldMaximizeConcurrentCompilation() const; - void setShouldMaximizeConcurrentCompilation(bool shouldMaximizeConcurrentCompilation); - - NS::UInteger maximumConcurrentCompilationTaskCount() const; + SizeAndAlign tensorSizeAndAlign(const MTL::TensorDescriptor* descriptor); }; } -// static method: alloc -_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::alloc() -{ - return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLArgumentDescriptor)); -} - -// method: init -_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: argumentDescriptor -_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::argumentDescriptor() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLArgumentDescriptor), _MTL_PRIVATE_SEL(argumentDescriptor)); -} - -// property: dataType -_MTL_INLINE MTL::DataType MTL::ArgumentDescriptor::dataType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); -} - -_MTL_INLINE void MTL::ArgumentDescriptor::setDataType(MTL::DataType dataType) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDataType_), dataType); -} - -// property: index -_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::index() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(index)); -} - -_MTL_INLINE void MTL::ArgumentDescriptor::setIndex(NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndex_), index); -} - -// property: arrayLength -_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::arrayLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); -} - -_MTL_INLINE void MTL::ArgumentDescriptor::setArrayLength(NS::UInteger arrayLength) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setArrayLength_), arrayLength); -} - -// property: access -_MTL_INLINE MTL::ArgumentAccess MTL::ArgumentDescriptor::access() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); -} - -_MTL_INLINE void MTL::ArgumentDescriptor::setAccess(MTL::ArgumentAccess access) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setAccess_), access); -} - -// property: textureType -_MTL_INLINE MTL::TextureType MTL::ArgumentDescriptor::textureType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); -} - -_MTL_INLINE void MTL::ArgumentDescriptor::setTextureType(MTL::TextureType textureType) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureType_), textureType); -} - -// property: constantBlockAlignment -_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::constantBlockAlignment() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(constantBlockAlignment)); -} - -_MTL_INLINE void MTL::ArgumentDescriptor::setConstantBlockAlignment(NS::UInteger constantBlockAlignment) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantBlockAlignment_), constantBlockAlignment); -} - +#if defined(MTL_PRIVATE_IMPLEMENTATION) +extern "C" MTL::Device* MTLCreateSystemDefaultDevice(); +extern "C" NS::Array* MTLCopyAllDevices(); +extern "C" NS::Array* MTLCopyAllDevicesWithObserver(NS::Object**, MTL::DeviceNotificationHandlerBlock); +extern "C" void MTLRemoveDeviceObserver(const NS::Object*); _MTL_PRIVATE_DEF_WEAK_CONST(MTL::DeviceNotificationName, DeviceWasAddedNotification); _MTL_PRIVATE_DEF_WEAK_CONST(MTL::DeviceNotificationName, DeviceRemovalRequestedNotification); _MTL_PRIVATE_DEF_WEAK_CONST(MTL::DeviceNotificationName, DeviceWasRemovedNotification); _MTL_PRIVATE_DEF_CONST(NS::ErrorUserInfoKey, CommandBufferEncoderInfoErrorKey); - -#if defined(MTL_PRIVATE_IMPLEMENTATION) - -extern "C" MTL::Device* MTLCreateSystemDefaultDevice(); - -extern "C" NS::Array* MTLCopyAllDevices(); - -extern "C" NS::Array* MTLCopyAllDevicesWithObserver(NS::Object**, MTL::DeviceNotificationHandlerBlock); - -extern "C" void MTLRemoveDeviceObserver(const NS::Object*); - -#include - _NS_EXPORT MTL::Device* MTL::CreateSystemDefaultDevice() { return ::MTLCreateSystemDefaultDevice(); @@ -594,34 +595,33 @@ _NS_EXPORT MTL::Device* MTL::CreateSystemDefaultDevice() _NS_EXPORT NS::Array* MTL::CopyAllDevices() { -#if TARGET_OS_OSX +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 180000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) return ::MTLCopyAllDevices(); #else return nullptr; -#endif // TARGET_OS_OSX +#endif } -_NS_EXPORT NS::Array* MTL::CopyAllDevicesWithObserver(NS::Object** pOutObserver, DeviceNotificationHandlerBlock handler) +_NS_EXPORT NS::Array* MTL::CopyAllDevicesWithObserver(NS::Object** pOutObserver, MTL::DeviceNotificationHandlerBlock handler) { #if TARGET_OS_OSX return ::MTLCopyAllDevicesWithObserver(pOutObserver, handler); #else (void)pOutObserver; (void)handler; - return nullptr; #endif // TARGET_OS_OSX } -_NS_EXPORT NS::Array* MTL::CopyAllDevicesWithObserver(NS::Object** pOutObserver, const DeviceNotificationHandlerFunction& handler) +_NS_EXPORT NS::Array* MTL::CopyAllDevicesWithObserver(NS::Object** pOutObserver, const MTL::DeviceNotificationHandlerFunction& handler) { __block DeviceNotificationHandlerFunction function = handler; - return CopyAllDevicesWithObserver(pOutObserver, ^(Device* pDevice, DeviceNotificationName pNotificationName) { function(pDevice, pNotificationName); }); } _NS_EXPORT void MTL::RemoveDeviceObserver(const NS::Object* pObserver) { + (void)pObserver; #if TARGET_OS_OSX ::MTLRemoveDeviceObserver(pObserver); #endif // TARGET_OS_OSX @@ -629,737 +629,732 @@ _NS_EXPORT void MTL::RemoveDeviceObserver(const NS::Object* pObserver) #endif // MTL_PRIVATE_IMPLEMENTATION -_MTL_INLINE void MTL::Device::newLibrary(const NS::String* pSource, const CompileOptions* pOptions, const NewLibraryCompletionHandlerFunction& completionHandler) +_MTL_INLINE MTL::BindingAccess MTL::ArgumentDescriptor::access() const { - __block NewLibraryCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newLibrary(pSource, pOptions, ^(Library* pLibrary, NS::Error* pError) { blockCompletionHandler(pLibrary, pError); }); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(access)); } -_MTL_INLINE void MTL::Device::newLibrary(const class StitchedLibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& completionHandler) +_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::alloc() { - __block NewLibraryCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newLibrary(pDescriptor, ^(Library* pLibrary, NS::Error* pError) { blockCompletionHandler(pLibrary, pError); }); + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLArgumentDescriptor)); } -_MTL_INLINE void MTL::Device::newRenderPipelineState(const RenderPipelineDescriptor* pDescriptor, const NewRenderPipelineStateCompletionHandlerFunction& completionHandler) +_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::argumentDescriptor() { - __block NewRenderPipelineStateCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newRenderPipelineState(pDescriptor, ^(RenderPipelineState* pPipelineState, NS::Error* pError) { blockCompletionHandler(pPipelineState, pError); }); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLArgumentDescriptor), _MTL_PRIVATE_SEL(argumentDescriptor)); } -_MTL_INLINE void MTL::Device::newRenderPipelineState(const RenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::arrayLength() const { - __block NewRenderPipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newRenderPipelineState(pDescriptor, options, ^(RenderPipelineState* pPipelineState, class RenderPipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); } -_MTL_INLINE void MTL::Device::newRenderPipelineState(const TileRenderPipelineDescriptor* pDescriptor, PipelineOption options, const NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::constantBlockAlignment() const { - __block NewRenderPipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newRenderPipelineState(pDescriptor, options, ^(RenderPipelineState* pPipelineState, class RenderPipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(constantBlockAlignment)); } -_MTL_INLINE void MTL::Device::newComputePipelineState(const class Function* pFunction, const NewComputePipelineStateCompletionHandlerFunction& completionHandler) +_MTL_INLINE MTL::DataType MTL::ArgumentDescriptor::dataType() const { - __block NewComputePipelineStateCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newComputePipelineState(pFunction, ^(ComputePipelineState* pPipelineState, NS::Error* pError) { blockCompletionHandler(pPipelineState, pError); }); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); } -_MTL_INLINE void MTL::Device::newComputePipelineState(const Function* pFunction, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +_MTL_INLINE NS::UInteger MTL::ArgumentDescriptor::index() const { - __block NewComputePipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newComputePipelineState(pFunction, options, ^(ComputePipelineState* pPipelineState, ComputePipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(index)); } -_MTL_INLINE void MTL::Device::newComputePipelineState(const ComputePipelineDescriptor* pDescriptor, PipelineOption options, const NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +_MTL_INLINE MTL::ArgumentDescriptor* MTL::ArgumentDescriptor::init() { - __block NewComputePipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; - - newComputePipelineState(pDescriptor, options, ^(ComputePipelineState* pPipelineState, ComputePipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); + return NS::Object::init(); } -_MTL_INLINE bool MTL::Device::isHeadless() const +_MTL_INLINE void MTL::ArgumentDescriptor::setAccess(MTL::BindingAccess access) { - return headless(); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setAccess_), access); } -// property: name -_MTL_INLINE NS::String* MTL::Device::name() const +_MTL_INLINE void MTL::ArgumentDescriptor::setArrayLength(NS::UInteger arrayLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArrayLength_), arrayLength); +} + +_MTL_INLINE void MTL::ArgumentDescriptor::setConstantBlockAlignment(NS::UInteger constantBlockAlignment) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantBlockAlignment_), constantBlockAlignment); +} + +_MTL_INLINE void MTL::ArgumentDescriptor::setDataType(MTL::DataType dataType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDataType_), dataType); +} + +_MTL_INLINE void MTL::ArgumentDescriptor::setIndex(NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndex_), index); +} + +_MTL_INLINE void MTL::ArgumentDescriptor::setTextureType(MTL::TextureType textureType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureType_), textureType); +} + +_MTL_INLINE MTL::TextureType MTL::ArgumentDescriptor::textureType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); +} + +_MTL_INLINE MTL::Architecture* MTL::Architecture::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLArchitecture)); +} + +_MTL_INLINE MTL::Architecture* MTL::Architecture::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL::Architecture::name() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); } -// property: registryID -_MTL_INLINE uint64_t MTL::Device::registryID() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(registryID)); -} - -// property: maxThreadsPerThreadgroup -_MTL_INLINE MTL::Size MTL::Device::maxThreadsPerThreadgroup() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxThreadsPerThreadgroup)); -} - -// property: lowPower -_MTL_INLINE bool MTL::Device::lowPower() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isLowPower)); -} - -// property: headless -_MTL_INLINE bool MTL::Device::headless() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isHeadless)); -} - -// property: removable -_MTL_INLINE bool MTL::Device::removable() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRemovable)); -} - -// property: hasUnifiedMemory -_MTL_INLINE bool MTL::Device::hasUnifiedMemory() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(hasUnifiedMemory)); -} - -// property: recommendedMaxWorkingSetSize -_MTL_INLINE uint64_t MTL::Device::recommendedMaxWorkingSetSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(recommendedMaxWorkingSetSize)); -} - -// property: location -_MTL_INLINE MTL::DeviceLocation MTL::Device::location() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(location)); -} - -// property: locationNumber -_MTL_INLINE NS::UInteger MTL::Device::locationNumber() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(locationNumber)); -} - -// property: maxTransferRate -_MTL_INLINE uint64_t MTL::Device::maxTransferRate() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTransferRate)); -} - -// property: depth24Stencil8PixelFormatSupported -_MTL_INLINE bool MTL::Device::depth24Stencil8PixelFormatSupported() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(isDepth24Stencil8PixelFormatSupported)); -} - -// property: readWriteTextureSupport -_MTL_INLINE MTL::ReadWriteTextureTier MTL::Device::readWriteTextureSupport() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(readWriteTextureSupport)); -} - -// property: argumentBuffersSupport -_MTL_INLINE MTL::ArgumentBuffersTier MTL::Device::argumentBuffersSupport() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(argumentBuffersSupport)); -} - -// property: rasterOrderGroupsSupported -_MTL_INLINE bool MTL::Device::rasterOrderGroupsSupported() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areRasterOrderGroupsSupported)); -} - -// property: supports32BitFloatFiltering -_MTL_INLINE bool MTL::Device::supports32BitFloatFiltering() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supports32BitFloatFiltering)); -} - -// property: supports32BitMSAA -_MTL_INLINE bool MTL::Device::supports32BitMSAA() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supports32BitMSAA)); -} - -// property: supportsQueryTextureLOD -_MTL_INLINE bool MTL::Device::supportsQueryTextureLOD() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsQueryTextureLOD)); -} - -// property: supportsBCTextureCompression -_MTL_INLINE bool MTL::Device::supportsBCTextureCompression() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsBCTextureCompression)); -} - -// property: supportsPullModelInterpolation -_MTL_INLINE bool MTL::Device::supportsPullModelInterpolation() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsPullModelInterpolation)); -} - -// property: barycentricCoordsSupported -_MTL_INLINE bool MTL::Device::barycentricCoordsSupported() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areBarycentricCoordsSupported)); -} - -// property: supportsShaderBarycentricCoordinates -_MTL_INLINE bool MTL::Device::supportsShaderBarycentricCoordinates() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsShaderBarycentricCoordinates)); -} - -// property: currentAllocatedSize -_MTL_INLINE NS::UInteger MTL::Device::currentAllocatedSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(currentAllocatedSize)); -} - -// method: newCommandQueue -_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandQueue)); -} - -// method: newCommandQueueWithMaxCommandBufferCount: -_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue(NS::UInteger maxCommandBufferCount) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandQueueWithMaxCommandBufferCount_), maxCommandBufferCount); -} - -// method: heapTextureSizeAndAlignWithDescriptor: -_MTL_INLINE MTL::SizeAndAlign MTL::Device::heapTextureSizeAndAlign(const MTL::TextureDescriptor* desc) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapTextureSizeAndAlignWithDescriptor_), desc); -} - -// method: heapBufferSizeAndAlignWithLength:options: -_MTL_INLINE MTL::SizeAndAlign MTL::Device::heapBufferSizeAndAlign(NS::UInteger length, MTL::ResourceOptions options) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapBufferSizeAndAlignWithLength_options_), length, options); -} - -// method: newHeapWithDescriptor: -_MTL_INLINE MTL::Heap* MTL::Device::newHeap(const MTL::HeapDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newHeapWithDescriptor_), descriptor); -} - -// method: newBufferWithLength:options: -_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(NS::UInteger length, MTL::ResourceOptions options) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_), length, options); -} - -// method: newBufferWithBytes:length:options: -_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithBytes_length_options_), pointer, length, options); -} - -// method: newBufferWithBytesNoCopy:length:options:deallocator: -_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options, void (^deallocator)(void*, NS::UInteger)) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithBytesNoCopy_length_options_deallocator_), pointer, length, options, deallocator); -} - -// method: newDepthStencilStateWithDescriptor: -_MTL_INLINE MTL::DepthStencilState* MTL::Device::newDepthStencilState(const MTL::DepthStencilDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDepthStencilStateWithDescriptor_), descriptor); -} - -// method: newTextureWithDescriptor: -_MTL_INLINE MTL::Texture* MTL::Device::newTexture(const MTL::TextureDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_), descriptor); -} - -// method: newTextureWithDescriptor:iosurface:plane: -_MTL_INLINE MTL::Texture* MTL::Device::newTexture(const MTL::TextureDescriptor* descriptor, const IOSurfaceRef iosurface, NS::UInteger plane) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_iosurface_plane_), descriptor, iosurface, plane); -} - -// method: newSharedTextureWithDescriptor: -_MTL_INLINE MTL::Texture* MTL::Device::newSharedTexture(const MTL::TextureDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedTextureWithDescriptor_), descriptor); -} - -// method: newSharedTextureWithHandle: -_MTL_INLINE MTL::Texture* MTL::Device::newSharedTexture(const MTL::SharedTextureHandle* sharedHandle) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedTextureWithHandle_), sharedHandle); -} - -// method: newSamplerStateWithDescriptor: -_MTL_INLINE MTL::SamplerState* MTL::Device::newSamplerState(const MTL::SamplerDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSamplerStateWithDescriptor_), descriptor); -} - -// method: newDefaultLibrary -_MTL_INLINE MTL::Library* MTL::Device::newDefaultLibrary() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDefaultLibrary)); -} - -// method: newDefaultLibraryWithBundle:error: -_MTL_INLINE MTL::Library* MTL::Device::newDefaultLibrary(const NS::Bundle* bundle, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDefaultLibraryWithBundle_error_), bundle, error); -} - -// method: newLibraryWithFile:error: -_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::String* filepath, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithFile_error_), filepath, error); -} - -// method: newLibraryWithURL:error: -_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::URL* url, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithURL_error_), url, error); -} - -// method: newLibraryWithData:error: -_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const dispatch_data_t data, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithData_error_), data, error); -} - -// method: newLibraryWithSource:options:error: -_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::String* source, const MTL::CompileOptions* options, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithSource_options_error_), source, options, error); -} - -// method: newLibraryWithSource:options:completionHandler: -_MTL_INLINE void MTL::Device::newLibrary(const NS::String* source, const MTL::CompileOptions* options, const MTL::NewLibraryCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithSource_options_completionHandler_), source, options, completionHandler); -} - -// method: newLibraryWithStitchedDescriptor:error: -_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithStitchedDescriptor_error_), descriptor, error); -} - -// method: newLibraryWithStitchedDescriptor:completionHandler: -_MTL_INLINE void MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithStitchedDescriptor_completionHandler_), descriptor, completionHandler); -} - -// method: newRenderPipelineStateWithDescriptor:error: -_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_error_), descriptor, error); -} - -// method: newRenderPipelineStateWithDescriptor:options:reflection:error: -_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_options_reflection_error_), descriptor, options, reflection, error); -} - -// method: newRenderPipelineStateWithDescriptor:completionHandler: -_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, const MTL::NewRenderPipelineStateCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_completionHandler_), descriptor, completionHandler); -} - -// method: newRenderPipelineStateWithDescriptor:options:completionHandler: -_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_options_completionHandler_), descriptor, options, completionHandler); -} - -// method: newComputePipelineStateWithFunction:error: -_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_error_), computeFunction, error); -} - -// method: newComputePipelineStateWithFunction:options:reflection:error: -_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_options_reflection_error_), computeFunction, options, reflection, error); -} - -// method: newComputePipelineStateWithFunction:completionHandler: -_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, const MTL::NewComputePipelineStateCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_completionHandler_), computeFunction, completionHandler); -} - -// method: newComputePipelineStateWithFunction:options:completionHandler: -_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_options_completionHandler_), computeFunction, options, completionHandler); -} - -// method: newComputePipelineStateWithDescriptor:options:reflection:error: -_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_options_reflection_error_), descriptor, options, reflection, error); -} - -// method: newComputePipelineStateWithDescriptor:options:completionHandler: -_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_options_completionHandler_), descriptor, options, completionHandler); -} - -// method: newFence -_MTL_INLINE MTL::Fence* MTL::Device::newFence() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFence)); -} - -// method: supportsFeatureSet: -_MTL_INLINE bool MTL::Device::supportsFeatureSet(MTL::FeatureSet featureSet) -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFeatureSet_), featureSet); -} - -// method: supportsFamily: -_MTL_INLINE bool MTL::Device::supportsFamily(MTL::GPUFamily gpuFamily) -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFamily_), gpuFamily); -} - -// method: supportsTextureSampleCount: -_MTL_INLINE bool MTL::Device::supportsTextureSampleCount(NS::UInteger sampleCount) -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsTextureSampleCount_), sampleCount); -} - -// method: minimumLinearTextureAlignmentForPixelFormat: -_MTL_INLINE NS::UInteger MTL::Device::minimumLinearTextureAlignmentForPixelFormat(MTL::PixelFormat format) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(minimumLinearTextureAlignmentForPixelFormat_), format); -} - -// method: minimumTextureBufferAlignmentForPixelFormat: -_MTL_INLINE NS::UInteger MTL::Device::minimumTextureBufferAlignmentForPixelFormat(MTL::PixelFormat format) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(minimumTextureBufferAlignmentForPixelFormat_), format); -} - -// method: newRenderPipelineStateWithTileDescriptor:options:reflection:error: -_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithTileDescriptor_options_reflection_error_), descriptor, options, reflection, error); -} - -// method: newRenderPipelineStateWithTileDescriptor:options:completionHandler: -_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithTileDescriptor_options_completionHandler_), descriptor, options, completionHandler); -} - -// method: newRenderPipelineStateWithMeshDescriptor:options:reflection:error: -_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithMeshDescriptor_options_reflection_error_), descriptor, options, reflection, error); -} - -// method: newRenderPipelineStateWithMeshDescriptor:options:completionHandler: -_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithMeshDescriptor_options_completionHandler_), descriptor, options, completionHandler); -} - -// property: maxThreadgroupMemoryLength -_MTL_INLINE NS::UInteger MTL::Device::maxThreadgroupMemoryLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxThreadgroupMemoryLength)); -} - -// property: maxArgumentBufferSamplerCount -_MTL_INLINE NS::UInteger MTL::Device::maxArgumentBufferSamplerCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxArgumentBufferSamplerCount)); -} - -// property: programmableSamplePositionsSupported -_MTL_INLINE bool MTL::Device::programmableSamplePositionsSupported() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areProgrammableSamplePositionsSupported)); -} - -// method: getDefaultSamplePositions:count: -_MTL_INLINE void MTL::Device::getDefaultSamplePositions(MTL::SamplePosition* positions, NS::UInteger count) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(getDefaultSamplePositions_count_), positions, count); -} - -// method: newArgumentEncoderWithArguments: -_MTL_INLINE MTL::ArgumentEncoder* MTL::Device::newArgumentEncoder(const NS::Array* arguments) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithArguments_), arguments); -} - -// method: supportsRasterizationRateMapWithLayerCount: -_MTL_INLINE bool MTL::Device::supportsRasterizationRateMap(NS::UInteger layerCount) -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRasterizationRateMapWithLayerCount_), layerCount); -} - -// method: newRasterizationRateMapWithDescriptor: -_MTL_INLINE MTL::RasterizationRateMap* MTL::Device::newRasterizationRateMap(const MTL::RasterizationRateMapDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRasterizationRateMapWithDescriptor_), descriptor); -} - -// method: newIndirectCommandBufferWithDescriptor:maxCommandCount:options: -_MTL_INLINE MTL::IndirectCommandBuffer* MTL::Device::newIndirectCommandBuffer(const MTL::IndirectCommandBufferDescriptor* descriptor, NS::UInteger maxCount, MTL::ResourceOptions options) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIndirectCommandBufferWithDescriptor_maxCommandCount_options_), descriptor, maxCount, options); -} - -// method: newEvent -_MTL_INLINE MTL::Event* MTL::Device::newEvent() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newEvent)); -} - -// method: newSharedEvent -_MTL_INLINE MTL::SharedEvent* MTL::Device::newSharedEvent() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedEvent)); -} - -// method: newSharedEventWithHandle: -_MTL_INLINE MTL::SharedEvent* MTL::Device::newSharedEvent(const MTL::SharedEventHandle* sharedEventHandle) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedEventWithHandle_), sharedEventHandle); -} - -// property: peerGroupID -_MTL_INLINE uint64_t MTL::Device::peerGroupID() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(peerGroupID)); -} - -// property: peerIndex -_MTL_INLINE uint32_t MTL::Device::peerIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(peerIndex)); -} - -// property: peerCount -_MTL_INLINE uint32_t MTL::Device::peerCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(peerCount)); -} - -// method: newIOHandleWithURL:error: -_MTL_INLINE MTL::IOFileHandle* MTL::Device::newIOHandle(const NS::URL* url, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOHandleWithURL_error_), url, error); -} - -// method: newIOCommandQueueWithDescriptor:error: -_MTL_INLINE MTL::IOCommandQueue* MTL::Device::newIOCommandQueue(const MTL::IOCommandQueueDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOCommandQueueWithDescriptor_error_), descriptor, error); -} - -// method: newIOHandleWithURL:compressionMethod:error: -_MTL_INLINE MTL::IOFileHandle* MTL::Device::newIOHandle(const NS::URL* url, MTL::IOCompressionMethod compressionMethod, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOHandleWithURL_compressionMethod_error_), url, compressionMethod, error); -} - -// method: sparseTileSizeWithTextureType:pixelFormat:sampleCount: -_MTL_INLINE MTL::Size MTL::Device::sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeWithTextureType_pixelFormat_sampleCount_), textureType, pixelFormat, sampleCount); -} - -// property: sparseTileSizeInBytes -_MTL_INLINE NS::UInteger MTL::Device::sparseTileSizeInBytes() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeInBytes)); -} - -// method: convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions: -_MTL_INLINE void MTL::Device::convertSparsePixelRegions(const MTL::Region* pixelRegions, MTL::Region* tileRegions, MTL::Size tileSize, MTL::SparseTextureRegionAlignmentMode mode, NS::UInteger numRegions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(convertSparsePixelRegions_toTileRegions_withTileSize_alignmentMode_numRegions_), pixelRegions, tileRegions, tileSize, mode, numRegions); -} - -// method: convertSparseTileRegions:toPixelRegions:withTileSize:numRegions: -_MTL_INLINE void MTL::Device::convertSparseTileRegions(const MTL::Region* tileRegions, MTL::Region* pixelRegions, MTL::Size tileSize, NS::UInteger numRegions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(convertSparseTileRegions_toPixelRegions_withTileSize_numRegions_), tileRegions, pixelRegions, tileSize, numRegions); -} - -// method: sparseTileSizeInBytesForSparsePageSize: -_MTL_INLINE NS::UInteger MTL::Device::sparseTileSizeInBytes(MTL::SparsePageSize sparsePageSize) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeInBytesForSparsePageSize_), sparsePageSize); -} - -// method: sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize: -_MTL_INLINE MTL::Size MTL::Device::sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount, MTL::SparsePageSize sparsePageSize) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeWithTextureType_pixelFormat_sampleCount_sparsePageSize_), textureType, pixelFormat, sampleCount, sparsePageSize); -} - -// property: maxBufferLength -_MTL_INLINE NS::UInteger MTL::Device::maxBufferLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxBufferLength)); -} - -// property: counterSets -_MTL_INLINE NS::Array* MTL::Device::counterSets() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(counterSets)); -} - -// method: newCounterSampleBufferWithDescriptor:error: -_MTL_INLINE MTL::CounterSampleBuffer* MTL::Device::newCounterSampleBuffer(const MTL::CounterSampleBufferDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCounterSampleBufferWithDescriptor_error_), descriptor, error); -} - -// method: sampleTimestamps:gpuTimestamp: -_MTL_INLINE void MTL::Device::sampleTimestamps(MTL::Timestamp* cpuTimestamp, MTL::Timestamp* gpuTimestamp) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleTimestamps_gpuTimestamp_), cpuTimestamp, gpuTimestamp); -} - -// method: newArgumentEncoderWithBufferBinding: -_MTL_INLINE MTL::ArgumentEncoder* MTL::Device::newArgumentEncoder(const MTL::BufferBinding* bufferBinding) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithBufferBinding_), bufferBinding); -} - -// method: supportsCounterSampling: -_MTL_INLINE bool MTL::Device::supportsCounterSampling(MTL::CounterSamplingPoint samplingPoint) -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsCounterSampling_), samplingPoint); -} - -// method: supportsVertexAmplificationCount: -_MTL_INLINE bool MTL::Device::supportsVertexAmplificationCount(NS::UInteger count) -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsVertexAmplificationCount_), count); -} - -// property: supportsDynamicLibraries -_MTL_INLINE bool MTL::Device::supportsDynamicLibraries() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsDynamicLibraries)); -} - -// property: supportsRenderDynamicLibraries -_MTL_INLINE bool MTL::Device::supportsRenderDynamicLibraries() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRenderDynamicLibraries)); -} - -// method: newDynamicLibrary:error: -_MTL_INLINE MTL::DynamicLibrary* MTL::Device::newDynamicLibrary(const MTL::Library* library, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibrary_error_), library, error); -} - -// method: newDynamicLibraryWithURL:error: -_MTL_INLINE MTL::DynamicLibrary* MTL::Device::newDynamicLibrary(const NS::URL* url, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibraryWithURL_error_), url, error); -} - -// method: newBinaryArchiveWithDescriptor:error: -_MTL_INLINE MTL::BinaryArchive* MTL::Device::newBinaryArchive(const MTL::BinaryArchiveDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBinaryArchiveWithDescriptor_error_), descriptor, error); -} - -// property: supportsRaytracing -_MTL_INLINE bool MTL::Device::supportsRaytracing() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRaytracing)); -} - -// method: accelerationStructureSizesWithDescriptor: _MTL_INLINE MTL::AccelerationStructureSizes MTL::Device::accelerationStructureSizes(const MTL::AccelerationStructureDescriptor* descriptor) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(accelerationStructureSizesWithDescriptor_), descriptor); } -// method: newAccelerationStructureWithSize: -_MTL_INLINE MTL::AccelerationStructure* MTL::Device::newAccelerationStructure(NS::UInteger size) +_MTL_INLINE MTL::Architecture* MTL::Device::architecture() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_), size); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(architecture)); } -// method: newAccelerationStructureWithDescriptor: -_MTL_INLINE MTL::AccelerationStructure* MTL::Device::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor) +_MTL_INLINE bool MTL::Device::areBarycentricCoordsSupported() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_), descriptor); + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areBarycentricCoordsSupported)); +} + +_MTL_INLINE bool MTL::Device::areProgrammableSamplePositionsSupported() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areProgrammableSamplePositionsSupported)); +} + +_MTL_INLINE bool MTL::Device::areRasterOrderGroupsSupported() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areRasterOrderGroupsSupported)); +} + +_MTL_INLINE MTL::ArgumentBuffersTier MTL::Device::argumentBuffersSupport() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(argumentBuffersSupport)); +} + +_MTL_INLINE bool MTL::Device::barycentricCoordsSupported() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areBarycentricCoordsSupported)); +} + +_MTL_INLINE void MTL::Device::convertSparsePixelRegions(const MTL::Region* pixelRegions, MTL::Region* tileRegions, MTL::Size tileSize, MTL::SparseTextureRegionAlignmentMode mode, NS::UInteger numRegions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(convertSparsePixelRegions_toTileRegions_withTileSize_alignmentMode_numRegions_), pixelRegions, tileRegions, tileSize, mode, numRegions); +} + +_MTL_INLINE void MTL::Device::convertSparseTileRegions(const MTL::Region* tileRegions, MTL::Region* pixelRegions, MTL::Size tileSize, NS::UInteger numRegions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(convertSparseTileRegions_toPixelRegions_withTileSize_numRegions_), tileRegions, pixelRegions, tileSize, numRegions); +} + +_MTL_INLINE NS::Array* MTL::Device::counterSets() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(counterSets)); +} + +_MTL_INLINE NS::UInteger MTL::Device::currentAllocatedSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(currentAllocatedSize)); +} + +_MTL_INLINE bool MTL::Device::depth24Stencil8PixelFormatSupported() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(isDepth24Stencil8PixelFormatSupported)); +} + +_MTL_INLINE MTL::FunctionHandle* MTL::Device::functionHandle(const MTL::Function* function) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithFunction_), function); +} + +_MTL_INLINE MTL::FunctionHandle* MTL::Device::functionHandle(const MTL4::BinaryFunction* function) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithBinaryFunction_), function); +} + +_MTL_INLINE void MTL::Device::getDefaultSamplePositions(MTL::SamplePosition* positions, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(getDefaultSamplePositions_count_), positions, count); +} + +_MTL_INLINE bool MTL::Device::hasUnifiedMemory() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(hasUnifiedMemory)); +} + +_MTL_INLINE bool MTL::Device::headless() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isHeadless)); } -// method: heapAccelerationStructureSizeAndAlignWithSize: _MTL_INLINE MTL::SizeAndAlign MTL::Device::heapAccelerationStructureSizeAndAlign(NS::UInteger size) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapAccelerationStructureSizeAndAlignWithSize_), size); } -// method: heapAccelerationStructureSizeAndAlignWithDescriptor: _MTL_INLINE MTL::SizeAndAlign MTL::Device::heapAccelerationStructureSizeAndAlign(const MTL::AccelerationStructureDescriptor* descriptor) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapAccelerationStructureSizeAndAlignWithDescriptor_), descriptor); } -// property: supportsFunctionPointers -_MTL_INLINE bool MTL::Device::supportsFunctionPointers() const +_MTL_INLINE MTL::SizeAndAlign MTL::Device::heapBufferSizeAndAlign(NS::UInteger length, MTL::ResourceOptions options) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFunctionPointers)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapBufferSizeAndAlignWithLength_options_), length, options); } -// property: supportsFunctionPointersFromRender -_MTL_INLINE bool MTL::Device::supportsFunctionPointersFromRender() const +_MTL_INLINE MTL::SizeAndAlign MTL::Device::heapTextureSizeAndAlign(const MTL::TextureDescriptor* desc) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFunctionPointersFromRender)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapTextureSizeAndAlignWithDescriptor_), desc); } -// property: supportsRaytracingFromRender -_MTL_INLINE bool MTL::Device::supportsRaytracingFromRender() const +_MTL_INLINE bool MTL::Device::isDepth24Stencil8PixelFormatSupported() const { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRaytracingFromRender)); + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(isDepth24Stencil8PixelFormatSupported)); } -// property: supportsPrimitiveMotionBlur -_MTL_INLINE bool MTL::Device::supportsPrimitiveMotionBlur() const +_MTL_INLINE bool MTL::Device::isHeadless() const { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsPrimitiveMotionBlur)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isHeadless)); } -// property: shouldMaximizeConcurrentCompilation -_MTL_INLINE bool MTL::Device::shouldMaximizeConcurrentCompilation() const +_MTL_INLINE bool MTL::Device::isLowPower() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(shouldMaximizeConcurrentCompilation)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isLowPower)); +} + +_MTL_INLINE bool MTL::Device::isRemovable() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRemovable)); +} + +_MTL_INLINE MTL::DeviceLocation MTL::Device::location() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(location)); +} + +_MTL_INLINE NS::UInteger MTL::Device::locationNumber() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(locationNumber)); +} + +_MTL_INLINE bool MTL::Device::lowPower() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isLowPower)); +} + +_MTL_INLINE NS::UInteger MTL::Device::maxArgumentBufferSamplerCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxArgumentBufferSamplerCount)); +} + +_MTL_INLINE NS::UInteger MTL::Device::maxBufferLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxBufferLength)); +} + +_MTL_INLINE NS::UInteger MTL::Device::maxThreadgroupMemoryLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxThreadgroupMemoryLength)); +} + +_MTL_INLINE MTL::Size MTL::Device::maxThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxThreadsPerThreadgroup)); +} + +_MTL_INLINE uint64_t MTL::Device::maxTransferRate() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTransferRate)); +} + +_MTL_INLINE NS::UInteger MTL::Device::maximumConcurrentCompilationTaskCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maximumConcurrentCompilationTaskCount)); +} + +_MTL_INLINE NS::UInteger MTL::Device::minimumLinearTextureAlignmentForPixelFormat(MTL::PixelFormat format) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(minimumLinearTextureAlignmentForPixelFormat_), format); +} + +_MTL_INLINE NS::UInteger MTL::Device::minimumTextureBufferAlignmentForPixelFormat(MTL::PixelFormat format) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(minimumTextureBufferAlignmentForPixelFormat_), format); +} + +_MTL_INLINE NS::String* MTL::Device::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE MTL::AccelerationStructure* MTL::Device::newAccelerationStructure(NS::UInteger size) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_), size); +} + +_MTL_INLINE MTL::AccelerationStructure* MTL::Device::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL4::Archive* MTL::Device::newArchive(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArchiveWithURL_error_), url, error); +} + +_MTL_INLINE MTL::ArgumentEncoder* MTL::Device::newArgumentEncoder(const NS::Array* arguments) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithArguments_), arguments); +} + +_MTL_INLINE MTL::ArgumentEncoder* MTL::Device::newArgumentEncoder(const MTL::BufferBinding* bufferBinding) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithBufferBinding_), bufferBinding); +} + +_MTL_INLINE MTL4::ArgumentTable* MTL::Device::newArgumentTable(const MTL4::ArgumentTableDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentTableWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::BinaryArchive* MTL::Device::newBinaryArchive(const MTL::BinaryArchiveDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBinaryArchiveWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(NS::UInteger length, MTL::ResourceOptions options) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_), length, options); +} + +_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithBytes_length_options_), pointer, length, options); +} + +_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(const void* pointer, NS::UInteger length, MTL::ResourceOptions options, void (^deallocator)(void*, NS::UInteger)) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithBytesNoCopy_length_options_deallocator_), pointer, length, options, deallocator); +} + +_MTL_INLINE MTL::Buffer* MTL::Device::newBuffer(NS::UInteger length, MTL::ResourceOptions options, MTL::SparsePageSize placementSparsePageSize) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_placementSparsePageSize_), length, options, placementSparsePageSize); +} + +_MTL_INLINE MTL4::CommandAllocator* MTL::Device::newCommandAllocator() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandAllocator)); +} + +_MTL_INLINE MTL4::CommandAllocator* MTL::Device::newCommandAllocator(const MTL4::CommandAllocatorDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandAllocatorWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL4::CommandBuffer* MTL::Device::newCommandBuffer() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandBuffer)); +} + +_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandQueue)); +} + +_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue(NS::UInteger maxCommandBufferCount) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandQueueWithMaxCommandBufferCount_), maxCommandBufferCount); +} + +_MTL_INLINE MTL::CommandQueue* MTL::Device::newCommandQueue(const MTL::CommandQueueDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCommandQueueWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL4::Compiler* MTL::Device::newCompiler(const MTL4::CompilerDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCompilerWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_error_), computeFunction, error); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_options_reflection_error_), computeFunction, options, reflection, error); +} + +_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, const MTL::NewComputePipelineStateCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_completionHandler_), computeFunction, completionHandler); +} + +_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* computeFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithFunction_options_completionHandler_), computeFunction, options, completionHandler); +} + +_MTL_INLINE MTL::ComputePipelineState* MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedComputePipelineReflection* reflection, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_options_reflection_error_), descriptor, options, reflection, error); +} + +_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newComputePipelineStateWithDescriptor_options_completionHandler_), descriptor, options, completionHandler); +} + +_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* pFunction, const MTL::NewComputePipelineStateCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewComputePipelineStateCompletionHandlerFunction blockCompletionHandler = completionHandler; + newComputePipelineState(pFunction, ^(MTL::ComputePipelineState* pPipelineState, NS::Error* pError) { blockCompletionHandler(pPipelineState, pError); }); +} + +_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::Function* pFunction, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewComputePipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newComputePipelineState(pFunction, options, ^(MTL::ComputePipelineState* pPipelineState, MTL::ComputePipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); +} + +_MTL_INLINE void MTL::Device::newComputePipelineState(const MTL::ComputePipelineDescriptor* pDescriptor, MTL::PipelineOption options, const MTL::NewComputePipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +{ + __block NewComputePipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newComputePipelineState(pDescriptor, options, ^(ComputePipelineState* pPipelineState, ComputePipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); +} + +_MTL_INLINE MTL4::CounterHeap* MTL::Device::newCounterHeap(const MTL4::CounterHeapDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCounterHeapWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::CounterSampleBuffer* MTL::Device::newCounterSampleBuffer(const MTL::CounterSampleBufferDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newCounterSampleBufferWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::Library* MTL::Device::newDefaultLibrary() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDefaultLibrary)); +} + +_MTL_INLINE MTL::Library* MTL::Device::newDefaultLibrary(const NS::Bundle* bundle, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDefaultLibraryWithBundle_error_), bundle, error); +} + +_MTL_INLINE MTL::DepthStencilState* MTL::Device::newDepthStencilState(const MTL::DepthStencilDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDepthStencilStateWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::DynamicLibrary* MTL::Device::newDynamicLibrary(const MTL::Library* library, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibrary_error_), library, error); +} + +_MTL_INLINE MTL::DynamicLibrary* MTL::Device::newDynamicLibrary(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newDynamicLibraryWithURL_error_), url, error); +} + +_MTL_INLINE MTL::Event* MTL::Device::newEvent() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newEvent)); +} + +_MTL_INLINE MTL::Fence* MTL::Device::newFence() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFence)); +} + +_MTL_INLINE MTL::Heap* MTL::Device::newHeap(const MTL::HeapDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newHeapWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::IOCommandQueue* MTL::Device::newIOCommandQueue(const MTL::IOCommandQueueDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOCommandQueueWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::IOFileHandle* MTL::Device::newIOFileHandle(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOFileHandleWithURL_error_), url, error); +} + +_MTL_INLINE MTL::IOFileHandle* MTL::Device::newIOFileHandle(const NS::URL* url, MTL::IOCompressionMethod compressionMethod, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOFileHandleWithURL_compressionMethod_error_), url, compressionMethod, error); +} + +_MTL_INLINE MTL::IOFileHandle* MTL::Device::newIOHandle(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOHandleWithURL_error_), url, error); +} + +_MTL_INLINE MTL::IOFileHandle* MTL::Device::newIOHandle(const NS::URL* url, MTL::IOCompressionMethod compressionMethod, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIOHandleWithURL_compressionMethod_error_), url, compressionMethod, error); +} + +_MTL_INLINE MTL::IndirectCommandBuffer* MTL::Device::newIndirectCommandBuffer(const MTL::IndirectCommandBufferDescriptor* descriptor, NS::UInteger maxCount, MTL::ResourceOptions options) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIndirectCommandBufferWithDescriptor_maxCommandCount_options_), descriptor, maxCount, options); +} + +_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::String* filepath, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithFile_error_), filepath, error); +} + +_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithURL_error_), url, error); +} + +_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const dispatch_data_t data, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithData_error_), data, error); +} + +_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const NS::String* source, const MTL::CompileOptions* options, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithSource_options_error_), source, options, error); +} + +_MTL_INLINE void MTL::Device::newLibrary(const NS::String* source, const MTL::CompileOptions* options, const MTL::NewLibraryCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithSource_options_completionHandler_), source, options, completionHandler); +} + +_MTL_INLINE MTL::Library* MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithStitchedDescriptor_error_), descriptor, error); +} + +_MTL_INLINE void MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* descriptor, const MTL::NewLibraryCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newLibraryWithStitchedDescriptor_completionHandler_), descriptor, completionHandler); +} + +_MTL_INLINE void MTL::Device::newLibrary(const NS::String* pSource, const MTL::CompileOptions* pOptions, const MTL::NewLibraryCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewLibraryCompletionHandlerFunction blockCompletionHandler = completionHandler; + newLibrary(pSource, pOptions, ^(MTL::Library* pLibrary, NS::Error* pError) { blockCompletionHandler(pLibrary, pError); }); +} + +_MTL_INLINE void MTL::Device::newLibrary(const MTL::StitchedLibraryDescriptor* pDescriptor, const MTL::NewLibraryCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewLibraryCompletionHandlerFunction blockCompletionHandler = completionHandler; + newLibrary(pDescriptor, ^(MTL::Library* pLibrary, NS::Error* pError) { blockCompletionHandler(pLibrary, pError); }); +} + +_MTL_INLINE MTL::LogState* MTL::Device::newLogState(const MTL::LogStateDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newLogStateWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL4::CommandQueue* MTL::Device::newMTL4CommandQueue() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newMTL4CommandQueue)); +} + +_MTL_INLINE MTL4::CommandQueue* MTL::Device::newMTL4CommandQueue(const MTL4::CommandQueueDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newMTL4CommandQueueWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL4::PipelineDataSetSerializer* MTL::Device::newPipelineDataSetSerializer(const MTL4::PipelineDataSetSerializerDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newPipelineDataSetSerializerWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::RasterizationRateMap* MTL::Device::newRasterizationRateMap(const MTL::RasterizationRateMapDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRasterizationRateMapWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_options_reflection_error_), descriptor, options, reflection, error); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, const MTL::NewRenderPipelineStateCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_completionHandler_), descriptor, completionHandler); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithDescriptor_options_completionHandler_), descriptor, options, completionHandler); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithTileDescriptor_options_reflection_error_), descriptor, options, reflection, error); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithTileDescriptor_options_completionHandler_), descriptor, options, completionHandler); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL::Device::newRenderPipelineState(const MTL::MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::AutoreleasedRenderPipelineReflection* reflection, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithMeshDescriptor_options_reflection_error_), descriptor, options, reflection, error); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::MeshRenderPipelineDescriptor* descriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandler completionHandler) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithMeshDescriptor_options_completionHandler_), descriptor, options, completionHandler); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* pDescriptor, const MTL::NewRenderPipelineStateCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewRenderPipelineStateCompletionHandlerFunction blockCompletionHandler = completionHandler; + newRenderPipelineState(pDescriptor, ^(MTL::RenderPipelineState* pPipelineState, NS::Error* pError) { blockCompletionHandler(pPipelineState, pError); }); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::RenderPipelineDescriptor* pDescriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewRenderPipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newRenderPipelineState(pDescriptor, options, ^(MTL::RenderPipelineState* pPipelineState, MTL::RenderPipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); +} + +_MTL_INLINE void MTL::Device::newRenderPipelineState(const MTL::TileRenderPipelineDescriptor* pDescriptor, MTL::PipelineOption options, const MTL::NewRenderPipelineStateWithReflectionCompletionHandlerFunction& completionHandler) +{ + __block MTL::NewRenderPipelineStateWithReflectionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newRenderPipelineState(pDescriptor, options, ^(MTL::RenderPipelineState* pPipelineState, MTL::RenderPipelineReflection* pReflection, NS::Error* pError) { blockCompletionHandler(pPipelineState, pReflection, pError); }); +} + +_MTL_INLINE MTL::ResidencySet* MTL::Device::newResidencySet(const MTL::ResidencySetDescriptor* desc, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newResidencySetWithDescriptor_error_), desc, error); +} + +_MTL_INLINE MTL::SamplerState* MTL::Device::newSamplerState(const MTL::SamplerDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSamplerStateWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::SharedEvent* MTL::Device::newSharedEvent() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedEvent)); +} + +_MTL_INLINE MTL::SharedEvent* MTL::Device::newSharedEvent(const MTL::SharedEventHandle* sharedEventHandle) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedEventWithHandle_), sharedEventHandle); +} + +_MTL_INLINE MTL::Texture* MTL::Device::newSharedTexture(const MTL::TextureDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedTextureWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::Texture* MTL::Device::newSharedTexture(const MTL::SharedTextureHandle* sharedHandle) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedTextureWithHandle_), sharedHandle); +} + +_MTL_INLINE MTL::Tensor* MTL::Device::newTensor(const MTL::TensorDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTensorWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE MTL::Texture* MTL::Device::newTexture(const MTL::TextureDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::Texture* MTL::Device::newTexture(const MTL::TextureDescriptor* descriptor, const IOSurfaceRef iosurface, NS::UInteger plane) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_iosurface_plane_), descriptor, iosurface, plane); +} + +_MTL_INLINE MTL::TextureViewPool* MTL::Device::newTextureViewPool(const MTL::ResourceViewPoolDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewPoolWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE uint32_t MTL::Device::peerCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(peerCount)); +} + +_MTL_INLINE uint64_t MTL::Device::peerGroupID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(peerGroupID)); +} + +_MTL_INLINE uint32_t MTL::Device::peerIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(peerIndex)); +} + +_MTL_INLINE bool MTL::Device::programmableSamplePositionsSupported() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areProgrammableSamplePositionsSupported)); +} + +_MTL_INLINE uint64_t MTL::Device::queryTimestampFrequency() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(queryTimestampFrequency)); +} + +_MTL_INLINE bool MTL::Device::rasterOrderGroupsSupported() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(areRasterOrderGroupsSupported)); +} + +_MTL_INLINE MTL::ReadWriteTextureTier MTL::Device::readWriteTextureSupport() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(readWriteTextureSupport)); +} + +_MTL_INLINE uint64_t MTL::Device::recommendedMaxWorkingSetSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(recommendedMaxWorkingSetSize)); +} + +_MTL_INLINE uint64_t MTL::Device::registryID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(registryID)); +} + +_MTL_INLINE bool MTL::Device::removable() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRemovable)); +} + +_MTL_INLINE void MTL::Device::sampleTimestamps(MTL::Timestamp* cpuTimestamp, MTL::Timestamp* gpuTimestamp) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleTimestamps_gpuTimestamp_), cpuTimestamp, gpuTimestamp); } _MTL_INLINE void MTL::Device::setShouldMaximizeConcurrentCompilation(bool shouldMaximizeConcurrentCompilation) @@ -1367,8 +1362,132 @@ _MTL_INLINE void MTL::Device::setShouldMaximizeConcurrentCompilation(bool should Object::sendMessage(this, _MTL_PRIVATE_SEL(setShouldMaximizeConcurrentCompilation_), shouldMaximizeConcurrentCompilation); } -// property: maximumConcurrentCompilationTaskCount -_MTL_INLINE NS::UInteger MTL::Device::maximumConcurrentCompilationTaskCount() const +_MTL_INLINE bool MTL::Device::shouldMaximizeConcurrentCompilation() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maximumConcurrentCompilationTaskCount)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shouldMaximizeConcurrentCompilation)); +} + +_MTL_INLINE NS::UInteger MTL::Device::sizeOfCounterHeapEntry(MTL4::CounterHeapType type) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sizeOfCounterHeapEntry_), type); +} + +_MTL_INLINE MTL::Size MTL::Device::sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeWithTextureType_pixelFormat_sampleCount_), textureType, pixelFormat, sampleCount); +} + +_MTL_INLINE MTL::Size MTL::Device::sparseTileSize(MTL::TextureType textureType, MTL::PixelFormat pixelFormat, NS::UInteger sampleCount, MTL::SparsePageSize sparsePageSize) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeWithTextureType_pixelFormat_sampleCount_sparsePageSize_), textureType, pixelFormat, sampleCount, sparsePageSize); +} + +_MTL_INLINE NS::UInteger MTL::Device::sparseTileSizeInBytes() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeInBytes)); +} + +_MTL_INLINE NS::UInteger MTL::Device::sparseTileSizeInBytes(MTL::SparsePageSize sparsePageSize) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTileSizeInBytesForSparsePageSize_), sparsePageSize); +} + +_MTL_INLINE bool MTL::Device::supports32BitFloatFiltering() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supports32BitFloatFiltering)); +} + +_MTL_INLINE bool MTL::Device::supports32BitMSAA() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supports32BitMSAA)); +} + +_MTL_INLINE bool MTL::Device::supportsBCTextureCompression() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsBCTextureCompression)); +} + +_MTL_INLINE bool MTL::Device::supportsCounterSampling(MTL::CounterSamplingPoint samplingPoint) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsCounterSampling_), samplingPoint); +} + +_MTL_INLINE bool MTL::Device::supportsDynamicLibraries() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsDynamicLibraries)); +} + +_MTL_INLINE bool MTL::Device::supportsFamily(MTL::GPUFamily gpuFamily) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFamily_), gpuFamily); +} + +_MTL_INLINE bool MTL::Device::supportsFeatureSet(MTL::FeatureSet featureSet) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFeatureSet_), featureSet); +} + +_MTL_INLINE bool MTL::Device::supportsFunctionPointers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFunctionPointers)); +} + +_MTL_INLINE bool MTL::Device::supportsFunctionPointersFromRender() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsFunctionPointersFromRender)); +} + +_MTL_INLINE bool MTL::Device::supportsPrimitiveMotionBlur() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsPrimitiveMotionBlur)); +} + +_MTL_INLINE bool MTL::Device::supportsPullModelInterpolation() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsPullModelInterpolation)); +} + +_MTL_INLINE bool MTL::Device::supportsQueryTextureLOD() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsQueryTextureLOD)); +} + +_MTL_INLINE bool MTL::Device::supportsRasterizationRateMap(NS::UInteger layerCount) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRasterizationRateMapWithLayerCount_), layerCount); +} + +_MTL_INLINE bool MTL::Device::supportsRaytracing() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRaytracing)); +} + +_MTL_INLINE bool MTL::Device::supportsRaytracingFromRender() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRaytracingFromRender)); +} + +_MTL_INLINE bool MTL::Device::supportsRenderDynamicLibraries() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsRenderDynamicLibraries)); +} + +_MTL_INLINE bool MTL::Device::supportsShaderBarycentricCoordinates() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsShaderBarycentricCoordinates)); +} + +_MTL_INLINE bool MTL::Device::supportsTextureSampleCount(NS::UInteger sampleCount) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsTextureSampleCount_), sampleCount); +} + +_MTL_INLINE bool MTL::Device::supportsVertexAmplificationCount(NS::UInteger count) +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportsVertexAmplificationCount_), count); +} + +_MTL_INLINE MTL::SizeAndAlign MTL::Device::tensorSizeAndAlign(const MTL::TensorDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tensorSizeAndAlignWithDescriptor_), descriptor); } diff --git a/vendor/metal-cpp/Metal/MTLDrawable.hpp b/vendor/metal-cpp/Metal/MTLDrawable.hpp index 58945d036..fad4feda9 100644 --- a/vendor/metal-cpp/Metal/MTLDrawable.hpp +++ b/vendor/metal-cpp/Metal/MTLDrawable.hpp @@ -2,7 +2,7 @@ // // Metal/MTLDrawable.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,80 +20,71 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include +#include #include #include namespace MTL { -using DrawablePresentedHandler = void (^)(class Drawable*); +class Drawable; -using DrawablePresentedHandlerFunction = std::function; +using DrawablePresentedHandler = void (^)(MTL::Drawable*); +using DrawablePresentedHandlerFunction = std::function; class Drawable : public NS::Referencing { public: + void addPresentedHandler(const MTL::DrawablePresentedHandler block); void addPresentedHandler(const MTL::DrawablePresentedHandlerFunction& function); + NS::UInteger drawableID() const; + void present(); + void presentAfterMinimumDuration(CFTimeInterval duration); void presentAtTime(CFTimeInterval presentationTime); - void presentAfterMinimumDuration(CFTimeInterval duration); - - void addPresentedHandler(const MTL::DrawablePresentedHandler block); - CFTimeInterval presentedTime() const; - - NS::UInteger drawableID() const; }; } - -_MTL_INLINE void MTL::Drawable::addPresentedHandler(const MTL::DrawablePresentedHandlerFunction& function) -{ - __block DrawablePresentedHandlerFunction blockFunction = function; - - addPresentedHandler(^(Drawable* pDrawable) { blockFunction(pDrawable); }); -} - -// method: present -_MTL_INLINE void MTL::Drawable::present() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(present)); -} - -// method: presentAtTime: -_MTL_INLINE void MTL::Drawable::presentAtTime(CFTimeInterval presentationTime) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(presentAtTime_), presentationTime); -} - -// method: presentAfterMinimumDuration: -_MTL_INLINE void MTL::Drawable::presentAfterMinimumDuration(CFTimeInterval duration) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(presentAfterMinimumDuration_), duration); -} - -// method: addPresentedHandler: _MTL_INLINE void MTL::Drawable::addPresentedHandler(const MTL::DrawablePresentedHandler block) { Object::sendMessage(this, _MTL_PRIVATE_SEL(addPresentedHandler_), block); } -// property: presentedTime -_MTL_INLINE CFTimeInterval MTL::Drawable::presentedTime() const +_MTL_INLINE void MTL::Drawable::addPresentedHandler(const MTL::DrawablePresentedHandlerFunction& function) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(presentedTime)); + __block DrawablePresentedHandlerFunction blockFunction = function; + addPresentedHandler(^(Drawable* pDrawable) { blockFunction(pDrawable); }); } -// property: drawableID _MTL_INLINE NS::UInteger MTL::Drawable::drawableID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(drawableID)); } + +_MTL_INLINE void MTL::Drawable::present() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(present)); +} + +_MTL_INLINE void MTL::Drawable::presentAfterMinimumDuration(CFTimeInterval duration) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(presentAfterMinimumDuration_), duration); +} + +_MTL_INLINE void MTL::Drawable::presentAtTime(CFTimeInterval presentationTime) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(presentAtTime_), presentationTime); +} + +_MTL_INLINE CFTimeInterval MTL::Drawable::presentedTime() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(presentedTime)); +} diff --git a/vendor/metal-cpp/Metal/MTLDynamicLibrary.hpp b/vendor/metal-cpp/Metal/MTLDynamicLibrary.hpp index f951d1258..0726acc1b 100644 --- a/vendor/metal-cpp/Metal/MTLDynamicLibrary.hpp +++ b/vendor/metal-cpp/Metal/MTLDynamicLibrary.hpp @@ -2,7 +2,7 @@ // // Metal/MTLDynamicLibrary.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,14 +20,14 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class Device; _MTL_ENUM(NS::UInteger, DynamicLibraryError) { DynamicLibraryErrorNone = 0, DynamicLibraryErrorInvalidFile = 1, @@ -40,43 +40,39 @@ _MTL_ENUM(NS::UInteger, DynamicLibraryError) { class DynamicLibrary : public NS::Referencing { public: - NS::String* label() const; - void setLabel(const NS::String* label); + Device* device() const; - class Device* device() const; + NS::String* installName() const; - NS::String* installName() const; + NS::String* label() const; - bool serializeToURL(const NS::URL* url, NS::Error** error); + bool serializeToURL(const NS::URL* url, NS::Error** error); + + void setLabel(const NS::String* label); }; } +_MTL_INLINE MTL::Device* MTL::DynamicLibrary::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL::DynamicLibrary::installName() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(installName)); +} -// property: label _MTL_INLINE NS::String* MTL::DynamicLibrary::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE bool MTL::DynamicLibrary::serializeToURL(const NS::URL* url, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(serializeToURL_error_), url, error); +} + _MTL_INLINE void MTL::DynamicLibrary::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } - -// property: device -_MTL_INLINE MTL::Device* MTL::DynamicLibrary::device() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); -} - -// property: installName -_MTL_INLINE NS::String* MTL::DynamicLibrary::installName() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(installName)); -} - -// method: serializeToURL:error: -_MTL_INLINE bool MTL::DynamicLibrary::serializeToURL(const NS::URL* url, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(serializeToURL_error_), url, error); -} diff --git a/vendor/metal-cpp/Metal/MTLEvent.hpp b/vendor/metal-cpp/Metal/MTLEvent.hpp index 965fc39e4..d06b96934 100644 --- a/vendor/metal-cpp/Metal/MTLEvent.hpp +++ b/vendor/metal-cpp/Metal/MTLEvent.hpp @@ -2,7 +2,7 @@ // // Metal/MTLEvent.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,69 +20,74 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" +#include +#include -#include - -#include "MTLEvent.hpp" +#include +#include namespace MTL { +class Device; +class SharedEvent; +class SharedEventHandle; +class SharedEventListener; + +using SharedEventNotificationBlock = void (^)(SharedEvent* pEvent, std::uint64_t value); +using SharedEventNotificationFunction = std::function; + class Event : public NS::Referencing { public: - class Device* device() const; + Device* device() const; - NS::String* label() const; - void setLabel(const NS::String* label); + NS::String* label() const; + void setLabel(const NS::String* label); }; - class SharedEventListener : public NS::Referencing { public: - static class SharedEventListener* alloc(); + static SharedEventListener* alloc(); - MTL::SharedEventListener* init(); + dispatch_queue_t dispatchQueue() const; - MTL::SharedEventListener* init(const dispatch_queue_t dispatchQueue); + SharedEventListener* init(); + SharedEventListener* init(const dispatch_queue_t dispatchQueue); - dispatch_queue_t dispatchQueue() const; + static SharedEventListener* sharedListener(); }; - -using SharedEventNotificationBlock = void (^)(SharedEvent* pEvent, std::uint64_t value); - class SharedEvent : public NS::Referencing { public: - void notifyListener(const class SharedEventListener* listener, uint64_t value, const MTL::SharedEventNotificationBlock block); + SharedEventHandle* newSharedEventHandle(); - class SharedEventHandle* newSharedEventHandle(); + void notifyListener(const MTL::SharedEventListener* listener, uint64_t value, const MTL::SharedEventNotificationBlock block); + void notifyListener(const MTL::SharedEventListener* listener, uint64_t value, const MTL::SharedEventNotificationFunction& function); - uint64_t signaledValue() const; - void setSignaledValue(uint64_t signaledValue); + void setSignaledValue(uint64_t signaledValue); + uint64_t signaledValue() const; + bool waitUntilSignaledValue(uint64_t value, uint64_t milliseconds); }; - class SharedEventHandle : public NS::SecureCoding { public: - static class SharedEventHandle* alloc(); + static SharedEventHandle* alloc(); - class SharedEventHandle* init(); + SharedEventHandle* init(); - NS::String* label() const; + NS::String* label() const; }; } - -// property: device _MTL_INLINE MTL::Device* MTL::Event::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: label _MTL_INLINE NS::String* MTL::Event::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); @@ -93,46 +98,45 @@ _MTL_INLINE void MTL::Event::setLabel(const NS::String* label) Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// static method: alloc _MTL_INLINE MTL::SharedEventListener* MTL::SharedEventListener::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLSharedEventListener)); } -// method: init -_MTL_INLINE MTL::SharedEventListener* MTL::SharedEventListener::init() -{ - return NS::Object::init(); -} - -// method: initWithDispatchQueue: -_MTL_INLINE MTL::SharedEventListener* MTL::SharedEventListener::init(const dispatch_queue_t dispatchQueue) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithDispatchQueue_), dispatchQueue); -} - -// property: dispatchQueue _MTL_INLINE dispatch_queue_t MTL::SharedEventListener::dispatchQueue() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchQueue)); } -// method: notifyListener:atValue:block: -_MTL_INLINE void MTL::SharedEvent::notifyListener(const MTL::SharedEventListener* listener, uint64_t value, const MTL::SharedEventNotificationBlock block) +_MTL_INLINE MTL::SharedEventListener* MTL::SharedEventListener::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(notifyListener_atValue_block_), listener, value, block); + return NS::Object::init(); +} + +_MTL_INLINE MTL::SharedEventListener* MTL::SharedEventListener::init(const dispatch_queue_t dispatchQueue) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithDispatchQueue_), dispatchQueue); +} + +_MTL_INLINE MTL::SharedEventListener* MTL::SharedEventListener::sharedListener() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLSharedEventListener), _MTL_PRIVATE_SEL(sharedListener)); } -// method: newSharedEventHandle _MTL_INLINE MTL::SharedEventHandle* MTL::SharedEvent::newSharedEventHandle() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedEventHandle)); } -// property: signaledValue -_MTL_INLINE uint64_t MTL::SharedEvent::signaledValue() const +_MTL_INLINE void MTL::SharedEvent::notifyListener(const MTL::SharedEventListener* listener, uint64_t value, const MTL::SharedEventNotificationBlock block) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(signaledValue)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(notifyListener_atValue_block_), listener, value, block); +} + +_MTL_INLINE void MTL::SharedEvent::notifyListener(const MTL::SharedEventListener* listener, uint64_t value, const MTL::SharedEventNotificationFunction& function) +{ + __block MTL::SharedEventNotificationFunction callback = function; + notifyListener(listener, value, ^void(SharedEvent* pEvent, std::uint64_t innerValue) { callback(pEvent, innerValue); }); } _MTL_INLINE void MTL::SharedEvent::setSignaledValue(uint64_t signaledValue) @@ -140,19 +144,26 @@ _MTL_INLINE void MTL::SharedEvent::setSignaledValue(uint64_t signaledValue) Object::sendMessage(this, _MTL_PRIVATE_SEL(setSignaledValue_), signaledValue); } -// static method: alloc +_MTL_INLINE uint64_t MTL::SharedEvent::signaledValue() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(signaledValue)); +} + +_MTL_INLINE bool MTL::SharedEvent::waitUntilSignaledValue(uint64_t value, uint64_t milliseconds) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilSignaledValue_timeoutMS_), value, milliseconds); +} + _MTL_INLINE MTL::SharedEventHandle* MTL::SharedEventHandle::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLSharedEventHandle)); } -// method: init _MTL_INLINE MTL::SharedEventHandle* MTL::SharedEventHandle::init() { return NS::Object::init(); } -// property: label _MTL_INLINE NS::String* MTL::SharedEventHandle::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); diff --git a/vendor/metal-cpp/Metal/MTLFence.hpp b/vendor/metal-cpp/Metal/MTLFence.hpp index c8ef24ca7..f31df4ce8 100644 --- a/vendor/metal-cpp/Metal/MTLFence.hpp +++ b/vendor/metal-cpp/Metal/MTLFence.hpp @@ -2,7 +2,7 @@ // // Metal/MTLFence.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,32 +20,30 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class Device; + class Fence : public NS::Referencing { public: - class Device* device() const; + Device* device() const; - NS::String* label() const; - void setLabel(const NS::String* label); + NS::String* label() const; + void setLabel(const NS::String* label); }; } - -// property: device _MTL_INLINE MTL::Device* MTL::Fence::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: label _MTL_INLINE NS::String* MTL::Fence::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); diff --git a/vendor/metal-cpp/Metal/MTLFunctionConstantValues.hpp b/vendor/metal-cpp/Metal/MTLFunctionConstantValues.hpp index d23d98fc4..dce89d15f 100644 --- a/vendor/metal-cpp/Metal/MTLFunctionConstantValues.hpp +++ b/vendor/metal-cpp/Metal/MTLFunctionConstantValues.hpp @@ -2,7 +2,7 @@ // // Metal/MTLFunctionConstantValues.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,66 +20,57 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLDataType.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLArgument.hpp" - namespace MTL { +class FunctionConstantValues; + class FunctionConstantValues : public NS::Copying { public: - static class FunctionConstantValues* alloc(); + static FunctionConstantValues* alloc(); - class FunctionConstantValues* init(); + FunctionConstantValues* init(); - void setConstantValue(const void* value, MTL::DataType type, NS::UInteger index); + void reset(); - void setConstantValues(const void* values, MTL::DataType type, NS::Range range); - - void setConstantValue(const void* value, MTL::DataType type, const NS::String* name); - - void reset(); + void setConstantValue(const void* value, MTL::DataType type, NS::UInteger index); + void setConstantValue(const void* value, MTL::DataType type, const NS::String* name); + void setConstantValues(const void* values, MTL::DataType type, NS::Range range); }; } - -// static method: alloc _MTL_INLINE MTL::FunctionConstantValues* MTL::FunctionConstantValues::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionConstantValues)); } -// method: init _MTL_INLINE MTL::FunctionConstantValues* MTL::FunctionConstantValues::init() { return NS::Object::init(); } -// method: setConstantValue:type:atIndex: +_MTL_INLINE void MTL::FunctionConstantValues::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + _MTL_INLINE void MTL::FunctionConstantValues::setConstantValue(const void* value, MTL::DataType type, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValue_type_atIndex_), value, type, index); } -// method: setConstantValues:type:withRange: -_MTL_INLINE void MTL::FunctionConstantValues::setConstantValues(const void* values, MTL::DataType type, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValues_type_withRange_), values, type, range); -} - -// method: setConstantValue:type:withName: _MTL_INLINE void MTL::FunctionConstantValues::setConstantValue(const void* value, MTL::DataType type, const NS::String* name) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValue_type_withName_), value, type, name); } -// method: reset -_MTL_INLINE void MTL::FunctionConstantValues::reset() +_MTL_INLINE void MTL::FunctionConstantValues::setConstantValues(const void* values, MTL::DataType type, NS::Range range) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValues_type_withRange_), values, type, range); } diff --git a/vendor/metal-cpp/Metal/MTLFunctionDescriptor.hpp b/vendor/metal-cpp/Metal/MTLFunctionDescriptor.hpp index 811ee1508..aa296b5ce 100644 --- a/vendor/metal-cpp/Metal/MTLFunctionDescriptor.hpp +++ b/vendor/metal-cpp/Metal/MTLFunctionDescriptor.hpp @@ -2,7 +2,7 @@ // // Metal/MTLFunctionDescriptor.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,136 +20,133 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLFunctionDescriptor.hpp" - namespace MTL { +class FunctionConstantValues; +class FunctionDescriptor; +class IntersectionFunctionDescriptor; + _MTL_OPTIONS(NS::UInteger, FunctionOptions) { FunctionOptionNone = 0, FunctionOptionCompileToBinary = 1, + FunctionOptionStoreFunctionInMetalPipelinesScript = 1 << 1, + FunctionOptionStoreFunctionInMetalScript = 1 << 1, + FunctionOptionFailOnBinaryArchiveMiss = 1 << 2, + FunctionOptionPipelineIndependent = 1 << 3, }; class FunctionDescriptor : public NS::Copying { public: - static class FunctionDescriptor* alloc(); + static FunctionDescriptor* alloc(); - class FunctionDescriptor* init(); + NS::Array* binaryArchives() const; - static class FunctionDescriptor* functionDescriptor(); + FunctionConstantValues* constantValues() const; - NS::String* name() const; - void setName(const NS::String* name); + static FunctionDescriptor* functionDescriptor(); - NS::String* specializedName() const; - void setSpecializedName(const NS::String* specializedName); + FunctionDescriptor* init(); - class FunctionConstantValues* constantValues() const; - void setConstantValues(const class FunctionConstantValues* constantValues); + NS::String* name() const; - MTL::FunctionOptions options() const; - void setOptions(MTL::FunctionOptions options); + FunctionOptions options() const; - NS::Array* binaryArchives() const; - void setBinaryArchives(const NS::Array* binaryArchives); + void setBinaryArchives(const NS::Array* binaryArchives); + + void setConstantValues(const MTL::FunctionConstantValues* constantValues); + + void setName(const NS::String* name); + + void setOptions(MTL::FunctionOptions options); + + void setSpecializedName(const NS::String* specializedName); + NS::String* specializedName() const; }; - -class IntersectionFunctionDescriptor : public NS::Copying +class IntersectionFunctionDescriptor : public NS::Copying { public: - static class IntersectionFunctionDescriptor* alloc(); + static IntersectionFunctionDescriptor* alloc(); - class IntersectionFunctionDescriptor* init(); + IntersectionFunctionDescriptor* init(); }; } - -// static method: alloc _MTL_INLINE MTL::FunctionDescriptor* MTL::FunctionDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionDescriptor)); } -// method: init -_MTL_INLINE MTL::FunctionDescriptor* MTL::FunctionDescriptor::init() +_MTL_INLINE NS::Array* MTL::FunctionDescriptor::binaryArchives() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); } -// static method: functionDescriptor -_MTL_INLINE MTL::FunctionDescriptor* MTL::FunctionDescriptor::functionDescriptor() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLFunctionDescriptor), _MTL_PRIVATE_SEL(functionDescriptor)); -} - -// property: name -_MTL_INLINE NS::String* MTL::FunctionDescriptor::name() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); -} - -_MTL_INLINE void MTL::FunctionDescriptor::setName(const NS::String* name) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); -} - -// property: specializedName -_MTL_INLINE NS::String* MTL::FunctionDescriptor::specializedName() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(specializedName)); -} - -_MTL_INLINE void MTL::FunctionDescriptor::setSpecializedName(const NS::String* specializedName) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSpecializedName_), specializedName); -} - -// property: constantValues _MTL_INLINE MTL::FunctionConstantValues* MTL::FunctionDescriptor::constantValues() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(constantValues)); } -_MTL_INLINE void MTL::FunctionDescriptor::setConstantValues(const MTL::FunctionConstantValues* constantValues) +_MTL_INLINE MTL::FunctionDescriptor* MTL::FunctionDescriptor::functionDescriptor() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValues_), constantValues); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLFunctionDescriptor), _MTL_PRIVATE_SEL(functionDescriptor)); +} + +_MTL_INLINE MTL::FunctionDescriptor* MTL::FunctionDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL::FunctionDescriptor::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); } -// property: options _MTL_INLINE MTL::FunctionOptions MTL::FunctionDescriptor::options() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); } -_MTL_INLINE void MTL::FunctionDescriptor::setOptions(MTL::FunctionOptions options) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptions_), options); -} - -// property: binaryArchives -_MTL_INLINE NS::Array* MTL::FunctionDescriptor::binaryArchives() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); -} - _MTL_INLINE void MTL::FunctionDescriptor::setBinaryArchives(const NS::Array* binaryArchives) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryArchives_), binaryArchives); } -// static method: alloc +_MTL_INLINE void MTL::FunctionDescriptor::setConstantValues(const MTL::FunctionConstantValues* constantValues) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setConstantValues_), constantValues); +} + +_MTL_INLINE void MTL::FunctionDescriptor::setName(const NS::String* name) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); +} + +_MTL_INLINE void MTL::FunctionDescriptor::setOptions(MTL::FunctionOptions options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptions_), options); +} + +_MTL_INLINE void MTL::FunctionDescriptor::setSpecializedName(const NS::String* specializedName) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSpecializedName_), specializedName); +} + +_MTL_INLINE NS::String* MTL::FunctionDescriptor::specializedName() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(specializedName)); +} + _MTL_INLINE MTL::IntersectionFunctionDescriptor* MTL::IntersectionFunctionDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLIntersectionFunctionDescriptor)); } -// method: init _MTL_INLINE MTL::IntersectionFunctionDescriptor* MTL::IntersectionFunctionDescriptor::init() { return NS::Object::init(); diff --git a/vendor/metal-cpp/Metal/MTLFunctionHandle.hpp b/vendor/metal-cpp/Metal/MTLFunctionHandle.hpp index 30f71f2e5..7a3ff95d6 100644 --- a/vendor/metal-cpp/Metal/MTLFunctionHandle.hpp +++ b/vendor/metal-cpp/Metal/MTLFunctionHandle.hpp @@ -2,7 +2,7 @@ // // Metal/MTLFunctionHandle.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,42 +20,46 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" -#include "MTLPrivate.hpp" - -#include - #include "MTLLibrary.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" namespace MTL { +class Device; + class FunctionHandle : public NS::Referencing { public: - MTL::FunctionType functionType() const; + Device* device() const; - NS::String* name() const; + FunctionType functionType() const; - class Device* device() const; + ResourceID gpuResourceID() const; + + NS::String* name() const; }; } +_MTL_INLINE MTL::Device* MTL::FunctionHandle::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} -// property: functionType _MTL_INLINE MTL::FunctionType MTL::FunctionHandle::functionType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionType)); } -// property: name +_MTL_INLINE MTL::ResourceID MTL::FunctionHandle::gpuResourceID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); +} + _MTL_INLINE NS::String* MTL::FunctionHandle::name() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); } - -// property: device -_MTL_INLINE MTL::Device* MTL::FunctionHandle::device() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); -} diff --git a/vendor/metal-cpp/Metal/MTLFunctionLog.hpp b/vendor/metal-cpp/Metal/MTLFunctionLog.hpp index 2a8995256..454e60585 100644 --- a/vendor/metal-cpp/Metal/MTLFunctionLog.hpp +++ b/vendor/metal-cpp/Metal/MTLFunctionLog.hpp @@ -2,7 +2,7 @@ // // Metal/MTLFunctionLog.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,95 +20,82 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLFunctionLog.hpp" - namespace MTL { +class Function; +class FunctionLogDebugLocation; _MTL_ENUM(NS::UInteger, FunctionLogType) { FunctionLogTypeValidation = 0, }; class LogContainer : public NS::Referencing { -public: }; - class FunctionLogDebugLocation : public NS::Referencing { public: - NS::String* functionName() const; - NS::URL* URL() const; - NS::UInteger line() const; - NS::UInteger column() const; -}; + NS::String* functionName() const; + + NS::UInteger line() const; +}; class FunctionLog : public NS::Referencing { public: - MTL::FunctionLogType type() const; + FunctionLogDebugLocation* debugLocation() const; - NS::String* encoderLabel() const; + NS::String* encoderLabel() const; - class Function* function() const; + Function* function() const; - class FunctionLogDebugLocation* debugLocation() const; + FunctionLogType type() const; }; } - -// property: functionName -_MTL_INLINE NS::String* MTL::FunctionLogDebugLocation::functionName() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionName)); -} - -// property: URL _MTL_INLINE NS::URL* MTL::FunctionLogDebugLocation::URL() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(URL)); } -// property: line -_MTL_INLINE NS::UInteger MTL::FunctionLogDebugLocation::line() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(line)); -} - -// property: column _MTL_INLINE NS::UInteger MTL::FunctionLogDebugLocation::column() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(column)); } -// property: type -_MTL_INLINE MTL::FunctionLogType MTL::FunctionLog::type() const +_MTL_INLINE NS::String* MTL::FunctionLogDebugLocation::functionName() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionName)); +} + +_MTL_INLINE NS::UInteger MTL::FunctionLogDebugLocation::line() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(line)); +} + +_MTL_INLINE MTL::FunctionLogDebugLocation* MTL::FunctionLog::debugLocation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(debugLocation)); } -// property: encoderLabel _MTL_INLINE NS::String* MTL::FunctionLog::encoderLabel() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(encoderLabel)); } -// property: function _MTL_INLINE MTL::Function* MTL::FunctionLog::function() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(function)); } -// property: debugLocation -_MTL_INLINE MTL::FunctionLogDebugLocation* MTL::FunctionLog::debugLocation() const +_MTL_INLINE MTL::FunctionLogType MTL::FunctionLog::type() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(debugLocation)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); } diff --git a/vendor/metal-cpp/Metal/MTLFunctionStitching.hpp b/vendor/metal-cpp/Metal/MTLFunctionStitching.hpp index 266afbd60..8dd5fd290 100644 --- a/vendor/metal-cpp/Metal/MTLFunctionStitching.hpp +++ b/vendor/metal-cpp/Metal/MTLFunctionStitching.hpp @@ -2,7 +2,7 @@ // // Metal/MTLFunctionStitching.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,130 +20,147 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLFunctionStitching.hpp" - namespace MTL { +class FunctionStitchingAttributeAlwaysInline; +class FunctionStitchingFunctionNode; +class FunctionStitchingGraph; +class FunctionStitchingInputNode; +class StitchedLibraryDescriptor; + +_MTL_OPTIONS(NS::UInteger, StitchedLibraryOptions) { + StitchedLibraryOptionNone = 0, + StitchedLibraryOptionFailOnBinaryArchiveMiss = 1, + StitchedLibraryOptionStoreLibraryInMetalPipelinesScript = 1 << 1, +}; + class FunctionStitchingAttribute : public NS::Referencing { }; - class FunctionStitchingAttributeAlwaysInline : public NS::Referencing { public: - static class FunctionStitchingAttributeAlwaysInline* alloc(); + static FunctionStitchingAttributeAlwaysInline* alloc(); - class FunctionStitchingAttributeAlwaysInline* init(); + FunctionStitchingAttributeAlwaysInline* init(); }; - class FunctionStitchingNode : public NS::Copying { }; - class FunctionStitchingInputNode : public NS::Referencing { public: - static class FunctionStitchingInputNode* alloc(); + static FunctionStitchingInputNode* alloc(); - class FunctionStitchingInputNode* init(); + NS::UInteger argumentIndex() const; - NS::UInteger argumentIndex() const; - void setArgumentIndex(NS::UInteger argumentIndex); + FunctionStitchingInputNode* init(); + FunctionStitchingInputNode* init(NS::UInteger argument); - MTL::FunctionStitchingInputNode* init(NS::UInteger argument); + void setArgumentIndex(NS::UInteger argumentIndex); }; - class FunctionStitchingFunctionNode : public NS::Referencing { public: - static class FunctionStitchingFunctionNode* alloc(); + static FunctionStitchingFunctionNode* alloc(); - class FunctionStitchingFunctionNode* init(); + NS::Array* arguments() const; - NS::String* name() const; - void setName(const NS::String* name); + NS::Array* controlDependencies() const; - NS::Array* arguments() const; - void setArguments(const NS::Array* arguments); + FunctionStitchingFunctionNode* init(); + FunctionStitchingFunctionNode* init(const NS::String* name, const NS::Array* arguments, const NS::Array* controlDependencies); - NS::Array* controlDependencies() const; - void setControlDependencies(const NS::Array* controlDependencies); + NS::String* name() const; - MTL::FunctionStitchingFunctionNode* init(const NS::String* name, const NS::Array* arguments, const NS::Array* controlDependencies); + void setArguments(const NS::Array* arguments); + + void setControlDependencies(const NS::Array* controlDependencies); + + void setName(const NS::String* name); }; - class FunctionStitchingGraph : public NS::Copying { public: - static class FunctionStitchingGraph* alloc(); + static FunctionStitchingGraph* alloc(); - class FunctionStitchingGraph* init(); + NS::Array* attributes() const; - NS::String* functionName() const; - void setFunctionName(const NS::String* functionName); + NS::String* functionName() const; - NS::Array* nodes() const; - void setNodes(const NS::Array* nodes); + FunctionStitchingGraph* init(); + FunctionStitchingGraph* init(const NS::String* functionName, const NS::Array* nodes, const MTL::FunctionStitchingFunctionNode* outputNode, const NS::Array* attributes); - class FunctionStitchingFunctionNode* outputNode() const; - void setOutputNode(const class FunctionStitchingFunctionNode* outputNode); + NS::Array* nodes() const; - NS::Array* attributes() const; - void setAttributes(const NS::Array* attributes); + FunctionStitchingFunctionNode* outputNode() const; - MTL::FunctionStitchingGraph* init(const NS::String* functionName, const NS::Array* nodes, const class FunctionStitchingFunctionNode* outputNode, const NS::Array* attributes); + void setAttributes(const NS::Array* attributes); + + void setFunctionName(const NS::String* functionName); + + void setNodes(const NS::Array* nodes); + + void setOutputNode(const MTL::FunctionStitchingFunctionNode* outputNode); }; - class StitchedLibraryDescriptor : public NS::Copying { public: - static class StitchedLibraryDescriptor* alloc(); + static StitchedLibraryDescriptor* alloc(); - class StitchedLibraryDescriptor* init(); + NS::Array* binaryArchives() const; - NS::Array* functionGraphs() const; - void setFunctionGraphs(const NS::Array* functionGraphs); + NS::Array* functionGraphs() const; - NS::Array* functions() const; - void setFunctions(const NS::Array* functions); + NS::Array* functions() const; + + StitchedLibraryDescriptor* init(); + + StitchedLibraryOptions options() const; + + void setBinaryArchives(const NS::Array* binaryArchives); + + void setFunctionGraphs(const NS::Array* functionGraphs); + + void setFunctions(const NS::Array* functions); + + void setOptions(MTL::StitchedLibraryOptions options); }; } - -// static method: alloc _MTL_INLINE MTL::FunctionStitchingAttributeAlwaysInline* MTL::FunctionStitchingAttributeAlwaysInline::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionStitchingAttributeAlwaysInline)); } -// method: init _MTL_INLINE MTL::FunctionStitchingAttributeAlwaysInline* MTL::FunctionStitchingAttributeAlwaysInline::init() { return NS::Object::init(); } -// static method: alloc _MTL_INLINE MTL::FunctionStitchingInputNode* MTL::FunctionStitchingInputNode::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionStitchingInputNode)); } -// method: init +_MTL_INLINE NS::UInteger MTL::FunctionStitchingInputNode::argumentIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(argumentIndex)); +} + _MTL_INLINE MTL::FunctionStitchingInputNode* MTL::FunctionStitchingInputNode::init() { return NS::Object::init(); } -// property: argumentIndex -_MTL_INLINE NS::UInteger MTL::FunctionStitchingInputNode::argumentIndex() const +_MTL_INLINE MTL::FunctionStitchingInputNode* MTL::FunctionStitchingInputNode::init(NS::UInteger argument) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(argumentIndex)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithArgumentIndex_), argument); } _MTL_INLINE void MTL::FunctionStitchingInputNode::setArgumentIndex(NS::UInteger argumentIndex) @@ -151,141 +168,139 @@ _MTL_INLINE void MTL::FunctionStitchingInputNode::setArgumentIndex(NS::UInteger Object::sendMessage(this, _MTL_PRIVATE_SEL(setArgumentIndex_), argumentIndex); } -// method: initWithArgumentIndex: -_MTL_INLINE MTL::FunctionStitchingInputNode* MTL::FunctionStitchingInputNode::init(NS::UInteger argument) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithArgumentIndex_), argument); -} - -// static method: alloc _MTL_INLINE MTL::FunctionStitchingFunctionNode* MTL::FunctionStitchingFunctionNode::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionStitchingFunctionNode)); } -// method: init +_MTL_INLINE NS::Array* MTL::FunctionStitchingFunctionNode::arguments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(arguments)); +} + +_MTL_INLINE NS::Array* MTL::FunctionStitchingFunctionNode::controlDependencies() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlDependencies)); +} + _MTL_INLINE MTL::FunctionStitchingFunctionNode* MTL::FunctionStitchingFunctionNode::init() { return NS::Object::init(); } -// property: name +_MTL_INLINE MTL::FunctionStitchingFunctionNode* MTL::FunctionStitchingFunctionNode::init(const NS::String* name, const NS::Array* arguments, const NS::Array* controlDependencies) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithName_arguments_controlDependencies_), name, arguments, controlDependencies); +} + _MTL_INLINE NS::String* MTL::FunctionStitchingFunctionNode::name() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); } -_MTL_INLINE void MTL::FunctionStitchingFunctionNode::setName(const NS::String* name) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); -} - -// property: arguments -_MTL_INLINE NS::Array* MTL::FunctionStitchingFunctionNode::arguments() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(arguments)); -} - _MTL_INLINE void MTL::FunctionStitchingFunctionNode::setArguments(const NS::Array* arguments) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setArguments_), arguments); } -// property: controlDependencies -_MTL_INLINE NS::Array* MTL::FunctionStitchingFunctionNode::controlDependencies() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(controlDependencies)); -} - _MTL_INLINE void MTL::FunctionStitchingFunctionNode::setControlDependencies(const NS::Array* controlDependencies) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setControlDependencies_), controlDependencies); } -// method: initWithName:arguments:controlDependencies: -_MTL_INLINE MTL::FunctionStitchingFunctionNode* MTL::FunctionStitchingFunctionNode::init(const NS::String* name, const NS::Array* arguments, const NS::Array* controlDependencies) +_MTL_INLINE void MTL::FunctionStitchingFunctionNode::setName(const NS::String* name) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithName_arguments_controlDependencies_), name, arguments, controlDependencies); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setName_), name); } -// static method: alloc _MTL_INLINE MTL::FunctionStitchingGraph* MTL::FunctionStitchingGraph::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionStitchingGraph)); } -// method: init -_MTL_INLINE MTL::FunctionStitchingGraph* MTL::FunctionStitchingGraph::init() +_MTL_INLINE NS::Array* MTL::FunctionStitchingGraph::attributes() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributes)); } -// property: functionName _MTL_INLINE NS::String* MTL::FunctionStitchingGraph::functionName() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionName)); } -_MTL_INLINE void MTL::FunctionStitchingGraph::setFunctionName(const NS::String* functionName) +_MTL_INLINE MTL::FunctionStitchingGraph* MTL::FunctionStitchingGraph::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionName_), functionName); + return NS::Object::init(); +} + +_MTL_INLINE MTL::FunctionStitchingGraph* MTL::FunctionStitchingGraph::init(const NS::String* functionName, const NS::Array* nodes, const MTL::FunctionStitchingFunctionNode* outputNode, const NS::Array* attributes) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithFunctionName_nodes_outputNode_attributes_), functionName, nodes, outputNode, attributes); } -// property: nodes _MTL_INLINE NS::Array* MTL::FunctionStitchingGraph::nodes() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(nodes)); } -_MTL_INLINE void MTL::FunctionStitchingGraph::setNodes(const NS::Array* nodes) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setNodes_), nodes); -} - -// property: outputNode _MTL_INLINE MTL::FunctionStitchingFunctionNode* MTL::FunctionStitchingGraph::outputNode() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(outputNode)); } -_MTL_INLINE void MTL::FunctionStitchingGraph::setOutputNode(const MTL::FunctionStitchingFunctionNode* outputNode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setOutputNode_), outputNode); -} - -// property: attributes -_MTL_INLINE NS::Array* MTL::FunctionStitchingGraph::attributes() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributes)); -} - _MTL_INLINE void MTL::FunctionStitchingGraph::setAttributes(const NS::Array* attributes) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setAttributes_), attributes); } -// method: initWithFunctionName:nodes:outputNode:attributes: -_MTL_INLINE MTL::FunctionStitchingGraph* MTL::FunctionStitchingGraph::init(const NS::String* functionName, const NS::Array* nodes, const MTL::FunctionStitchingFunctionNode* outputNode, const NS::Array* attributes) +_MTL_INLINE void MTL::FunctionStitchingGraph::setFunctionName(const NS::String* functionName) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithFunctionName_nodes_outputNode_attributes_), functionName, nodes, outputNode, attributes); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionName_), functionName); +} + +_MTL_INLINE void MTL::FunctionStitchingGraph::setNodes(const NS::Array* nodes) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setNodes_), nodes); +} + +_MTL_INLINE void MTL::FunctionStitchingGraph::setOutputNode(const MTL::FunctionStitchingFunctionNode* outputNode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOutputNode_), outputNode); } -// static method: alloc _MTL_INLINE MTL::StitchedLibraryDescriptor* MTL::StitchedLibraryDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLStitchedLibraryDescriptor)); } -// method: init +_MTL_INLINE NS::Array* MTL::StitchedLibraryDescriptor::binaryArchives() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); +} + +_MTL_INLINE NS::Array* MTL::StitchedLibraryDescriptor::functionGraphs() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionGraphs)); +} + +_MTL_INLINE NS::Array* MTL::StitchedLibraryDescriptor::functions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functions)); +} + _MTL_INLINE MTL::StitchedLibraryDescriptor* MTL::StitchedLibraryDescriptor::init() { return NS::Object::init(); } -// property: functionGraphs -_MTL_INLINE NS::Array* MTL::StitchedLibraryDescriptor::functionGraphs() const +_MTL_INLINE MTL::StitchedLibraryOptions MTL::StitchedLibraryDescriptor::options() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionGraphs)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); +} + +_MTL_INLINE void MTL::StitchedLibraryDescriptor::setBinaryArchives(const NS::Array* binaryArchives) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryArchives_), binaryArchives); } _MTL_INLINE void MTL::StitchedLibraryDescriptor::setFunctionGraphs(const NS::Array* functionGraphs) @@ -293,13 +308,12 @@ _MTL_INLINE void MTL::StitchedLibraryDescriptor::setFunctionGraphs(const NS::Arr Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionGraphs_), functionGraphs); } -// property: functions -_MTL_INLINE NS::Array* MTL::StitchedLibraryDescriptor::functions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functions)); -} - _MTL_INLINE void MTL::StitchedLibraryDescriptor::setFunctions(const NS::Array* functions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctions_), functions); } + +_MTL_INLINE void MTL::StitchedLibraryDescriptor::setOptions(MTL::StitchedLibraryOptions options) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptions_), options); +} diff --git a/vendor/metal-cpp/Metal/MTLGPUAddress.hpp b/vendor/metal-cpp/Metal/MTLGPUAddress.hpp new file mode 100644 index 000000000..fb9d61d57 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLGPUAddress.hpp @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLGPUAddress.hpp +// +// Copyright 2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#ifdef __METAL_VERSION__ + +#include + +#else + +#include + +#endif // __METAL_VERSION__ + +namespace MTL +{ + using GPUAddress = uint64_t; +} diff --git a/vendor/metal-cpp/Metal/MTLHeaderBridge.hpp b/vendor/metal-cpp/Metal/MTLHeaderBridge.hpp index ac2866fc3..6a3a14223 100644 --- a/vendor/metal-cpp/Metal/MTLHeaderBridge.hpp +++ b/vendor/metal-cpp/Metal/MTLHeaderBridge.hpp @@ -2,7 +2,7 @@ // // Metal/MTLHeaderBridge.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,15 +24,59 @@ namespace MTL::Private::Class { +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureBoundingBoxGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureCurveGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureMotionCurveGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureMotionTriangleGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4AccelerationStructureTriangleGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4ArgumentTableDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4BinaryFunctionDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4CommandAllocatorDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4CommandBufferOptions); +_MTL_PRIVATE_DEF_CLS(MTL4CommandQueueDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4CommitOptions); +_MTL_PRIVATE_DEF_CLS(MTL4CompilerDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4CompilerTaskOptions); +_MTL_PRIVATE_DEF_CLS(MTL4ComputePipelineDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4CounterHeapDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4FunctionDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4IndirectInstanceAccelerationStructureDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4InstanceAccelerationStructureDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4LibraryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4LibraryFunctionDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4MachineLearningPipelineDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4MachineLearningPipelineReflection); +_MTL_PRIVATE_DEF_CLS(MTL4MeshRenderPipelineDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4PipelineDataSetSerializerDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4PipelineDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4PipelineOptions); +_MTL_PRIVATE_DEF_CLS(MTL4PipelineStageDynamicLinkingDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4PrimitiveAccelerationStructureDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4RenderPassDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4RenderPipelineBinaryFunctionsDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4RenderPipelineColorAttachmentDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4RenderPipelineColorAttachmentDescriptorArray); +_MTL_PRIVATE_DEF_CLS(MTL4RenderPipelineDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4RenderPipelineDynamicLinkingDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4SpecializedFunctionDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4StaticLinkingDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4StitchedFunctionDescriptor); +_MTL_PRIVATE_DEF_CLS(MTL4TileRenderPipelineDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureBoundingBoxGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureCurveGeometryDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureGeometryDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureMotionCurveGeometryDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureMotionTriangleGeometryDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructurePassDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructurePassSampleBufferAttachmentDescriptor); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray); _MTL_PRIVATE_DEF_CLS(MTLAccelerationStructureTriangleGeometryDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLArchitecture); _MTL_PRIVATE_DEF_CLS(MTLArgument); _MTL_PRIVATE_DEF_CLS(MTLArgumentDescriptor); _MTL_PRIVATE_DEF_CLS(MTLArrayType); @@ -48,6 +92,7 @@ _MTL_PRIVATE_DEF_CLS(MTLBufferLayoutDescriptorArray); _MTL_PRIVATE_DEF_CLS(MTLCaptureDescriptor); _MTL_PRIVATE_DEF_CLS(MTLCaptureManager); _MTL_PRIVATE_DEF_CLS(MTLCommandBufferDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLCommandQueueDescriptor); _MTL_PRIVATE_DEF_CLS(MTLCompileOptions); _MTL_PRIVATE_DEF_CLS(MTLComputePassDescriptor); _MTL_PRIVATE_DEF_CLS(MTLComputePassSampleBufferAttachmentDescriptor); @@ -59,6 +104,7 @@ _MTL_PRIVATE_DEF_CLS(MTLDepthStencilDescriptor); _MTL_PRIVATE_DEF_CLS(MTLFunctionConstant); _MTL_PRIVATE_DEF_CLS(MTLFunctionConstantValues); _MTL_PRIVATE_DEF_CLS(MTLFunctionDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLFunctionReflection); _MTL_PRIVATE_DEF_CLS(MTLFunctionStitchingAttributeAlwaysInline); _MTL_PRIVATE_DEF_CLS(MTLFunctionStitchingFunctionNode); _MTL_PRIVATE_DEF_CLS(MTLFunctionStitchingGraph); @@ -66,10 +112,13 @@ _MTL_PRIVATE_DEF_CLS(MTLFunctionStitchingInputNode); _MTL_PRIVATE_DEF_CLS(MTLHeapDescriptor); _MTL_PRIVATE_DEF_CLS(MTLIOCommandQueueDescriptor); _MTL_PRIVATE_DEF_CLS(MTLIndirectCommandBufferDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLIndirectInstanceAccelerationStructureDescriptor); _MTL_PRIVATE_DEF_CLS(MTLInstanceAccelerationStructureDescriptor); _MTL_PRIVATE_DEF_CLS(MTLIntersectionFunctionDescriptor); _MTL_PRIVATE_DEF_CLS(MTLIntersectionFunctionTableDescriptor); _MTL_PRIVATE_DEF_CLS(MTLLinkedFunctions); +_MTL_PRIVATE_DEF_CLS(MTLLogStateDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLLogicalToPhysicalColorAttachmentMap); _MTL_PRIVATE_DEF_CLS(MTLMeshRenderPipelineDescriptor); _MTL_PRIVATE_DEF_CLS(MTLMotionKeyframeData); _MTL_PRIVATE_DEF_CLS(MTLPipelineBufferDescriptor); @@ -93,9 +142,11 @@ _MTL_PRIVATE_DEF_CLS(MTLRenderPipelineColorAttachmentDescriptorArray); _MTL_PRIVATE_DEF_CLS(MTLRenderPipelineDescriptor); _MTL_PRIVATE_DEF_CLS(MTLRenderPipelineFunctionsDescriptor); _MTL_PRIVATE_DEF_CLS(MTLRenderPipelineReflection); +_MTL_PRIVATE_DEF_CLS(MTLResidencySetDescriptor); _MTL_PRIVATE_DEF_CLS(MTLResourceStatePassDescriptor); _MTL_PRIVATE_DEF_CLS(MTLResourceStatePassSampleBufferAttachmentDescriptor); _MTL_PRIVATE_DEF_CLS(MTLResourceStatePassSampleBufferAttachmentDescriptorArray); +_MTL_PRIVATE_DEF_CLS(MTLResourceViewPoolDescriptor); _MTL_PRIVATE_DEF_CLS(MTLSamplerDescriptor); _MTL_PRIVATE_DEF_CLS(MTLSharedEventHandle); _MTL_PRIVATE_DEF_CLS(MTLSharedEventListener); @@ -105,8 +156,12 @@ _MTL_PRIVATE_DEF_CLS(MTLStencilDescriptor); _MTL_PRIVATE_DEF_CLS(MTLStitchedLibraryDescriptor); _MTL_PRIVATE_DEF_CLS(MTLStructMember); _MTL_PRIVATE_DEF_CLS(MTLStructType); +_MTL_PRIVATE_DEF_CLS(MTLTensorDescriptor); +_MTL_PRIVATE_DEF_CLS(MTLTensorExtents); +_MTL_PRIVATE_DEF_CLS(MTLTensorReferenceType); _MTL_PRIVATE_DEF_CLS(MTLTextureDescriptor); _MTL_PRIVATE_DEF_CLS(MTLTextureReferenceType); +_MTL_PRIVATE_DEF_CLS(MTLTextureViewDescriptor); _MTL_PRIVATE_DEF_CLS(MTLTileRenderPipelineColorAttachmentDescriptor); _MTL_PRIVATE_DEF_CLS(MTLTileRenderPipelineColorAttachmentDescriptorArray); _MTL_PRIVATE_DEF_CLS(MTLTileRenderPipelineDescriptor); @@ -124,8 +179,25 @@ _MTL_PRIVATE_DEF_CLS(MTLVisibleFunctionTableDescriptor); namespace MTL::Private::Protocol { +_MTL_PRIVATE_DEF_PRO(MTL4Archive); +_MTL_PRIVATE_DEF_PRO(MTL4ArgumentTable); +_MTL_PRIVATE_DEF_PRO(MTL4BinaryFunction); +_MTL_PRIVATE_DEF_PRO(MTL4CommandAllocator); +_MTL_PRIVATE_DEF_PRO(MTL4CommandBuffer); +_MTL_PRIVATE_DEF_PRO(MTL4CommandEncoder); +_MTL_PRIVATE_DEF_PRO(MTL4CommandQueue); +_MTL_PRIVATE_DEF_PRO(MTL4CommitFeedback); +_MTL_PRIVATE_DEF_PRO(MTL4Compiler); +_MTL_PRIVATE_DEF_PRO(MTL4CompilerTask); +_MTL_PRIVATE_DEF_PRO(MTL4ComputeCommandEncoder); +_MTL_PRIVATE_DEF_PRO(MTL4CounterHeap); +_MTL_PRIVATE_DEF_PRO(MTL4MachineLearningCommandEncoder); +_MTL_PRIVATE_DEF_PRO(MTL4MachineLearningPipelineState); +_MTL_PRIVATE_DEF_PRO(MTL4PipelineDataSetSerializer); +_MTL_PRIVATE_DEF_PRO(MTL4RenderCommandEncoder); _MTL_PRIVATE_DEF_PRO(MTLAccelerationStructure); _MTL_PRIVATE_DEF_PRO(MTLAccelerationStructureCommandEncoder); +_MTL_PRIVATE_DEF_PRO(MTLAllocation); _MTL_PRIVATE_DEF_PRO(MTLArgumentEncoder); _MTL_PRIVATE_DEF_PRO(MTLBinaryArchive); _MTL_PRIVATE_DEF_PRO(MTLBinding); @@ -165,17 +237,23 @@ _MTL_PRIVATE_DEF_PRO(MTLIndirectRenderCommand); _MTL_PRIVATE_DEF_PRO(MTLIntersectionFunctionTable); _MTL_PRIVATE_DEF_PRO(MTLLibrary); _MTL_PRIVATE_DEF_PRO(MTLLogContainer); +_MTL_PRIVATE_DEF_PRO(MTLLogState); _MTL_PRIVATE_DEF_PRO(MTLObjectPayloadBinding); _MTL_PRIVATE_DEF_PRO(MTLParallelRenderCommandEncoder); _MTL_PRIVATE_DEF_PRO(MTLRasterizationRateMap); _MTL_PRIVATE_DEF_PRO(MTLRenderCommandEncoder); _MTL_PRIVATE_DEF_PRO(MTLRenderPipelineState); +_MTL_PRIVATE_DEF_PRO(MTLResidencySet); _MTL_PRIVATE_DEF_PRO(MTLResource); _MTL_PRIVATE_DEF_PRO(MTLResourceStateCommandEncoder); +_MTL_PRIVATE_DEF_PRO(MTLResourceViewPool); _MTL_PRIVATE_DEF_PRO(MTLSamplerState); _MTL_PRIVATE_DEF_PRO(MTLSharedEvent); +_MTL_PRIVATE_DEF_PRO(MTLTensor); +_MTL_PRIVATE_DEF_PRO(MTLTensorBinding); _MTL_PRIVATE_DEF_PRO(MTLTexture); _MTL_PRIVATE_DEF_PRO(MTLTextureBinding); +_MTL_PRIVATE_DEF_PRO(MTLTextureViewPool); _MTL_PRIVATE_DEF_PRO(MTLThreadgroupBinding); _MTL_PRIVATE_DEF_PRO(MTLVisibleFunctionTable); @@ -200,6 +278,10 @@ _MTL_PRIVATE_DEF_SEL(accelerationStructureSizesWithDescriptor_, "accelerationStructureSizesWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(access, "access"); +_MTL_PRIVATE_DEF_SEL(addAllocation_, + "addAllocation:"); +_MTL_PRIVATE_DEF_SEL(addAllocations_count_, + "addAllocations:count:"); _MTL_PRIVATE_DEF_SEL(addBarrier, "addBarrier"); _MTL_PRIVATE_DEF_SEL(addCompletedHandler_, @@ -208,20 +290,36 @@ _MTL_PRIVATE_DEF_SEL(addComputePipelineFunctionsWithDescriptor_error_, "addComputePipelineFunctionsWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(addDebugMarker_range_, "addDebugMarker:range:"); +_MTL_PRIVATE_DEF_SEL(addFeedbackHandler_, + "addFeedbackHandler:"); _MTL_PRIVATE_DEF_SEL(addFunctionWithDescriptor_library_error_, "addFunctionWithDescriptor:library:error:"); +_MTL_PRIVATE_DEF_SEL(addLibraryWithDescriptor_error_, + "addLibraryWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(addLogHandler_, + "addLogHandler:"); +_MTL_PRIVATE_DEF_SEL(addMeshRenderPipelineFunctionsWithDescriptor_error_, + "addMeshRenderPipelineFunctionsWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(addPresentedHandler_, "addPresentedHandler:"); _MTL_PRIVATE_DEF_SEL(addRenderPipelineFunctionsWithDescriptor_error_, "addRenderPipelineFunctionsWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(addResidencySet_, + "addResidencySet:"); +_MTL_PRIVATE_DEF_SEL(addResidencySets_count_, + "addResidencySets:count:"); _MTL_PRIVATE_DEF_SEL(addScheduledHandler_, "addScheduledHandler:"); _MTL_PRIVATE_DEF_SEL(addTileRenderPipelineFunctionsWithDescriptor_error_, "addTileRenderPipelineFunctionsWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(alignment, "alignment"); +_MTL_PRIVATE_DEF_SEL(allAllocations, + "allAllocations"); _MTL_PRIVATE_DEF_SEL(allocatedSize, "allocatedSize"); +_MTL_PRIVATE_DEF_SEL(allocationCount, + "allocationCount"); _MTL_PRIVATE_DEF_SEL(allowDuplicateIntersectionFunctionInvocation, "allowDuplicateIntersectionFunctionInvocation"); _MTL_PRIVATE_DEF_SEL(allowGPUOptimizedContents, @@ -230,6 +328,12 @@ _MTL_PRIVATE_DEF_SEL(allowReferencingUndefinedSymbols, "allowReferencingUndefinedSymbols"); _MTL_PRIVATE_DEF_SEL(alphaBlendOperation, "alphaBlendOperation"); +_MTL_PRIVATE_DEF_SEL(alphaToCoverageState, + "alphaToCoverageState"); +_MTL_PRIVATE_DEF_SEL(alphaToOneState, + "alphaToOneState"); +_MTL_PRIVATE_DEF_SEL(architecture, + "architecture"); _MTL_PRIVATE_DEF_SEL(areBarycentricCoordsSupported, "areBarycentricCoordsSupported"); _MTL_PRIVATE_DEF_SEL(areProgrammableSamplePositionsSupported, @@ -258,12 +362,30 @@ _MTL_PRIVATE_DEF_SEL(attributes, "attributes"); _MTL_PRIVATE_DEF_SEL(backFaceStencil, "backFaceStencil"); +_MTL_PRIVATE_DEF_SEL(barrierAfterEncoderStages_beforeEncoderStages_visibilityOptions_, + "barrierAfterEncoderStages:beforeEncoderStages:visibilityOptions:"); +_MTL_PRIVATE_DEF_SEL(barrierAfterQueueStages_beforeStages_, + "barrierAfterQueueStages:beforeStages:"); +_MTL_PRIVATE_DEF_SEL(barrierAfterQueueStages_beforeStages_visibilityOptions_, + "barrierAfterQueueStages:beforeStages:visibilityOptions:"); +_MTL_PRIVATE_DEF_SEL(barrierAfterStages_beforeQueueStages_visibilityOptions_, + "barrierAfterStages:beforeQueueStages:visibilityOptions:"); +_MTL_PRIVATE_DEF_SEL(baseResourceID, + "baseResourceID"); +_MTL_PRIVATE_DEF_SEL(beginCommandBufferWithAllocator_, + "beginCommandBufferWithAllocator:"); +_MTL_PRIVATE_DEF_SEL(beginCommandBufferWithAllocator_options_, + "beginCommandBufferWithAllocator:options:"); _MTL_PRIVATE_DEF_SEL(binaryArchives, "binaryArchives"); _MTL_PRIVATE_DEF_SEL(binaryFunctions, "binaryFunctions"); +_MTL_PRIVATE_DEF_SEL(binaryLinkedFunctions, + "binaryLinkedFunctions"); _MTL_PRIVATE_DEF_SEL(bindings, "bindings"); +_MTL_PRIVATE_DEF_SEL(blendingState, + "blendingState"); _MTL_PRIVATE_DEF_SEL(blitCommandEncoder, "blitCommandEncoder"); _MTL_PRIVATE_DEF_SEL(blitCommandEncoderWithDescriptor_, @@ -298,10 +420,14 @@ _MTL_PRIVATE_DEF_SEL(bufferOffset, "bufferOffset"); _MTL_PRIVATE_DEF_SEL(bufferPointerType, "bufferPointerType"); +_MTL_PRIVATE_DEF_SEL(bufferSize, + "bufferSize"); _MTL_PRIVATE_DEF_SEL(bufferStructType, "bufferStructType"); _MTL_PRIVATE_DEF_SEL(buffers, "buffers"); +_MTL_PRIVATE_DEF_SEL(buildAccelerationStructure_descriptor_scratchBuffer_, + "buildAccelerationStructure:descriptor:scratchBuffer:"); _MTL_PRIVATE_DEF_SEL(buildAccelerationStructure_descriptor_scratchBuffer_scratchBufferOffset_, "buildAccelerationStructure:descriptor:scratchBuffer:scratchBufferOffset:"); _MTL_PRIVATE_DEF_SEL(captureObject, @@ -314,6 +440,8 @@ _MTL_PRIVATE_DEF_SEL(clearDepth, "clearDepth"); _MTL_PRIVATE_DEF_SEL(clearStencil, "clearStencil"); +_MTL_PRIVATE_DEF_SEL(colorAttachmentMappingState, + "colorAttachmentMappingState"); _MTL_PRIVATE_DEF_SEL(colorAttachments, "colorAttachments"); _MTL_PRIVATE_DEF_SEL(column, @@ -330,10 +458,16 @@ _MTL_PRIVATE_DEF_SEL(commandTypes, "commandTypes"); _MTL_PRIVATE_DEF_SEL(commit, "commit"); +_MTL_PRIVATE_DEF_SEL(commit_count_, + "commit:count:"); +_MTL_PRIVATE_DEF_SEL(commit_count_options_, + "commit:count:options:"); _MTL_PRIVATE_DEF_SEL(compareFunction, "compareFunction"); _MTL_PRIVATE_DEF_SEL(compileSymbolVisibility, "compileSymbolVisibility"); +_MTL_PRIVATE_DEF_SEL(compiler, + "compiler"); _MTL_PRIVATE_DEF_SEL(compressionType, "compressionType"); _MTL_PRIVATE_DEF_SEL(computeCommandEncoder, @@ -344,22 +478,40 @@ _MTL_PRIVATE_DEF_SEL(computeCommandEncoderWithDispatchType_, "computeCommandEncoderWithDispatchType:"); _MTL_PRIVATE_DEF_SEL(computeFunction, "computeFunction"); +_MTL_PRIVATE_DEF_SEL(computeFunctionDescriptor, + "computeFunctionDescriptor"); _MTL_PRIVATE_DEF_SEL(computePassDescriptor, "computePassDescriptor"); _MTL_PRIVATE_DEF_SEL(concurrentDispatchThreadgroups_threadsPerThreadgroup_, "concurrentDispatchThreadgroups:threadsPerThreadgroup:"); _MTL_PRIVATE_DEF_SEL(concurrentDispatchThreads_threadsPerThreadgroup_, "concurrentDispatchThreads:threadsPerThreadgroup:"); +_MTL_PRIVATE_DEF_SEL(configuration, + "configuration"); _MTL_PRIVATE_DEF_SEL(constantBlockAlignment, "constantBlockAlignment"); _MTL_PRIVATE_DEF_SEL(constantDataAtIndex_, "constantDataAtIndex:"); _MTL_PRIVATE_DEF_SEL(constantValues, "constantValues"); +_MTL_PRIVATE_DEF_SEL(containsAllocation_, + "containsAllocation:"); _MTL_PRIVATE_DEF_SEL(contents, "contents"); _MTL_PRIVATE_DEF_SEL(controlDependencies, "controlDependencies"); +_MTL_PRIVATE_DEF_SEL(controlPointBuffer, + "controlPointBuffer"); +_MTL_PRIVATE_DEF_SEL(controlPointBufferOffset, + "controlPointBufferOffset"); +_MTL_PRIVATE_DEF_SEL(controlPointBuffers, + "controlPointBuffers"); +_MTL_PRIVATE_DEF_SEL(controlPointCount, + "controlPointCount"); +_MTL_PRIVATE_DEF_SEL(controlPointFormat, + "controlPointFormat"); +_MTL_PRIVATE_DEF_SEL(controlPointStride, + "controlPointStride"); _MTL_PRIVATE_DEF_SEL(convertSparsePixelRegions_toTileRegions_withTileSize_alignmentMode_numRegions_, "convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:"); _MTL_PRIVATE_DEF_SEL(convertSparseTileRegions_toPixelRegions_withTileSize_numRegions_, @@ -368,12 +520,16 @@ _MTL_PRIVATE_DEF_SEL(copyAccelerationStructure_toAccelerationStructure_, "copyAccelerationStructure:toAccelerationStructure:"); _MTL_PRIVATE_DEF_SEL(copyAndCompactAccelerationStructure_toAccelerationStructure_, "copyAndCompactAccelerationStructure:toAccelerationStructure:"); +_MTL_PRIVATE_DEF_SEL(copyBufferMappingsFromBuffer_toBuffer_operations_count_, + "copyBufferMappingsFromBuffer:toBuffer:operations:count:"); _MTL_PRIVATE_DEF_SEL(copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_, "copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:"); _MTL_PRIVATE_DEF_SEL(copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_options_, "copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:"); _MTL_PRIVATE_DEF_SEL(copyFromBuffer_sourceOffset_toBuffer_destinationOffset_size_, "copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:"); +_MTL_PRIVATE_DEF_SEL(copyFromTensor_sourceOrigin_sourceDimensions_toTensor_destinationOrigin_destinationDimensions_, + "copyFromTensor:sourceOrigin:sourceDimensions:toTensor:destinationOrigin:destinationDimensions:"); _MTL_PRIVATE_DEF_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_, "copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:"); _MTL_PRIVATE_DEF_SEL(copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_options_, @@ -388,8 +544,14 @@ _MTL_PRIVATE_DEF_SEL(copyIndirectCommandBuffer_sourceRange_destination_destinati "copyIndirectCommandBuffer:sourceRange:destination:destinationIndex:"); _MTL_PRIVATE_DEF_SEL(copyParameterDataToBuffer_offset_, "copyParameterDataToBuffer:offset:"); +_MTL_PRIVATE_DEF_SEL(copyResourceViewsFromPool_sourceRange_destinationIndex_, + "copyResourceViewsFromPool:sourceRange:destinationIndex:"); _MTL_PRIVATE_DEF_SEL(copyStatusToBuffer_offset_, "copyStatusToBuffer:offset:"); +_MTL_PRIVATE_DEF_SEL(copyTextureMappingsFromTexture_toTexture_operations_count_, + "copyTextureMappingsFromTexture:toTexture:operations:count:"); +_MTL_PRIVATE_DEF_SEL(count, + "count"); _MTL_PRIVATE_DEF_SEL(counterSet, "counterSet"); _MTL_PRIVATE_DEF_SEL(counterSets, @@ -400,6 +562,12 @@ _MTL_PRIVATE_DEF_SEL(cpuCacheMode, "cpuCacheMode"); _MTL_PRIVATE_DEF_SEL(currentAllocatedSize, "currentAllocatedSize"); +_MTL_PRIVATE_DEF_SEL(curveBasis, + "curveBasis"); +_MTL_PRIVATE_DEF_SEL(curveEndCaps, + "curveEndCaps"); +_MTL_PRIVATE_DEF_SEL(curveType, + "curveType"); _MTL_PRIVATE_DEF_SEL(data, "data"); _MTL_PRIVATE_DEF_SEL(dataSize, @@ -444,16 +612,24 @@ _MTL_PRIVATE_DEF_SEL(device, "device"); _MTL_PRIVATE_DEF_SEL(didModifyRange_, "didModifyRange:"); +_MTL_PRIVATE_DEF_SEL(dimensions, + "dimensions"); +_MTL_PRIVATE_DEF_SEL(dispatchNetworkWithIntermediatesHeap_, + "dispatchNetworkWithIntermediatesHeap:"); _MTL_PRIVATE_DEF_SEL(dispatchQueue, "dispatchQueue"); _MTL_PRIVATE_DEF_SEL(dispatchThreadgroups_threadsPerThreadgroup_, "dispatchThreadgroups:threadsPerThreadgroup:"); _MTL_PRIVATE_DEF_SEL(dispatchThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerThreadgroup_, "dispatchThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerThreadgroup:"); +_MTL_PRIVATE_DEF_SEL(dispatchThreadgroupsWithIndirectBuffer_threadsPerThreadgroup_, + "dispatchThreadgroupsWithIndirectBuffer:threadsPerThreadgroup:"); _MTL_PRIVATE_DEF_SEL(dispatchThreads_threadsPerThreadgroup_, "dispatchThreads:threadsPerThreadgroup:"); _MTL_PRIVATE_DEF_SEL(dispatchThreadsPerTile_, "dispatchThreadsPerTile:"); +_MTL_PRIVATE_DEF_SEL(dispatchThreadsWithIndirectBuffer_, + "dispatchThreadsWithIndirectBuffer:"); _MTL_PRIVATE_DEF_SEL(dispatchType, "dispatchType"); _MTL_PRIVATE_DEF_SEL(drawIndexedPatches_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_indirectBuffer_indirectBufferOffset_, @@ -462,18 +638,28 @@ _MTL_PRIVATE_DEF_SEL(drawIndexedPatches_patchStart_patchCount_patchIndexBuffer_p "drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:"); _MTL_PRIVATE_DEF_SEL(drawIndexedPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_instanceCount_baseInstance_tessellationFactorBuffer_tessellationFactorBufferOffset_tessellationFactorBufferInstanceStride_, "drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:"); +_MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferLength_, + "drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferLength:"); +_MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferLength_instanceCount_, + "drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferLength:instanceCount:"); +_MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferLength_instanceCount_baseVertex_baseInstance_, + "drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferLength:instanceCount:baseVertex:baseInstance:"); _MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_, "drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:"); _MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_, "drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:"); _MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_baseVertex_baseInstance_, "drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:"); +_MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexType_indexBuffer_indexBufferLength_indirectBuffer_, + "drawIndexedPrimitives:indexType:indexBuffer:indexBufferLength:indirectBuffer:"); _MTL_PRIVATE_DEF_SEL(drawIndexedPrimitives_indexType_indexBuffer_indexBufferOffset_indirectBuffer_indirectBufferOffset_, "drawIndexedPrimitives:indexType:indexBuffer:indexBufferOffset:indirectBuffer:indirectBufferOffset:"); _MTL_PRIVATE_DEF_SEL(drawMeshThreadgroups_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_, "drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:"); _MTL_PRIVATE_DEF_SEL(drawMeshThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_, "drawMeshThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:"); +_MTL_PRIVATE_DEF_SEL(drawMeshThreadgroupsWithIndirectBuffer_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_, + "drawMeshThreadgroupsWithIndirectBuffer:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:"); _MTL_PRIVATE_DEF_SEL(drawMeshThreads_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_, "drawMeshThreads:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:"); _MTL_PRIVATE_DEF_SEL(drawPatches_patchIndexBuffer_patchIndexBufferOffset_indirectBuffer_indirectBufferOffset_, @@ -482,6 +668,8 @@ _MTL_PRIVATE_DEF_SEL(drawPatches_patchStart_patchCount_patchIndexBuffer_patchInd "drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:"); _MTL_PRIVATE_DEF_SEL(drawPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_instanceCount_baseInstance_tessellationFactorBuffer_tessellationFactorBufferOffset_tessellationFactorBufferInstanceStride_, "drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:"); +_MTL_PRIVATE_DEF_SEL(drawPrimitives_indirectBuffer_, + "drawPrimitives:indirectBuffer:"); _MTL_PRIVATE_DEF_SEL(drawPrimitives_indirectBuffer_indirectBufferOffset_, "drawPrimitives:indirectBuffer:indirectBufferOffset:"); _MTL_PRIVATE_DEF_SEL(drawPrimitives_vertexStart_vertexCount_, @@ -500,10 +688,14 @@ _MTL_PRIVATE_DEF_SEL(elementPointerType, "elementPointerType"); _MTL_PRIVATE_DEF_SEL(elementStructType, "elementStructType"); +_MTL_PRIVATE_DEF_SEL(elementTensorReferenceType, + "elementTensorReferenceType"); _MTL_PRIVATE_DEF_SEL(elementTextureReferenceType, "elementTextureReferenceType"); _MTL_PRIVATE_DEF_SEL(elementType, "elementType"); +_MTL_PRIVATE_DEF_SEL(enableLogging, + "enableLogging"); _MTL_PRIVATE_DEF_SEL(encodeSignalEvent_value_, "encodeSignalEvent:value:"); _MTL_PRIVATE_DEF_SEL(encodeWaitForEvent_value_, @@ -512,6 +704,8 @@ _MTL_PRIVATE_DEF_SEL(encodedLength, "encodedLength"); _MTL_PRIVATE_DEF_SEL(encoderLabel, "encoderLabel"); +_MTL_PRIVATE_DEF_SEL(endCommandBuffer, + "endCommandBuffer"); _MTL_PRIVATE_DEF_SEL(endEncoding, "endEncoding"); _MTL_PRIVATE_DEF_SEL(endOfEncoderSampleIndex, @@ -520,6 +714,8 @@ _MTL_PRIVATE_DEF_SEL(endOfFragmentSampleIndex, "endOfFragmentSampleIndex"); _MTL_PRIVATE_DEF_SEL(endOfVertexSampleIndex, "endOfVertexSampleIndex"); +_MTL_PRIVATE_DEF_SEL(endResidency, + "endResidency"); _MTL_PRIVATE_DEF_SEL(enqueue, "enqueue"); _MTL_PRIVATE_DEF_SEL(enqueueBarrier, @@ -530,12 +726,18 @@ _MTL_PRIVATE_DEF_SEL(errorOptions, "errorOptions"); _MTL_PRIVATE_DEF_SEL(errorState, "errorState"); +_MTL_PRIVATE_DEF_SEL(executeCommandsInBuffer_indirectBuffer_, + "executeCommandsInBuffer:indirectBuffer:"); _MTL_PRIVATE_DEF_SEL(executeCommandsInBuffer_indirectBuffer_indirectBufferOffset_, "executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:"); _MTL_PRIVATE_DEF_SEL(executeCommandsInBuffer_withRange_, "executeCommandsInBuffer:withRange:"); +_MTL_PRIVATE_DEF_SEL(extentAtDimensionIndex_, + "extentAtDimensionIndex:"); _MTL_PRIVATE_DEF_SEL(fastMathEnabled, "fastMathEnabled"); +_MTL_PRIVATE_DEF_SEL(feedbackQueue, + "feedbackQueue"); _MTL_PRIVATE_DEF_SEL(fillBuffer_range_value_, "fillBuffer:range:value:"); _MTL_PRIVATE_DEF_SEL(firstMipmapInTail, @@ -552,10 +754,16 @@ _MTL_PRIVATE_DEF_SEL(fragmentBuffers, "fragmentBuffers"); _MTL_PRIVATE_DEF_SEL(fragmentFunction, "fragmentFunction"); +_MTL_PRIVATE_DEF_SEL(fragmentFunctionDescriptor, + "fragmentFunctionDescriptor"); _MTL_PRIVATE_DEF_SEL(fragmentLinkedFunctions, "fragmentLinkedFunctions"); +_MTL_PRIVATE_DEF_SEL(fragmentLinkingDescriptor, + "fragmentLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(fragmentPreloadedLibraries, "fragmentPreloadedLibraries"); +_MTL_PRIVATE_DEF_SEL(fragmentStaticLinkingDescriptor, + "fragmentStaticLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(frontFaceStencil, "frontFaceStencil"); _MTL_PRIVATE_DEF_SEL(function, @@ -566,12 +774,24 @@ _MTL_PRIVATE_DEF_SEL(functionCount, "functionCount"); _MTL_PRIVATE_DEF_SEL(functionDescriptor, "functionDescriptor"); +_MTL_PRIVATE_DEF_SEL(functionDescriptors, + "functionDescriptors"); +_MTL_PRIVATE_DEF_SEL(functionGraph, + "functionGraph"); _MTL_PRIVATE_DEF_SEL(functionGraphs, "functionGraphs"); +_MTL_PRIVATE_DEF_SEL(functionHandleWithBinaryFunction_, + "functionHandleWithBinaryFunction:"); +_MTL_PRIVATE_DEF_SEL(functionHandleWithBinaryFunction_stage_, + "functionHandleWithBinaryFunction:stage:"); _MTL_PRIVATE_DEF_SEL(functionHandleWithFunction_, "functionHandleWithFunction:"); _MTL_PRIVATE_DEF_SEL(functionHandleWithFunction_stage_, "functionHandleWithFunction:stage:"); +_MTL_PRIVATE_DEF_SEL(functionHandleWithName_, + "functionHandleWithName:"); +_MTL_PRIVATE_DEF_SEL(functionHandleWithName_stage_, + "functionHandleWithName:stage:"); _MTL_PRIVATE_DEF_SEL(functionName, "functionName"); _MTL_PRIVATE_DEF_SEL(functionNames, @@ -588,8 +808,12 @@ _MTL_PRIVATE_DEF_SEL(getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_s "getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice:"); _MTL_PRIVATE_DEF_SEL(getBytes_bytesPerRow_fromRegion_mipmapLevel_, "getBytes:bytesPerRow:fromRegion:mipmapLevel:"); +_MTL_PRIVATE_DEF_SEL(getBytes_strides_fromSliceOrigin_sliceDimensions_, + "getBytes:strides:fromSliceOrigin:sliceDimensions:"); _MTL_PRIVATE_DEF_SEL(getDefaultSamplePositions_count_, "getDefaultSamplePositions:count:"); +_MTL_PRIVATE_DEF_SEL(getPhysicalIndexForLogicalIndex_, + "getPhysicalIndexForLogicalIndex:"); _MTL_PRIVATE_DEF_SEL(getSamplePositions_count_, "getSamplePositions:count:"); _MTL_PRIVATE_DEF_SEL(getTextureAccessCounters_region_mipLevel_slice_resetCounters_countersBuffer_countersBufferOffset_, @@ -642,8 +866,20 @@ _MTL_PRIVATE_DEF_SEL(indirectRenderCommandAtIndex_, "indirectRenderCommandAtIndex:"); _MTL_PRIVATE_DEF_SEL(inheritBuffers, "inheritBuffers"); +_MTL_PRIVATE_DEF_SEL(inheritCullMode, + "inheritCullMode"); +_MTL_PRIVATE_DEF_SEL(inheritDepthBias, + "inheritDepthBias"); +_MTL_PRIVATE_DEF_SEL(inheritDepthClipMode, + "inheritDepthClipMode"); +_MTL_PRIVATE_DEF_SEL(inheritDepthStencilState, + "inheritDepthStencilState"); +_MTL_PRIVATE_DEF_SEL(inheritFrontFacingWinding, + "inheritFrontFacingWinding"); _MTL_PRIVATE_DEF_SEL(inheritPipelineState, "inheritPipelineState"); +_MTL_PRIVATE_DEF_SEL(inheritTriangleFillMode, + "inheritTriangleFillMode"); _MTL_PRIVATE_DEF_SEL(init, "init"); _MTL_PRIVATE_DEF_SEL(initWithArgumentIndex_, @@ -654,10 +890,18 @@ _MTL_PRIVATE_DEF_SEL(initWithFunctionName_nodes_outputNode_attributes_, "initWithFunctionName:nodes:outputNode:attributes:"); _MTL_PRIVATE_DEF_SEL(initWithName_arguments_controlDependencies_, "initWithName:arguments:controlDependencies:"); +_MTL_PRIVATE_DEF_SEL(initWithRank_values_, + "initWithRank:values:"); _MTL_PRIVATE_DEF_SEL(initWithSampleCount_, "initWithSampleCount:"); _MTL_PRIVATE_DEF_SEL(initWithSampleCount_horizontal_vertical_, "initWithSampleCount:horizontal:vertical:"); +_MTL_PRIVATE_DEF_SEL(initialCapacity, + "initialCapacity"); +_MTL_PRIVATE_DEF_SEL(initializeBindings, + "initializeBindings"); +_MTL_PRIVATE_DEF_SEL(inputDimensionsAtBufferIndex_, + "inputDimensionsAtBufferIndex:"); _MTL_PRIVATE_DEF_SEL(inputPrimitiveTopology, "inputPrimitiveTopology"); _MTL_PRIVATE_DEF_SEL(insertDebugCaptureBoundary, @@ -670,6 +914,10 @@ _MTL_PRIVATE_DEF_SEL(installName, "installName"); _MTL_PRIVATE_DEF_SEL(instanceCount, "instanceCount"); +_MTL_PRIVATE_DEF_SEL(instanceCountBuffer, + "instanceCountBuffer"); +_MTL_PRIVATE_DEF_SEL(instanceCountBufferOffset, + "instanceCountBufferOffset"); _MTL_PRIVATE_DEF_SEL(instanceDescriptorBuffer, "instanceDescriptorBuffer"); _MTL_PRIVATE_DEF_SEL(instanceDescriptorBufferOffset, @@ -678,12 +926,18 @@ _MTL_PRIVATE_DEF_SEL(instanceDescriptorStride, "instanceDescriptorStride"); _MTL_PRIVATE_DEF_SEL(instanceDescriptorType, "instanceDescriptorType"); +_MTL_PRIVATE_DEF_SEL(instanceTransformationMatrixLayout, + "instanceTransformationMatrixLayout"); _MTL_PRIVATE_DEF_SEL(instancedAccelerationStructures, "instancedAccelerationStructures"); +_MTL_PRIVATE_DEF_SEL(intermediatesHeapSize, + "intermediatesHeapSize"); _MTL_PRIVATE_DEF_SEL(intersectionFunctionTableDescriptor, "intersectionFunctionTableDescriptor"); _MTL_PRIVATE_DEF_SEL(intersectionFunctionTableOffset, "intersectionFunctionTableOffset"); +_MTL_PRIVATE_DEF_SEL(invalidateCounterRange_, + "invalidateCounterRange:"); _MTL_PRIVATE_DEF_SEL(iosurface, "iosurface"); _MTL_PRIVATE_DEF_SEL(iosurfacePlane, @@ -750,8 +1004,12 @@ _MTL_PRIVATE_DEF_SEL(length, "length"); _MTL_PRIVATE_DEF_SEL(level, "level"); +_MTL_PRIVATE_DEF_SEL(levelRange, + "levelRange"); _MTL_PRIVATE_DEF_SEL(libraries, "libraries"); +_MTL_PRIVATE_DEF_SEL(library, + "library"); _MTL_PRIVATE_DEF_SEL(libraryType, "libraryType"); _MTL_PRIVATE_DEF_SEL(line, @@ -772,12 +1030,22 @@ _MTL_PRIVATE_DEF_SEL(locationNumber, "locationNumber"); _MTL_PRIVATE_DEF_SEL(lodAverage, "lodAverage"); +_MTL_PRIVATE_DEF_SEL(lodBias, + "lodBias"); _MTL_PRIVATE_DEF_SEL(lodMaxClamp, "lodMaxClamp"); _MTL_PRIVATE_DEF_SEL(lodMinClamp, "lodMinClamp"); +_MTL_PRIVATE_DEF_SEL(logState, + "logState"); _MTL_PRIVATE_DEF_SEL(logs, "logs"); +_MTL_PRIVATE_DEF_SEL(lookupArchives, + "lookupArchives"); +_MTL_PRIVATE_DEF_SEL(machineLearningCommandEncoder, + "machineLearningCommandEncoder"); +_MTL_PRIVATE_DEF_SEL(machineLearningFunctionDescriptor, + "machineLearningFunctionDescriptor"); _MTL_PRIVATE_DEF_SEL(magFilter, "magFilter"); _MTL_PRIVATE_DEF_SEL(makeAliasable, @@ -786,12 +1054,18 @@ _MTL_PRIVATE_DEF_SEL(mapPhysicalToScreenCoordinates_forLayer_, "mapPhysicalToScreenCoordinates:forLayer:"); _MTL_PRIVATE_DEF_SEL(mapScreenToPhysicalCoordinates_forLayer_, "mapScreenToPhysicalCoordinates:forLayer:"); +_MTL_PRIVATE_DEF_SEL(mathFloatingPointFunctions, + "mathFloatingPointFunctions"); +_MTL_PRIVATE_DEF_SEL(mathMode, + "mathMode"); _MTL_PRIVATE_DEF_SEL(maxAnisotropy, "maxAnisotropy"); _MTL_PRIVATE_DEF_SEL(maxArgumentBufferSamplerCount, "maxArgumentBufferSamplerCount"); _MTL_PRIVATE_DEF_SEL(maxAvailableSizeWithAlignment_, "maxAvailableSizeWithAlignment:"); +_MTL_PRIVATE_DEF_SEL(maxBufferBindCount, + "maxBufferBindCount"); _MTL_PRIVATE_DEF_SEL(maxBufferLength, "maxBufferLength"); _MTL_PRIVATE_DEF_SEL(maxCallStackDepth, @@ -800,16 +1074,34 @@ _MTL_PRIVATE_DEF_SEL(maxCommandBufferCount, "maxCommandBufferCount"); _MTL_PRIVATE_DEF_SEL(maxCommandsInFlight, "maxCommandsInFlight"); +_MTL_PRIVATE_DEF_SEL(maxCompatiblePlacementSparsePageSize, + "maxCompatiblePlacementSparsePageSize"); _MTL_PRIVATE_DEF_SEL(maxFragmentBufferBindCount, "maxFragmentBufferBindCount"); _MTL_PRIVATE_DEF_SEL(maxFragmentCallStackDepth, "maxFragmentCallStackDepth"); +_MTL_PRIVATE_DEF_SEL(maxInstanceCount, + "maxInstanceCount"); _MTL_PRIVATE_DEF_SEL(maxKernelBufferBindCount, "maxKernelBufferBindCount"); +_MTL_PRIVATE_DEF_SEL(maxKernelThreadgroupMemoryBindCount, + "maxKernelThreadgroupMemoryBindCount"); +_MTL_PRIVATE_DEF_SEL(maxMeshBufferBindCount, + "maxMeshBufferBindCount"); +_MTL_PRIVATE_DEF_SEL(maxMotionTransformCount, + "maxMotionTransformCount"); +_MTL_PRIVATE_DEF_SEL(maxObjectBufferBindCount, + "maxObjectBufferBindCount"); +_MTL_PRIVATE_DEF_SEL(maxObjectThreadgroupMemoryBindCount, + "maxObjectThreadgroupMemoryBindCount"); _MTL_PRIVATE_DEF_SEL(maxSampleCount, "maxSampleCount"); +_MTL_PRIVATE_DEF_SEL(maxSamplerStateBindCount, + "maxSamplerStateBindCount"); _MTL_PRIVATE_DEF_SEL(maxTessellationFactor, "maxTessellationFactor"); +_MTL_PRIVATE_DEF_SEL(maxTextureBindCount, + "maxTextureBindCount"); _MTL_PRIVATE_DEF_SEL(maxThreadgroupMemoryLength, "maxThreadgroupMemoryLength"); _MTL_PRIVATE_DEF_SEL(maxThreadsPerThreadgroup, @@ -844,12 +1136,22 @@ _MTL_PRIVATE_DEF_SEL(memoryBarrierWithScope_, "memoryBarrierWithScope:"); _MTL_PRIVATE_DEF_SEL(memoryBarrierWithScope_afterStages_beforeStages_, "memoryBarrierWithScope:afterStages:beforeStages:"); +_MTL_PRIVATE_DEF_SEL(meshAdditionalBinaryFunctions, + "meshAdditionalBinaryFunctions"); _MTL_PRIVATE_DEF_SEL(meshBindings, "meshBindings"); _MTL_PRIVATE_DEF_SEL(meshBuffers, "meshBuffers"); _MTL_PRIVATE_DEF_SEL(meshFunction, "meshFunction"); +_MTL_PRIVATE_DEF_SEL(meshFunctionDescriptor, + "meshFunctionDescriptor"); +_MTL_PRIVATE_DEF_SEL(meshLinkedFunctions, + "meshLinkedFunctions"); +_MTL_PRIVATE_DEF_SEL(meshLinkingDescriptor, + "meshLinkingDescriptor"); +_MTL_PRIVATE_DEF_SEL(meshStaticLinkingDescriptor, + "meshStaticLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(meshThreadExecutionWidth, "meshThreadExecutionWidth"); _MTL_PRIVATE_DEF_SEL(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth, @@ -880,6 +1182,14 @@ _MTL_PRIVATE_DEF_SEL(motionTransformBufferOffset, "motionTransformBufferOffset"); _MTL_PRIVATE_DEF_SEL(motionTransformCount, "motionTransformCount"); +_MTL_PRIVATE_DEF_SEL(motionTransformCountBuffer, + "motionTransformCountBuffer"); +_MTL_PRIVATE_DEF_SEL(motionTransformCountBufferOffset, + "motionTransformCountBufferOffset"); +_MTL_PRIVATE_DEF_SEL(motionTransformStride, + "motionTransformStride"); +_MTL_PRIVATE_DEF_SEL(motionTransformType, + "motionTransformType"); _MTL_PRIVATE_DEF_SEL(moveTextureMappingsFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_, "moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:"); _MTL_PRIVATE_DEF_SEL(mutability, @@ -894,6 +1204,8 @@ _MTL_PRIVATE_DEF_SEL(newAccelerationStructureWithSize_, "newAccelerationStructureWithSize:"); _MTL_PRIVATE_DEF_SEL(newAccelerationStructureWithSize_offset_, "newAccelerationStructureWithSize:offset:"); +_MTL_PRIVATE_DEF_SEL(newArchiveWithURL_error_, + "newArchiveWithURL:error:"); _MTL_PRIVATE_DEF_SEL(newArgumentEncoderForBufferAtIndex_, "newArgumentEncoderForBufferAtIndex:"); _MTL_PRIVATE_DEF_SEL(newArgumentEncoderWithArguments_, @@ -904,8 +1216,16 @@ _MTL_PRIVATE_DEF_SEL(newArgumentEncoderWithBufferIndex_, "newArgumentEncoderWithBufferIndex:"); _MTL_PRIVATE_DEF_SEL(newArgumentEncoderWithBufferIndex_reflection_, "newArgumentEncoderWithBufferIndex:reflection:"); +_MTL_PRIVATE_DEF_SEL(newArgumentTableWithDescriptor_error_, + "newArgumentTableWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newBinaryArchiveWithDescriptor_error_, "newBinaryArchiveWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newBinaryFunctionWithDescriptor_compilerTaskOptions_completionHandler_, + "newBinaryFunctionWithDescriptor:compilerTaskOptions:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newBinaryFunctionWithDescriptor_compilerTaskOptions_error_, + "newBinaryFunctionWithDescriptor:compilerTaskOptions:error:"); +_MTL_PRIVATE_DEF_SEL(newBinaryFunctionWithDescriptor_error_, + "newBinaryFunctionWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newBufferWithBytes_length_options_, "newBufferWithBytes:length:options:"); _MTL_PRIVATE_DEF_SEL(newBufferWithBytesNoCopy_length_options_deallocator_, @@ -914,16 +1234,44 @@ _MTL_PRIVATE_DEF_SEL(newBufferWithLength_options_, "newBufferWithLength:options:"); _MTL_PRIVATE_DEF_SEL(newBufferWithLength_options_offset_, "newBufferWithLength:options:offset:"); +_MTL_PRIVATE_DEF_SEL(newBufferWithLength_options_placementSparsePageSize_, + "newBufferWithLength:options:placementSparsePageSize:"); _MTL_PRIVATE_DEF_SEL(newCaptureScopeWithCommandQueue_, "newCaptureScopeWithCommandQueue:"); _MTL_PRIVATE_DEF_SEL(newCaptureScopeWithDevice_, "newCaptureScopeWithDevice:"); +_MTL_PRIVATE_DEF_SEL(newCaptureScopeWithMTL4CommandQueue_, + "newCaptureScopeWithMTL4CommandQueue:"); +_MTL_PRIVATE_DEF_SEL(newCommandAllocator, + "newCommandAllocator"); +_MTL_PRIVATE_DEF_SEL(newCommandAllocatorWithDescriptor_error_, + "newCommandAllocatorWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newCommandBuffer, + "newCommandBuffer"); _MTL_PRIVATE_DEF_SEL(newCommandQueue, "newCommandQueue"); +_MTL_PRIVATE_DEF_SEL(newCommandQueueWithDescriptor_, + "newCommandQueueWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newCommandQueueWithMaxCommandBufferCount_, "newCommandQueueWithMaxCommandBufferCount:"); +_MTL_PRIVATE_DEF_SEL(newCompilerWithDescriptor_error_, + "newCompilerWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithAdditionalBinaryFunctions_error_, "newComputePipelineStateWithAdditionalBinaryFunctions:error:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithBinaryFunctions_error_, + "newComputePipelineStateWithBinaryFunctions:error:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_compilerTaskOptions_completionHandler_, + "newComputePipelineStateWithDescriptor:compilerTaskOptions:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_compilerTaskOptions_error_, + "newComputePipelineStateWithDescriptor:compilerTaskOptions:error:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler_, + "newComputePipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error_, + "newComputePipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:error:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_error_, + "newComputePipelineStateWithDescriptor:dynamicLinkingDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_error_, + "newComputePipelineStateWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_options_completionHandler_, "newComputePipelineStateWithDescriptor:options:completionHandler:"); _MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithDescriptor_options_reflection_error_, @@ -936,6 +1284,8 @@ _MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithFunction_options_completionHandl "newComputePipelineStateWithFunction:options:completionHandler:"); _MTL_PRIVATE_DEF_SEL(newComputePipelineStateWithFunction_options_reflection_error_, "newComputePipelineStateWithFunction:options:reflection:error:"); +_MTL_PRIVATE_DEF_SEL(newCounterHeapWithDescriptor_error_, + "newCounterHeapWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newCounterSampleBufferWithDescriptor_error_, "newCounterSampleBufferWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newDefaultLibrary, @@ -944,8 +1294,12 @@ _MTL_PRIVATE_DEF_SEL(newDefaultLibraryWithBundle_error_, "newDefaultLibraryWithBundle:error:"); _MTL_PRIVATE_DEF_SEL(newDepthStencilStateWithDescriptor_, "newDepthStencilStateWithDescriptor:"); +_MTL_PRIVATE_DEF_SEL(newDynamicLibrary_completionHandler_, + "newDynamicLibrary:completionHandler:"); _MTL_PRIVATE_DEF_SEL(newDynamicLibrary_error_, "newDynamicLibrary:error:"); +_MTL_PRIVATE_DEF_SEL(newDynamicLibraryWithURL_completionHandler_, + "newDynamicLibraryWithURL:completionHandler:"); _MTL_PRIVATE_DEF_SEL(newDynamicLibraryWithURL_error_, "newDynamicLibraryWithURL:error:"); _MTL_PRIVATE_DEF_SEL(newEvent, @@ -966,6 +1320,10 @@ _MTL_PRIVATE_DEF_SEL(newHeapWithDescriptor_, "newHeapWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newIOCommandQueueWithDescriptor_error_, "newIOCommandQueueWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newIOFileHandleWithURL_compressionMethod_error_, + "newIOFileHandleWithURL:compressionMethod:error:"); +_MTL_PRIVATE_DEF_SEL(newIOFileHandleWithURL_error_, + "newIOFileHandleWithURL:error:"); _MTL_PRIVATE_DEF_SEL(newIOHandleWithURL_compressionMethod_error_, "newIOHandleWithURL:compressionMethod:error:"); _MTL_PRIVATE_DEF_SEL(newIOHandleWithURL_error_, @@ -982,6 +1340,10 @@ _MTL_PRIVATE_DEF_SEL(newIntersectionFunctionWithDescriptor_error_, "newIntersectionFunctionWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newLibraryWithData_error_, "newLibraryWithData:error:"); +_MTL_PRIVATE_DEF_SEL(newLibraryWithDescriptor_completionHandler_, + "newLibraryWithDescriptor:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newLibraryWithDescriptor_error_, + "newLibraryWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newLibraryWithFile_error_, "newLibraryWithFile:error:"); _MTL_PRIVATE_DEF_SEL(newLibraryWithSource_options_completionHandler_, @@ -994,16 +1356,46 @@ _MTL_PRIVATE_DEF_SEL(newLibraryWithStitchedDescriptor_error_, "newLibraryWithStitchedDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newLibraryWithURL_error_, "newLibraryWithURL:error:"); +_MTL_PRIVATE_DEF_SEL(newLogStateWithDescriptor_error_, + "newLogStateWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newMTL4CommandQueue, + "newMTL4CommandQueue"); +_MTL_PRIVATE_DEF_SEL(newMTL4CommandQueueWithDescriptor_error_, + "newMTL4CommandQueueWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newMachineLearningPipelineStateWithDescriptor_completionHandler_, + "newMachineLearningPipelineStateWithDescriptor:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newMachineLearningPipelineStateWithDescriptor_error_, + "newMachineLearningPipelineStateWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newPipelineDataSetSerializerWithDescriptor_, + "newPipelineDataSetSerializerWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newRasterizationRateMapWithDescriptor_, "newRasterizationRateMapWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newRemoteBufferViewForDevice_, "newRemoteBufferViewForDevice:"); _MTL_PRIVATE_DEF_SEL(newRemoteTextureViewForDevice_, "newRemoteTextureViewForDevice:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineDescriptorForSpecialization, + "newRenderPipelineDescriptorForSpecialization"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateBySpecializationWithDescriptor_pipeline_completionHandler_, + "newRenderPipelineStateBySpecializationWithDescriptor:pipeline:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateBySpecializationWithDescriptor_pipeline_error_, + "newRenderPipelineStateBySpecializationWithDescriptor:pipeline:error:"); _MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithAdditionalBinaryFunctions_error_, "newRenderPipelineStateWithAdditionalBinaryFunctions:error:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithBinaryFunctions_error_, + "newRenderPipelineStateWithBinaryFunctions:error:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_compilerTaskOptions_completionHandler_, + "newRenderPipelineStateWithDescriptor:compilerTaskOptions:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_compilerTaskOptions_error_, + "newRenderPipelineStateWithDescriptor:compilerTaskOptions:error:"); _MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_completionHandler_, "newRenderPipelineStateWithDescriptor:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler_, + "newRenderPipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:completionHandler:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error_, + "newRenderPipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:error:"); +_MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_error_, + "newRenderPipelineStateWithDescriptor:dynamicLinkingDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_error_, "newRenderPipelineStateWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithDescriptor_options_completionHandler_, @@ -1018,6 +1410,8 @@ _MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithTileDescriptor_options_completion "newRenderPipelineStateWithTileDescriptor:options:completionHandler:"); _MTL_PRIVATE_DEF_SEL(newRenderPipelineStateWithTileDescriptor_options_reflection_error_, "newRenderPipelineStateWithTileDescriptor:options:reflection:error:"); +_MTL_PRIVATE_DEF_SEL(newResidencySetWithDescriptor_error_, + "newResidencySetWithDescriptor:error:"); _MTL_PRIVATE_DEF_SEL(newSamplerStateWithDescriptor_, "newSamplerStateWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newScratchBufferWithMinimumSize_, @@ -1034,6 +1428,14 @@ _MTL_PRIVATE_DEF_SEL(newSharedTextureWithDescriptor_, "newSharedTextureWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newSharedTextureWithHandle_, "newSharedTextureWithHandle:"); +_MTL_PRIVATE_DEF_SEL(newTensorWithDescriptor_error_, + "newTensorWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newTensorWithDescriptor_offset_error_, + "newTensorWithDescriptor:offset:error:"); +_MTL_PRIVATE_DEF_SEL(newTextureViewPoolWithDescriptor_error_, + "newTextureViewPoolWithDescriptor:error:"); +_MTL_PRIVATE_DEF_SEL(newTextureViewWithDescriptor_, + "newTextureViewWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(newTextureViewWithPixelFormat_, "newTextureViewWithPixelFormat:"); _MTL_PRIVATE_DEF_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_, @@ -1058,6 +1460,8 @@ _MTL_PRIVATE_DEF_SEL(normalizedCoordinates, "normalizedCoordinates"); _MTL_PRIVATE_DEF_SEL(notifyListener_atValue_block_, "notifyListener:atValue:block:"); +_MTL_PRIVATE_DEF_SEL(objectAdditionalBinaryFunctions, + "objectAdditionalBinaryFunctions"); _MTL_PRIVATE_DEF_SEL(objectAtIndexedSubscript_, "objectAtIndexedSubscript:"); _MTL_PRIVATE_DEF_SEL(objectBindings, @@ -1066,10 +1470,18 @@ _MTL_PRIVATE_DEF_SEL(objectBuffers, "objectBuffers"); _MTL_PRIVATE_DEF_SEL(objectFunction, "objectFunction"); +_MTL_PRIVATE_DEF_SEL(objectFunctionDescriptor, + "objectFunctionDescriptor"); +_MTL_PRIVATE_DEF_SEL(objectLinkedFunctions, + "objectLinkedFunctions"); +_MTL_PRIVATE_DEF_SEL(objectLinkingDescriptor, + "objectLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(objectPayloadAlignment, "objectPayloadAlignment"); _MTL_PRIVATE_DEF_SEL(objectPayloadDataSize, "objectPayloadDataSize"); +_MTL_PRIVATE_DEF_SEL(objectStaticLinkingDescriptor, + "objectStaticLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(objectThreadExecutionWidth, "objectThreadExecutionWidth"); _MTL_PRIVATE_DEF_SEL(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth, @@ -1122,8 +1534,12 @@ _MTL_PRIVATE_DEF_SEL(physicalGranularity, "physicalGranularity"); _MTL_PRIVATE_DEF_SEL(physicalSizeForLayer_, "physicalSizeForLayer:"); +_MTL_PRIVATE_DEF_SEL(pipelineDataSetSerializer, + "pipelineDataSetSerializer"); _MTL_PRIVATE_DEF_SEL(pixelFormat, "pixelFormat"); +_MTL_PRIVATE_DEF_SEL(placementSparsePageSize, + "placementSparsePageSize"); _MTL_PRIVATE_DEF_SEL(pointerType, "pointerType"); _MTL_PRIVATE_DEF_SEL(popDebugGroup, @@ -1158,12 +1574,28 @@ _MTL_PRIVATE_DEF_SEL(primitiveDataStride, "primitiveDataStride"); _MTL_PRIVATE_DEF_SEL(priority, "priority"); +_MTL_PRIVATE_DEF_SEL(privateFunctionDescriptors, + "privateFunctionDescriptors"); _MTL_PRIVATE_DEF_SEL(privateFunctions, "privateFunctions"); _MTL_PRIVATE_DEF_SEL(pushDebugGroup_, "pushDebugGroup:"); +_MTL_PRIVATE_DEF_SEL(queryTimestampFrequency, + "queryTimestampFrequency"); _MTL_PRIVATE_DEF_SEL(rAddressMode, "rAddressMode"); +_MTL_PRIVATE_DEF_SEL(radiusBuffer, + "radiusBuffer"); +_MTL_PRIVATE_DEF_SEL(radiusBufferOffset, + "radiusBufferOffset"); +_MTL_PRIVATE_DEF_SEL(radiusBuffers, + "radiusBuffers"); +_MTL_PRIVATE_DEF_SEL(radiusFormat, + "radiusFormat"); +_MTL_PRIVATE_DEF_SEL(radiusStride, + "radiusStride"); +_MTL_PRIVATE_DEF_SEL(rank, + "rank"); _MTL_PRIVATE_DEF_SEL(rasterSampleCount, "rasterSampleCount"); _MTL_PRIVATE_DEF_SEL(rasterizationRateMap, @@ -1180,22 +1612,44 @@ _MTL_PRIVATE_DEF_SEL(readWriteTextureSupport, "readWriteTextureSupport"); _MTL_PRIVATE_DEF_SEL(recommendedMaxWorkingSetSize, "recommendedMaxWorkingSetSize"); +_MTL_PRIVATE_DEF_SEL(reductionMode, + "reductionMode"); +_MTL_PRIVATE_DEF_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_, + "refitAccelerationStructure:descriptor:destination:scratchBuffer:"); +_MTL_PRIVATE_DEF_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_options_, + "refitAccelerationStructure:descriptor:destination:scratchBuffer:options:"); _MTL_PRIVATE_DEF_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_, "refitAccelerationStructure:descriptor:destination:scratchBuffer:scratchBufferOffset:"); _MTL_PRIVATE_DEF_SEL(refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_options_, "refitAccelerationStructure:descriptor:destination:scratchBuffer:scratchBufferOffset:options:"); +_MTL_PRIVATE_DEF_SEL(reflection, + "reflection"); +_MTL_PRIVATE_DEF_SEL(reflectionForFunctionWithName_, + "reflectionForFunctionWithName:"); _MTL_PRIVATE_DEF_SEL(registryID, "registryID"); _MTL_PRIVATE_DEF_SEL(remoteStorageBuffer, "remoteStorageBuffer"); _MTL_PRIVATE_DEF_SEL(remoteStorageTexture, "remoteStorageTexture"); +_MTL_PRIVATE_DEF_SEL(removeAllAllocations, + "removeAllAllocations"); _MTL_PRIVATE_DEF_SEL(removeAllDebugMarkers, "removeAllDebugMarkers"); +_MTL_PRIVATE_DEF_SEL(removeAllocation_, + "removeAllocation:"); +_MTL_PRIVATE_DEF_SEL(removeAllocations_count_, + "removeAllocations:count:"); +_MTL_PRIVATE_DEF_SEL(removeResidencySet_, + "removeResidencySet:"); +_MTL_PRIVATE_DEF_SEL(removeResidencySets_count_, + "removeResidencySets:count:"); _MTL_PRIVATE_DEF_SEL(renderCommandEncoder, "renderCommandEncoder"); _MTL_PRIVATE_DEF_SEL(renderCommandEncoderWithDescriptor_, "renderCommandEncoderWithDescriptor:"); +_MTL_PRIVATE_DEF_SEL(renderCommandEncoderWithDescriptor_options_, + "renderCommandEncoderWithDescriptor:options:"); _MTL_PRIVATE_DEF_SEL(renderPassDescriptor, "renderPassDescriptor"); _MTL_PRIVATE_DEF_SEL(renderTargetArrayLength, @@ -1208,8 +1662,20 @@ _MTL_PRIVATE_DEF_SEL(replaceRegion_mipmapLevel_slice_withBytes_bytesPerRow_bytes "replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:"); _MTL_PRIVATE_DEF_SEL(replaceRegion_mipmapLevel_withBytes_bytesPerRow_, "replaceRegion:mipmapLevel:withBytes:bytesPerRow:"); +_MTL_PRIVATE_DEF_SEL(replaceSliceOrigin_sliceDimensions_withBytes_strides_, + "replaceSliceOrigin:sliceDimensions:withBytes:strides:"); +_MTL_PRIVATE_DEF_SEL(requestResidency, + "requestResidency"); _MTL_PRIVATE_DEF_SEL(required, "required"); +_MTL_PRIVATE_DEF_SEL(requiredThreadsPerMeshThreadgroup, + "requiredThreadsPerMeshThreadgroup"); +_MTL_PRIVATE_DEF_SEL(requiredThreadsPerObjectThreadgroup, + "requiredThreadsPerObjectThreadgroup"); +_MTL_PRIVATE_DEF_SEL(requiredThreadsPerThreadgroup, + "requiredThreadsPerThreadgroup"); +_MTL_PRIVATE_DEF_SEL(requiredThreadsPerTileThreadgroup, + "requiredThreadsPerTileThreadgroup"); _MTL_PRIVATE_DEF_SEL(reset, "reset"); _MTL_PRIVATE_DEF_SEL(resetCommandsInBuffer_withRange_, @@ -1218,6 +1684,8 @@ _MTL_PRIVATE_DEF_SEL(resetTextureAccessCounters_region_mipLevel_slice_, "resetTextureAccessCounters:region:mipLevel:slice:"); _MTL_PRIVATE_DEF_SEL(resetWithRange_, "resetWithRange:"); +_MTL_PRIVATE_DEF_SEL(resolveCounterHeap_withRange_intoBuffer_waitFence_updateFence_, + "resolveCounterHeap:withRange:intoBuffer:waitFence:updateFence:"); _MTL_PRIVATE_DEF_SEL(resolveCounterRange_, "resolveCounterRange:"); _MTL_PRIVATE_DEF_SEL(resolveCounters_inRange_destinationBuffer_destinationOffset_, @@ -1238,6 +1706,8 @@ _MTL_PRIVATE_DEF_SEL(resourceStateCommandEncoderWithDescriptor_, "resourceStateCommandEncoderWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(resourceStatePassDescriptor, "resourceStatePassDescriptor"); +_MTL_PRIVATE_DEF_SEL(resourceViewCount, + "resourceViewCount"); _MTL_PRIVATE_DEF_SEL(retainedReferences, "retainedReferences"); _MTL_PRIVATE_DEF_SEL(rgbBlendOperation, @@ -1260,6 +1730,14 @@ _MTL_PRIVATE_DEF_SEL(scratchBufferAllocator, "scratchBufferAllocator"); _MTL_PRIVATE_DEF_SEL(screenSize, "screenSize"); +_MTL_PRIVATE_DEF_SEL(segmentControlPointCount, + "segmentControlPointCount"); +_MTL_PRIVATE_DEF_SEL(segmentCount, + "segmentCount"); +_MTL_PRIVATE_DEF_SEL(serializeAsArchiveAndFlushToURL_error_, + "serializeAsArchiveAndFlushToURL:error:"); +_MTL_PRIVATE_DEF_SEL(serializeAsPipelinesScriptWithError_, + "serializeAsPipelinesScriptWithError:"); _MTL_PRIVATE_DEF_SEL(serializeToURL_error_, "serializeToURL:error:"); _MTL_PRIVATE_DEF_SEL(setAccelerationStructure_atBufferIndex_, @@ -1268,6 +1746,10 @@ _MTL_PRIVATE_DEF_SEL(setAccelerationStructure_atIndex_, "setAccelerationStructure:atIndex:"); _MTL_PRIVATE_DEF_SEL(setAccess_, "setAccess:"); +_MTL_PRIVATE_DEF_SEL(setAddress_atIndex_, + "setAddress:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setAddress_attributeStride_atIndex_, + "setAddress:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setAllowDuplicateIntersectionFunctionInvocation_, "setAllowDuplicateIntersectionFunctionInvocation:"); _MTL_PRIVATE_DEF_SEL(setAllowGPUOptimizedContents_, @@ -1278,14 +1760,22 @@ _MTL_PRIVATE_DEF_SEL(setAlphaBlendOperation_, "setAlphaBlendOperation:"); _MTL_PRIVATE_DEF_SEL(setAlphaToCoverageEnabled_, "setAlphaToCoverageEnabled:"); +_MTL_PRIVATE_DEF_SEL(setAlphaToCoverageState_, + "setAlphaToCoverageState:"); _MTL_PRIVATE_DEF_SEL(setAlphaToOneEnabled_, "setAlphaToOneEnabled:"); +_MTL_PRIVATE_DEF_SEL(setAlphaToOneState_, + "setAlphaToOneState:"); _MTL_PRIVATE_DEF_SEL(setArgumentBuffer_offset_, "setArgumentBuffer:offset:"); _MTL_PRIVATE_DEF_SEL(setArgumentBuffer_startOffset_arrayElement_, "setArgumentBuffer:startOffset:arrayElement:"); _MTL_PRIVATE_DEF_SEL(setArgumentIndex_, "setArgumentIndex:"); +_MTL_PRIVATE_DEF_SEL(setArgumentTable_, + "setArgumentTable:"); +_MTL_PRIVATE_DEF_SEL(setArgumentTable_atStages_, + "setArgumentTable:atStages:"); _MTL_PRIVATE_DEF_SEL(setArguments_, "setArguments:"); _MTL_PRIVATE_DEF_SEL(setArrayLength_, @@ -1300,10 +1790,14 @@ _MTL_PRIVATE_DEF_SEL(setBinaryArchives_, "setBinaryArchives:"); _MTL_PRIVATE_DEF_SEL(setBinaryFunctions_, "setBinaryFunctions:"); +_MTL_PRIVATE_DEF_SEL(setBinaryLinkedFunctions_, + "setBinaryLinkedFunctions:"); _MTL_PRIVATE_DEF_SEL(setBlendColorRed_green_blue_alpha_, "setBlendColorRed:green:blue:alpha:"); _MTL_PRIVATE_DEF_SEL(setBlendingEnabled_, "setBlendingEnabled:"); +_MTL_PRIVATE_DEF_SEL(setBlendingState_, + "setBlendingState:"); _MTL_PRIVATE_DEF_SEL(setBorderColor_, "setBorderColor:"); _MTL_PRIVATE_DEF_SEL(setBoundingBoxBuffer_, @@ -1320,14 +1814,24 @@ _MTL_PRIVATE_DEF_SEL(setBuffer_, "setBuffer:"); _MTL_PRIVATE_DEF_SEL(setBuffer_offset_atIndex_, "setBuffer:offset:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setBuffer_offset_attributeStride_atIndex_, + "setBuffer:offset:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setBufferIndex_, "setBufferIndex:"); _MTL_PRIVATE_DEF_SEL(setBufferOffset_atIndex_, "setBufferOffset:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setBufferOffset_attributeStride_atIndex_, + "setBufferOffset:attributeStride:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setBufferSize_, + "setBufferSize:"); +_MTL_PRIVATE_DEF_SEL(setBuffers_offsets_attributeStrides_withRange_, + "setBuffers:offsets:attributeStrides:withRange:"); _MTL_PRIVATE_DEF_SEL(setBuffers_offsets_withRange_, "setBuffers:offsets:withRange:"); _MTL_PRIVATE_DEF_SEL(setBytes_length_atIndex_, "setBytes:length:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setBytes_length_attributeStride_atIndex_, + "setBytes:length:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setCaptureObject_, "setCaptureObject:"); _MTL_PRIVATE_DEF_SEL(setClearColor_, @@ -1336,6 +1840,10 @@ _MTL_PRIVATE_DEF_SEL(setClearDepth_, "setClearDepth:"); _MTL_PRIVATE_DEF_SEL(setClearStencil_, "setClearStencil:"); +_MTL_PRIVATE_DEF_SEL(setColorAttachmentMap_, + "setColorAttachmentMap:"); +_MTL_PRIVATE_DEF_SEL(setColorAttachmentMappingState_, + "setColorAttachmentMappingState:"); _MTL_PRIVATE_DEF_SEL(setColorStoreAction_atIndex_, "setColorStoreAction:atIndex:"); _MTL_PRIVATE_DEF_SEL(setColorStoreActionOptions_atIndex_, @@ -1350,12 +1858,16 @@ _MTL_PRIVATE_DEF_SEL(setCompressionType_, "setCompressionType:"); _MTL_PRIVATE_DEF_SEL(setComputeFunction_, "setComputeFunction:"); +_MTL_PRIVATE_DEF_SEL(setComputeFunctionDescriptor_, + "setComputeFunctionDescriptor:"); _MTL_PRIVATE_DEF_SEL(setComputePipelineState_, "setComputePipelineState:"); _MTL_PRIVATE_DEF_SEL(setComputePipelineState_atIndex_, "setComputePipelineState:atIndex:"); _MTL_PRIVATE_DEF_SEL(setComputePipelineStates_withRange_, "setComputePipelineStates:withRange:"); +_MTL_PRIVATE_DEF_SEL(setConfiguration_, + "setConfiguration:"); _MTL_PRIVATE_DEF_SEL(setConstantBlockAlignment_, "setConstantBlockAlignment:"); _MTL_PRIVATE_DEF_SEL(setConstantValue_type_atIndex_, @@ -1368,12 +1880,32 @@ _MTL_PRIVATE_DEF_SEL(setConstantValues_type_withRange_, "setConstantValues:type:withRange:"); _MTL_PRIVATE_DEF_SEL(setControlDependencies_, "setControlDependencies:"); +_MTL_PRIVATE_DEF_SEL(setControlPointBuffer_, + "setControlPointBuffer:"); +_MTL_PRIVATE_DEF_SEL(setControlPointBufferOffset_, + "setControlPointBufferOffset:"); +_MTL_PRIVATE_DEF_SEL(setControlPointBuffers_, + "setControlPointBuffers:"); +_MTL_PRIVATE_DEF_SEL(setControlPointCount_, + "setControlPointCount:"); +_MTL_PRIVATE_DEF_SEL(setControlPointFormat_, + "setControlPointFormat:"); +_MTL_PRIVATE_DEF_SEL(setControlPointStride_, + "setControlPointStride:"); +_MTL_PRIVATE_DEF_SEL(setCount_, + "setCount:"); _MTL_PRIVATE_DEF_SEL(setCounterSet_, "setCounterSet:"); _MTL_PRIVATE_DEF_SEL(setCpuCacheMode_, "setCpuCacheMode:"); _MTL_PRIVATE_DEF_SEL(setCullMode_, "setCullMode:"); +_MTL_PRIVATE_DEF_SEL(setCurveBasis_, + "setCurveBasis:"); +_MTL_PRIVATE_DEF_SEL(setCurveEndCaps_, + "setCurveEndCaps:"); +_MTL_PRIVATE_DEF_SEL(setCurveType_, + "setCurveType:"); _MTL_PRIVATE_DEF_SEL(setDataType_, "setDataType:"); _MTL_PRIVATE_DEF_SEL(setDefaultCaptureScope_, @@ -1402,10 +1934,16 @@ _MTL_PRIVATE_DEF_SEL(setDepthStencilPassOperation_, "setDepthStencilPassOperation:"); _MTL_PRIVATE_DEF_SEL(setDepthStencilState_, "setDepthStencilState:"); +_MTL_PRIVATE_DEF_SEL(setDepthStencilState_atIndex_, + "setDepthStencilState:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setDepthStencilStates_withRange_, + "setDepthStencilStates:withRange:"); _MTL_PRIVATE_DEF_SEL(setDepthStoreAction_, "setDepthStoreAction:"); _MTL_PRIVATE_DEF_SEL(setDepthStoreActionOptions_, "setDepthStoreActionOptions:"); +_MTL_PRIVATE_DEF_SEL(setDepthTestMinBound_maxBound_, + "setDepthTestMinBound:maxBound:"); _MTL_PRIVATE_DEF_SEL(setDepthWriteEnabled_, "setDepthWriteEnabled:"); _MTL_PRIVATE_DEF_SEL(setDestination_, @@ -1414,8 +1952,12 @@ _MTL_PRIVATE_DEF_SEL(setDestinationAlphaBlendFactor_, "setDestinationAlphaBlendFactor:"); _MTL_PRIVATE_DEF_SEL(setDestinationRGBBlendFactor_, "setDestinationRGBBlendFactor:"); +_MTL_PRIVATE_DEF_SEL(setDimensions_, + "setDimensions:"); _MTL_PRIVATE_DEF_SEL(setDispatchType_, "setDispatchType:"); +_MTL_PRIVATE_DEF_SEL(setEnableLogging_, + "setEnableLogging:"); _MTL_PRIVATE_DEF_SEL(setEndOfEncoderSampleIndex_, "setEndOfEncoderSampleIndex:"); _MTL_PRIVATE_DEF_SEL(setEndOfFragmentSampleIndex_, @@ -1426,6 +1968,8 @@ _MTL_PRIVATE_DEF_SEL(setErrorOptions_, "setErrorOptions:"); _MTL_PRIVATE_DEF_SEL(setFastMathEnabled_, "setFastMathEnabled:"); +_MTL_PRIVATE_DEF_SEL(setFeedbackQueue_, + "setFeedbackQueue:"); _MTL_PRIVATE_DEF_SEL(setFormat_, "setFormat:"); _MTL_PRIVATE_DEF_SEL(setFragmentAccelerationStructure_atBufferIndex_, @@ -1442,6 +1986,8 @@ _MTL_PRIVATE_DEF_SEL(setFragmentBytes_length_atIndex_, "setFragmentBytes:length:atIndex:"); _MTL_PRIVATE_DEF_SEL(setFragmentFunction_, "setFragmentFunction:"); +_MTL_PRIVATE_DEF_SEL(setFragmentFunctionDescriptor_, + "setFragmentFunctionDescriptor:"); _MTL_PRIVATE_DEF_SEL(setFragmentIntersectionFunctionTable_atBufferIndex_, "setFragmentIntersectionFunctionTable:atBufferIndex:"); _MTL_PRIVATE_DEF_SEL(setFragmentIntersectionFunctionTables_withBufferRange_, @@ -1458,6 +2004,8 @@ _MTL_PRIVATE_DEF_SEL(setFragmentSamplerStates_lodMinClamps_lodMaxClamps_withRang "setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:"); _MTL_PRIVATE_DEF_SEL(setFragmentSamplerStates_withRange_, "setFragmentSamplerStates:withRange:"); +_MTL_PRIVATE_DEF_SEL(setFragmentStaticLinkingDescriptor_, + "setFragmentStaticLinkingDescriptor:"); _MTL_PRIVATE_DEF_SEL(setFragmentTexture_atIndex_, "setFragmentTexture:atIndex:"); _MTL_PRIVATE_DEF_SEL(setFragmentTextures_withRange_, @@ -1474,6 +2022,12 @@ _MTL_PRIVATE_DEF_SEL(setFunction_atIndex_, "setFunction:atIndex:"); _MTL_PRIVATE_DEF_SEL(setFunctionCount_, "setFunctionCount:"); +_MTL_PRIVATE_DEF_SEL(setFunctionDescriptor_, + "setFunctionDescriptor:"); +_MTL_PRIVATE_DEF_SEL(setFunctionDescriptors_, + "setFunctionDescriptors:"); +_MTL_PRIVATE_DEF_SEL(setFunctionGraph_, + "setFunctionGraph:"); _MTL_PRIVATE_DEF_SEL(setFunctionGraphs_, "setFunctionGraphs:"); _MTL_PRIVATE_DEF_SEL(setFunctionName_, @@ -1510,8 +2064,28 @@ _MTL_PRIVATE_DEF_SEL(setIndirectCommandBuffers_withRange_, "setIndirectCommandBuffers:withRange:"); _MTL_PRIVATE_DEF_SEL(setInheritBuffers_, "setInheritBuffers:"); +_MTL_PRIVATE_DEF_SEL(setInheritCullMode_, + "setInheritCullMode:"); +_MTL_PRIVATE_DEF_SEL(setInheritDepthBias_, + "setInheritDepthBias:"); +_MTL_PRIVATE_DEF_SEL(setInheritDepthClipMode_, + "setInheritDepthClipMode:"); +_MTL_PRIVATE_DEF_SEL(setInheritDepthStencilState_, + "setInheritDepthStencilState:"); +_MTL_PRIVATE_DEF_SEL(setInheritFrontFacingWinding_, + "setInheritFrontFacingWinding:"); _MTL_PRIVATE_DEF_SEL(setInheritPipelineState_, "setInheritPipelineState:"); +_MTL_PRIVATE_DEF_SEL(setInheritTriangleFillMode_, + "setInheritTriangleFillMode:"); +_MTL_PRIVATE_DEF_SEL(setInitialCapacity_, + "setInitialCapacity:"); +_MTL_PRIVATE_DEF_SEL(setInitializeBindings_, + "setInitializeBindings:"); +_MTL_PRIVATE_DEF_SEL(setInputDimensions_atBufferIndex_, + "setInputDimensions:atBufferIndex:"); +_MTL_PRIVATE_DEF_SEL(setInputDimensions_withRange_, + "setInputDimensions:withRange:"); _MTL_PRIVATE_DEF_SEL(setInputPrimitiveTopology_, "setInputPrimitiveTopology:"); _MTL_PRIVATE_DEF_SEL(setInsertLibraries_, @@ -1520,6 +2094,10 @@ _MTL_PRIVATE_DEF_SEL(setInstallName_, "setInstallName:"); _MTL_PRIVATE_DEF_SEL(setInstanceCount_, "setInstanceCount:"); +_MTL_PRIVATE_DEF_SEL(setInstanceCountBuffer_, + "setInstanceCountBuffer:"); +_MTL_PRIVATE_DEF_SEL(setInstanceCountBufferOffset_, + "setInstanceCountBufferOffset:"); _MTL_PRIVATE_DEF_SEL(setInstanceDescriptorBuffer_, "setInstanceDescriptorBuffer:"); _MTL_PRIVATE_DEF_SEL(setInstanceDescriptorBufferOffset_, @@ -1528,6 +2106,8 @@ _MTL_PRIVATE_DEF_SEL(setInstanceDescriptorStride_, "setInstanceDescriptorStride:"); _MTL_PRIVATE_DEF_SEL(setInstanceDescriptorType_, "setInstanceDescriptorType:"); +_MTL_PRIVATE_DEF_SEL(setInstanceTransformationMatrixLayout_, + "setInstanceTransformationMatrixLayout:"); _MTL_PRIVATE_DEF_SEL(setInstancedAccelerationStructures_, "setInstancedAccelerationStructures:"); _MTL_PRIVATE_DEF_SEL(setIntersectionFunctionTable_atBufferIndex_, @@ -1542,6 +2122,8 @@ _MTL_PRIVATE_DEF_SEL(setIntersectionFunctionTables_withRange_, "setIntersectionFunctionTables:withRange:"); _MTL_PRIVATE_DEF_SEL(setKernelBuffer_offset_atIndex_, "setKernelBuffer:offset:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setKernelBuffer_offset_attributeStride_atIndex_, + "setKernelBuffer:offset:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setLabel_, "setLabel:"); _MTL_PRIVATE_DEF_SEL(setLanguageVersion_, @@ -1550,8 +2132,12 @@ _MTL_PRIVATE_DEF_SEL(setLayer_atIndex_, "setLayer:atIndex:"); _MTL_PRIVATE_DEF_SEL(setLevel_, "setLevel:"); +_MTL_PRIVATE_DEF_SEL(setLevelRange_, + "setLevelRange:"); _MTL_PRIVATE_DEF_SEL(setLibraries_, "setLibraries:"); +_MTL_PRIVATE_DEF_SEL(setLibrary_, + "setLibrary:"); _MTL_PRIVATE_DEF_SEL(setLibraryType_, "setLibraryType:"); _MTL_PRIVATE_DEF_SEL(setLinkedFunctions_, @@ -1560,28 +2146,60 @@ _MTL_PRIVATE_DEF_SEL(setLoadAction_, "setLoadAction:"); _MTL_PRIVATE_DEF_SEL(setLodAverage_, "setLodAverage:"); +_MTL_PRIVATE_DEF_SEL(setLodBias_, + "setLodBias:"); _MTL_PRIVATE_DEF_SEL(setLodMaxClamp_, "setLodMaxClamp:"); _MTL_PRIVATE_DEF_SEL(setLodMinClamp_, "setLodMinClamp:"); +_MTL_PRIVATE_DEF_SEL(setLogState_, + "setLogState:"); +_MTL_PRIVATE_DEF_SEL(setLookupArchives_, + "setLookupArchives:"); +_MTL_PRIVATE_DEF_SEL(setMachineLearningFunctionDescriptor_, + "setMachineLearningFunctionDescriptor:"); _MTL_PRIVATE_DEF_SEL(setMagFilter_, "setMagFilter:"); +_MTL_PRIVATE_DEF_SEL(setMathFloatingPointFunctions_, + "setMathFloatingPointFunctions:"); +_MTL_PRIVATE_DEF_SEL(setMathMode_, + "setMathMode:"); _MTL_PRIVATE_DEF_SEL(setMaxAnisotropy_, "setMaxAnisotropy:"); +_MTL_PRIVATE_DEF_SEL(setMaxBufferBindCount_, + "setMaxBufferBindCount:"); _MTL_PRIVATE_DEF_SEL(setMaxCallStackDepth_, "setMaxCallStackDepth:"); _MTL_PRIVATE_DEF_SEL(setMaxCommandBufferCount_, "setMaxCommandBufferCount:"); _MTL_PRIVATE_DEF_SEL(setMaxCommandsInFlight_, "setMaxCommandsInFlight:"); +_MTL_PRIVATE_DEF_SEL(setMaxCompatiblePlacementSparsePageSize_, + "setMaxCompatiblePlacementSparsePageSize:"); _MTL_PRIVATE_DEF_SEL(setMaxFragmentBufferBindCount_, "setMaxFragmentBufferBindCount:"); _MTL_PRIVATE_DEF_SEL(setMaxFragmentCallStackDepth_, "setMaxFragmentCallStackDepth:"); +_MTL_PRIVATE_DEF_SEL(setMaxInstanceCount_, + "setMaxInstanceCount:"); _MTL_PRIVATE_DEF_SEL(setMaxKernelBufferBindCount_, "setMaxKernelBufferBindCount:"); +_MTL_PRIVATE_DEF_SEL(setMaxKernelThreadgroupMemoryBindCount_, + "setMaxKernelThreadgroupMemoryBindCount:"); +_MTL_PRIVATE_DEF_SEL(setMaxMeshBufferBindCount_, + "setMaxMeshBufferBindCount:"); +_MTL_PRIVATE_DEF_SEL(setMaxMotionTransformCount_, + "setMaxMotionTransformCount:"); +_MTL_PRIVATE_DEF_SEL(setMaxObjectBufferBindCount_, + "setMaxObjectBufferBindCount:"); +_MTL_PRIVATE_DEF_SEL(setMaxObjectThreadgroupMemoryBindCount_, + "setMaxObjectThreadgroupMemoryBindCount:"); +_MTL_PRIVATE_DEF_SEL(setMaxSamplerStateBindCount_, + "setMaxSamplerStateBindCount:"); _MTL_PRIVATE_DEF_SEL(setMaxTessellationFactor_, "setMaxTessellationFactor:"); +_MTL_PRIVATE_DEF_SEL(setMaxTextureBindCount_, + "setMaxTextureBindCount:"); _MTL_PRIVATE_DEF_SEL(setMaxTotalThreadgroupsPerMeshGrid_, "setMaxTotalThreadgroupsPerMeshGrid:"); _MTL_PRIVATE_DEF_SEL(setMaxTotalThreadsPerMeshThreadgroup_, @@ -1596,6 +2214,8 @@ _MTL_PRIVATE_DEF_SEL(setMaxVertexBufferBindCount_, "setMaxVertexBufferBindCount:"); _MTL_PRIVATE_DEF_SEL(setMaxVertexCallStackDepth_, "setMaxVertexCallStackDepth:"); +_MTL_PRIVATE_DEF_SEL(setMeshAdditionalBinaryFunctions_, + "setMeshAdditionalBinaryFunctions:"); _MTL_PRIVATE_DEF_SEL(setMeshBuffer_offset_atIndex_, "setMeshBuffer:offset:atIndex:"); _MTL_PRIVATE_DEF_SEL(setMeshBufferOffset_atIndex_, @@ -1606,6 +2226,10 @@ _MTL_PRIVATE_DEF_SEL(setMeshBytes_length_atIndex_, "setMeshBytes:length:atIndex:"); _MTL_PRIVATE_DEF_SEL(setMeshFunction_, "setMeshFunction:"); +_MTL_PRIVATE_DEF_SEL(setMeshFunctionDescriptor_, + "setMeshFunctionDescriptor:"); +_MTL_PRIVATE_DEF_SEL(setMeshLinkedFunctions_, + "setMeshLinkedFunctions:"); _MTL_PRIVATE_DEF_SEL(setMeshSamplerState_atIndex_, "setMeshSamplerState:atIndex:"); _MTL_PRIVATE_DEF_SEL(setMeshSamplerState_lodMinClamp_lodMaxClamp_atIndex_, @@ -1614,6 +2238,8 @@ _MTL_PRIVATE_DEF_SEL(setMeshSamplerStates_lodMinClamps_lodMaxClamps_withRange_, "setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:"); _MTL_PRIVATE_DEF_SEL(setMeshSamplerStates_withRange_, "setMeshSamplerStates:withRange:"); +_MTL_PRIVATE_DEF_SEL(setMeshStaticLinkingDescriptor_, + "setMeshStaticLinkingDescriptor:"); _MTL_PRIVATE_DEF_SEL(setMeshTexture_atIndex_, "setMeshTexture:atIndex:"); _MTL_PRIVATE_DEF_SEL(setMeshTextures_withRange_, @@ -1642,6 +2268,14 @@ _MTL_PRIVATE_DEF_SEL(setMotionTransformBufferOffset_, "setMotionTransformBufferOffset:"); _MTL_PRIVATE_DEF_SEL(setMotionTransformCount_, "setMotionTransformCount:"); +_MTL_PRIVATE_DEF_SEL(setMotionTransformCountBuffer_, + "setMotionTransformCountBuffer:"); +_MTL_PRIVATE_DEF_SEL(setMotionTransformCountBufferOffset_, + "setMotionTransformCountBufferOffset:"); +_MTL_PRIVATE_DEF_SEL(setMotionTransformStride_, + "setMotionTransformStride:"); +_MTL_PRIVATE_DEF_SEL(setMotionTransformType_, + "setMotionTransformType:"); _MTL_PRIVATE_DEF_SEL(setMutability_, "setMutability:"); _MTL_PRIVATE_DEF_SEL(setName_, @@ -1652,6 +2286,8 @@ _MTL_PRIVATE_DEF_SEL(setNormalizedCoordinates_, "setNormalizedCoordinates:"); _MTL_PRIVATE_DEF_SEL(setObject_atIndexedSubscript_, "setObject:atIndexedSubscript:"); +_MTL_PRIVATE_DEF_SEL(setObjectAdditionalBinaryFunctions_, + "setObjectAdditionalBinaryFunctions:"); _MTL_PRIVATE_DEF_SEL(setObjectBuffer_offset_atIndex_, "setObjectBuffer:offset:atIndex:"); _MTL_PRIVATE_DEF_SEL(setObjectBufferOffset_atIndex_, @@ -1662,6 +2298,10 @@ _MTL_PRIVATE_DEF_SEL(setObjectBytes_length_atIndex_, "setObjectBytes:length:atIndex:"); _MTL_PRIVATE_DEF_SEL(setObjectFunction_, "setObjectFunction:"); +_MTL_PRIVATE_DEF_SEL(setObjectFunctionDescriptor_, + "setObjectFunctionDescriptor:"); +_MTL_PRIVATE_DEF_SEL(setObjectLinkedFunctions_, + "setObjectLinkedFunctions:"); _MTL_PRIVATE_DEF_SEL(setObjectSamplerState_atIndex_, "setObjectSamplerState:atIndex:"); _MTL_PRIVATE_DEF_SEL(setObjectSamplerState_lodMinClamp_lodMaxClamp_atIndex_, @@ -1670,6 +2310,8 @@ _MTL_PRIVATE_DEF_SEL(setObjectSamplerStates_lodMinClamps_lodMaxClamps_withRange_ "setObjectSamplerStates:lodMinClamps:lodMaxClamps:withRange:"); _MTL_PRIVATE_DEF_SEL(setObjectSamplerStates_withRange_, "setObjectSamplerStates:withRange:"); +_MTL_PRIVATE_DEF_SEL(setObjectStaticLinkingDescriptor_, + "setObjectStaticLinkingDescriptor:"); _MTL_PRIVATE_DEF_SEL(setObjectTexture_atIndex_, "setObjectTexture:atIndex:"); _MTL_PRIVATE_DEF_SEL(setObjectTextures_withRange_, @@ -1682,6 +2324,10 @@ _MTL_PRIVATE_DEF_SEL(setOffset_, "setOffset:"); _MTL_PRIVATE_DEF_SEL(setOpaque_, "setOpaque:"); +_MTL_PRIVATE_DEF_SEL(setOpaqueCurveIntersectionFunctionWithSignature_atIndex_, + "setOpaqueCurveIntersectionFunctionWithSignature:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setOpaqueCurveIntersectionFunctionWithSignature_withRange_, + "setOpaqueCurveIntersectionFunctionWithSignature:withRange:"); _MTL_PRIVATE_DEF_SEL(setOpaqueTriangleIntersectionFunctionWithSignature_atIndex_, "setOpaqueTriangleIntersectionFunctionWithSignature:atIndex:"); _MTL_PRIVATE_DEF_SEL(setOpaqueTriangleIntersectionFunctionWithSignature_withRange_, @@ -1694,10 +2340,20 @@ _MTL_PRIVATE_DEF_SEL(setOutputNode_, "setOutputNode:"); _MTL_PRIVATE_DEF_SEL(setOutputURL_, "setOutputURL:"); +_MTL_PRIVATE_DEF_SEL(setOwnerWithIdentity_, + "setOwnerWithIdentity:"); _MTL_PRIVATE_DEF_SEL(setPayloadMemoryLength_, "setPayloadMemoryLength:"); +_MTL_PRIVATE_DEF_SEL(setPhysicalIndex_forLogicalIndex_, + "setPhysicalIndex:forLogicalIndex:"); +_MTL_PRIVATE_DEF_SEL(setPipelineDataSetSerializer_, + "setPipelineDataSetSerializer:"); +_MTL_PRIVATE_DEF_SEL(setPipelineState_, + "setPipelineState:"); _MTL_PRIVATE_DEF_SEL(setPixelFormat_, "setPixelFormat:"); +_MTL_PRIVATE_DEF_SEL(setPlacementSparsePageSize_, + "setPlacementSparsePageSize:"); _MTL_PRIVATE_DEF_SEL(setPreloadedLibraries_, "setPreloadedLibraries:"); _MTL_PRIVATE_DEF_SEL(setPreprocessorMacros_, @@ -1714,12 +2370,24 @@ _MTL_PRIVATE_DEF_SEL(setPrimitiveDataStride_, "setPrimitiveDataStride:"); _MTL_PRIVATE_DEF_SEL(setPriority_, "setPriority:"); +_MTL_PRIVATE_DEF_SEL(setPrivateFunctionDescriptors_, + "setPrivateFunctionDescriptors:"); _MTL_PRIVATE_DEF_SEL(setPrivateFunctions_, "setPrivateFunctions:"); _MTL_PRIVATE_DEF_SEL(setPurgeableState_, "setPurgeableState:"); _MTL_PRIVATE_DEF_SEL(setRAddressMode_, "setRAddressMode:"); +_MTL_PRIVATE_DEF_SEL(setRadiusBuffer_, + "setRadiusBuffer:"); +_MTL_PRIVATE_DEF_SEL(setRadiusBufferOffset_, + "setRadiusBufferOffset:"); +_MTL_PRIVATE_DEF_SEL(setRadiusBuffers_, + "setRadiusBuffers:"); +_MTL_PRIVATE_DEF_SEL(setRadiusFormat_, + "setRadiusFormat:"); +_MTL_PRIVATE_DEF_SEL(setRadiusStride_, + "setRadiusStride:"); _MTL_PRIVATE_DEF_SEL(setRasterSampleCount_, "setRasterSampleCount:"); _MTL_PRIVATE_DEF_SEL(setRasterizationEnabled_, @@ -1728,6 +2396,8 @@ _MTL_PRIVATE_DEF_SEL(setRasterizationRateMap_, "setRasterizationRateMap:"); _MTL_PRIVATE_DEF_SEL(setReadMask_, "setReadMask:"); +_MTL_PRIVATE_DEF_SEL(setReductionMode_, + "setReductionMode:"); _MTL_PRIVATE_DEF_SEL(setRenderPipelineState_, "setRenderPipelineState:"); _MTL_PRIVATE_DEF_SEL(setRenderPipelineState_atIndex_, @@ -1740,6 +2410,12 @@ _MTL_PRIVATE_DEF_SEL(setRenderTargetHeight_, "setRenderTargetHeight:"); _MTL_PRIVATE_DEF_SEL(setRenderTargetWidth_, "setRenderTargetWidth:"); +_MTL_PRIVATE_DEF_SEL(setRequiredThreadsPerMeshThreadgroup_, + "setRequiredThreadsPerMeshThreadgroup:"); +_MTL_PRIVATE_DEF_SEL(setRequiredThreadsPerObjectThreadgroup_, + "setRequiredThreadsPerObjectThreadgroup:"); +_MTL_PRIVATE_DEF_SEL(setRequiredThreadsPerThreadgroup_, + "setRequiredThreadsPerThreadgroup:"); _MTL_PRIVATE_DEF_SEL(setResolveDepthPlane_, "setResolveDepthPlane:"); _MTL_PRIVATE_DEF_SEL(setResolveLevel_, @@ -1748,8 +2424,12 @@ _MTL_PRIVATE_DEF_SEL(setResolveSlice_, "setResolveSlice:"); _MTL_PRIVATE_DEF_SEL(setResolveTexture_, "setResolveTexture:"); +_MTL_PRIVATE_DEF_SEL(setResource_atBufferIndex_, + "setResource:atBufferIndex:"); _MTL_PRIVATE_DEF_SEL(setResourceOptions_, "setResourceOptions:"); +_MTL_PRIVATE_DEF_SEL(setResourceViewCount_, + "setResourceViewCount:"); _MTL_PRIVATE_DEF_SEL(setRetainedReferences_, "setRetainedReferences:"); _MTL_PRIVATE_DEF_SEL(setRgbBlendOperation_, @@ -1778,6 +2458,14 @@ _MTL_PRIVATE_DEF_SEL(setScratchBufferAllocator_, "setScratchBufferAllocator:"); _MTL_PRIVATE_DEF_SEL(setScreenSize_, "setScreenSize:"); +_MTL_PRIVATE_DEF_SEL(setSegmentControlPointCount_, + "setSegmentControlPointCount:"); +_MTL_PRIVATE_DEF_SEL(setSegmentCount_, + "setSegmentCount:"); +_MTL_PRIVATE_DEF_SEL(setShaderReflection_, + "setShaderReflection:"); +_MTL_PRIVATE_DEF_SEL(setShaderValidation_, + "setShaderValidation:"); _MTL_PRIVATE_DEF_SEL(setShouldMaximizeConcurrentCompilation_, "setShouldMaximizeConcurrentCompilation:"); _MTL_PRIVATE_DEF_SEL(setSignaledValue_, @@ -1786,6 +2474,10 @@ _MTL_PRIVATE_DEF_SEL(setSize_, "setSize:"); _MTL_PRIVATE_DEF_SEL(setSlice_, "setSlice:"); +_MTL_PRIVATE_DEF_SEL(setSliceRange_, + "setSliceRange:"); +_MTL_PRIVATE_DEF_SEL(setSource_, + "setSource:"); _MTL_PRIVATE_DEF_SEL(setSourceAlphaBlendFactor_, "setSourceAlphaBlendFactor:"); _MTL_PRIVATE_DEF_SEL(setSourceRGBBlendFactor_, @@ -1806,6 +2498,8 @@ _MTL_PRIVATE_DEF_SEL(setStartOfFragmentSampleIndex_, "setStartOfFragmentSampleIndex:"); _MTL_PRIVATE_DEF_SEL(setStartOfVertexSampleIndex_, "setStartOfVertexSampleIndex:"); +_MTL_PRIVATE_DEF_SEL(setStaticLinkingDescriptor_, + "setStaticLinkingDescriptor:"); _MTL_PRIVATE_DEF_SEL(setStencilAttachment_, "setStencilAttachment:"); _MTL_PRIVATE_DEF_SEL(setStencilAttachmentPixelFormat_, @@ -1836,6 +2530,8 @@ _MTL_PRIVATE_DEF_SEL(setStoreActionOptions_, "setStoreActionOptions:"); _MTL_PRIVATE_DEF_SEL(setStride_, "setStride:"); +_MTL_PRIVATE_DEF_SEL(setStrides_, + "setStrides:"); _MTL_PRIVATE_DEF_SEL(setSupportAddingBinaryFunctions_, "setSupportAddingBinaryFunctions:"); _MTL_PRIVATE_DEF_SEL(setSupportAddingFragmentBinaryFunctions_, @@ -1844,10 +2540,26 @@ _MTL_PRIVATE_DEF_SEL(setSupportAddingVertexBinaryFunctions_, "setSupportAddingVertexBinaryFunctions:"); _MTL_PRIVATE_DEF_SEL(setSupportArgumentBuffers_, "setSupportArgumentBuffers:"); +_MTL_PRIVATE_DEF_SEL(setSupportAttributeStrides_, + "setSupportAttributeStrides:"); +_MTL_PRIVATE_DEF_SEL(setSupportBinaryLinking_, + "setSupportBinaryLinking:"); +_MTL_PRIVATE_DEF_SEL(setSupportColorAttachmentMapping_, + "setSupportColorAttachmentMapping:"); +_MTL_PRIVATE_DEF_SEL(setSupportDynamicAttributeStride_, + "setSupportDynamicAttributeStride:"); +_MTL_PRIVATE_DEF_SEL(setSupportFragmentBinaryLinking_, + "setSupportFragmentBinaryLinking:"); _MTL_PRIVATE_DEF_SEL(setSupportIndirectCommandBuffers_, "setSupportIndirectCommandBuffers:"); +_MTL_PRIVATE_DEF_SEL(setSupportMeshBinaryLinking_, + "setSupportMeshBinaryLinking:"); +_MTL_PRIVATE_DEF_SEL(setSupportObjectBinaryLinking_, + "setSupportObjectBinaryLinking:"); _MTL_PRIVATE_DEF_SEL(setSupportRayTracing_, "setSupportRayTracing:"); +_MTL_PRIVATE_DEF_SEL(setSupportVertexBinaryLinking_, + "setSupportVertexBinaryLinking:"); _MTL_PRIVATE_DEF_SEL(setSwizzle_, "setSwizzle:"); _MTL_PRIVATE_DEF_SEL(setTAddressMode_, @@ -1874,6 +2586,12 @@ _MTL_PRIVATE_DEF_SEL(setTexture_atIndex_, "setTexture:atIndex:"); _MTL_PRIVATE_DEF_SEL(setTextureType_, "setTextureType:"); +_MTL_PRIVATE_DEF_SEL(setTextureView_atIndex_, + "setTextureView:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setTextureView_descriptor_atIndex_, + "setTextureView:descriptor:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setTextureViewFromBuffer_descriptor_offset_bytesPerRow_atIndex_, + "setTextureViewFromBuffer:descriptor:offset:bytesPerRow:atIndex:"); _MTL_PRIVATE_DEF_SEL(setTextures_withRange_, "setTextures:withRange:"); _MTL_PRIVATE_DEF_SEL(setThreadGroupSizeIsMultipleOfThreadExecutionWidth_, @@ -1900,6 +2618,8 @@ _MTL_PRIVATE_DEF_SEL(setTileBytes_length_atIndex_, "setTileBytes:length:atIndex:"); _MTL_PRIVATE_DEF_SEL(setTileFunction_, "setTileFunction:"); +_MTL_PRIVATE_DEF_SEL(setTileFunctionDescriptor_, + "setTileFunctionDescriptor:"); _MTL_PRIVATE_DEF_SEL(setTileHeight_, "setTileHeight:"); _MTL_PRIVATE_DEF_SEL(setTileIntersectionFunctionTable_atBufferIndex_, @@ -1928,6 +2648,8 @@ _MTL_PRIVATE_DEF_SEL(setTransformationMatrixBuffer_, "setTransformationMatrixBuffer:"); _MTL_PRIVATE_DEF_SEL(setTransformationMatrixBufferOffset_, "setTransformationMatrixBufferOffset:"); +_MTL_PRIVATE_DEF_SEL(setTransformationMatrixLayout_, + "setTransformationMatrixLayout:"); _MTL_PRIVATE_DEF_SEL(setTriangleCount_, "setTriangleCount:"); _MTL_PRIVATE_DEF_SEL(setTriangleFillMode_, @@ -1948,22 +2670,32 @@ _MTL_PRIVATE_DEF_SEL(setVertexBuffer_, "setVertexBuffer:"); _MTL_PRIVATE_DEF_SEL(setVertexBuffer_offset_atIndex_, "setVertexBuffer:offset:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setVertexBuffer_offset_attributeStride_atIndex_, + "setVertexBuffer:offset:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setVertexBufferOffset_, "setVertexBufferOffset:"); _MTL_PRIVATE_DEF_SEL(setVertexBufferOffset_atIndex_, "setVertexBufferOffset:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setVertexBufferOffset_attributeStride_atIndex_, + "setVertexBufferOffset:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setVertexBuffers_, "setVertexBuffers:"); +_MTL_PRIVATE_DEF_SEL(setVertexBuffers_offsets_attributeStrides_withRange_, + "setVertexBuffers:offsets:attributeStrides:withRange:"); _MTL_PRIVATE_DEF_SEL(setVertexBuffers_offsets_withRange_, "setVertexBuffers:offsets:withRange:"); _MTL_PRIVATE_DEF_SEL(setVertexBytes_length_atIndex_, "setVertexBytes:length:atIndex:"); +_MTL_PRIVATE_DEF_SEL(setVertexBytes_length_attributeStride_atIndex_, + "setVertexBytes:length:attributeStride:atIndex:"); _MTL_PRIVATE_DEF_SEL(setVertexDescriptor_, "setVertexDescriptor:"); _MTL_PRIVATE_DEF_SEL(setVertexFormat_, "setVertexFormat:"); _MTL_PRIVATE_DEF_SEL(setVertexFunction_, "setVertexFunction:"); +_MTL_PRIVATE_DEF_SEL(setVertexFunctionDescriptor_, + "setVertexFunctionDescriptor:"); _MTL_PRIVATE_DEF_SEL(setVertexIntersectionFunctionTable_atBufferIndex_, "setVertexIntersectionFunctionTable:atBufferIndex:"); _MTL_PRIVATE_DEF_SEL(setVertexIntersectionFunctionTables_withBufferRange_, @@ -1980,6 +2712,8 @@ _MTL_PRIVATE_DEF_SEL(setVertexSamplerStates_lodMinClamps_lodMaxClamps_withRange_ "setVertexSamplerStates:lodMinClamps:lodMaxClamps:withRange:"); _MTL_PRIVATE_DEF_SEL(setVertexSamplerStates_withRange_, "setVertexSamplerStates:withRange:"); +_MTL_PRIVATE_DEF_SEL(setVertexStaticLinkingDescriptor_, + "setVertexStaticLinkingDescriptor:"); _MTL_PRIVATE_DEF_SEL(setVertexStride_, "setVertexStride:"); _MTL_PRIVATE_DEF_SEL(setVertexTexture_atIndex_, @@ -1998,6 +2732,8 @@ _MTL_PRIVATE_DEF_SEL(setVisibilityResultBuffer_, "setVisibilityResultBuffer:"); _MTL_PRIVATE_DEF_SEL(setVisibilityResultMode_offset_, "setVisibilityResultMode:offset:"); +_MTL_PRIVATE_DEF_SEL(setVisibilityResultType_, + "setVisibilityResultType:"); _MTL_PRIVATE_DEF_SEL(setVisibleFunctionTable_atBufferIndex_, "setVisibleFunctionTable:atBufferIndex:"); _MTL_PRIVATE_DEF_SEL(setVisibleFunctionTable_atIndex_, @@ -2010,24 +2746,42 @@ _MTL_PRIVATE_DEF_SEL(setWidth_, "setWidth:"); _MTL_PRIVATE_DEF_SEL(setWriteMask_, "setWriteMask:"); +_MTL_PRIVATE_DEF_SEL(shaderReflection, + "shaderReflection"); +_MTL_PRIVATE_DEF_SEL(shaderValidation, + "shaderValidation"); _MTL_PRIVATE_DEF_SEL(sharedCaptureManager, "sharedCaptureManager"); +_MTL_PRIVATE_DEF_SEL(sharedListener, + "sharedListener"); _MTL_PRIVATE_DEF_SEL(shouldMaximizeConcurrentCompilation, "shouldMaximizeConcurrentCompilation"); +_MTL_PRIVATE_DEF_SEL(signalDrawable_, + "signalDrawable:"); _MTL_PRIVATE_DEF_SEL(signalEvent_value_, "signalEvent:value:"); _MTL_PRIVATE_DEF_SEL(signaledValue, "signaledValue"); _MTL_PRIVATE_DEF_SEL(size, "size"); +_MTL_PRIVATE_DEF_SEL(sizeOfCounterHeapEntry_, + "sizeOfCounterHeapEntry:"); _MTL_PRIVATE_DEF_SEL(slice, "slice"); +_MTL_PRIVATE_DEF_SEL(sliceRange, + "sliceRange"); +_MTL_PRIVATE_DEF_SEL(source, + "source"); _MTL_PRIVATE_DEF_SEL(sourceAlphaBlendFactor, "sourceAlphaBlendFactor"); _MTL_PRIVATE_DEF_SEL(sourceRGBBlendFactor, "sourceRGBBlendFactor"); +_MTL_PRIVATE_DEF_SEL(sparseBufferTier, + "sparseBufferTier"); _MTL_PRIVATE_DEF_SEL(sparsePageSize, "sparsePageSize"); +_MTL_PRIVATE_DEF_SEL(sparseTextureTier, + "sparseTextureTier"); _MTL_PRIVATE_DEF_SEL(sparseTileSizeInBytes, "sparseTileSizeInBytes"); _MTL_PRIVATE_DEF_SEL(sparseTileSizeInBytesForSparsePageSize_, @@ -2044,6 +2798,8 @@ _MTL_PRIVATE_DEF_SEL(stageInputDescriptor, "stageInputDescriptor"); _MTL_PRIVATE_DEF_SEL(stageInputOutputDescriptor, "stageInputOutputDescriptor"); +_MTL_PRIVATE_DEF_SEL(stages, + "stages"); _MTL_PRIVATE_DEF_SEL(startCaptureWithCommandQueue_, "startCaptureWithCommandQueue:"); _MTL_PRIVATE_DEF_SEL(startCaptureWithDescriptor_error_, @@ -2058,6 +2814,8 @@ _MTL_PRIVATE_DEF_SEL(startOfFragmentSampleIndex, "startOfFragmentSampleIndex"); _MTL_PRIVATE_DEF_SEL(startOfVertexSampleIndex, "startOfVertexSampleIndex"); +_MTL_PRIVATE_DEF_SEL(staticLinkingDescriptor, + "staticLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(staticThreadgroupMemoryLength, "staticThreadgroupMemoryLength"); _MTL_PRIVATE_DEF_SEL(status, @@ -2086,6 +2844,8 @@ _MTL_PRIVATE_DEF_SEL(storeActionOptions, "storeActionOptions"); _MTL_PRIVATE_DEF_SEL(stride, "stride"); +_MTL_PRIVATE_DEF_SEL(strides, + "strides"); _MTL_PRIVATE_DEF_SEL(structType, "structType"); _MTL_PRIVATE_DEF_SEL(supportAddingBinaryFunctions, @@ -2096,10 +2856,26 @@ _MTL_PRIVATE_DEF_SEL(supportAddingVertexBinaryFunctions, "supportAddingVertexBinaryFunctions"); _MTL_PRIVATE_DEF_SEL(supportArgumentBuffers, "supportArgumentBuffers"); +_MTL_PRIVATE_DEF_SEL(supportAttributeStrides, + "supportAttributeStrides"); +_MTL_PRIVATE_DEF_SEL(supportBinaryLinking, + "supportBinaryLinking"); +_MTL_PRIVATE_DEF_SEL(supportColorAttachmentMapping, + "supportColorAttachmentMapping"); +_MTL_PRIVATE_DEF_SEL(supportDynamicAttributeStride, + "supportDynamicAttributeStride"); +_MTL_PRIVATE_DEF_SEL(supportFragmentBinaryLinking, + "supportFragmentBinaryLinking"); _MTL_PRIVATE_DEF_SEL(supportIndirectCommandBuffers, "supportIndirectCommandBuffers"); +_MTL_PRIVATE_DEF_SEL(supportMeshBinaryLinking, + "supportMeshBinaryLinking"); +_MTL_PRIVATE_DEF_SEL(supportObjectBinaryLinking, + "supportObjectBinaryLinking"); _MTL_PRIVATE_DEF_SEL(supportRayTracing, "supportRayTracing"); +_MTL_PRIVATE_DEF_SEL(supportVertexBinaryLinking, + "supportVertexBinaryLinking"); _MTL_PRIVATE_DEF_SEL(supports32BitFloatFiltering, "supports32BitFloatFiltering"); _MTL_PRIVATE_DEF_SEL(supports32BitMSAA, @@ -2150,6 +2926,12 @@ _MTL_PRIVATE_DEF_SEL(tAddressMode, "tAddressMode"); _MTL_PRIVATE_DEF_SEL(tailSizeInBytes, "tailSizeInBytes"); +_MTL_PRIVATE_DEF_SEL(tensorDataType, + "tensorDataType"); +_MTL_PRIVATE_DEF_SEL(tensorReferenceType, + "tensorReferenceType"); +_MTL_PRIVATE_DEF_SEL(tensorSizeAndAlignWithDescriptor_, + "tensorSizeAndAlignWithDescriptor:"); _MTL_PRIVATE_DEF_SEL(tessellationControlPointIndexType, "tessellationControlPointIndexType"); _MTL_PRIVATE_DEF_SEL(tessellationFactorFormat, @@ -2198,28 +2980,40 @@ _MTL_PRIVATE_DEF_SEL(tileBuffers, "tileBuffers"); _MTL_PRIVATE_DEF_SEL(tileFunction, "tileFunction"); +_MTL_PRIVATE_DEF_SEL(tileFunctionDescriptor, + "tileFunctionDescriptor"); _MTL_PRIVATE_DEF_SEL(tileHeight, "tileHeight"); +_MTL_PRIVATE_DEF_SEL(tileLinkingDescriptor, + "tileLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(tileWidth, "tileWidth"); _MTL_PRIVATE_DEF_SEL(transformationMatrixBuffer, "transformationMatrixBuffer"); _MTL_PRIVATE_DEF_SEL(transformationMatrixBufferOffset, "transformationMatrixBufferOffset"); +_MTL_PRIVATE_DEF_SEL(transformationMatrixLayout, + "transformationMatrixLayout"); _MTL_PRIVATE_DEF_SEL(triangleCount, "triangleCount"); _MTL_PRIVATE_DEF_SEL(tryCancel, "tryCancel"); _MTL_PRIVATE_DEF_SEL(type, "type"); +_MTL_PRIVATE_DEF_SEL(updateBufferMappings_heap_operations_count_, + "updateBufferMappings:heap:operations:count:"); _MTL_PRIVATE_DEF_SEL(updateFence_, "updateFence:"); +_MTL_PRIVATE_DEF_SEL(updateFence_afterEncoderStages_, + "updateFence:afterEncoderStages:"); _MTL_PRIVATE_DEF_SEL(updateFence_afterStages_, "updateFence:afterStages:"); _MTL_PRIVATE_DEF_SEL(updateTextureMapping_mode_indirectBuffer_indirectBufferOffset_, "updateTextureMapping:mode:indirectBuffer:indirectBufferOffset:"); _MTL_PRIVATE_DEF_SEL(updateTextureMapping_mode_region_mipLevel_slice_, "updateTextureMapping:mode:region:mipLevel:slice:"); +_MTL_PRIVATE_DEF_SEL(updateTextureMappings_heap_operations_count_, + "updateTextureMappings:heap:operations:count:"); _MTL_PRIVATE_DEF_SEL(updateTextureMappings_mode_regions_mipLevels_slices_numRegions_, "updateTextureMappings:mode:regions:mipLevels:slices:numRegions:"); _MTL_PRIVATE_DEF_SEL(url, @@ -2234,6 +3028,10 @@ _MTL_PRIVATE_DEF_SEL(useHeaps_count_, "useHeaps:count:"); _MTL_PRIVATE_DEF_SEL(useHeaps_count_stages_, "useHeaps:count:stages:"); +_MTL_PRIVATE_DEF_SEL(useResidencySet_, + "useResidencySet:"); +_MTL_PRIVATE_DEF_SEL(useResidencySets_count_, + "useResidencySets:count:"); _MTL_PRIVATE_DEF_SEL(useResource_usage_, "useResource:usage:"); _MTL_PRIVATE_DEF_SEL(useResource_usage_stages_, @@ -2264,10 +3062,16 @@ _MTL_PRIVATE_DEF_SEL(vertexFormat, "vertexFormat"); _MTL_PRIVATE_DEF_SEL(vertexFunction, "vertexFunction"); +_MTL_PRIVATE_DEF_SEL(vertexFunctionDescriptor, + "vertexFunctionDescriptor"); _MTL_PRIVATE_DEF_SEL(vertexLinkedFunctions, "vertexLinkedFunctions"); +_MTL_PRIVATE_DEF_SEL(vertexLinkingDescriptor, + "vertexLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(vertexPreloadedLibraries, "vertexPreloadedLibraries"); +_MTL_PRIVATE_DEF_SEL(vertexStaticLinkingDescriptor, + "vertexStaticLinkingDescriptor"); _MTL_PRIVATE_DEF_SEL(vertexStride, "vertexStride"); _MTL_PRIVATE_DEF_SEL(vertical, @@ -2276,25 +3080,41 @@ _MTL_PRIVATE_DEF_SEL(verticalSampleStorage, "verticalSampleStorage"); _MTL_PRIVATE_DEF_SEL(visibilityResultBuffer, "visibilityResultBuffer"); +_MTL_PRIVATE_DEF_SEL(visibilityResultType, + "visibilityResultType"); _MTL_PRIVATE_DEF_SEL(visibleFunctionTableDescriptor, "visibleFunctionTableDescriptor"); +_MTL_PRIVATE_DEF_SEL(waitForDrawable_, + "waitForDrawable:"); _MTL_PRIVATE_DEF_SEL(waitForEvent_value_, "waitForEvent:value:"); _MTL_PRIVATE_DEF_SEL(waitForFence_, "waitForFence:"); +_MTL_PRIVATE_DEF_SEL(waitForFence_beforeEncoderStages_, + "waitForFence:beforeEncoderStages:"); _MTL_PRIVATE_DEF_SEL(waitForFence_beforeStages_, "waitForFence:beforeStages:"); _MTL_PRIVATE_DEF_SEL(waitUntilCompleted, "waitUntilCompleted"); _MTL_PRIVATE_DEF_SEL(waitUntilScheduled, "waitUntilScheduled"); +_MTL_PRIVATE_DEF_SEL(waitUntilSignaledValue_timeoutMS_, + "waitUntilSignaledValue:timeoutMS:"); _MTL_PRIVATE_DEF_SEL(width, "width"); +_MTL_PRIVATE_DEF_SEL(writeCompactedAccelerationStructureSize_toBuffer_, + "writeCompactedAccelerationStructureSize:toBuffer:"); _MTL_PRIVATE_DEF_SEL(writeCompactedAccelerationStructureSize_toBuffer_offset_, "writeCompactedAccelerationStructureSize:toBuffer:offset:"); _MTL_PRIVATE_DEF_SEL(writeCompactedAccelerationStructureSize_toBuffer_offset_sizeDataType_, "writeCompactedAccelerationStructureSize:toBuffer:offset:sizeDataType:"); _MTL_PRIVATE_DEF_SEL(writeMask, "writeMask"); +_MTL_PRIVATE_DEF_SEL(writeTimestampIntoHeap_atIndex_, + "writeTimestampIntoHeap:atIndex:"); +_MTL_PRIVATE_DEF_SEL(writeTimestampWithGranularity_afterStage_intoHeap_atIndex_, + "writeTimestampWithGranularity:afterStage:intoHeap:atIndex:"); +_MTL_PRIVATE_DEF_SEL(writeTimestampWithGranularity_intoHeap_atIndex_, + "writeTimestampWithGranularity:intoHeap:atIndex:"); } diff --git a/vendor/metal-cpp/Metal/MTLHeap.hpp b/vendor/metal-cpp/Metal/MTLHeap.hpp index 51af01259..251b284a8 100644 --- a/vendor/metal-cpp/Metal/MTLHeap.hpp +++ b/vendor/metal-cpp/Metal/MTLHeap.hpp @@ -2,7 +2,7 @@ // // Metal/MTLHeap.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,18 +20,22 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLAllocation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLDevice.hpp" -#include "MTLHeap.hpp" #include "MTLResource.hpp" namespace MTL { +class AccelerationStructure; +class AccelerationStructureDescriptor; +class Buffer; +class Device; +class HeapDescriptor; +class Texture; +class TextureDescriptor; _MTL_ENUM(NS::Integer, HeapType) { HeapTypeAutomatic = 0, HeapTypePlacement = 1, @@ -41,117 +45,111 @@ _MTL_ENUM(NS::Integer, HeapType) { class HeapDescriptor : public NS::Copying { public: - static class HeapDescriptor* alloc(); + static HeapDescriptor* alloc(); - class HeapDescriptor* init(); + CPUCacheMode cpuCacheMode() const; - NS::UInteger size() const; - void setSize(NS::UInteger size); + HazardTrackingMode hazardTrackingMode() const; - MTL::StorageMode storageMode() const; - void setStorageMode(MTL::StorageMode storageMode); + HeapDescriptor* init(); - MTL::CPUCacheMode cpuCacheMode() const; - void setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode); + SparsePageSize maxCompatiblePlacementSparsePageSize() const; - MTL::SparsePageSize sparsePageSize() const; - void setSparsePageSize(MTL::SparsePageSize sparsePageSize); + ResourceOptions resourceOptions() const; - MTL::HazardTrackingMode hazardTrackingMode() const; - void setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode); + void setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode); - MTL::ResourceOptions resourceOptions() const; - void setResourceOptions(MTL::ResourceOptions resourceOptions); + void setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode); - MTL::HeapType type() const; - void setType(MTL::HeapType type); + void setMaxCompatiblePlacementSparsePageSize(MTL::SparsePageSize maxCompatiblePlacementSparsePageSize); + + void setResourceOptions(MTL::ResourceOptions resourceOptions); + + void setSize(NS::UInteger size); + + void setSparsePageSize(MTL::SparsePageSize sparsePageSize); + + void setStorageMode(MTL::StorageMode storageMode); + + void setType(MTL::HeapType type); + + NS::UInteger size() const; + SparsePageSize sparsePageSize() const; + + StorageMode storageMode() const; + + HeapType type() const; }; - -class Heap : public NS::Referencing +class Heap : public NS::Referencing { public: - NS::String* label() const; - void setLabel(const NS::String* label); + CPUCacheMode cpuCacheMode() const; - class Device* device() const; + NS::UInteger currentAllocatedSize() const; - MTL::StorageMode storageMode() const; + Device* device() const; - MTL::CPUCacheMode cpuCacheMode() const; + HazardTrackingMode hazardTrackingMode() const; - MTL::HazardTrackingMode hazardTrackingMode() const; + NS::String* label() const; - MTL::ResourceOptions resourceOptions() const; + NS::UInteger maxAvailableSize(NS::UInteger alignment); - NS::UInteger size() const; + AccelerationStructure* newAccelerationStructure(NS::UInteger size); + AccelerationStructure* newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor); + AccelerationStructure* newAccelerationStructure(NS::UInteger size, NS::UInteger offset); + AccelerationStructure* newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor, NS::UInteger offset); - NS::UInteger usedSize() const; + Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options); + Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options, NS::UInteger offset); - NS::UInteger currentAllocatedSize() const; + Texture* newTexture(const MTL::TextureDescriptor* descriptor); + Texture* newTexture(const MTL::TextureDescriptor* descriptor, NS::UInteger offset); - NS::UInteger maxAvailableSize(NS::UInteger alignment); + ResourceOptions resourceOptions() const; - class Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options); + void setLabel(const NS::String* label); - class Texture* newTexture(const class TextureDescriptor* desc); + PurgeableState setPurgeableState(MTL::PurgeableState state); - MTL::PurgeableState setPurgeableState(MTL::PurgeableState state); + NS::UInteger size() const; - MTL::HeapType type() const; + StorageMode storageMode() const; - class Buffer* newBuffer(NS::UInteger length, MTL::ResourceOptions options, NS::UInteger offset); + HeapType type() const; - class Texture* newTexture(const class TextureDescriptor* descriptor, NS::UInteger offset); - - class AccelerationStructure* newAccelerationStructure(NS::UInteger size); - - class AccelerationStructure* newAccelerationStructure(const class AccelerationStructureDescriptor* descriptor); - - class AccelerationStructure* newAccelerationStructure(NS::UInteger size, NS::UInteger offset); - - class AccelerationStructure* newAccelerationStructure(const class AccelerationStructureDescriptor* descriptor, NS::UInteger offset); + NS::UInteger usedSize() const; }; } - -// static method: alloc _MTL_INLINE MTL::HeapDescriptor* MTL::HeapDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLHeapDescriptor)); } -// method: init +_MTL_INLINE MTL::CPUCacheMode MTL::HeapDescriptor::cpuCacheMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); +} + +_MTL_INLINE MTL::HazardTrackingMode MTL::HeapDescriptor::hazardTrackingMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); +} + _MTL_INLINE MTL::HeapDescriptor* MTL::HeapDescriptor::init() { return NS::Object::init(); } -// property: size -_MTL_INLINE NS::UInteger MTL::HeapDescriptor::size() const +_MTL_INLINE MTL::SparsePageSize MTL::HeapDescriptor::maxCompatiblePlacementSparsePageSize() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCompatiblePlacementSparsePageSize)); } -_MTL_INLINE void MTL::HeapDescriptor::setSize(NS::UInteger size) +_MTL_INLINE MTL::ResourceOptions MTL::HeapDescriptor::resourceOptions() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSize_), size); -} - -// property: storageMode -_MTL_INLINE MTL::StorageMode MTL::HeapDescriptor::storageMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); -} - -_MTL_INLINE void MTL::HeapDescriptor::setStorageMode(MTL::StorageMode storageMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); -} - -// property: cpuCacheMode -_MTL_INLINE MTL::CPUCacheMode MTL::HeapDescriptor::cpuCacheMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); } _MTL_INLINE void MTL::HeapDescriptor::setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode) @@ -159,32 +157,14 @@ _MTL_INLINE void MTL::HeapDescriptor::setCpuCacheMode(MTL::CPUCacheMode cpuCache Object::sendMessage(this, _MTL_PRIVATE_SEL(setCpuCacheMode_), cpuCacheMode); } -// property: sparsePageSize -_MTL_INLINE MTL::SparsePageSize MTL::HeapDescriptor::sparsePageSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparsePageSize)); -} - -_MTL_INLINE void MTL::HeapDescriptor::setSparsePageSize(MTL::SparsePageSize sparsePageSize) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSparsePageSize_), sparsePageSize); -} - -// property: hazardTrackingMode -_MTL_INLINE MTL::HazardTrackingMode MTL::HeapDescriptor::hazardTrackingMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); -} - _MTL_INLINE void MTL::HeapDescriptor::setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setHazardTrackingMode_), hazardTrackingMode); } -// property: resourceOptions -_MTL_INLINE MTL::ResourceOptions MTL::HeapDescriptor::resourceOptions() const +_MTL_INLINE void MTL::HeapDescriptor::setMaxCompatiblePlacementSparsePageSize(MTL::SparsePageSize maxCompatiblePlacementSparsePageSize) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCompatiblePlacementSparsePageSize_), maxCompatiblePlacementSparsePageSize); } _MTL_INLINE void MTL::HeapDescriptor::setResourceOptions(MTL::ResourceOptions resourceOptions) @@ -192,10 +172,19 @@ _MTL_INLINE void MTL::HeapDescriptor::setResourceOptions(MTL::ResourceOptions re Object::sendMessage(this, _MTL_PRIVATE_SEL(setResourceOptions_), resourceOptions); } -// property: type -_MTL_INLINE MTL::HeapType MTL::HeapDescriptor::type() const +_MTL_INLINE void MTL::HeapDescriptor::setSize(NS::UInteger size) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSize_), size); +} + +_MTL_INLINE void MTL::HeapDescriptor::setSparsePageSize(MTL::SparsePageSize sparsePageSize) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSparsePageSize_), sparsePageSize); +} + +_MTL_INLINE void MTL::HeapDescriptor::setStorageMode(MTL::StorageMode storageMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); } _MTL_INLINE void MTL::HeapDescriptor::setType(MTL::HeapType type) @@ -203,127 +192,127 @@ _MTL_INLINE void MTL::HeapDescriptor::setType(MTL::HeapType type) Object::sendMessage(this, _MTL_PRIVATE_SEL(setType_), type); } -// property: label +_MTL_INLINE NS::UInteger MTL::HeapDescriptor::size() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); +} + +_MTL_INLINE MTL::SparsePageSize MTL::HeapDescriptor::sparsePageSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparsePageSize)); +} + +_MTL_INLINE MTL::StorageMode MTL::HeapDescriptor::storageMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); +} + +_MTL_INLINE MTL::HeapType MTL::HeapDescriptor::type() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); +} + +_MTL_INLINE MTL::CPUCacheMode MTL::Heap::cpuCacheMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); +} + +_MTL_INLINE NS::UInteger MTL::Heap::currentAllocatedSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(currentAllocatedSize)); +} + +_MTL_INLINE MTL::Device* MTL::Heap::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE MTL::HazardTrackingMode MTL::Heap::hazardTrackingMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); +} + _MTL_INLINE NS::String* MTL::Heap::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE NS::UInteger MTL::Heap::maxAvailableSize(NS::UInteger alignment) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxAvailableSizeWithAlignment_), alignment); +} + +_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(NS::UInteger size) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_), size); +} + +_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(NS::UInteger size, NS::UInteger offset) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_offset_), size, offset); +} + +_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor, NS::UInteger offset) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_offset_), descriptor, offset); +} + +_MTL_INLINE MTL::Buffer* MTL::Heap::newBuffer(NS::UInteger length, MTL::ResourceOptions options) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_), length, options); +} + +_MTL_INLINE MTL::Buffer* MTL::Heap::newBuffer(NS::UInteger length, MTL::ResourceOptions options, NS::UInteger offset) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_offset_), length, options, offset); +} + +_MTL_INLINE MTL::Texture* MTL::Heap::newTexture(const MTL::TextureDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::Texture* MTL::Heap::newTexture(const MTL::TextureDescriptor* descriptor, NS::UInteger offset) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_offset_), descriptor, offset); +} + +_MTL_INLINE MTL::ResourceOptions MTL::Heap::resourceOptions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); +} + _MTL_INLINE void MTL::Heap::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: device -_MTL_INLINE MTL::Device* MTL::Heap::device() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); -} - -// property: storageMode -_MTL_INLINE MTL::StorageMode MTL::Heap::storageMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); -} - -// property: cpuCacheMode -_MTL_INLINE MTL::CPUCacheMode MTL::Heap::cpuCacheMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); -} - -// property: hazardTrackingMode -_MTL_INLINE MTL::HazardTrackingMode MTL::Heap::hazardTrackingMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); -} - -// property: resourceOptions -_MTL_INLINE MTL::ResourceOptions MTL::Heap::resourceOptions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); -} - -// property: size -_MTL_INLINE NS::UInteger MTL::Heap::size() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); -} - -// property: usedSize -_MTL_INLINE NS::UInteger MTL::Heap::usedSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(usedSize)); -} - -// property: currentAllocatedSize -_MTL_INLINE NS::UInteger MTL::Heap::currentAllocatedSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(currentAllocatedSize)); -} - -// method: maxAvailableSizeWithAlignment: -_MTL_INLINE NS::UInteger MTL::Heap::maxAvailableSize(NS::UInteger alignment) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxAvailableSizeWithAlignment_), alignment); -} - -// method: newBufferWithLength:options: -_MTL_INLINE MTL::Buffer* MTL::Heap::newBuffer(NS::UInteger length, MTL::ResourceOptions options) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_), length, options); -} - -// method: newTextureWithDescriptor: -_MTL_INLINE MTL::Texture* MTL::Heap::newTexture(const MTL::TextureDescriptor* desc) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_), desc); -} - -// method: setPurgeableState: _MTL_INLINE MTL::PurgeableState MTL::Heap::setPurgeableState(MTL::PurgeableState state) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(setPurgeableState_), state); } -// property: type +_MTL_INLINE NS::UInteger MTL::Heap::size() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); +} + +_MTL_INLINE MTL::StorageMode MTL::Heap::storageMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); +} + _MTL_INLINE MTL::HeapType MTL::Heap::type() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); } -// method: newBufferWithLength:options:offset: -_MTL_INLINE MTL::Buffer* MTL::Heap::newBuffer(NS::UInteger length, MTL::ResourceOptions options, NS::UInteger offset) +_MTL_INLINE NS::UInteger MTL::Heap::usedSize() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newBufferWithLength_options_offset_), length, options, offset); -} - -// method: newTextureWithDescriptor:offset: -_MTL_INLINE MTL::Texture* MTL::Heap::newTexture(const MTL::TextureDescriptor* descriptor, NS::UInteger offset) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureWithDescriptor_offset_), descriptor, offset); -} - -// method: newAccelerationStructureWithSize: -_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(NS::UInteger size) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_), size); -} - -// method: newAccelerationStructureWithDescriptor: -_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_), descriptor); -} - -// method: newAccelerationStructureWithSize:offset: -_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(NS::UInteger size, NS::UInteger offset) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithSize_offset_), size, offset); -} - -// method: newAccelerationStructureWithDescriptor:offset: -_MTL_INLINE MTL::AccelerationStructure* MTL::Heap::newAccelerationStructure(const MTL::AccelerationStructureDescriptor* descriptor, NS::UInteger offset) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newAccelerationStructureWithDescriptor_offset_), descriptor, offset); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(usedSize)); } diff --git a/vendor/metal-cpp/Metal/MTLIOCommandBuffer.hpp b/vendor/metal-cpp/Metal/MTLIOCommandBuffer.hpp index fb28f3e7c..9402318d7 100644 --- a/vendor/metal-cpp/Metal/MTLIOCommandBuffer.hpp +++ b/vendor/metal-cpp/Metal/MTLIOCommandBuffer.hpp @@ -2,7 +2,7 @@ // // Metal/MTLIOCommandBuffer.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,17 +20,20 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLIOCommandBuffer.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class Buffer; +class IOCommandBuffer; +class IOFileHandle; +class SharedEvent; +class Texture; _MTL_ENUM(NS::Integer, IOStatus) { IOStatusPending = 0, IOStatusCancelled = 1, @@ -38,163 +41,142 @@ _MTL_ENUM(NS::Integer, IOStatus) { IOStatusComplete = 3, }; -using IOCommandBufferHandler = void (^)(class IOCommandBuffer*); - -using IOCommandBufferHandlerFunction = std::function; +using IOCommandBufferHandler = void (^)(MTL::IOCommandBuffer*); +using IOCommandBufferHandlerFunction = std::function; class IOCommandBuffer : public NS::Referencing { public: - void addCompletedHandler(const MTL::IOCommandBufferHandlerFunction& function); + void addBarrier(); - void addCompletedHandler(const MTL::IOCommandBufferHandler block); + void addCompletedHandler(const MTL::IOCommandBufferHandler block); + void addCompletedHandler(const MTL::IOCommandBufferHandlerFunction& function); - void loadBytes(const void* pointer, NS::UInteger size, const class IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset); + void commit(); - void loadBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger size, const class IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset); + void copyStatusToBuffer(const MTL::Buffer* buffer, NS::UInteger offset); - void loadTexture(const class Texture* texture, NS::UInteger slice, NS::UInteger level, MTL::Size size, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Origin destinationOrigin, const class IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset); + void enqueue(); - void copyStatusToBuffer(const class Buffer* buffer, NS::UInteger offset); + NS::Error* error() const; - void commit(); + NS::String* label() const; - void waitUntilCompleted(); + void loadBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger size, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset); - void tryCancel(); + void loadBytes(const void* pointer, NS::UInteger size, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset); - void addBarrier(); + void loadTexture(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level, MTL::Size size, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Origin destinationOrigin, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset); - void pushDebugGroup(const NS::String* string); + void popDebugGroup(); - void popDebugGroup(); + void pushDebugGroup(const NS::String* string); - void enqueue(); + void setLabel(const NS::String* label); - void wait(const class SharedEvent* event, uint64_t value); + void signalEvent(const MTL::SharedEvent* event, uint64_t value); - void signalEvent(const class SharedEvent* event, uint64_t value); + IOStatus status() const; - NS::String* label() const; - void setLabel(const NS::String* label); + void tryCancel(); - MTL::IOStatus status() const; - - NS::Error* error() const; + void wait(const MTL::SharedEvent* event, uint64_t value); + void waitUntilCompleted(); }; } - -_MTL_INLINE void MTL::IOCommandBuffer::addCompletedHandler(const MTL::IOCommandBufferHandlerFunction& function) -{ - __block IOCommandBufferHandlerFunction blockFunction = function; - - addCompletedHandler(^(IOCommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); }); -} - -// method: addCompletedHandler: -_MTL_INLINE void MTL::IOCommandBuffer::addCompletedHandler(const MTL::IOCommandBufferHandler block) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(addCompletedHandler_), block); -} - -// method: loadBytes:size:sourceHandle:sourceHandleOffset: -_MTL_INLINE void MTL::IOCommandBuffer::loadBytes(const void* pointer, NS::UInteger size, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(loadBytes_size_sourceHandle_sourceHandleOffset_), pointer, size, sourceHandle, sourceHandleOffset); -} - -// method: loadBuffer:offset:size:sourceHandle:sourceHandleOffset: -_MTL_INLINE void MTL::IOCommandBuffer::loadBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger size, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(loadBuffer_offset_size_sourceHandle_sourceHandleOffset_), buffer, offset, size, sourceHandle, sourceHandleOffset); -} - -// method: loadTexture:slice:level:size:sourceBytesPerRow:sourceBytesPerImage:destinationOrigin:sourceHandle:sourceHandleOffset: -_MTL_INLINE void MTL::IOCommandBuffer::loadTexture(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level, MTL::Size size, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Origin destinationOrigin, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(loadTexture_slice_level_size_sourceBytesPerRow_sourceBytesPerImage_destinationOrigin_sourceHandle_sourceHandleOffset_), texture, slice, level, size, sourceBytesPerRow, sourceBytesPerImage, destinationOrigin, sourceHandle, sourceHandleOffset); -} - -// method: copyStatusToBuffer:offset: -_MTL_INLINE void MTL::IOCommandBuffer::copyStatusToBuffer(const MTL::Buffer* buffer, NS::UInteger offset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(copyStatusToBuffer_offset_), buffer, offset); -} - -// method: commit -_MTL_INLINE void MTL::IOCommandBuffer::commit() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(commit)); -} - -// method: waitUntilCompleted -_MTL_INLINE void MTL::IOCommandBuffer::waitUntilCompleted() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilCompleted)); -} - -// method: tryCancel -_MTL_INLINE void MTL::IOCommandBuffer::tryCancel() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(tryCancel)); -} - -// method: addBarrier _MTL_INLINE void MTL::IOCommandBuffer::addBarrier() { Object::sendMessage(this, _MTL_PRIVATE_SEL(addBarrier)); } -// method: pushDebugGroup: -_MTL_INLINE void MTL::IOCommandBuffer::pushDebugGroup(const NS::String* string) +_MTL_INLINE void MTL::IOCommandBuffer::addCompletedHandler(const MTL::IOCommandBufferHandler block) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); + Object::sendMessage(this, _MTL_PRIVATE_SEL(addCompletedHandler_), block); } -// method: popDebugGroup -_MTL_INLINE void MTL::IOCommandBuffer::popDebugGroup() +_MTL_INLINE void MTL::IOCommandBuffer::addCompletedHandler(const MTL::IOCommandBufferHandlerFunction& function) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); + __block MTL::IOCommandBufferHandlerFunction blockFunction = function; + addCompletedHandler(^(MTL::IOCommandBuffer* pCommandBuffer) { blockFunction(pCommandBuffer); }); +} + +_MTL_INLINE void MTL::IOCommandBuffer::commit() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(commit)); +} + +_MTL_INLINE void MTL::IOCommandBuffer::copyStatusToBuffer(const MTL::Buffer* buffer, NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(copyStatusToBuffer_offset_), buffer, offset); } -// method: enqueue _MTL_INLINE void MTL::IOCommandBuffer::enqueue() { Object::sendMessage(this, _MTL_PRIVATE_SEL(enqueue)); } -// method: waitForEvent:value: -_MTL_INLINE void MTL::IOCommandBuffer::wait(const MTL::SharedEvent* event, uint64_t value) +_MTL_INLINE NS::Error* MTL::IOCommandBuffer::error() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForEvent_value_), event, value); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(error)); } -// method: signalEvent:value: -_MTL_INLINE void MTL::IOCommandBuffer::signalEvent(const MTL::SharedEvent* event, uint64_t value) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(signalEvent_value_), event, value); -} - -// property: label _MTL_INLINE NS::String* MTL::IOCommandBuffer::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE void MTL::IOCommandBuffer::loadBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger size, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(loadBuffer_offset_size_sourceHandle_sourceHandleOffset_), buffer, offset, size, sourceHandle, sourceHandleOffset); +} + +_MTL_INLINE void MTL::IOCommandBuffer::loadBytes(const void* pointer, NS::UInteger size, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(loadBytes_size_sourceHandle_sourceHandleOffset_), pointer, size, sourceHandle, sourceHandleOffset); +} + +_MTL_INLINE void MTL::IOCommandBuffer::loadTexture(const MTL::Texture* texture, NS::UInteger slice, NS::UInteger level, MTL::Size size, NS::UInteger sourceBytesPerRow, NS::UInteger sourceBytesPerImage, MTL::Origin destinationOrigin, const MTL::IOFileHandle* sourceHandle, NS::UInteger sourceHandleOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(loadTexture_slice_level_size_sourceBytesPerRow_sourceBytesPerImage_destinationOrigin_sourceHandle_sourceHandleOffset_), texture, slice, level, size, sourceBytesPerRow, sourceBytesPerImage, destinationOrigin, sourceHandle, sourceHandleOffset); +} + +_MTL_INLINE void MTL::IOCommandBuffer::popDebugGroup() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(popDebugGroup)); +} + +_MTL_INLINE void MTL::IOCommandBuffer::pushDebugGroup(const NS::String* string) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(pushDebugGroup_), string); +} + _MTL_INLINE void MTL::IOCommandBuffer::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: status +_MTL_INLINE void MTL::IOCommandBuffer::signalEvent(const MTL::SharedEvent* event, uint64_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(signalEvent_value_), event, value); +} + _MTL_INLINE MTL::IOStatus MTL::IOCommandBuffer::status() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(status)); } -// property: error -_MTL_INLINE NS::Error* MTL::IOCommandBuffer::error() const +_MTL_INLINE void MTL::IOCommandBuffer::tryCancel() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(error)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(tryCancel)); +} + +_MTL_INLINE void MTL::IOCommandBuffer::wait(const MTL::SharedEvent* event, uint64_t value) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForEvent_value_), event, value); +} + +_MTL_INLINE void MTL::IOCommandBuffer::waitUntilCompleted() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitUntilCompleted)); } diff --git a/vendor/metal-cpp/Metal/MTLIOCommandQueue.hpp b/vendor/metal-cpp/Metal/MTLIOCommandQueue.hpp index b5f5d1c22..ac956c8f1 100644 --- a/vendor/metal-cpp/Metal/MTLIOCommandQueue.hpp +++ b/vendor/metal-cpp/Metal/MTLIOCommandQueue.hpp @@ -2,7 +2,7 @@ // // Metal/MTLIOCommandQueue.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,18 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLIOCommandQueue.hpp" - namespace MTL { +class Buffer; +class IOCommandBuffer; +class IOCommandQueueDescriptor; +class IOScratchBuffer; +class IOScratchBufferAllocator; _MTL_ENUM(NS::Integer, IOPriority) { IOPriorityHigh = 0, IOPriorityNormal = 1, @@ -41,61 +43,59 @@ _MTL_ENUM(NS::Integer, IOCommandQueueType) { IOCommandQueueTypeSerial = 1, }; -_MTL_CONST(NS::ErrorDomain, IOErrorDomain); - _MTL_ENUM(NS::Integer, IOError) { IOErrorURLInvalid = 1, IOErrorInternal = 2, }; +_MTL_CONST(NS::ErrorDomain, IOErrorDomain); class IOCommandQueue : public NS::Referencing { public: - void enqueueBarrier(); + IOCommandBuffer* commandBuffer(); + IOCommandBuffer* commandBufferWithUnretainedReferences(); - class IOCommandBuffer* commandBuffer(); + void enqueueBarrier(); - class IOCommandBuffer* commandBufferWithUnretainedReferences(); - - NS::String* label() const; - void setLabel(const NS::String* label); + NS::String* label() const; + void setLabel(const NS::String* label); }; - class IOScratchBuffer : public NS::Referencing { public: - class Buffer* buffer() const; + Buffer* buffer() const; }; - class IOScratchBufferAllocator : public NS::Referencing { public: - class IOScratchBuffer* newScratchBuffer(NS::UInteger minimumSize); + IOScratchBuffer* newScratchBuffer(NS::UInteger minimumSize); }; - class IOCommandQueueDescriptor : public NS::Copying { public: - static class IOCommandQueueDescriptor* alloc(); + static IOCommandQueueDescriptor* alloc(); - class IOCommandQueueDescriptor* init(); + IOCommandQueueDescriptor* init(); - NS::UInteger maxCommandBufferCount() const; - void setMaxCommandBufferCount(NS::UInteger maxCommandBufferCount); + NS::UInteger maxCommandBufferCount() const; - MTL::IOPriority priority() const; - void setPriority(MTL::IOPriority priority); + NS::UInteger maxCommandsInFlight() const; - MTL::IOCommandQueueType type() const; - void setType(MTL::IOCommandQueueType type); + IOPriority priority() const; - NS::UInteger maxCommandsInFlight() const; - void setMaxCommandsInFlight(NS::UInteger maxCommandsInFlight); + IOScratchBufferAllocator* scratchBufferAllocator() const; - class IOScratchBufferAllocator* scratchBufferAllocator() const; - void setScratchBufferAllocator(const class IOScratchBufferAllocator* scratchBufferAllocator); + void setMaxCommandBufferCount(NS::UInteger maxCommandBufferCount); + + void setMaxCommandsInFlight(NS::UInteger maxCommandsInFlight); + + void setPriority(MTL::IOPriority priority); + + void setScratchBufferAllocator(const MTL::IOScratchBufferAllocator* scratchBufferAllocator); + + void setType(MTL::IOCommandQueueType type); + IOCommandQueueType type() const; }; - class IOFileHandle : public NS::Referencing { public: @@ -104,26 +104,22 @@ public: }; } - -// method: enqueueBarrier -_MTL_INLINE void MTL::IOCommandQueue::enqueueBarrier() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(enqueueBarrier)); -} - -// method: commandBuffer +_MTL_PRIVATE_DEF_CONST(NS::ErrorDomain, IOErrorDomain); _MTL_INLINE MTL::IOCommandBuffer* MTL::IOCommandQueue::commandBuffer() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBuffer)); } -// method: commandBufferWithUnretainedReferences _MTL_INLINE MTL::IOCommandBuffer* MTL::IOCommandQueue::commandBufferWithUnretainedReferences() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandBufferWithUnretainedReferences)); } -// property: label +_MTL_INLINE void MTL::IOCommandQueue::enqueueBarrier() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(enqueueBarrier)); +} + _MTL_INLINE NS::String* MTL::IOCommandQueue::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); @@ -134,45 +130,54 @@ _MTL_INLINE void MTL::IOCommandQueue::setLabel(const NS::String* label) Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: buffer _MTL_INLINE MTL::Buffer* MTL::IOScratchBuffer::buffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffer)); } -// method: newScratchBufferWithMinimumSize: _MTL_INLINE MTL::IOScratchBuffer* MTL::IOScratchBufferAllocator::newScratchBuffer(NS::UInteger minimumSize) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newScratchBufferWithMinimumSize_), minimumSize); } -// static method: alloc _MTL_INLINE MTL::IOCommandQueueDescriptor* MTL::IOCommandQueueDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLIOCommandQueueDescriptor)); } -// method: init _MTL_INLINE MTL::IOCommandQueueDescriptor* MTL::IOCommandQueueDescriptor::init() { return NS::Object::init(); } -// property: maxCommandBufferCount _MTL_INLINE NS::UInteger MTL::IOCommandQueueDescriptor::maxCommandBufferCount() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCommandBufferCount)); } +_MTL_INLINE NS::UInteger MTL::IOCommandQueueDescriptor::maxCommandsInFlight() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCommandsInFlight)); +} + +_MTL_INLINE MTL::IOPriority MTL::IOCommandQueueDescriptor::priority() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(priority)); +} + +_MTL_INLINE MTL::IOScratchBufferAllocator* MTL::IOCommandQueueDescriptor::scratchBufferAllocator() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(scratchBufferAllocator)); +} + _MTL_INLINE void MTL::IOCommandQueueDescriptor::setMaxCommandBufferCount(NS::UInteger maxCommandBufferCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCommandBufferCount_), maxCommandBufferCount); } -// property: priority -_MTL_INLINE MTL::IOPriority MTL::IOCommandQueueDescriptor::priority() const +_MTL_INLINE void MTL::IOCommandQueueDescriptor::setMaxCommandsInFlight(NS::UInteger maxCommandsInFlight) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(priority)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCommandsInFlight_), maxCommandsInFlight); } _MTL_INLINE void MTL::IOCommandQueueDescriptor::setPriority(MTL::IOPriority priority) @@ -180,10 +185,9 @@ _MTL_INLINE void MTL::IOCommandQueueDescriptor::setPriority(MTL::IOPriority prio Object::sendMessage(this, _MTL_PRIVATE_SEL(setPriority_), priority); } -// property: type -_MTL_INLINE MTL::IOCommandQueueType MTL::IOCommandQueueDescriptor::type() const +_MTL_INLINE void MTL::IOCommandQueueDescriptor::setScratchBufferAllocator(const MTL::IOScratchBufferAllocator* scratchBufferAllocator) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setScratchBufferAllocator_), scratchBufferAllocator); } _MTL_INLINE void MTL::IOCommandQueueDescriptor::setType(MTL::IOCommandQueueType type) @@ -191,29 +195,11 @@ _MTL_INLINE void MTL::IOCommandQueueDescriptor::setType(MTL::IOCommandQueueType Object::sendMessage(this, _MTL_PRIVATE_SEL(setType_), type); } -// property: maxCommandsInFlight -_MTL_INLINE NS::UInteger MTL::IOCommandQueueDescriptor::maxCommandsInFlight() const +_MTL_INLINE MTL::IOCommandQueueType MTL::IOCommandQueueDescriptor::type() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCommandsInFlight)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); } -_MTL_INLINE void MTL::IOCommandQueueDescriptor::setMaxCommandsInFlight(NS::UInteger maxCommandsInFlight) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCommandsInFlight_), maxCommandsInFlight); -} - -// property: scratchBufferAllocator -_MTL_INLINE MTL::IOScratchBufferAllocator* MTL::IOCommandQueueDescriptor::scratchBufferAllocator() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(scratchBufferAllocator)); -} - -_MTL_INLINE void MTL::IOCommandQueueDescriptor::setScratchBufferAllocator(const MTL::IOScratchBufferAllocator* scratchBufferAllocator) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setScratchBufferAllocator_), scratchBufferAllocator); -} - -// property: label _MTL_INLINE NS::String* MTL::IOFileHandle::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); diff --git a/vendor/metal-cpp/Metal/MTLIOCompressor.hpp b/vendor/metal-cpp/Metal/MTLIOCompressor.hpp index 7719beccd..920fa611c 100644 --- a/vendor/metal-cpp/Metal/MTLIOCompressor.hpp +++ b/vendor/metal-cpp/Metal/MTLIOCompressor.hpp @@ -2,7 +2,7 @@ // // Metal/MTLIOCompressor.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,10 +25,12 @@ #include "MTLPrivate.hpp" #include "MTLDevice.hpp" -#include +#include "../Foundation/Foundation.hpp" namespace MTL { +using IOCompressionContext=void*; + _MTL_ENUM(NS::Integer, IOCompressionStatus) { IOCompressionStatusComplete = 0, IOCompressionStatusError = 1, @@ -36,11 +38,11 @@ _MTL_ENUM(NS::Integer, IOCompressionStatus) { size_t IOCompressionContextDefaultChunkSize(); -void* IOCreateCompressionContext(const char* path, IOCompressionMethod type, size_t chunkSize); +IOCompressionContext IOCreateCompressionContext(const char* path, IOCompressionMethod type, size_t chunkSize); -void IOCompressionContextAppendData(void* context, const void* data, size_t size); +void IOCompressionContextAppendData(IOCompressionContext context, const void* data, size_t size); -IOCompressionStatus IOFlushAndDestroyCompressionContext(void* context); +IOCompressionStatus IOFlushAndDestroyCompressionContext(IOCompressionContext context); } diff --git a/vendor/metal-cpp/Metal/MTLIndirectCommandBuffer.hpp b/vendor/metal-cpp/Metal/MTLIndirectCommandBuffer.hpp index e933083cf..6944d5621 100644 --- a/vendor/metal-cpp/Metal/MTLIndirectCommandBuffer.hpp +++ b/vendor/metal-cpp/Metal/MTLIndirectCommandBuffer.hpp @@ -2,7 +2,7 @@ // // Metal/MTLIndirectCommandBuffer.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,25 +20,29 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLIndirectCommandBuffer.hpp" #include "MTLResource.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class IndirectCommandBufferDescriptor; +class IndirectComputeCommand; +class IndirectRenderCommand; + _MTL_OPTIONS(NS::UInteger, IndirectCommandType) { IndirectCommandTypeDraw = 1, - IndirectCommandTypeDrawIndexed = 2, - IndirectCommandTypeDrawPatches = 4, - IndirectCommandTypeDrawIndexedPatches = 8, - IndirectCommandTypeConcurrentDispatch = 32, - IndirectCommandTypeConcurrentDispatchThreads = 64, + IndirectCommandTypeDrawIndexed = 1 << 1, + IndirectCommandTypeDrawPatches = 1 << 2, + IndirectCommandTypeDrawIndexedPatches = 1 << 3, + IndirectCommandTypeConcurrentDispatch = 1 << 5, + IndirectCommandTypeConcurrentDispatchThreads = 1 << 6, + IndirectCommandTypeDrawMeshThreadgroups = 1 << 7, + IndirectCommandTypeDrawMeshThreads = 1 << 8, }; struct IndirectCommandBufferExecutionRange @@ -50,64 +54,190 @@ struct IndirectCommandBufferExecutionRange class IndirectCommandBufferDescriptor : public NS::Copying { public: - static class IndirectCommandBufferDescriptor* alloc(); + static IndirectCommandBufferDescriptor* alloc(); - class IndirectCommandBufferDescriptor* init(); + IndirectCommandType commandTypes() const; - MTL::IndirectCommandType commandTypes() const; - void setCommandTypes(MTL::IndirectCommandType commandTypes); + bool inheritBuffers() const; - bool inheritPipelineState() const; - void setInheritPipelineState(bool inheritPipelineState); + bool inheritCullMode() const; - bool inheritBuffers() const; - void setInheritBuffers(bool inheritBuffers); + bool inheritDepthBias() const; - NS::UInteger maxVertexBufferBindCount() const; - void setMaxVertexBufferBindCount(NS::UInteger maxVertexBufferBindCount); + bool inheritDepthClipMode() const; - NS::UInteger maxFragmentBufferBindCount() const; - void setMaxFragmentBufferBindCount(NS::UInteger maxFragmentBufferBindCount); + bool inheritDepthStencilState() const; - NS::UInteger maxKernelBufferBindCount() const; - void setMaxKernelBufferBindCount(NS::UInteger maxKernelBufferBindCount); + bool inheritFrontFacingWinding() const; - bool supportRayTracing() const; - void setSupportRayTracing(bool supportRayTracing); + bool inheritPipelineState() const; + + bool inheritTriangleFillMode() const; + + IndirectCommandBufferDescriptor* init(); + + NS::UInteger maxFragmentBufferBindCount() const; + + NS::UInteger maxKernelBufferBindCount() const; + + NS::UInteger maxKernelThreadgroupMemoryBindCount() const; + + NS::UInteger maxMeshBufferBindCount() const; + + NS::UInteger maxObjectBufferBindCount() const; + + NS::UInteger maxObjectThreadgroupMemoryBindCount() const; + + NS::UInteger maxVertexBufferBindCount() const; + + void setCommandTypes(MTL::IndirectCommandType commandTypes); + + void setInheritBuffers(bool inheritBuffers); + + void setInheritCullMode(bool inheritCullMode); + + void setInheritDepthBias(bool inheritDepthBias); + + void setInheritDepthClipMode(bool inheritDepthClipMode); + + void setInheritDepthStencilState(bool inheritDepthStencilState); + + void setInheritFrontFacingWinding(bool inheritFrontFacingWinding); + + void setInheritPipelineState(bool inheritPipelineState); + + void setInheritTriangleFillMode(bool inheritTriangleFillMode); + + void setMaxFragmentBufferBindCount(NS::UInteger maxFragmentBufferBindCount); + + void setMaxKernelBufferBindCount(NS::UInteger maxKernelBufferBindCount); + + void setMaxKernelThreadgroupMemoryBindCount(NS::UInteger maxKernelThreadgroupMemoryBindCount); + + void setMaxMeshBufferBindCount(NS::UInteger maxMeshBufferBindCount); + + void setMaxObjectBufferBindCount(NS::UInteger maxObjectBufferBindCount); + + void setMaxObjectThreadgroupMemoryBindCount(NS::UInteger maxObjectThreadgroupMemoryBindCount); + + void setMaxVertexBufferBindCount(NS::UInteger maxVertexBufferBindCount); + + void setSupportColorAttachmentMapping(bool supportColorAttachmentMapping); + + void setSupportDynamicAttributeStride(bool supportDynamicAttributeStride); + + void setSupportRayTracing(bool supportRayTracing); + + bool supportColorAttachmentMapping() const; + + bool supportDynamicAttributeStride() const; + + bool supportRayTracing() const; }; - class IndirectCommandBuffer : public NS::Referencing { public: - NS::UInteger size() const; + ResourceID gpuResourceID() const; - MTL::ResourceID gpuResourceID() const; + IndirectComputeCommand* indirectComputeCommand(NS::UInteger commandIndex); - void reset(NS::Range range); + IndirectRenderCommand* indirectRenderCommand(NS::UInteger commandIndex); - class IndirectRenderCommand* indirectRenderCommand(NS::UInteger commandIndex); + void reset(NS::Range range); - class IndirectComputeCommand* indirectComputeCommand(NS::UInteger commandIndex); + NS::UInteger size() const; }; } -// static method: alloc _MTL_INLINE MTL::IndirectCommandBufferDescriptor* MTL::IndirectCommandBufferDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLIndirectCommandBufferDescriptor)); } -// method: init +_MTL_INLINE MTL::IndirectCommandType MTL::IndirectCommandBufferDescriptor::commandTypes() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandTypes)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritBuffers)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritCullMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritCullMode)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritDepthBias() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritDepthBias)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritDepthClipMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritDepthClipMode)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritDepthStencilState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritDepthStencilState)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritFrontFacingWinding() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritFrontFacingWinding)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritPipelineState() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritPipelineState)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritTriangleFillMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritTriangleFillMode)); +} + _MTL_INLINE MTL::IndirectCommandBufferDescriptor* MTL::IndirectCommandBufferDescriptor::init() { return NS::Object::init(); } -// property: commandTypes -_MTL_INLINE MTL::IndirectCommandType MTL::IndirectCommandBufferDescriptor::commandTypes() const +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxFragmentBufferBindCount() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(commandTypes)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxFragmentBufferBindCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxKernelBufferBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxKernelBufferBindCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxKernelThreadgroupMemoryBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxKernelThreadgroupMemoryBindCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxMeshBufferBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxMeshBufferBindCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxObjectBufferBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxObjectBufferBindCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxObjectThreadgroupMemoryBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxObjectThreadgroupMemoryBindCount)); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxVertexBufferBindCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexBufferBindCount)); } _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setCommandTypes(MTL::IndirectCommandType commandTypes) @@ -115,10 +245,34 @@ _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setCommandTypes(MTL::Indi Object::sendMessage(this, _MTL_PRIVATE_SEL(setCommandTypes_), commandTypes); } -// property: inheritPipelineState -_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritPipelineState() const +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritBuffers(bool inheritBuffers) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritPipelineState)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritBuffers_), inheritBuffers); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritCullMode(bool inheritCullMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritCullMode_), inheritCullMode); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritDepthBias(bool inheritDepthBias) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritDepthBias_), inheritDepthBias); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritDepthClipMode(bool inheritDepthClipMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritDepthClipMode_), inheritDepthClipMode); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritDepthStencilState(bool inheritDepthStencilState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritDepthStencilState_), inheritDepthStencilState); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritFrontFacingWinding(bool inheritFrontFacingWinding) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritFrontFacingWinding_), inheritFrontFacingWinding); } _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritPipelineState(bool inheritPipelineState) @@ -126,32 +280,9 @@ _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritPipelineState(b Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritPipelineState_), inheritPipelineState); } -// property: inheritBuffers -_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::inheritBuffers() const +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritTriangleFillMode(bool inheritTriangleFillMode) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(inheritBuffers)); -} - -_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setInheritBuffers(bool inheritBuffers) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritBuffers_), inheritBuffers); -} - -// property: maxVertexBufferBindCount -_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxVertexBufferBindCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexBufferBindCount)); -} - -_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxVertexBufferBindCount(NS::UInteger maxVertexBufferBindCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexBufferBindCount_), maxVertexBufferBindCount); -} - -// property: maxFragmentBufferBindCount -_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxFragmentBufferBindCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxFragmentBufferBindCount)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInheritTriangleFillMode_), inheritTriangleFillMode); } _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxFragmentBufferBindCount(NS::UInteger maxFragmentBufferBindCount) @@ -159,21 +290,44 @@ _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxFragmentBufferBindC Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxFragmentBufferBindCount_), maxFragmentBufferBindCount); } -// property: maxKernelBufferBindCount -_MTL_INLINE NS::UInteger MTL::IndirectCommandBufferDescriptor::maxKernelBufferBindCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxKernelBufferBindCount)); -} - _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxKernelBufferBindCount(NS::UInteger maxKernelBufferBindCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxKernelBufferBindCount_), maxKernelBufferBindCount); } -// property: supportRayTracing -_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::supportRayTracing() const +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxKernelThreadgroupMemoryBindCount(NS::UInteger maxKernelThreadgroupMemoryBindCount) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportRayTracing)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxKernelThreadgroupMemoryBindCount_), maxKernelThreadgroupMemoryBindCount); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxMeshBufferBindCount(NS::UInteger maxMeshBufferBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxMeshBufferBindCount_), maxMeshBufferBindCount); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxObjectBufferBindCount(NS::UInteger maxObjectBufferBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxObjectBufferBindCount_), maxObjectBufferBindCount); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxObjectThreadgroupMemoryBindCount(NS::UInteger maxObjectThreadgroupMemoryBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxObjectThreadgroupMemoryBindCount_), maxObjectThreadgroupMemoryBindCount); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setMaxVertexBufferBindCount(NS::UInteger maxVertexBufferBindCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexBufferBindCount_), maxVertexBufferBindCount); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setSupportColorAttachmentMapping(bool supportColorAttachmentMapping) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportColorAttachmentMapping_), supportColorAttachmentMapping); +} + +_MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setSupportDynamicAttributeStride(bool supportDynamicAttributeStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportDynamicAttributeStride_), supportDynamicAttributeStride); } _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setSupportRayTracing(bool supportRayTracing) @@ -181,32 +335,42 @@ _MTL_INLINE void MTL::IndirectCommandBufferDescriptor::setSupportRayTracing(bool Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportRayTracing_), supportRayTracing); } -// property: size -_MTL_INLINE NS::UInteger MTL::IndirectCommandBuffer::size() const +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::supportColorAttachmentMapping() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportColorAttachmentMapping)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::supportDynamicAttributeStride() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportDynamicAttributeStride)); +} + +_MTL_INLINE bool MTL::IndirectCommandBufferDescriptor::supportRayTracing() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportRayTracing)); } -// property: gpuResourceID _MTL_INLINE MTL::ResourceID MTL::IndirectCommandBuffer::gpuResourceID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); } -// method: resetWithRange: -_MTL_INLINE void MTL::IndirectCommandBuffer::reset(NS::Range range) +_MTL_INLINE MTL::IndirectComputeCommand* MTL::IndirectCommandBuffer::indirectComputeCommand(NS::UInteger commandIndex) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(resetWithRange_), range); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indirectComputeCommandAtIndex_), commandIndex); } -// method: indirectRenderCommandAtIndex: _MTL_INLINE MTL::IndirectRenderCommand* MTL::IndirectCommandBuffer::indirectRenderCommand(NS::UInteger commandIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(indirectRenderCommandAtIndex_), commandIndex); } -// method: indirectComputeCommandAtIndex: -_MTL_INLINE MTL::IndirectComputeCommand* MTL::IndirectCommandBuffer::indirectComputeCommand(NS::UInteger commandIndex) +_MTL_INLINE void MTL::IndirectCommandBuffer::reset(NS::Range range) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(indirectComputeCommandAtIndex_), commandIndex); + Object::sendMessage(this, _MTL_PRIVATE_SEL(resetWithRange_), range); +} + +_MTL_INLINE NS::UInteger MTL::IndirectCommandBuffer::size() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(size)); } diff --git a/vendor/metal-cpp/Metal/MTLIndirectCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLIndirectCommandEncoder.hpp index 50ee75328..9e1a94004 100644 --- a/vendor/metal-cpp/Metal/MTLIndirectCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLIndirectCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLIndirectCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,168 +20,253 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLArgument.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - #include "MTLRenderCommandEncoder.hpp" -#include "MTLStageInputOutputDescriptor.hpp" #include "MTLTypes.hpp" namespace MTL { +class Buffer; +class ComputePipelineState; +class RenderPipelineState; + class IndirectRenderCommand : public NS::Referencing { public: - void setRenderPipelineState(const class RenderPipelineState* pipelineState); + void clearBarrier(); - void setVertexBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride); - void setFragmentBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance); - void drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const class Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const class Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride); + void drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); - void drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const class Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const class Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const class Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride); + void drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); + + void drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride); void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance); - void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const class Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance); - void reset(); -}; + void setBarrier(); + + void setCullMode(MTL::CullMode cullMode); + + void setDepthBias(float depthBias, float slopeScale, float clamp); + + void setDepthClipMode(MTL::DepthClipMode depthClipMode); + + void setDepthStencilState(const MTL::DepthStencilState* depthStencilState); + + void setFragmentBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + + void setFrontFacingWinding(MTL::Winding frontFacingWindning); + + void setMeshBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + + void setObjectBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + + void setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); + + void setRenderPipelineState(const MTL::RenderPipelineState* pipelineState); + + void setTriangleFillMode(MTL::TriangleFillMode fillMode); + + void setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index); +}; class IndirectComputeCommand : public NS::Referencing { public: - void setComputePipelineState(const class ComputePipelineState* pipelineState); - - void setKernelBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void clearBarrier(); void concurrentDispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup); void concurrentDispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup); + void reset(); + void setBarrier(); - void clearBarrier(); + void setComputePipelineState(const MTL::ComputePipelineState* pipelineState); void setImageblockWidth(NS::UInteger width, NS::UInteger height); - void reset(); - - void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); + void setKernelBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setKernelBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index); void setStageInRegion(MTL::Region region); + + void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); }; } - -// method: setRenderPipelineState: -_MTL_INLINE void MTL::IndirectRenderCommand::setRenderPipelineState(const MTL::RenderPipelineState* pipelineState) +_MTL_INLINE void MTL::IndirectRenderCommand::clearBarrier() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineState_), pipelineState); + Object::sendMessage(this, _MTL_PRIVATE_SEL(clearBarrier)); } -// method: setVertexBuffer:offset:atIndex: -_MTL_INLINE void MTL::IndirectRenderCommand::setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setFragmentBuffer:offset:atIndex: -_MTL_INLINE void MTL::IndirectRenderCommand::setFragmentBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride: -_MTL_INLINE void MTL::IndirectRenderCommand::drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_instanceCount_baseInstance_tessellationFactorBuffer_tessellationFactorBufferOffset_tessellationFactorBufferInstanceStride_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, instanceCount, baseInstance, buffer, offset, instanceStride); -} - -// method: drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride: _MTL_INLINE void MTL::IndirectRenderCommand::drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride) { Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_instanceCount_baseInstance_tessellationFactorBuffer_tessellationFactorBufferOffset_tessellationFactorBufferInstanceStride_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, controlPointIndexBuffer, controlPointIndexBufferOffset, instanceCount, baseInstance, buffer, offset, instanceStride); } -// method: drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance: -_MTL_INLINE void MTL::IndirectRenderCommand::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_baseInstance_), primitiveType, vertexStart, vertexCount, instanceCount, baseInstance); -} - -// method: drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance: _MTL_INLINE void MTL::IndirectRenderCommand::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance) { Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_baseVertex_baseInstance_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset, instanceCount, baseVertex, baseInstance); } -// method: reset +_MTL_INLINE void MTL::IndirectRenderCommand::drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroups_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadgroupsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreads_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance, const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_instanceCount_baseInstance_tessellationFactorBuffer_tessellationFactorBufferOffset_tessellationFactorBufferInstanceStride_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, instanceCount, baseInstance, buffer, offset, instanceStride); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_baseInstance_), primitiveType, vertexStart, vertexCount, instanceCount, baseInstance); +} + _MTL_INLINE void MTL::IndirectRenderCommand::reset() { Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } -// method: setComputePipelineState: -_MTL_INLINE void MTL::IndirectComputeCommand::setComputePipelineState(const MTL::ComputePipelineState* pipelineState) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_), pipelineState); -} - -// method: setKernelBuffer:offset:atIndex: -_MTL_INLINE void MTL::IndirectComputeCommand::setKernelBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setKernelBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: concurrentDispatchThreadgroups:threadsPerThreadgroup: -_MTL_INLINE void MTL::IndirectComputeCommand::concurrentDispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(concurrentDispatchThreadgroups_threadsPerThreadgroup_), threadgroupsPerGrid, threadsPerThreadgroup); -} - -// method: concurrentDispatchThreads:threadsPerThreadgroup: -_MTL_INLINE void MTL::IndirectComputeCommand::concurrentDispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(concurrentDispatchThreads_threadsPerThreadgroup_), threadsPerGrid, threadsPerThreadgroup); -} - -// method: setBarrier -_MTL_INLINE void MTL::IndirectComputeCommand::setBarrier() +_MTL_INLINE void MTL::IndirectRenderCommand::setBarrier() { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBarrier)); } -// method: clearBarrier +_MTL_INLINE void MTL::IndirectRenderCommand::setCullMode(MTL::CullMode cullMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCullMode_), cullMode); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setDepthBias(float depthBias, float slopeScale, float clamp) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthBias_slopeScale_clamp_), depthBias, slopeScale, clamp); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setDepthClipMode(MTL::DepthClipMode depthClipMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthClipMode_), depthClipMode); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setDepthStencilState(const MTL::DepthStencilState* depthStencilState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilState_), depthStencilState); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setFragmentBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setFrontFacingWinding(MTL::Winding frontFacingWindning) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFrontFacingWinding_), frontFacingWindning); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setMeshBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setObjectBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupMemoryLength_atIndex_), length, index); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setRenderPipelineState(const MTL::RenderPipelineState* pipelineState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineState_), pipelineState); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setTriangleFillMode(MTL::TriangleFillMode fillMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleFillMode_), fillMode); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::IndirectRenderCommand::setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_offset_attributeStride_atIndex_), buffer, offset, stride, index); +} + _MTL_INLINE void MTL::IndirectComputeCommand::clearBarrier() { Object::sendMessage(this, _MTL_PRIVATE_SEL(clearBarrier)); } -// method: setImageblockWidth:height: -_MTL_INLINE void MTL::IndirectComputeCommand::setImageblockWidth(NS::UInteger width, NS::UInteger height) +_MTL_INLINE void MTL::IndirectComputeCommand::concurrentDispatchThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerThreadgroup) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockWidth_height_), width, height); + Object::sendMessage(this, _MTL_PRIVATE_SEL(concurrentDispatchThreadgroups_threadsPerThreadgroup_), threadgroupsPerGrid, threadsPerThreadgroup); +} + +_MTL_INLINE void MTL::IndirectComputeCommand::concurrentDispatchThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(concurrentDispatchThreads_threadsPerThreadgroup_), threadsPerGrid, threadsPerThreadgroup); } -// method: reset _MTL_INLINE void MTL::IndirectComputeCommand::reset() { Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } -// method: setThreadgroupMemoryLength:atIndex: -_MTL_INLINE void MTL::IndirectComputeCommand::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +_MTL_INLINE void MTL::IndirectComputeCommand::setBarrier() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_atIndex_), length, index); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBarrier)); +} + +_MTL_INLINE void MTL::IndirectComputeCommand::setComputePipelineState(const MTL::ComputePipelineState* pipelineState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setComputePipelineState_), pipelineState); +} + +_MTL_INLINE void MTL::IndirectComputeCommand::setImageblockWidth(NS::UInteger width, NS::UInteger height) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockWidth_height_), width, height); +} + +_MTL_INLINE void MTL::IndirectComputeCommand::setKernelBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setKernelBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::IndirectComputeCommand::setKernelBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setKernelBuffer_offset_attributeStride_atIndex_), buffer, offset, stride, index); } -// method: setStageInRegion: _MTL_INLINE void MTL::IndirectComputeCommand::setStageInRegion(MTL::Region region) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStageInRegion_), region); } + +_MTL_INLINE void MTL::IndirectComputeCommand::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_atIndex_), length, index); +} diff --git a/vendor/metal-cpp/Metal/MTLIntersectionFunctionTable.hpp b/vendor/metal-cpp/Metal/MTLIntersectionFunctionTable.hpp index 68322c342..436653b2e 100644 --- a/vendor/metal-cpp/Metal/MTLIntersectionFunctionTable.hpp +++ b/vendor/metal-cpp/Metal/MTLIntersectionFunctionTable.hpp @@ -2,7 +2,7 @@ // // Metal/MTLIntersectionFunctionTable.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,143 +20,153 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLIntersectionFunctionTable.hpp" #include "MTLResource.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class Buffer; +class FunctionHandle; +class IntersectionFunctionTableDescriptor; +class VisibleFunctionTable; + _MTL_OPTIONS(NS::UInteger, IntersectionFunctionSignature) { IntersectionFunctionSignatureNone = 0, IntersectionFunctionSignatureInstancing = 1, - IntersectionFunctionSignatureTriangleData = 2, - IntersectionFunctionSignatureWorldSpaceData = 4, - IntersectionFunctionSignatureInstanceMotion = 8, - IntersectionFunctionSignaturePrimitiveMotion = 16, - IntersectionFunctionSignatureExtendedLimits = 32, + IntersectionFunctionSignatureTriangleData = 1 << 1, + IntersectionFunctionSignatureWorldSpaceData = 1 << 2, + IntersectionFunctionSignatureInstanceMotion = 1 << 3, + IntersectionFunctionSignaturePrimitiveMotion = 1 << 4, + IntersectionFunctionSignatureExtendedLimits = 1 << 5, + IntersectionFunctionSignatureMaxLevels = 1 << 6, + IntersectionFunctionSignatureCurveData = 1 << 7, + IntersectionFunctionSignatureIntersectionFunctionBuffer = 1 << 8, + IntersectionFunctionSignatureUserData = 1 << 9, }; +struct IntersectionFunctionBufferArguments +{ + uint64_t intersectionFunctionBuffer; + uint64_t intersectionFunctionBufferSize; + uint64_t intersectionFunctionStride; +} _MTL_PACKED; + class IntersectionFunctionTableDescriptor : public NS::Copying { public: - static class IntersectionFunctionTableDescriptor* alloc(); + static IntersectionFunctionTableDescriptor* alloc(); - class IntersectionFunctionTableDescriptor* init(); + NS::UInteger functionCount() const; - static class IntersectionFunctionTableDescriptor* intersectionFunctionTableDescriptor(); + IntersectionFunctionTableDescriptor* init(); - NS::UInteger functionCount() const; - void setFunctionCount(NS::UInteger functionCount); + static IntersectionFunctionTableDescriptor* intersectionFunctionTableDescriptor(); + + void setFunctionCount(NS::UInteger functionCount); }; - class IntersectionFunctionTable : public NS::Referencing { public: - void setBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + ResourceID gpuResourceID() const; - void setBuffers(const class Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); + void setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); - MTL::ResourceID gpuResourceID() const; + void setFunction(const MTL::FunctionHandle* function, NS::UInteger index); + void setFunctions(const MTL::FunctionHandle* const functions[], NS::Range range); - void setFunction(const class FunctionHandle* function, NS::UInteger index); + void setOpaqueCurveIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index); + void setOpaqueCurveIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range); - void setFunctions(const class FunctionHandle* const functions[], NS::Range range); + void setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index); + void setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range); - void setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index); - - void setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range); - - void setVisibleFunctionTable(const class VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); - - void setVisibleFunctionTables(const class VisibleFunctionTable* const functionTables[], NS::Range bufferRange); + void setVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); + void setVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range bufferRange); }; } -// static method: alloc _MTL_INLINE MTL::IntersectionFunctionTableDescriptor* MTL::IntersectionFunctionTableDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLIntersectionFunctionTableDescriptor)); } -// method: init +_MTL_INLINE NS::UInteger MTL::IntersectionFunctionTableDescriptor::functionCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionCount)); +} + _MTL_INLINE MTL::IntersectionFunctionTableDescriptor* MTL::IntersectionFunctionTableDescriptor::init() { return NS::Object::init(); } -// static method: intersectionFunctionTableDescriptor _MTL_INLINE MTL::IntersectionFunctionTableDescriptor* MTL::IntersectionFunctionTableDescriptor::intersectionFunctionTableDescriptor() { return Object::sendMessage(_MTL_PRIVATE_CLS(MTLIntersectionFunctionTableDescriptor), _MTL_PRIVATE_SEL(intersectionFunctionTableDescriptor)); } -// property: functionCount -_MTL_INLINE NS::UInteger MTL::IntersectionFunctionTableDescriptor::functionCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionCount)); -} - _MTL_INLINE void MTL::IntersectionFunctionTableDescriptor::setFunctionCount(NS::UInteger functionCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionCount_), functionCount); } -// method: setBuffer:offset:atIndex: -_MTL_INLINE void MTL::IntersectionFunctionTable::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setBuffers:offsets:withRange: -_MTL_INLINE void MTL::IntersectionFunctionTable::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range); -} - -// property: gpuResourceID _MTL_INLINE MTL::ResourceID MTL::IntersectionFunctionTable::gpuResourceID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); } -// method: setFunction:atIndex: +_MTL_INLINE void MTL::IntersectionFunctionTable::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::IntersectionFunctionTable::setBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range); +} + _MTL_INLINE void MTL::IntersectionFunctionTable::setFunction(const MTL::FunctionHandle* function, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunction_atIndex_), function, index); } -// method: setFunctions:withRange: _MTL_INLINE void MTL::IntersectionFunctionTable::setFunctions(const MTL::FunctionHandle* const functions[], NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctions_withRange_), functions, range); } -// method: setOpaqueTriangleIntersectionFunctionWithSignature:atIndex: +_MTL_INLINE void MTL::IntersectionFunctionTable::setOpaqueCurveIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaqueCurveIntersectionFunctionWithSignature_atIndex_), signature, index); +} + +_MTL_INLINE void MTL::IntersectionFunctionTable::setOpaqueCurveIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaqueCurveIntersectionFunctionWithSignature_withRange_), signature, range); +} + _MTL_INLINE void MTL::IntersectionFunctionTable::setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaqueTriangleIntersectionFunctionWithSignature_atIndex_), signature, index); } -// method: setOpaqueTriangleIntersectionFunctionWithSignature:withRange: _MTL_INLINE void MTL::IntersectionFunctionTable::setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setOpaqueTriangleIntersectionFunctionWithSignature_withRange_), signature, range); } -// method: setVisibleFunctionTable:atBufferIndex: _MTL_INLINE void MTL::IntersectionFunctionTable::setVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); } -// method: setVisibleFunctionTables:withBufferRange: _MTL_INLINE void MTL::IntersectionFunctionTable::setVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range bufferRange) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibleFunctionTables_withBufferRange_), functionTables, bufferRange); diff --git a/vendor/metal-cpp/Metal/MTLLibrary.hpp b/vendor/metal-cpp/Metal/MTLLibrary.hpp index 234373d4b..44aa3a7a0 100644 --- a/vendor/metal-cpp/Metal/MTLLibrary.hpp +++ b/vendor/metal-cpp/Metal/MTLLibrary.hpp @@ -2,7 +2,7 @@ // // Metal/MTLLibrary.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,65 +20,34 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLDataType.hpp" #include "MTLDefines.hpp" +#include "MTLFunctionDescriptor.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLArgument.hpp" -#include "MTLFunctionDescriptor.hpp" -#include "MTLLibrary.hpp" -#include +#include "MTLTypes.hpp" namespace MTL { +class Argument; +class ArgumentEncoder; +class Attribute; +class CompileOptions; +class Device; +class Function; +class FunctionConstant; +class FunctionConstantValues; +class FunctionDescriptor; +class FunctionReflection; +class IntersectionFunctionDescriptor; +class VertexAttribute; _MTL_ENUM(NS::UInteger, PatchType) { PatchTypeNone = 0, PatchTypeTriangle = 1, PatchTypeQuad = 2, }; -class VertexAttribute : public NS::Referencing -{ -public: - static class VertexAttribute* alloc(); - - class VertexAttribute* init(); - - NS::String* name() const; - - NS::UInteger attributeIndex() const; - - MTL::DataType attributeType() const; - - bool active() const; - - bool patchData() const; - - bool patchControlPointData() const; -}; - -class Attribute : public NS::Referencing -{ -public: - static class Attribute* alloc(); - - class Attribute* init(); - - NS::String* name() const; - - NS::UInteger attributeIndex() const; - - MTL::DataType attributeType() const; - - bool active() const; - - bool patchData() const; - - bool patchControlPointData() const; -}; - _MTL_ENUM(NS::UInteger, FunctionType) { FunctionTypeVertex = 1, FunctionTypeFragment = 2, @@ -89,53 +58,6 @@ _MTL_ENUM(NS::UInteger, FunctionType) { FunctionTypeObject = 8, }; -class FunctionConstant : public NS::Referencing -{ -public: - static class FunctionConstant* alloc(); - - class FunctionConstant* init(); - - NS::String* name() const; - - MTL::DataType type() const; - - NS::UInteger index() const; - - bool required() const; -}; - -using AutoreleasedArgument = class Argument*; - -class Function : public NS::Referencing -{ -public: - NS::String* label() const; - void setLabel(const NS::String* label); - - class Device* device() const; - - MTL::FunctionType functionType() const; - - MTL::PatchType patchType() const; - - NS::Integer patchControlPointCount() const; - - NS::Array* vertexAttributes() const; - - NS::Array* stageInputAttributes() const; - - NS::String* name() const; - - NS::Dictionary* functionConstantsDictionary() const; - - class ArgumentEncoder* newArgumentEncoder(NS::UInteger bufferIndex); - - class ArgumentEncoder* newArgumentEncoder(NS::UInteger bufferIndex, const MTL::AutoreleasedArgument* reflection); - - MTL::FunctionOptions options() const; -}; - _MTL_ENUM(NS::UInteger, LanguageVersion) { LanguageVersion1_0 = 65536, LanguageVersion1_1 = 65537, @@ -146,6 +68,9 @@ _MTL_ENUM(NS::UInteger, LanguageVersion) { LanguageVersion2_3 = 131075, LanguageVersion2_4 = 131076, LanguageVersion3_0 = 196608, + LanguageVersion3_1 = 196609, + LanguageVersion3_2 = 196610, + LanguageVersion4_0 = 262144, }; _MTL_ENUM(NS::Integer, LibraryType) { @@ -163,45 +88,15 @@ _MTL_ENUM(NS::Integer, CompileSymbolVisibility) { CompileSymbolVisibilityHidden = 1, }; -class CompileOptions : public NS::Copying -{ -public: - static class CompileOptions* alloc(); +_MTL_ENUM(NS::Integer, MathMode) { + MathModeSafe = 0, + MathModeRelaxed = 1, + MathModeFast = 2, +}; - class CompileOptions* init(); - - NS::Dictionary* preprocessorMacros() const; - void setPreprocessorMacros(const NS::Dictionary* preprocessorMacros); - - bool fastMathEnabled() const; - void setFastMathEnabled(bool fastMathEnabled); - - MTL::LanguageVersion languageVersion() const; - void setLanguageVersion(MTL::LanguageVersion languageVersion); - - MTL::LibraryType libraryType() const; - void setLibraryType(MTL::LibraryType libraryType); - - NS::String* installName() const; - void setInstallName(const NS::String* installName); - - NS::Array* libraries() const; - void setLibraries(const NS::Array* libraries); - - bool preserveInvariance() const; - void setPreserveInvariance(bool preserveInvariance); - - MTL::LibraryOptimizationLevel optimizationLevel() const; - void setOptimizationLevel(MTL::LibraryOptimizationLevel optimizationLevel); - - MTL::CompileSymbolVisibility compileSymbolVisibility() const; - void setCompileSymbolVisibility(MTL::CompileSymbolVisibility compileSymbolVisibility); - - bool allowReferencingUndefinedSymbols() const; - void setAllowReferencingUndefinedSymbols(bool allowReferencingUndefinedSymbols); - - NS::UInteger maxTotalThreadsPerThreadgroup() const; - void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); +_MTL_ENUM(NS::Integer, MathFloatingPointFunctions) { + MathFloatingPointFunctionsFast = 0, + MathFloatingPointFunctionsPrecise = 1, }; _MTL_ENUM(NS::UInteger, LibraryError) { @@ -213,367 +108,503 @@ _MTL_ENUM(NS::UInteger, LibraryError) { LibraryErrorFileNotFound = 6, }; +using AutoreleasedArgument = MTL::Argument*; +using FunctionCompletionHandlerFunction = std::function; + +class VertexAttribute : public NS::Referencing +{ +public: + [[deprecated("please use isActive instead")]] + bool active() const; + + static VertexAttribute* alloc(); + + NS::UInteger attributeIndex() const; + + DataType attributeType() const; + + VertexAttribute* init(); + + bool isActive() const; + + bool isPatchControlPointData() const; + + bool isPatchData() const; + + NS::String* name() const; + + [[deprecated("please use isPatchControlPointData instead")]] + bool patchControlPointData() const; + + [[deprecated("please use isPatchData instead")]] + bool patchData() const; +}; +class Attribute : public NS::Referencing +{ +public: + [[deprecated("please use isActive instead")]] + bool active() const; + + static Attribute* alloc(); + + NS::UInteger attributeIndex() const; + + DataType attributeType() const; + + Attribute* init(); + + bool isActive() const; + + bool isPatchControlPointData() const; + + bool isPatchData() const; + + NS::String* name() const; + + [[deprecated("please use isPatchControlPointData instead")]] + bool patchControlPointData() const; + + [[deprecated("please use isPatchData instead")]] + bool patchData() const; +}; +class FunctionConstant : public NS::Referencing +{ +public: + static FunctionConstant* alloc(); + + NS::UInteger index() const; + + FunctionConstant* init(); + + NS::String* name() const; + + bool required() const; + + DataType type() const; +}; +class Function : public NS::Referencing +{ +public: + Device* device() const; + + NS::Dictionary* functionConstantsDictionary() const; + + FunctionType functionType() const; + + NS::String* label() const; + + NS::String* name() const; + + ArgumentEncoder* newArgumentEncoder(NS::UInteger bufferIndex); + ArgumentEncoder* newArgumentEncoder(NS::UInteger bufferIndex, const MTL::AutoreleasedArgument* reflection); + + FunctionOptions options() const; + + NS::Integer patchControlPointCount() const; + + PatchType patchType() const; + + void setLabel(const NS::String* label); + + NS::Array* stageInputAttributes() const; + + NS::Array* vertexAttributes() const; +}; +class CompileOptions : public NS::Copying +{ +public: + static CompileOptions* alloc(); + + bool allowReferencingUndefinedSymbols() const; + + CompileSymbolVisibility compileSymbolVisibility() const; + + bool enableLogging() const; + + bool fastMathEnabled() const; + + CompileOptions* init(); + + NS::String* installName() const; + + LanguageVersion languageVersion() const; + + NS::Array* libraries() const; + + LibraryType libraryType() const; + + MathFloatingPointFunctions mathFloatingPointFunctions() const; + + MathMode mathMode() const; + + NS::UInteger maxTotalThreadsPerThreadgroup() const; + + LibraryOptimizationLevel optimizationLevel() const; + + NS::Dictionary* preprocessorMacros() const; + + bool preserveInvariance() const; + + Size requiredThreadsPerThreadgroup() const; + + void setAllowReferencingUndefinedSymbols(bool allowReferencingUndefinedSymbols); + + void setCompileSymbolVisibility(MTL::CompileSymbolVisibility compileSymbolVisibility); + + void setEnableLogging(bool enableLogging); + + void setFastMathEnabled(bool fastMathEnabled); + + void setInstallName(const NS::String* installName); + + void setLanguageVersion(MTL::LanguageVersion languageVersion); + + void setLibraries(const NS::Array* libraries); + + void setLibraryType(MTL::LibraryType libraryType); + + void setMathFloatingPointFunctions(MTL::MathFloatingPointFunctions mathFloatingPointFunctions); + + void setMathMode(MTL::MathMode mathMode); + + void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + + void setOptimizationLevel(MTL::LibraryOptimizationLevel optimizationLevel); + + void setPreprocessorMacros(const NS::Dictionary* preprocessorMacros); + + void setPreserveInvariance(bool preserveInvariance); + + void setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup); +}; +class FunctionReflection : public NS::Referencing +{ +public: + static FunctionReflection* alloc(); + + NS::Array* bindings() const; + + FunctionReflection* init(); +}; class Library : public NS::Referencing { public: - void newFunction(const NS::String* pFunctionName, const class FunctionConstantValues* pConstantValues, const std::function& completionHandler); + Device* device() const; - void newFunction(const class FunctionDescriptor* pDescriptor, const std::function& completionHandler); + NS::Array* functionNames() const; - void newIntersectionFunction(const class IntersectionFunctionDescriptor* pDescriptor, const std::function& completionHandler); + NS::String* installName() const; - NS::String* label() const; - void setLabel(const NS::String* label); + NS::String* label() const; - class Device* device() const; + Function* newFunction(const NS::String* functionName); + Function* newFunction(const NS::String* name, const MTL::FunctionConstantValues* constantValues, NS::Error** error); + void newFunction(const NS::String* name, const MTL::FunctionConstantValues* constantValues, void (^completionHandler)(MTL::Function*, NS::Error*)); + void newFunction(const MTL::FunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)); + Function* newFunction(const MTL::FunctionDescriptor* descriptor, NS::Error** error); + void newFunction(const NS::String* pFunctionName, const MTL::FunctionConstantValues* pConstantValues, const MTL::FunctionCompletionHandlerFunction& completionHandler); + void newFunction(const MTL::FunctionDescriptor* pDescriptor, const MTL::FunctionCompletionHandlerFunction& completionHandler); - class Function* newFunction(const NS::String* functionName); + void newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)); + Function* newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* descriptor, NS::Error** error); + void newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* pDescriptor, const MTL::FunctionCompletionHandlerFunction& completionHandler); - class Function* newFunction(const NS::String* name, const class FunctionConstantValues* constantValues, NS::Error** error); + FunctionReflection* reflectionForFunction(const NS::String* functionName); - void newFunction(const NS::String* name, const class FunctionConstantValues* constantValues, void (^completionHandler)(MTL::Function*, NS::Error*)); + void setLabel(const NS::String* label); - void newFunction(const class FunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)); - - class Function* newFunction(const class FunctionDescriptor* descriptor, NS::Error** error); - - void newIntersectionFunction(const class IntersectionFunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)); - - class Function* newIntersectionFunction(const class IntersectionFunctionDescriptor* descriptor, NS::Error** error); - - NS::Array* functionNames() const; - - MTL::LibraryType type() const; - - NS::String* installName() const; + LibraryType type() const; }; } - -// static method: alloc -_MTL_INLINE MTL::VertexAttribute* MTL::VertexAttribute::alloc() -{ - return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexAttribute)); -} - -// method: init -_MTL_INLINE MTL::VertexAttribute* MTL::VertexAttribute::init() -{ - return NS::Object::init(); -} - -// property: name -_MTL_INLINE NS::String* MTL::VertexAttribute::name() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); -} - -// property: attributeIndex -_MTL_INLINE NS::UInteger MTL::VertexAttribute::attributeIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeIndex)); -} - -// property: attributeType -_MTL_INLINE MTL::DataType MTL::VertexAttribute::attributeType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeType)); -} - -// property: active _MTL_INLINE bool MTL::VertexAttribute::active() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isActive)); } -// property: patchData -_MTL_INLINE bool MTL::VertexAttribute::patchData() const +_MTL_INLINE MTL::VertexAttribute* MTL::VertexAttribute::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexAttribute)); +} + +_MTL_INLINE NS::UInteger MTL::VertexAttribute::attributeIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeIndex)); +} + +_MTL_INLINE MTL::DataType MTL::VertexAttribute::attributeType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeType)); +} + +_MTL_INLINE MTL::VertexAttribute* MTL::VertexAttribute::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE bool MTL::VertexAttribute::isActive() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isActive)); +} + +_MTL_INLINE bool MTL::VertexAttribute::isPatchControlPointData() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchControlPointData)); +} + +_MTL_INLINE bool MTL::VertexAttribute::isPatchData() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchData)); } -// property: patchControlPointData +_MTL_INLINE NS::String* MTL::VertexAttribute::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + _MTL_INLINE bool MTL::VertexAttribute::patchControlPointData() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchControlPointData)); } -// static method: alloc -_MTL_INLINE MTL::Attribute* MTL::Attribute::alloc() +_MTL_INLINE bool MTL::VertexAttribute::patchData() const { - return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAttribute)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchData)); } -// method: init -_MTL_INLINE MTL::Attribute* MTL::Attribute::init() -{ - return NS::Object::init(); -} - -// property: name -_MTL_INLINE NS::String* MTL::Attribute::name() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); -} - -// property: attributeIndex -_MTL_INLINE NS::UInteger MTL::Attribute::attributeIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeIndex)); -} - -// property: attributeType -_MTL_INLINE MTL::DataType MTL::Attribute::attributeType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeType)); -} - -// property: active _MTL_INLINE bool MTL::Attribute::active() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isActive)); } -// property: patchData -_MTL_INLINE bool MTL::Attribute::patchData() const +_MTL_INLINE MTL::Attribute* MTL::Attribute::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAttribute)); +} + +_MTL_INLINE NS::UInteger MTL::Attribute::attributeIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeIndex)); +} + +_MTL_INLINE MTL::DataType MTL::Attribute::attributeType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributeType)); +} + +_MTL_INLINE MTL::Attribute* MTL::Attribute::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE bool MTL::Attribute::isActive() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isActive)); +} + +_MTL_INLINE bool MTL::Attribute::isPatchControlPointData() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchControlPointData)); +} + +_MTL_INLINE bool MTL::Attribute::isPatchData() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchData)); } -// property: patchControlPointData +_MTL_INLINE NS::String* MTL::Attribute::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + _MTL_INLINE bool MTL::Attribute::patchControlPointData() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchControlPointData)); } -// static method: alloc +_MTL_INLINE bool MTL::Attribute::patchData() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isPatchData)); +} + _MTL_INLINE MTL::FunctionConstant* MTL::FunctionConstant::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionConstant)); } -// method: init -_MTL_INLINE MTL::FunctionConstant* MTL::FunctionConstant::init() -{ - return NS::Object::init(); -} - -// property: name -_MTL_INLINE NS::String* MTL::FunctionConstant::name() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); -} - -// property: type -_MTL_INLINE MTL::DataType MTL::FunctionConstant::type() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); -} - -// property: index _MTL_INLINE NS::UInteger MTL::FunctionConstant::index() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(index)); } -// property: required +_MTL_INLINE MTL::FunctionConstant* MTL::FunctionConstant::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL::FunctionConstant::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + _MTL_INLINE bool MTL::FunctionConstant::required() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(required)); } -// property: label +_MTL_INLINE MTL::DataType MTL::FunctionConstant::type() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); +} + +_MTL_INLINE MTL::Device* MTL::Function::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::Dictionary* MTL::Function::functionConstantsDictionary() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionConstantsDictionary)); +} + +_MTL_INLINE MTL::FunctionType MTL::Function::functionType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionType)); +} + _MTL_INLINE NS::String* MTL::Function::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE NS::String* MTL::Function::name() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); +} + +_MTL_INLINE MTL::ArgumentEncoder* MTL::Function::newArgumentEncoder(NS::UInteger bufferIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithBufferIndex_), bufferIndex); +} + +_MTL_INLINE MTL::ArgumentEncoder* MTL::Function::newArgumentEncoder(NS::UInteger bufferIndex, const MTL::AutoreleasedArgument* reflection) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithBufferIndex_reflection_), bufferIndex, reflection); +} + +_MTL_INLINE MTL::FunctionOptions MTL::Function::options() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); +} + +_MTL_INLINE NS::Integer MTL::Function::patchControlPointCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(patchControlPointCount)); +} + +_MTL_INLINE MTL::PatchType MTL::Function::patchType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(patchType)); +} + _MTL_INLINE void MTL::Function::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: device -_MTL_INLINE MTL::Device* MTL::Function::device() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); -} - -// property: functionType -_MTL_INLINE MTL::FunctionType MTL::Function::functionType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionType)); -} - -// property: patchType -_MTL_INLINE MTL::PatchType MTL::Function::patchType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(patchType)); -} - -// property: patchControlPointCount -_MTL_INLINE NS::Integer MTL::Function::patchControlPointCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(patchControlPointCount)); -} - -// property: vertexAttributes -_MTL_INLINE NS::Array* MTL::Function::vertexAttributes() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexAttributes)); -} - -// property: stageInputAttributes _MTL_INLINE NS::Array* MTL::Function::stageInputAttributes() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(stageInputAttributes)); } -// property: name -_MTL_INLINE NS::String* MTL::Function::name() const +_MTL_INLINE NS::Array* MTL::Function::vertexAttributes() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(name)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexAttributes)); } -// property: functionConstantsDictionary -_MTL_INLINE NS::Dictionary* MTL::Function::functionConstantsDictionary() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionConstantsDictionary)); -} - -// method: newArgumentEncoderWithBufferIndex: -_MTL_INLINE MTL::ArgumentEncoder* MTL::Function::newArgumentEncoder(NS::UInteger bufferIndex) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithBufferIndex_), bufferIndex); -} - -// method: newArgumentEncoderWithBufferIndex:reflection: -_MTL_INLINE MTL::ArgumentEncoder* MTL::Function::newArgumentEncoder(NS::UInteger bufferIndex, const MTL::AutoreleasedArgument* reflection) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newArgumentEncoderWithBufferIndex_reflection_), bufferIndex, reflection); -} - -// property: options -_MTL_INLINE MTL::FunctionOptions MTL::Function::options() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(options)); -} - -// static method: alloc _MTL_INLINE MTL::CompileOptions* MTL::CompileOptions::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLCompileOptions)); } -// method: init -_MTL_INLINE MTL::CompileOptions* MTL::CompileOptions::init() +_MTL_INLINE bool MTL::CompileOptions::allowReferencingUndefinedSymbols() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowReferencingUndefinedSymbols)); } -// property: preprocessorMacros -_MTL_INLINE NS::Dictionary* MTL::CompileOptions::preprocessorMacros() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(preprocessorMacros)); -} - -_MTL_INLINE void MTL::CompileOptions::setPreprocessorMacros(const NS::Dictionary* preprocessorMacros) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreprocessorMacros_), preprocessorMacros); -} - -// property: fastMathEnabled -_MTL_INLINE bool MTL::CompileOptions::fastMathEnabled() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(fastMathEnabled)); -} - -_MTL_INLINE void MTL::CompileOptions::setFastMathEnabled(bool fastMathEnabled) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFastMathEnabled_), fastMathEnabled); -} - -// property: languageVersion -_MTL_INLINE MTL::LanguageVersion MTL::CompileOptions::languageVersion() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(languageVersion)); -} - -_MTL_INLINE void MTL::CompileOptions::setLanguageVersion(MTL::LanguageVersion languageVersion) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLanguageVersion_), languageVersion); -} - -// property: libraryType -_MTL_INLINE MTL::LibraryType MTL::CompileOptions::libraryType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(libraryType)); -} - -_MTL_INLINE void MTL::CompileOptions::setLibraryType(MTL::LibraryType libraryType) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLibraryType_), libraryType); -} - -// property: installName -_MTL_INLINE NS::String* MTL::CompileOptions::installName() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(installName)); -} - -_MTL_INLINE void MTL::CompileOptions::setInstallName(const NS::String* installName) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstallName_), installName); -} - -// property: libraries -_MTL_INLINE NS::Array* MTL::CompileOptions::libraries() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(libraries)); -} - -_MTL_INLINE void MTL::CompileOptions::setLibraries(const NS::Array* libraries) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLibraries_), libraries); -} - -// property: preserveInvariance -_MTL_INLINE bool MTL::CompileOptions::preserveInvariance() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(preserveInvariance)); -} - -_MTL_INLINE void MTL::CompileOptions::setPreserveInvariance(bool preserveInvariance) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreserveInvariance_), preserveInvariance); -} - -// property: optimizationLevel -_MTL_INLINE MTL::LibraryOptimizationLevel MTL::CompileOptions::optimizationLevel() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizationLevel)); -} - -_MTL_INLINE void MTL::CompileOptions::setOptimizationLevel(MTL::LibraryOptimizationLevel optimizationLevel) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptimizationLevel_), optimizationLevel); -} - -// property: compileSymbolVisibility _MTL_INLINE MTL::CompileSymbolVisibility MTL::CompileOptions::compileSymbolVisibility() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(compileSymbolVisibility)); } -_MTL_INLINE void MTL::CompileOptions::setCompileSymbolVisibility(MTL::CompileSymbolVisibility compileSymbolVisibility) +_MTL_INLINE bool MTL::CompileOptions::enableLogging() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setCompileSymbolVisibility_), compileSymbolVisibility); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(enableLogging)); } -// property: allowReferencingUndefinedSymbols -_MTL_INLINE bool MTL::CompileOptions::allowReferencingUndefinedSymbols() const +_MTL_INLINE bool MTL::CompileOptions::fastMathEnabled() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowReferencingUndefinedSymbols)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fastMathEnabled)); +} + +_MTL_INLINE MTL::CompileOptions* MTL::CompileOptions::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL::CompileOptions::installName() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(installName)); +} + +_MTL_INLINE MTL::LanguageVersion MTL::CompileOptions::languageVersion() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(languageVersion)); +} + +_MTL_INLINE NS::Array* MTL::CompileOptions::libraries() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(libraries)); +} + +_MTL_INLINE MTL::LibraryType MTL::CompileOptions::libraryType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(libraryType)); +} + +_MTL_INLINE MTL::MathFloatingPointFunctions MTL::CompileOptions::mathFloatingPointFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(mathFloatingPointFunctions)); +} + +_MTL_INLINE MTL::MathMode MTL::CompileOptions::mathMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(mathMode)); +} + +_MTL_INLINE NS::UInteger MTL::CompileOptions::maxTotalThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); +} + +_MTL_INLINE MTL::LibraryOptimizationLevel MTL::CompileOptions::optimizationLevel() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(optimizationLevel)); +} + +_MTL_INLINE NS::Dictionary* MTL::CompileOptions::preprocessorMacros() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(preprocessorMacros)); +} + +_MTL_INLINE bool MTL::CompileOptions::preserveInvariance() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(preserveInvariance)); +} + +_MTL_INLINE MTL::Size MTL::CompileOptions::requiredThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup)); } _MTL_INLINE void MTL::CompileOptions::setAllowReferencingUndefinedSymbols(bool allowReferencingUndefinedSymbols) @@ -581,10 +612,49 @@ _MTL_INLINE void MTL::CompileOptions::setAllowReferencingUndefinedSymbols(bool a Object::sendMessage(this, _MTL_PRIVATE_SEL(setAllowReferencingUndefinedSymbols_), allowReferencingUndefinedSymbols); } -// property: maxTotalThreadsPerThreadgroup -_MTL_INLINE NS::UInteger MTL::CompileOptions::maxTotalThreadsPerThreadgroup() const +_MTL_INLINE void MTL::CompileOptions::setCompileSymbolVisibility(MTL::CompileSymbolVisibility compileSymbolVisibility) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCompileSymbolVisibility_), compileSymbolVisibility); +} + +_MTL_INLINE void MTL::CompileOptions::setEnableLogging(bool enableLogging) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setEnableLogging_), enableLogging); +} + +_MTL_INLINE void MTL::CompileOptions::setFastMathEnabled(bool fastMathEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFastMathEnabled_), fastMathEnabled); +} + +_MTL_INLINE void MTL::CompileOptions::setInstallName(const NS::String* installName) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInstallName_), installName); +} + +_MTL_INLINE void MTL::CompileOptions::setLanguageVersion(MTL::LanguageVersion languageVersion) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLanguageVersion_), languageVersion); +} + +_MTL_INLINE void MTL::CompileOptions::setLibraries(const NS::Array* libraries) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLibraries_), libraries); +} + +_MTL_INLINE void MTL::CompileOptions::setLibraryType(MTL::LibraryType libraryType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLibraryType_), libraryType); +} + +_MTL_INLINE void MTL::CompileOptions::setMathFloatingPointFunctions(MTL::MathFloatingPointFunctions mathFloatingPointFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMathFloatingPointFunctions_), mathFloatingPointFunctions); +} + +_MTL_INLINE void MTL::CompileOptions::setMathMode(MTL::MathMode mathMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMathMode_), mathMode); } _MTL_INLINE void MTL::CompileOptions::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) @@ -592,100 +662,125 @@ _MTL_INLINE void MTL::CompileOptions::setMaxTotalThreadsPerThreadgroup(NS::UInte Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); } -_MTL_INLINE void MTL::Library::newFunction(const NS::String* pFunctionName, const FunctionConstantValues* pConstantValues, const std::function& completionHandler) +_MTL_INLINE void MTL::CompileOptions::setOptimizationLevel(MTL::LibraryOptimizationLevel optimizationLevel) { - __block std::function blockCompletionHandler = completionHandler; - - newFunction(pFunctionName, pConstantValues, ^(Function* pFunction, NS::Error* pError) { blockCompletionHandler(pFunction, pError); }); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOptimizationLevel_), optimizationLevel); } -_MTL_INLINE void MTL::Library::newFunction(const FunctionDescriptor* pDescriptor, const std::function& completionHandler) +_MTL_INLINE void MTL::CompileOptions::setPreprocessorMacros(const NS::Dictionary* preprocessorMacros) { - __block std::function blockCompletionHandler = completionHandler; - - newFunction(pDescriptor, ^(Function* pFunction, NS::Error* pError) { blockCompletionHandler(pFunction, pError); }); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreprocessorMacros_), preprocessorMacros); } -_MTL_INLINE void MTL::Library::newIntersectionFunction(const IntersectionFunctionDescriptor* pDescriptor, const std::function& completionHandler) +_MTL_INLINE void MTL::CompileOptions::setPreserveInvariance(bool preserveInvariance) { - __block std::function blockCompletionHandler = completionHandler; - - newIntersectionFunction(pDescriptor, ^(Function* pFunction, NS::Error* pError) { blockCompletionHandler(pFunction, pError); }); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreserveInvariance_), preserveInvariance); +} + +_MTL_INLINE void MTL::CompileOptions::setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerThreadgroup_), requiredThreadsPerThreadgroup); +} + +_MTL_INLINE MTL::FunctionReflection* MTL::FunctionReflection::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLFunctionReflection)); +} + +_MTL_INLINE NS::Array* MTL::FunctionReflection::bindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bindings)); +} + +_MTL_INLINE MTL::FunctionReflection* MTL::FunctionReflection::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::Device* MTL::Library::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::Array* MTL::Library::functionNames() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionNames)); +} + +_MTL_INLINE NS::String* MTL::Library::installName() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(installName)); } -// property: label _MTL_INLINE NS::String* MTL::Library::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE MTL::Function* MTL::Library::newFunction(const NS::String* functionName) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithName_), functionName); +} + +_MTL_INLINE MTL::Function* MTL::Library::newFunction(const NS::String* name, const MTL::FunctionConstantValues* constantValues, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithName_constantValues_error_), name, constantValues, error); +} + +_MTL_INLINE void MTL::Library::newFunction(const NS::String* name, const MTL::FunctionConstantValues* constantValues, void (^completionHandler)(MTL::Function*, NS::Error*)) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithName_constantValues_completionHandler_), name, constantValues, completionHandler); +} + +_MTL_INLINE void MTL::Library::newFunction(const MTL::FunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithDescriptor_completionHandler_), descriptor, completionHandler); +} + +_MTL_INLINE MTL::Function* MTL::Library::newFunction(const MTL::FunctionDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE void MTL::Library::newFunction(const NS::String* pFunctionName, const MTL::FunctionConstantValues* pConstantValues, const MTL::FunctionCompletionHandlerFunction& completionHandler) +{ + __block MTL::FunctionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newFunction(pFunctionName, pConstantValues, ^(MTL::Function* pFunction, NS::Error* pError) { blockCompletionHandler(pFunction, pError); }); +} + +_MTL_INLINE void MTL::Library::newFunction(const MTL::FunctionDescriptor* pDescriptor, const MTL::FunctionCompletionHandlerFunction& completionHandler) +{ + __block MTL::FunctionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newFunction(pDescriptor, ^(MTL::Function* pFunction, NS::Error* pError) { blockCompletionHandler(pFunction, pError); }); +} + +_MTL_INLINE void MTL::Library::newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionWithDescriptor_completionHandler_), descriptor, completionHandler); +} + +_MTL_INLINE MTL::Function* MTL::Library::newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* descriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionWithDescriptor_error_), descriptor, error); +} + +_MTL_INLINE void MTL::Library::newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* pDescriptor, const MTL::FunctionCompletionHandlerFunction& completionHandler) +{ + __block MTL::FunctionCompletionHandlerFunction blockCompletionHandler = completionHandler; + newIntersectionFunction(pDescriptor, ^(MTL::Function* pFunction, NS::Error* pError) { blockCompletionHandler(pFunction, pError); }); +} + +_MTL_INLINE MTL::FunctionReflection* MTL::Library::reflectionForFunction(const NS::String* functionName) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(reflectionForFunctionWithName_), functionName); +} + _MTL_INLINE void MTL::Library::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: device -_MTL_INLINE MTL::Device* MTL::Library::device() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); -} - -// method: newFunctionWithName: -_MTL_INLINE MTL::Function* MTL::Library::newFunction(const NS::String* functionName) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithName_), functionName); -} - -// method: newFunctionWithName:constantValues:error: -_MTL_INLINE MTL::Function* MTL::Library::newFunction(const NS::String* name, const MTL::FunctionConstantValues* constantValues, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithName_constantValues_error_), name, constantValues, error); -} - -// method: newFunctionWithName:constantValues:completionHandler: -_MTL_INLINE void MTL::Library::newFunction(const NS::String* name, const MTL::FunctionConstantValues* constantValues, void (^completionHandler)(MTL::Function*, NS::Error*)) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithName_constantValues_completionHandler_), name, constantValues, completionHandler); -} - -// method: newFunctionWithDescriptor:completionHandler: -_MTL_INLINE void MTL::Library::newFunction(const MTL::FunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithDescriptor_completionHandler_), descriptor, completionHandler); -} - -// method: newFunctionWithDescriptor:error: -_MTL_INLINE MTL::Function* MTL::Library::newFunction(const MTL::FunctionDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newFunctionWithDescriptor_error_), descriptor, error); -} - -// method: newIntersectionFunctionWithDescriptor:completionHandler: -_MTL_INLINE void MTL::Library::newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* descriptor, void (^completionHandler)(MTL::Function*, NS::Error*)) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionWithDescriptor_completionHandler_), descriptor, completionHandler); -} - -// method: newIntersectionFunctionWithDescriptor:error: -_MTL_INLINE MTL::Function* MTL::Library::newIntersectionFunction(const MTL::IntersectionFunctionDescriptor* descriptor, NS::Error** error) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionWithDescriptor_error_), descriptor, error); -} - -// property: functionNames -_MTL_INLINE NS::Array* MTL::Library::functionNames() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionNames)); -} - -// property: type _MTL_INLINE MTL::LibraryType MTL::Library::type() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(type)); } - -// property: installName -_MTL_INLINE NS::String* MTL::Library::installName() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(installName)); -} diff --git a/vendor/metal-cpp/Metal/MTLLinkedFunctions.hpp b/vendor/metal-cpp/Metal/MTLLinkedFunctions.hpp index 89ee87599..4b1bd9538 100644 --- a/vendor/metal-cpp/Metal/MTLLinkedFunctions.hpp +++ b/vendor/metal-cpp/Metal/MTLLinkedFunctions.hpp @@ -2,7 +2,7 @@ // // Metal/MTLLinkedFunctions.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,71 +20,73 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { + class LinkedFunctions : public NS::Copying { public: - static class LinkedFunctions* alloc(); + static LinkedFunctions* alloc(); - class LinkedFunctions* init(); + NS::Array* binaryFunctions() const; + NS::Array* functions() const; - static class LinkedFunctions* linkedFunctions(); + NS::Dictionary* groups() const; - NS::Array* functions() const; - void setFunctions(const NS::Array* functions); + LinkedFunctions* init(); - NS::Array* binaryFunctions() const; - void setBinaryFunctions(const NS::Array* binaryFunctions); + static LinkedFunctions* linkedFunctions(); - NS::Dictionary* groups() const; - void setGroups(const NS::Dictionary* groups); + NS::Array* privateFunctions() const; - NS::Array* privateFunctions() const; - void setPrivateFunctions(const NS::Array* privateFunctions); + void setBinaryFunctions(const NS::Array* binaryFunctions); + + void setFunctions(const NS::Array* functions); + + void setGroups(const NS::Dictionary* groups); + + void setPrivateFunctions(const NS::Array* privateFunctions); }; } - -// static method: alloc _MTL_INLINE MTL::LinkedFunctions* MTL::LinkedFunctions::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLLinkedFunctions)); } -// method: init -_MTL_INLINE MTL::LinkedFunctions* MTL::LinkedFunctions::init() +_MTL_INLINE NS::Array* MTL::LinkedFunctions::binaryFunctions() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryFunctions)); } -// static method: linkedFunctions -_MTL_INLINE MTL::LinkedFunctions* MTL::LinkedFunctions::linkedFunctions() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLLinkedFunctions), _MTL_PRIVATE_SEL(linkedFunctions)); -} - -// property: functions _MTL_INLINE NS::Array* MTL::LinkedFunctions::functions() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(functions)); } -_MTL_INLINE void MTL::LinkedFunctions::setFunctions(const NS::Array* functions) +_MTL_INLINE NS::Dictionary* MTL::LinkedFunctions::groups() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctions_), functions); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(groups)); } -// property: binaryFunctions -_MTL_INLINE NS::Array* MTL::LinkedFunctions::binaryFunctions() const +_MTL_INLINE MTL::LinkedFunctions* MTL::LinkedFunctions::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryFunctions)); + return NS::Object::init(); +} + +_MTL_INLINE MTL::LinkedFunctions* MTL::LinkedFunctions::linkedFunctions() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLLinkedFunctions), _MTL_PRIVATE_SEL(linkedFunctions)); +} + +_MTL_INLINE NS::Array* MTL::LinkedFunctions::privateFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(privateFunctions)); } _MTL_INLINE void MTL::LinkedFunctions::setBinaryFunctions(const NS::Array* binaryFunctions) @@ -92,10 +94,9 @@ _MTL_INLINE void MTL::LinkedFunctions::setBinaryFunctions(const NS::Array* binar Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryFunctions_), binaryFunctions); } -// property: groups -_MTL_INLINE NS::Dictionary* MTL::LinkedFunctions::groups() const +_MTL_INLINE void MTL::LinkedFunctions::setFunctions(const NS::Array* functions) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(groups)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctions_), functions); } _MTL_INLINE void MTL::LinkedFunctions::setGroups(const NS::Dictionary* groups) @@ -103,12 +104,6 @@ _MTL_INLINE void MTL::LinkedFunctions::setGroups(const NS::Dictionary* groups) Object::sendMessage(this, _MTL_PRIVATE_SEL(setGroups_), groups); } -// property: privateFunctions -_MTL_INLINE NS::Array* MTL::LinkedFunctions::privateFunctions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(privateFunctions)); -} - _MTL_INLINE void MTL::LinkedFunctions::setPrivateFunctions(const NS::Array* privateFunctions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setPrivateFunctions_), privateFunctions); diff --git a/vendor/metal-cpp/Metal/MTLLogState.hpp b/vendor/metal-cpp/Metal/MTLLogState.hpp new file mode 100644 index 000000000..b802adf35 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLLogState.hpp @@ -0,0 +1,111 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLLogState.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" + +namespace MTL +{ +class LogStateDescriptor; +_MTL_ENUM(NS::Integer, LogLevel) { + LogLevelUndefined = 0, + LogLevelDebug = 1, + LogLevelInfo = 2, + LogLevelNotice = 3, + LogLevelError = 4, + LogLevelFault = 5, +}; + +_MTL_ENUM(NS::UInteger, LogStateError) { + LogStateErrorInvalidSize = 1, + LogStateErrorInvalid = 2, +}; + +using LogHandlerFunction = std::function; + +_MTL_CONST(NS::ErrorDomain, LogStateErrorDomain); +class LogState : public NS::Referencing +{ +public: + void addLogHandler(void (^block)(NS::String*, NS::String*, MTL::LogLevel, NS::String*)); + void addLogHandler(const MTL::LogHandlerFunction& handler); +}; +class LogStateDescriptor : public NS::Copying +{ +public: + static LogStateDescriptor* alloc(); + + NS::Integer bufferSize() const; + + LogStateDescriptor* init(); + + LogLevel level() const; + + void setBufferSize(NS::Integer bufferSize); + + void setLevel(MTL::LogLevel level); +}; + +} +_MTL_PRIVATE_DEF_CONST(NS::ErrorDomain, LogStateErrorDomain); +_MTL_INLINE void MTL::LogState::addLogHandler(void (^block)(NS::String*, NS::String*, MTL::LogLevel, NS::String*)) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addLogHandler_), block); +} + +_MTL_INLINE void MTL::LogState::addLogHandler(const MTL::LogHandlerFunction& handler) +{ + __block LogHandlerFunction function = handler; + addLogHandler(^void(NS::String* subsystem, NS::String* category, MTL::LogLevel logLevel, NS::String* message) { function(subsystem, category, logLevel, message); }); +} + +_MTL_INLINE MTL::LogStateDescriptor* MTL::LogStateDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLLogStateDescriptor)); +} + +_MTL_INLINE NS::Integer MTL::LogStateDescriptor::bufferSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferSize)); +} + +_MTL_INLINE MTL::LogStateDescriptor* MTL::LogStateDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::LogLevel MTL::LogStateDescriptor::level() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(level)); +} + +_MTL_INLINE void MTL::LogStateDescriptor::setBufferSize(NS::Integer bufferSize) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBufferSize_), bufferSize); +} + +_MTL_INLINE void MTL::LogStateDescriptor::setLevel(MTL::LogLevel level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLevel_), level); +} diff --git a/vendor/metal-cpp/Metal/MTLParallelRenderCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLParallelRenderCommandEncoder.hpp index d6d6ad8cf..8c3451262 100644 --- a/vendor/metal-cpp/Metal/MTLParallelRenderCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLParallelRenderCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLParallelRenderCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,74 +20,63 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLCommandEncoder.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLCommandEncoder.hpp" #include "MTLRenderPass.hpp" namespace MTL { +class RenderCommandEncoder; + class ParallelRenderCommandEncoder : public NS::Referencing { public: - class RenderCommandEncoder* renderCommandEncoder(); + RenderCommandEncoder* renderCommandEncoder(); - void setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex); + void setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex); + void setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex); - void setDepthStoreAction(MTL::StoreAction storeAction); + void setDepthStoreAction(MTL::StoreAction storeAction); + void setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions); - void setStencilStoreAction(MTL::StoreAction storeAction); - - void setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex); - - void setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions); - - void setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions); + void setStencilStoreAction(MTL::StoreAction storeAction); + void setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions); }; } - -// method: renderCommandEncoder _MTL_INLINE MTL::RenderCommandEncoder* MTL::ParallelRenderCommandEncoder::renderCommandEncoder() { return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderCommandEncoder)); } -// method: setColorStoreAction:atIndex: _MTL_INLINE void MTL::ParallelRenderCommandEncoder::setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreAction_atIndex_), storeAction, colorAttachmentIndex); } -// method: setDepthStoreAction: -_MTL_INLINE void MTL::ParallelRenderCommandEncoder::setDepthStoreAction(MTL::StoreAction storeAction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreAction_), storeAction); -} - -// method: setStencilStoreAction: -_MTL_INLINE void MTL::ParallelRenderCommandEncoder::setStencilStoreAction(MTL::StoreAction storeAction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreAction_), storeAction); -} - -// method: setColorStoreActionOptions:atIndex: _MTL_INLINE void MTL::ParallelRenderCommandEncoder::setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreActionOptions_atIndex_), storeActionOptions, colorAttachmentIndex); } -// method: setDepthStoreActionOptions: +_MTL_INLINE void MTL::ParallelRenderCommandEncoder::setDepthStoreAction(MTL::StoreAction storeAction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreAction_), storeAction); +} + _MTL_INLINE void MTL::ParallelRenderCommandEncoder::setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreActionOptions_), storeActionOptions); } -// method: setStencilStoreActionOptions: +_MTL_INLINE void MTL::ParallelRenderCommandEncoder::setStencilStoreAction(MTL::StoreAction storeAction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreAction_), storeAction); +} + _MTL_INLINE void MTL::ParallelRenderCommandEncoder::setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreActionOptions_), storeActionOptions); diff --git a/vendor/metal-cpp/Metal/MTLPipeline.hpp b/vendor/metal-cpp/Metal/MTLPipeline.hpp index 1b6859ca1..930bb7ebb 100644 --- a/vendor/metal-cpp/Metal/MTLPipeline.hpp +++ b/vendor/metal-cpp/Metal/MTLPipeline.hpp @@ -2,7 +2,7 @@ // // Metal/MTLPipeline.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,60 +20,59 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLPipeline.hpp" - namespace MTL { +class PipelineBufferDescriptor; +class PipelineBufferDescriptorArray; _MTL_ENUM(NS::UInteger, Mutability) { MutabilityDefault = 0, MutabilityMutable = 1, MutabilityImmutable = 2, }; +_MTL_ENUM(NS::Integer, ShaderValidation) { + ShaderValidationDefault = 0, + ShaderValidationEnabled = 1, + ShaderValidationDisabled = 2, +}; + class PipelineBufferDescriptor : public NS::Copying { public: - static class PipelineBufferDescriptor* alloc(); + static PipelineBufferDescriptor* alloc(); - class PipelineBufferDescriptor* init(); + PipelineBufferDescriptor* init(); - MTL::Mutability mutability() const; - void setMutability(MTL::Mutability mutability); + Mutability mutability() const; + void setMutability(MTL::Mutability mutability); }; - class PipelineBufferDescriptorArray : public NS::Referencing { public: - static class PipelineBufferDescriptorArray* alloc(); + static PipelineBufferDescriptorArray* alloc(); - class PipelineBufferDescriptorArray* init(); + PipelineBufferDescriptorArray* init(); - class PipelineBufferDescriptor* object(NS::UInteger bufferIndex); - - void setObject(const class PipelineBufferDescriptor* buffer, NS::UInteger bufferIndex); + PipelineBufferDescriptor* object(NS::UInteger bufferIndex); + void setObject(const MTL::PipelineBufferDescriptor* buffer, NS::UInteger bufferIndex); }; } - -// static method: alloc _MTL_INLINE MTL::PipelineBufferDescriptor* MTL::PipelineBufferDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLPipelineBufferDescriptor)); } -// method: init _MTL_INLINE MTL::PipelineBufferDescriptor* MTL::PipelineBufferDescriptor::init() { return NS::Object::init(); } -// property: mutability _MTL_INLINE MTL::Mutability MTL::PipelineBufferDescriptor::mutability() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(mutability)); @@ -84,25 +83,21 @@ _MTL_INLINE void MTL::PipelineBufferDescriptor::setMutability(MTL::Mutability mu Object::sendMessage(this, _MTL_PRIVATE_SEL(setMutability_), mutability); } -// static method: alloc _MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::PipelineBufferDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLPipelineBufferDescriptorArray)); } -// method: init _MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::PipelineBufferDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::PipelineBufferDescriptor* MTL::PipelineBufferDescriptorArray::object(NS::UInteger bufferIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), bufferIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::PipelineBufferDescriptorArray::setObject(const MTL::PipelineBufferDescriptor* buffer, NS::UInteger bufferIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), buffer, bufferIndex); diff --git a/vendor/metal-cpp/Metal/MTLPixelFormat.hpp b/vendor/metal-cpp/Metal/MTLPixelFormat.hpp index 7a0c3c09c..6d5d886c3 100644 --- a/vendor/metal-cpp/Metal/MTLPixelFormat.hpp +++ b/vendor/metal-cpp/Metal/MTLPixelFormat.hpp @@ -2,7 +2,7 @@ // // Metal/MTLPixelFormat.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,12 +20,11 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { _MTL_ENUM(NS::UInteger, PixelFormat) { @@ -70,6 +69,8 @@ _MTL_ENUM(NS::UInteger, PixelFormat) { PixelFormatRG11B10Float = 92, PixelFormatRGB9E5Float = 93, PixelFormatBGR10A2Unorm = 94, + PixelFormatBGR10_XR = 554, + PixelFormatBGR10_XR_sRGB = 555, PixelFormatRG32Uint = 103, PixelFormatRG32Sint = 104, PixelFormatRG32Float = 105, @@ -78,6 +79,8 @@ _MTL_ENUM(NS::UInteger, PixelFormat) { PixelFormatRGBA16Uint = 113, PixelFormatRGBA16Sint = 114, PixelFormatRGBA16Float = 115, + PixelFormatBGRA10_XR = 552, + PixelFormatBGRA10_XR_sRGB = 553, PixelFormatRGBA32Uint = 123, PixelFormatRGBA32Sint = 124, PixelFormatRGBA32Float = 125, @@ -164,10 +167,7 @@ _MTL_ENUM(NS::UInteger, PixelFormat) { PixelFormatDepth32Float_Stencil8 = 260, PixelFormatX32_Stencil8 = 261, PixelFormatX24_Stencil8 = 262, - PixelFormatBGRA10_XR = 552, - PixelFormatBGRA10_XR_sRGB = 553, - PixelFormatBGR10_XR = 554, - PixelFormatBGR10_XR_sRGB = 555, + PixelFormatUnspecialized = 263, }; } diff --git a/vendor/metal-cpp/Metal/MTLPrivate.hpp b/vendor/metal-cpp/Metal/MTLPrivate.hpp index 7db23cf57..41bcaa508 100644 --- a/vendor/metal-cpp/Metal/MTLPrivate.hpp +++ b/vendor/metal-cpp/Metal/MTLPrivate.hpp @@ -2,7 +2,7 @@ // // Metal/MTLPrivate.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- -#define _MTL_PRIVATE_CLS(symbol) (Private::Class::s_k##symbol) -#define _MTL_PRIVATE_SEL(accessor) (Private::Selector::s_k##accessor) +#define _MTL_PRIVATE_CLS(symbol) (MTL::Private::Class::s_k##symbol) +#define _MTL_PRIVATE_SEL(accessor) (MTL::Private::Selector::s_k##accessor) //------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -71,7 +71,7 @@ namespace MTL::Private } } // MTL::Private -#if defined(__MAC_10_16) || defined(__MAC_11_0) || defined(__MAC_12_0) || defined(__MAC_13_0) || defined(__IPHONE_14_0) || defined(__IPHONE_15_0) || defined(__IPHONE_16_0) || defined(__TVOS_14_0) || defined(__TVOS_15_0) || defined(__TVOS_16_0) +#if defined(__MAC_26_0) || defined(__IPHONE_26_0) || defined(__TVOS_26_0) #define _MTL_PRIVATE_DEF_STR(type, symbol) \ _MTL_EXTERN type const MTL##symbol _MTL_PRIVATE_IMPORT; \ @@ -83,21 +83,21 @@ namespace MTL::Private #define _MTL_PRIVATE_DEF_WEAK_CONST(type, symbol) \ _MTL_EXTERN type const MTL##symbol; \ - type const MTL::symbol = Private::LoadSymbol("MTL" #symbol) + type const MTL::symbol = MTL::Private::LoadSymbol("MTL" #symbol) #else #define _MTL_PRIVATE_DEF_STR(type, symbol) \ _MTL_EXTERN type const MTL##symbol; \ - type const MTL::symbol = Private::LoadSymbol("MTL" #symbol) + type const MTL::symbol = MTL::Private::LoadSymbol("MTL" #symbol) #define _MTL_PRIVATE_DEF_CONST(type, symbol) \ _MTL_EXTERN type const MTL##symbol; \ - type const MTL::symbol = Private::LoadSymbol("MTL" #symbol) + type const MTL::symbol = MTL::Private::LoadSymbol("MTL" #symbol) #define _MTL_PRIVATE_DEF_WEAK_CONST(type, symbol) _MTL_PRIVATE_DEF_CONST(type, symbol) -#endif // defined(__MAC_10_16) || defined(__MAC_11_0) || defined(__MAC_12_0) || defined(__MAC_13_0) || defined(__IPHONE_14_0) || defined(__IPHONE_15_0) || defined(__IPHONE_16_0) || defined(__TVOS_14_0) || defined(__TVOS_15_0) || defined(__TVOS_16_0) +#endif #else diff --git a/vendor/metal-cpp/Metal/MTLRasterizationRate.hpp b/vendor/metal-cpp/Metal/MTLRasterizationRate.hpp index cac233926..b2804fa84 100644 --- a/vendor/metal-cpp/Metal/MTLRasterizationRate.hpp +++ b/vendor/metal-cpp/Metal/MTLRasterizationRate.hpp @@ -2,7 +2,7 @@ // // Metal/MTLRasterizationRate.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,367 +20,318 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" +#include "MTLDevice.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLDevice.hpp" #include "MTLTypes.hpp" namespace MTL { +class Buffer; +class Device; +class RasterizationRateLayerArray; +class RasterizationRateLayerDescriptor; +class RasterizationRateMapDescriptor; +class RasterizationRateSampleArray; + class RasterizationRateSampleArray : public NS::Referencing { public: - static class RasterizationRateSampleArray* alloc(); + static RasterizationRateSampleArray* alloc(); - class RasterizationRateSampleArray* init(); + RasterizationRateSampleArray* init(); - NS::Number* object(NS::UInteger index); - - void setObject(const NS::Number* value, NS::UInteger index); + NS::Number* object(NS::UInteger index); + void setObject(const NS::Number* value, NS::UInteger index); }; - class RasterizationRateLayerDescriptor : public NS::Copying { public: - static class RasterizationRateLayerDescriptor* alloc(); + static RasterizationRateLayerDescriptor* alloc(); - MTL::RasterizationRateLayerDescriptor* init(); + RasterizationRateSampleArray* horizontal() const; + float* horizontalSampleStorage() const; - MTL::RasterizationRateLayerDescriptor* init(MTL::Size sampleCount); + RasterizationRateLayerDescriptor* init(); + RasterizationRateLayerDescriptor* init(MTL::Size sampleCount); + RasterizationRateLayerDescriptor* init(MTL::Size sampleCount, const float* horizontal, const float* vertical); - MTL::RasterizationRateLayerDescriptor* init(MTL::Size sampleCount, const float* horizontal, const float* vertical); + Size maxSampleCount() const; + Size sampleCount() const; + void setSampleCount(MTL::Size sampleCount); - MTL::Size sampleCount() const; - - MTL::Size maxSampleCount() const; - - float* horizontalSampleStorage() const; - - float* verticalSampleStorage() const; - - class RasterizationRateSampleArray* horizontal() const; - - class RasterizationRateSampleArray* vertical() const; - - void setSampleCount(MTL::Size sampleCount); + RasterizationRateSampleArray* vertical() const; + float* verticalSampleStorage() const; }; - class RasterizationRateLayerArray : public NS::Referencing { public: - static class RasterizationRateLayerArray* alloc(); + static RasterizationRateLayerArray* alloc(); - class RasterizationRateLayerArray* init(); + RasterizationRateLayerArray* init(); - class RasterizationRateLayerDescriptor* object(NS::UInteger layerIndex); - - void setObject(const class RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex); + RasterizationRateLayerDescriptor* object(NS::UInteger layerIndex); + void setObject(const MTL::RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex); }; - class RasterizationRateMapDescriptor : public NS::Copying { public: - static class RasterizationRateMapDescriptor* alloc(); + static RasterizationRateMapDescriptor* alloc(); - class RasterizationRateMapDescriptor* init(); + RasterizationRateMapDescriptor* init(); - static class RasterizationRateMapDescriptor* rasterizationRateMapDescriptor(MTL::Size screenSize); + NS::String* label() const; - static class RasterizationRateMapDescriptor* rasterizationRateMapDescriptor(MTL::Size screenSize, const class RasterizationRateLayerDescriptor* layer); + RasterizationRateLayerDescriptor* layer(NS::UInteger layerIndex); + NS::UInteger layerCount() const; - static class RasterizationRateMapDescriptor* rasterizationRateMapDescriptor(MTL::Size screenSize, NS::UInteger layerCount, const class RasterizationRateLayerDescriptor* const* layers); + RasterizationRateLayerArray* layers() const; - class RasterizationRateLayerDescriptor* layer(NS::UInteger layerIndex); + static RasterizationRateMapDescriptor* rasterizationRateMapDescriptor(MTL::Size screenSize); + static RasterizationRateMapDescriptor* rasterizationRateMapDescriptor(MTL::Size screenSize, const MTL::RasterizationRateLayerDescriptor* layer); + static RasterizationRateMapDescriptor* rasterizationRateMapDescriptor(MTL::Size screenSize, NS::UInteger layerCount, const MTL::RasterizationRateLayerDescriptor* const* layers); - void setLayer(const class RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex); + Size screenSize() const; - class RasterizationRateLayerArray* layers() const; + void setLabel(const NS::String* label); - MTL::Size screenSize() const; - void setScreenSize(MTL::Size screenSize); + void setLayer(const MTL::RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex); - NS::String* label() const; - void setLabel(const NS::String* label); - - NS::UInteger layerCount() const; + void setScreenSize(MTL::Size screenSize); }; - class RasterizationRateMap : public NS::Referencing { public: - class Device* device() const; + void copyParameterDataToBuffer(const MTL::Buffer* buffer, NS::UInteger offset); - NS::String* label() const; + Device* device() const; - MTL::Size screenSize() const; + NS::String* label() const; - MTL::Size physicalGranularity() const; + NS::UInteger layerCount() const; - NS::UInteger layerCount() const; + Coordinate2D mapPhysicalToScreenCoordinates(MTL::Coordinate2D physicalCoordinates, NS::UInteger layerIndex); - MTL::SizeAndAlign parameterBufferSizeAndAlign() const; + Coordinate2D mapScreenToPhysicalCoordinates(MTL::Coordinate2D screenCoordinates, NS::UInteger layerIndex); - void copyParameterDataToBuffer(const class Buffer* buffer, NS::UInteger offset); + SizeAndAlign parameterBufferSizeAndAlign() const; - MTL::Size physicalSize(NS::UInteger layerIndex); + Size physicalGranularity() const; - MTL::Coordinate2D mapScreenToPhysicalCoordinates(MTL::Coordinate2D screenCoordinates, NS::UInteger layerIndex); + Size physicalSize(NS::UInteger layerIndex); - MTL::Coordinate2D mapPhysicalToScreenCoordinates(MTL::Coordinate2D physicalCoordinates, NS::UInteger layerIndex); + Size screenSize() const; }; } - -// static method: alloc _MTL_INLINE MTL::RasterizationRateSampleArray* MTL::RasterizationRateSampleArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRasterizationRateSampleArray)); } -// method: init _MTL_INLINE MTL::RasterizationRateSampleArray* MTL::RasterizationRateSampleArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE NS::Number* MTL::RasterizationRateSampleArray::object(NS::UInteger index) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), index); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::RasterizationRateSampleArray::setObject(const NS::Number* value, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), value, index); } -// static method: alloc _MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRasterizationRateLayerDescriptor)); } -// method: init -_MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::init() -{ - return NS::Object::init(); -} - -// method: initWithSampleCount: -_MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::init(MTL::Size sampleCount) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithSampleCount_), sampleCount); -} - -// method: initWithSampleCount:horizontal:vertical: -_MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::init(MTL::Size sampleCount, const float* horizontal, const float* vertical) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithSampleCount_horizontal_vertical_), sampleCount, horizontal, vertical); -} - -// property: sampleCount -_MTL_INLINE MTL::Size MTL::RasterizationRateLayerDescriptor::sampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); -} - -// property: maxSampleCount -_MTL_INLINE MTL::Size MTL::RasterizationRateLayerDescriptor::maxSampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxSampleCount)); -} - -// property: horizontalSampleStorage -_MTL_INLINE float* MTL::RasterizationRateLayerDescriptor::horizontalSampleStorage() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(horizontalSampleStorage)); -} - -// property: verticalSampleStorage -_MTL_INLINE float* MTL::RasterizationRateLayerDescriptor::verticalSampleStorage() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(verticalSampleStorage)); -} - -// property: horizontal _MTL_INLINE MTL::RasterizationRateSampleArray* MTL::RasterizationRateLayerDescriptor::horizontal() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(horizontal)); } -// property: vertical -_MTL_INLINE MTL::RasterizationRateSampleArray* MTL::RasterizationRateLayerDescriptor::vertical() const +_MTL_INLINE float* MTL::RasterizationRateLayerDescriptor::horizontalSampleStorage() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertical)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(horizontalSampleStorage)); +} + +_MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::init(MTL::Size sampleCount) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithSampleCount_), sampleCount); +} + +_MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerDescriptor::init(MTL::Size sampleCount, const float* horizontal, const float* vertical) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithSampleCount_horizontal_vertical_), sampleCount, horizontal, vertical); +} + +_MTL_INLINE MTL::Size MTL::RasterizationRateLayerDescriptor::maxSampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxSampleCount)); +} + +_MTL_INLINE MTL::Size MTL::RasterizationRateLayerDescriptor::sampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); } -// method: setSampleCount: _MTL_INLINE void MTL::RasterizationRateLayerDescriptor::setSampleCount(MTL::Size sampleCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount); } -// static method: alloc +_MTL_INLINE MTL::RasterizationRateSampleArray* MTL::RasterizationRateLayerDescriptor::vertical() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertical)); +} + +_MTL_INLINE float* MTL::RasterizationRateLayerDescriptor::verticalSampleStorage() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(verticalSampleStorage)); +} + _MTL_INLINE MTL::RasterizationRateLayerArray* MTL::RasterizationRateLayerArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRasterizationRateLayerArray)); } -// method: init _MTL_INLINE MTL::RasterizationRateLayerArray* MTL::RasterizationRateLayerArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateLayerArray::object(NS::UInteger layerIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), layerIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::RasterizationRateLayerArray::setObject(const MTL::RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), layer, layerIndex); } -// static method: alloc _MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor)); } -// method: init _MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::init() { return NS::Object::init(); } -// static method: rasterizationRateMapDescriptorWithScreenSize: -_MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::rasterizationRateMapDescriptor(MTL::Size screenSize) +_MTL_INLINE NS::String* MTL::RasterizationRateMapDescriptor::label() const { - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor), _MTL_PRIVATE_SEL(rasterizationRateMapDescriptorWithScreenSize_), screenSize); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -// static method: rasterizationRateMapDescriptorWithScreenSize:layer: -_MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::rasterizationRateMapDescriptor(MTL::Size screenSize, const MTL::RasterizationRateLayerDescriptor* layer) -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor), _MTL_PRIVATE_SEL(rasterizationRateMapDescriptorWithScreenSize_layer_), screenSize, layer); -} - -// static method: rasterizationRateMapDescriptorWithScreenSize:layerCount:layers: -_MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::rasterizationRateMapDescriptor(MTL::Size screenSize, NS::UInteger layerCount, const MTL::RasterizationRateLayerDescriptor* const* layers) -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor), _MTL_PRIVATE_SEL(rasterizationRateMapDescriptorWithScreenSize_layerCount_layers_), screenSize, layerCount, layers); -} - -// method: layerAtIndex: _MTL_INLINE MTL::RasterizationRateLayerDescriptor* MTL::RasterizationRateMapDescriptor::layer(NS::UInteger layerIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(layerAtIndex_), layerIndex); } -// method: setLayer:atIndex: -_MTL_INLINE void MTL::RasterizationRateMapDescriptor::setLayer(const MTL::RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex) +_MTL_INLINE NS::UInteger MTL::RasterizationRateMapDescriptor::layerCount() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLayer_atIndex_), layer, layerIndex); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(layerCount)); } -// property: layers _MTL_INLINE MTL::RasterizationRateLayerArray* MTL::RasterizationRateMapDescriptor::layers() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(layers)); } -// property: screenSize +_MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::rasterizationRateMapDescriptor(MTL::Size screenSize) +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor), _MTL_PRIVATE_SEL(rasterizationRateMapDescriptorWithScreenSize_), screenSize); +} + +_MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::rasterizationRateMapDescriptor(MTL::Size screenSize, const MTL::RasterizationRateLayerDescriptor* layer) +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor), _MTL_PRIVATE_SEL(rasterizationRateMapDescriptorWithScreenSize_layer_), screenSize, layer); +} + +_MTL_INLINE MTL::RasterizationRateMapDescriptor* MTL::RasterizationRateMapDescriptor::rasterizationRateMapDescriptor(MTL::Size screenSize, NS::UInteger layerCount, const MTL::RasterizationRateLayerDescriptor* const* layers) +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRasterizationRateMapDescriptor), _MTL_PRIVATE_SEL(rasterizationRateMapDescriptorWithScreenSize_layerCount_layers_), screenSize, layerCount, layers); +} + _MTL_INLINE MTL::Size MTL::RasterizationRateMapDescriptor::screenSize() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(screenSize)); } -_MTL_INLINE void MTL::RasterizationRateMapDescriptor::setScreenSize(MTL::Size screenSize) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setScreenSize_), screenSize); -} - -// property: label -_MTL_INLINE NS::String* MTL::RasterizationRateMapDescriptor::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - _MTL_INLINE void MTL::RasterizationRateMapDescriptor::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: layerCount -_MTL_INLINE NS::UInteger MTL::RasterizationRateMapDescriptor::layerCount() const +_MTL_INLINE void MTL::RasterizationRateMapDescriptor::setLayer(const MTL::RasterizationRateLayerDescriptor* layer, NS::UInteger layerIndex) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(layerCount)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLayer_atIndex_), layer, layerIndex); } -// property: device -_MTL_INLINE MTL::Device* MTL::RasterizationRateMap::device() const +_MTL_INLINE void MTL::RasterizationRateMapDescriptor::setScreenSize(MTL::Size screenSize) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setScreenSize_), screenSize); } -// property: label -_MTL_INLINE NS::String* MTL::RasterizationRateMap::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - -// property: screenSize -_MTL_INLINE MTL::Size MTL::RasterizationRateMap::screenSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(screenSize)); -} - -// property: physicalGranularity -_MTL_INLINE MTL::Size MTL::RasterizationRateMap::physicalGranularity() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(physicalGranularity)); -} - -// property: layerCount -_MTL_INLINE NS::UInteger MTL::RasterizationRateMap::layerCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(layerCount)); -} - -// property: parameterBufferSizeAndAlign -_MTL_INLINE MTL::SizeAndAlign MTL::RasterizationRateMap::parameterBufferSizeAndAlign() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(parameterBufferSizeAndAlign)); -} - -// method: copyParameterDataToBuffer:offset: _MTL_INLINE void MTL::RasterizationRateMap::copyParameterDataToBuffer(const MTL::Buffer* buffer, NS::UInteger offset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(copyParameterDataToBuffer_offset_), buffer, offset); } -// method: physicalSizeForLayer: -_MTL_INLINE MTL::Size MTL::RasterizationRateMap::physicalSize(NS::UInteger layerIndex) +_MTL_INLINE MTL::Device* MTL::RasterizationRateMap::device() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(physicalSizeForLayer_), layerIndex); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL::RasterizationRateMap::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::RasterizationRateMap::layerCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(layerCount)); +} + +_MTL_INLINE MTL::Coordinate2D MTL::RasterizationRateMap::mapPhysicalToScreenCoordinates(MTL::Coordinate2D physicalCoordinates, NS::UInteger layerIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(mapPhysicalToScreenCoordinates_forLayer_), physicalCoordinates, layerIndex); } -// method: mapScreenToPhysicalCoordinates:forLayer: _MTL_INLINE MTL::Coordinate2D MTL::RasterizationRateMap::mapScreenToPhysicalCoordinates(MTL::Coordinate2D screenCoordinates, NS::UInteger layerIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(mapScreenToPhysicalCoordinates_forLayer_), screenCoordinates, layerIndex); } -// method: mapPhysicalToScreenCoordinates:forLayer: -_MTL_INLINE MTL::Coordinate2D MTL::RasterizationRateMap::mapPhysicalToScreenCoordinates(MTL::Coordinate2D physicalCoordinates, NS::UInteger layerIndex) +_MTL_INLINE MTL::SizeAndAlign MTL::RasterizationRateMap::parameterBufferSizeAndAlign() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(mapPhysicalToScreenCoordinates_forLayer_), physicalCoordinates, layerIndex); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(parameterBufferSizeAndAlign)); +} + +_MTL_INLINE MTL::Size MTL::RasterizationRateMap::physicalGranularity() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(physicalGranularity)); +} + +_MTL_INLINE MTL::Size MTL::RasterizationRateMap::physicalSize(NS::UInteger layerIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(physicalSizeForLayer_), layerIndex); +} + +_MTL_INLINE MTL::Size MTL::RasterizationRateMap::screenSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(screenSize)); } diff --git a/vendor/metal-cpp/Metal/MTLRenderCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLRenderCommandEncoder.hpp index 3c14d6b6d..b2667b77e 100644 --- a/vendor/metal-cpp/Metal/MTLRenderCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLRenderCommandEncoder.hpp @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Metal/MTLRenderCommandEncoder.hpp +// Metal/MTLResourceStatePass.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,20 +20,35 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLArgument.hpp" +#include "MTLCommandEncoder.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLCommandEncoder.hpp" -#include "MTLRenderCommandEncoder.hpp" #include "MTLRenderPass.hpp" -#include "MTLStageInputOutputDescriptor.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class AccelerationStructure; +class Buffer; +class CounterSampleBuffer; +class DepthStencilState; +class Fence; +class Heap; +class IndirectCommandBuffer; +class IntersectionFunctionTable; +class LogicalToPhysicalColorAttachmentMap; +class RenderPipelineState; +class Resource; +class SamplerState; +struct ScissorRect; +class Texture; +struct VertexAmplificationViewMapping; +struct Viewport; +class VisibleFunctionTable; _MTL_ENUM(NS::UInteger, PrimitiveType) { PrimitiveTypePoint = 0, PrimitiveTypeLine = 1, @@ -48,24 +63,6 @@ _MTL_ENUM(NS::UInteger, VisibilityResultMode) { VisibilityResultModeCounting = 2, }; -struct ScissorRect -{ - NS::UInteger x; - NS::UInteger y; - NS::UInteger width; - NS::UInteger height; -} _MTL_PACKED; - -struct Viewport -{ - double originX; - double originY; - double width; - double height; - double znear; - double zfar; -} _MTL_PACKED; - _MTL_ENUM(NS::UInteger, CullMode) { CullModeNone = 0, CullModeFront = 1, @@ -87,6 +84,32 @@ _MTL_ENUM(NS::UInteger, TriangleFillMode) { TriangleFillModeLines = 1, }; +_MTL_OPTIONS(NS::UInteger, RenderStages) { + RenderStageVertex = 1, + RenderStageFragment = 1 << 1, + RenderStageTile = 1 << 2, + RenderStageObject = 1 << 3, + RenderStageMesh = 1 << 4, +}; + +struct ScissorRect +{ + NS::UInteger x; + NS::UInteger y; + NS::UInteger width; + NS::UInteger height; +} _MTL_PACKED; + +struct Viewport +{ + double originX; + double originY; + double width; + double height; + double znear; + double zfar; +} _MTL_PACKED; + struct DrawPrimitivesIndirectArguments { uint32_t vertexCount; @@ -130,1016 +153,867 @@ struct TriangleTessellationFactorsHalf uint16_t insideTessellationFactor; } _MTL_PACKED; -_MTL_OPTIONS(NS::UInteger, RenderStages) { - RenderStageVertex = 1, - RenderStageFragment = 2, - RenderStageTile = 4, - RenderStageObject = 8, - RenderStageMesh = 16, -}; - class RenderCommandEncoder : public NS::Referencing { public: - void setRenderPipelineState(const class RenderPipelineState* pipelineState); + void dispatchThreadsPerTile(MTL::Size threadsPerTile); - void setVertexBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + void drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance); + void drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); - void setVertexBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); - - void setVertexBufferOffset(NS::UInteger offset, NS::UInteger index); - - void setVertexBuffers(const class Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); - - void setVertexTexture(const class Texture* texture, NS::UInteger index); - - void setVertexTextures(const class Texture* const textures[], NS::Range range); - - void setVertexSamplerState(const class SamplerState* sampler, NS::UInteger index); - - void setVertexSamplerStates(const class SamplerState* const samplers[], NS::Range range); - - void setVertexSamplerState(const class SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); - - void setVertexSamplerStates(const class SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); - - void setVertexVisibleFunctionTable(const class VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); - - void setVertexVisibleFunctionTables(const class VisibleFunctionTable* const functionTables[], NS::Range range); - - void setVertexIntersectionFunctionTable(const class IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); - - void setVertexIntersectionFunctionTables(const class IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); - - void setVertexAccelerationStructure(const class AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); - - void setViewport(MTL::Viewport viewport); - - void setViewports(const MTL::Viewport* viewports, NS::UInteger count); - - void setFrontFacingWinding(MTL::Winding frontFacingWinding); - - void setVertexAmplificationCount(NS::UInteger count, const MTL::VertexAmplificationViewMapping* viewMappings); - - void setCullMode(MTL::CullMode cullMode); - - void setDepthClipMode(MTL::DepthClipMode depthClipMode); - - void setDepthBias(float depthBias, float slopeScale, float clamp); - - void setScissorRect(MTL::ScissorRect rect); - - void setScissorRects(const MTL::ScissorRect* scissorRects, NS::UInteger count); - - void setTriangleFillMode(MTL::TriangleFillMode fillMode); - - void setFragmentBytes(const void* bytes, NS::UInteger length, NS::UInteger index); - - void setFragmentBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); - - void setFragmentBufferOffset(NS::UInteger offset, NS::UInteger index); - - void setFragmentBuffers(const class Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); - - void setFragmentTexture(const class Texture* texture, NS::UInteger index); - - void setFragmentTextures(const class Texture* const textures[], NS::Range range); - - void setFragmentSamplerState(const class SamplerState* sampler, NS::UInteger index); - - void setFragmentSamplerStates(const class SamplerState* const samplers[], NS::Range range); - - void setFragmentSamplerState(const class SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); - - void setFragmentSamplerStates(const class SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); - - void setFragmentVisibleFunctionTable(const class VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); - - void setFragmentVisibleFunctionTables(const class VisibleFunctionTable* const functionTables[], NS::Range range); - - void setFragmentIntersectionFunctionTable(const class IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); - - void setFragmentIntersectionFunctionTables(const class IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); - - void setFragmentAccelerationStructure(const class AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); - - void setBlendColor(float red, float green, float blue, float alpha); - - void setDepthStencilState(const class DepthStencilState* depthStencilState); - - void setStencilReferenceValue(uint32_t referenceValue); - - void setStencilReferenceValues(uint32_t frontReferenceValue, uint32_t backReferenceValue); - - void setVisibilityResultMode(MTL::VisibilityResultMode mode, NS::UInteger offset); - - void setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex); - - void setDepthStoreAction(MTL::StoreAction storeAction); - - void setStencilStoreAction(MTL::StoreAction storeAction); - - void setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex); - - void setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions); - - void setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions); - - void setObjectBytes(const void* bytes, NS::UInteger length, NS::UInteger index); - - void setObjectBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); - - void setObjectBufferOffset(NS::UInteger offset, NS::UInteger index); - - void setObjectBuffers(const class Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range); - - void setObjectTexture(const class Texture* texture, NS::UInteger index); - - void setObjectTextures(const class Texture* const textures[], NS::Range range); - - void setObjectSamplerState(const class SamplerState* sampler, NS::UInteger index); - - void setObjectSamplerStates(const class SamplerState* const samplers[], NS::Range range); - - void setObjectSamplerState(const class SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); - - void setObjectSamplerStates(const class SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range); - - void setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); - - void setMeshBytes(const void* bytes, NS::UInteger length, NS::UInteger index); - - void setMeshBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); - - void setMeshBufferOffset(NS::UInteger offset, NS::UInteger index); - - void setMeshBuffers(const class Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range); - - void setMeshTexture(const class Texture* texture, NS::UInteger index); - - void setMeshTextures(const class Texture* const textures[], NS::Range range); - - void setMeshSamplerState(const class SamplerState* sampler, NS::UInteger index); - - void setMeshSamplerStates(const class SamplerState* const samplers[], NS::Range range); - - void setMeshSamplerState(const class SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); - - void setMeshSamplerStates(const class SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance); + void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); void drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); + void drawMeshThreadgroups(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); void drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); - void drawMeshThreadgroups(const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup); + void drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance); + void drawPatches(NS::UInteger numberOfPatchControlPoints, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount); - void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount); - - void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const class Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount); - - void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const class Buffer* indexBuffer, NS::UInteger indexBufferOffset); - void drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance); + void drawPrimitives(MTL::PrimitiveType primitiveType, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); - void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const class Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance); + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange); + void executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandbuffer, const MTL::Buffer* indirectRangeBuffer, NS::UInteger indirectBufferOffset); - void drawPrimitives(MTL::PrimitiveType primitiveType, const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); + void memoryBarrier(MTL::BarrierScope scope, MTL::RenderStages after, MTL::RenderStages before); + void memoryBarrier(const MTL::Resource* const resources[], NS::UInteger count, MTL::RenderStages after, MTL::RenderStages before); - void drawIndexedPrimitives(MTL::PrimitiveType primitiveType, MTL::IndexType indexType, const class Buffer* indexBuffer, NS::UInteger indexBufferOffset, const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); + void sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); - void textureBarrier(); + void setBlendColor(float red, float green, float blue, float alpha); - void updateFence(const class Fence* fence, MTL::RenderStages stages); + void setColorAttachmentMap(const MTL::LogicalToPhysicalColorAttachmentMap* mapping); - void waitForFence(const class Fence* fence, MTL::RenderStages stages); + void setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex); + void setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex); - void setTessellationFactorBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride); + void setCullMode(MTL::CullMode cullMode); + + void setDepthBias(float depthBias, float slopeScale, float clamp); + + void setDepthClipMode(MTL::DepthClipMode depthClipMode); + + void setDepthStencilState(const MTL::DepthStencilState* depthStencilState); + + void setDepthStoreAction(MTL::StoreAction storeAction); + void setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions); + + void setDepthTestBounds(float minBound, float maxBound); + + void setFragmentAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); + + void setFragmentBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setFragmentBufferOffset(NS::UInteger offset, NS::UInteger index); + + void setFragmentBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); + + void setFragmentBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + + void setFragmentIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); + void setFragmentIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); + + void setFragmentSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setFragmentSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setFragmentSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); + void setFragmentSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); + + void setFragmentTexture(const MTL::Texture* texture, NS::UInteger index); + void setFragmentTextures(const MTL::Texture* const textures[], NS::Range range); + + void setFragmentVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); + void setFragmentVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range); + + void setFrontFacingWinding(MTL::Winding frontFacingWinding); + + void setMeshBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setMeshBufferOffset(NS::UInteger offset, NS::UInteger index); + + void setMeshBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range); + + void setMeshBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + + void setMeshSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setMeshSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setMeshSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); + void setMeshSamplerStates(const MTL::SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range); + + void setMeshTexture(const MTL::Texture* texture, NS::UInteger index); + void setMeshTextures(const MTL::Texture* const textures[], NS::Range range); + + void setObjectBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setObjectBufferOffset(NS::UInteger offset, NS::UInteger index); + + void setObjectBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range); + + void setObjectBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + + void setObjectSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setObjectSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setObjectSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); + void setObjectSamplerStates(const MTL::SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range); + + void setObjectTexture(const MTL::Texture* texture, NS::UInteger index); + void setObjectTextures(const MTL::Texture* const textures[], NS::Range range); + + void setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index); + + void setRenderPipelineState(const MTL::RenderPipelineState* pipelineState); + + void setScissorRect(MTL::ScissorRect rect); + void setScissorRects(const MTL::ScissorRect* scissorRects, NS::UInteger count); + + void setStencilReferenceValue(uint32_t referenceValue); + void setStencilReferenceValues(uint32_t frontReferenceValue, uint32_t backReferenceValue); + + void setStencilStoreAction(MTL::StoreAction storeAction); + void setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions); + + void setTessellationFactorBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride); void setTessellationFactorScale(float scale); - void drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const class Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance); + void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger offset, NS::UInteger index); - void drawPatches(NS::UInteger numberOfPatchControlPoints, const class Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); + void setTileAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); - void drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const class Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const class Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance); + void setTileBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setTileBufferOffset(NS::UInteger offset, NS::UInteger index); - void drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, const class Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const class Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); - - NS::UInteger tileWidth() const; - - NS::UInteger tileHeight() const; + void setTileBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range); void setTileBytes(const void* bytes, NS::UInteger length, NS::UInteger index); - void setTileBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setTileIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); + void setTileIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); - void setTileBufferOffset(NS::UInteger offset, NS::UInteger index); + void setTileSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setTileSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setTileSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); + void setTileSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); - void setTileBuffers(const class Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range); + void setTileTexture(const MTL::Texture* texture, NS::UInteger index); + void setTileTextures(const MTL::Texture* const textures[], NS::Range range); - void setTileTexture(const class Texture* texture, NS::UInteger index); + void setTileVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); + void setTileVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range); - void setTileTextures(const class Texture* const textures[], NS::Range range); + void setTriangleFillMode(MTL::TriangleFillMode fillMode); - void setTileSamplerState(const class SamplerState* sampler, NS::UInteger index); + void setVertexAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); - void setTileSamplerStates(const class SamplerState* const samplers[], NS::Range range); + void setVertexAmplificationCount(NS::UInteger count, const MTL::VertexAmplificationViewMapping* viewMappings); - void setTileSamplerState(const class SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index); + void setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index); + void setVertexBufferOffset(NS::UInteger offset, NS::UInteger index); + void setVertexBufferOffset(NS::UInteger offset, NS::UInteger stride, NS::UInteger index); - void setTileSamplerStates(const class SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); + void setVertexBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range); + void setVertexBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, const NS::UInteger* strides, NS::Range range); - void setTileVisibleFunctionTable(const class VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); + void setVertexBytes(const void* bytes, NS::UInteger length, NS::UInteger index); + void setVertexBytes(const void* bytes, NS::UInteger length, NS::UInteger stride, NS::UInteger index); - void setTileVisibleFunctionTables(const class VisibleFunctionTable* const functionTables[], NS::Range range); + void setVertexIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); + void setVertexIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); - void setTileIntersectionFunctionTable(const class IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex); + void setVertexSamplerState(const MTL::SamplerState* sampler, NS::UInteger index); + void setVertexSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index); + void setVertexSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range); + void setVertexSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range); - void setTileIntersectionFunctionTables(const class IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range); + void setVertexTexture(const MTL::Texture* texture, NS::UInteger index); + void setVertexTextures(const MTL::Texture* const textures[], NS::Range range); - void setTileAccelerationStructure(const class AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex); + void setVertexVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex); + void setVertexVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range); - void dispatchThreadsPerTile(MTL::Size threadsPerTile); + void setViewport(MTL::Viewport viewport); + void setViewports(const MTL::Viewport* viewports, NS::UInteger count); - void setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger offset, NS::UInteger index); + void setVisibilityResultMode(MTL::VisibilityResultMode mode, NS::UInteger offset); - void useResource(const class Resource* resource, MTL::ResourceUsage usage); + void textureBarrier(); - void useResources(const class Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage); + NS::UInteger tileHeight() const; - void useResource(const class Resource* resource, MTL::ResourceUsage usage, MTL::RenderStages stages); + NS::UInteger tileWidth() const; - void useResources(const class Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage, MTL::RenderStages stages); + void updateFence(const MTL::Fence* fence, MTL::RenderStages stages); - void useHeap(const class Heap* heap); + void useHeap(const MTL::Heap* heap); + void useHeap(const MTL::Heap* heap, MTL::RenderStages stages); + void useHeaps(const MTL::Heap* const heaps[], NS::UInteger count); + void useHeaps(const MTL::Heap* const heaps[], NS::UInteger count, MTL::RenderStages stages); - void useHeaps(const class Heap* const heaps[], NS::UInteger count); + void useResource(const MTL::Resource* resource, MTL::ResourceUsage usage); + void useResource(const MTL::Resource* resource, MTL::ResourceUsage usage, MTL::RenderStages stages); + void useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage); + void useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage, MTL::RenderStages stages); - void useHeap(const class Heap* heap, MTL::RenderStages stages); - - void useHeaps(const class Heap* const heaps[], NS::UInteger count, MTL::RenderStages stages); - - void executeCommandsInBuffer(const class IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange); - - void executeCommandsInBuffer(const class IndirectCommandBuffer* indirectCommandbuffer, const class Buffer* indirectRangeBuffer, NS::UInteger indirectBufferOffset); - - void memoryBarrier(MTL::BarrierScope scope, MTL::RenderStages after, MTL::RenderStages before); - - void memoryBarrier(const class Resource* const resources[], NS::UInteger count, MTL::RenderStages after, MTL::RenderStages before); - - void sampleCountersInBuffer(const class CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier); + void waitForFence(const MTL::Fence* fence, MTL::RenderStages stages); }; } -// method: setRenderPipelineState: -_MTL_INLINE void MTL::RenderCommandEncoder::setRenderPipelineState(const MTL::RenderPipelineState* pipelineState) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineState_), pipelineState); -} - -// method: setVertexBytes:length:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBytes(const void* bytes, NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBytes_length_atIndex_), bytes, length, index); -} - -// method: setVertexBuffer:offset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setVertexBufferOffset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBufferOffset(NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBufferOffset_atIndex_), offset, index); -} - -// method: setVertexBuffers:offsets:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setVertexTexture:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexTexture_atIndex_), texture, index); -} - -// method: setVertexTextures:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexTextures_withRange_), textures, range); -} - -// method: setVertexSamplerState:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerState_atIndex_), sampler, index); -} - -// method: setVertexSamplerStates:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerStates_withRange_), samplers, range); -} - -// method: setVertexSamplerState:lodMinClamp:lodMaxClamp:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); -} - -// method: setVertexSamplerStates:lodMinClamps:lodMaxClamps:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); -} - -// method: setVertexVisibleFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); -} - -// method: setVertexVisibleFunctionTables:withBufferRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexVisibleFunctionTables_withBufferRange_), functionTables, range); -} - -// method: setVertexIntersectionFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); -} - -// method: setVertexIntersectionFunctionTables:withBufferRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); -} - -// method: setVertexAccelerationStructure:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); -} - -// method: setViewport: -_MTL_INLINE void MTL::RenderCommandEncoder::setViewport(MTL::Viewport viewport) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setViewport_), viewport); -} - -// method: setViewports:count: -_MTL_INLINE void MTL::RenderCommandEncoder::setViewports(const MTL::Viewport* viewports, NS::UInteger count) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setViewports_count_), viewports, count); -} - -// method: setFrontFacingWinding: -_MTL_INLINE void MTL::RenderCommandEncoder::setFrontFacingWinding(MTL::Winding frontFacingWinding) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFrontFacingWinding_), frontFacingWinding); -} - -// method: setVertexAmplificationCount:viewMappings: -_MTL_INLINE void MTL::RenderCommandEncoder::setVertexAmplificationCount(NS::UInteger count, const MTL::VertexAmplificationViewMapping* viewMappings) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAmplificationCount_viewMappings_), count, viewMappings); -} - -// method: setCullMode: -_MTL_INLINE void MTL::RenderCommandEncoder::setCullMode(MTL::CullMode cullMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setCullMode_), cullMode); -} - -// method: setDepthClipMode: -_MTL_INLINE void MTL::RenderCommandEncoder::setDepthClipMode(MTL::DepthClipMode depthClipMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthClipMode_), depthClipMode); -} - -// method: setDepthBias:slopeScale:clamp: -_MTL_INLINE void MTL::RenderCommandEncoder::setDepthBias(float depthBias, float slopeScale, float clamp) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthBias_slopeScale_clamp_), depthBias, slopeScale, clamp); -} - -// method: setScissorRect: -_MTL_INLINE void MTL::RenderCommandEncoder::setScissorRect(MTL::ScissorRect rect) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setScissorRect_), rect); -} - -// method: setScissorRects:count: -_MTL_INLINE void MTL::RenderCommandEncoder::setScissorRects(const MTL::ScissorRect* scissorRects, NS::UInteger count) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setScissorRects_count_), scissorRects, count); -} - -// method: setTriangleFillMode: -_MTL_INLINE void MTL::RenderCommandEncoder::setTriangleFillMode(MTL::TriangleFillMode fillMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleFillMode_), fillMode); -} - -// method: setFragmentBytes:length:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBytes(const void* bytes, NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBytes_length_atIndex_), bytes, length, index); -} - -// method: setFragmentBuffer:offset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setFragmentBufferOffset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBufferOffset(NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBufferOffset_atIndex_), offset, index); -} - -// method: setFragmentBuffers:offsets:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setFragmentTexture:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentTexture_atIndex_), texture, index); -} - -// method: setFragmentTextures:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentTextures_withRange_), textures, range); -} - -// method: setFragmentSamplerState:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerState_atIndex_), sampler, index); -} - -// method: setFragmentSamplerStates:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerStates_withRange_), samplers, range); -} - -// method: setFragmentSamplerState:lodMinClamp:lodMaxClamp:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); -} - -// method: setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); -} - -// method: setFragmentVisibleFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); -} - -// method: setFragmentVisibleFunctionTables:withBufferRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentVisibleFunctionTables_withBufferRange_), functionTables, range); -} - -// method: setFragmentIntersectionFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); -} - -// method: setFragmentIntersectionFunctionTables:withBufferRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); -} - -// method: setFragmentAccelerationStructure:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); -} - -// method: setBlendColorRed:green:blue:alpha: -_MTL_INLINE void MTL::RenderCommandEncoder::setBlendColor(float red, float green, float blue, float alpha) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBlendColorRed_green_blue_alpha_), red, green, blue, alpha); -} - -// method: setDepthStencilState: -_MTL_INLINE void MTL::RenderCommandEncoder::setDepthStencilState(const MTL::DepthStencilState* depthStencilState) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilState_), depthStencilState); -} - -// method: setStencilReferenceValue: -_MTL_INLINE void MTL::RenderCommandEncoder::setStencilReferenceValue(uint32_t referenceValue) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilReferenceValue_), referenceValue); -} - -// method: setStencilFrontReferenceValue:backReferenceValue: -_MTL_INLINE void MTL::RenderCommandEncoder::setStencilReferenceValues(uint32_t frontReferenceValue, uint32_t backReferenceValue) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilFrontReferenceValue_backReferenceValue_), frontReferenceValue, backReferenceValue); -} - -// method: setVisibilityResultMode:offset: -_MTL_INLINE void MTL::RenderCommandEncoder::setVisibilityResultMode(MTL::VisibilityResultMode mode, NS::UInteger offset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultMode_offset_), mode, offset); -} - -// method: setColorStoreAction:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreAction_atIndex_), storeAction, colorAttachmentIndex); -} - -// method: setDepthStoreAction: -_MTL_INLINE void MTL::RenderCommandEncoder::setDepthStoreAction(MTL::StoreAction storeAction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreAction_), storeAction); -} - -// method: setStencilStoreAction: -_MTL_INLINE void MTL::RenderCommandEncoder::setStencilStoreAction(MTL::StoreAction storeAction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreAction_), storeAction); -} - -// method: setColorStoreActionOptions:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreActionOptions_atIndex_), storeActionOptions, colorAttachmentIndex); -} - -// method: setDepthStoreActionOptions: -_MTL_INLINE void MTL::RenderCommandEncoder::setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreActionOptions_), storeActionOptions); -} - -// method: setStencilStoreActionOptions: -_MTL_INLINE void MTL::RenderCommandEncoder::setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreActionOptions_), storeActionOptions); -} - -// method: setObjectBytes:length:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBytes(const void* bytes, NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBytes_length_atIndex_), bytes, length, index); -} - -// method: setObjectBuffer:offset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setObjectBufferOffset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBufferOffset(NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBufferOffset_atIndex_), offset, index); -} - -// method: setObjectBuffers:offsets:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setObjectTexture:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectTexture_atIndex_), texture, index); -} - -// method: setObjectTextures:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectTextures_withRange_), textures, range); -} - -// method: setObjectSamplerState:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerState_atIndex_), sampler, index); -} - -// method: setObjectSamplerStates:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerStates_withRange_), samplers, range); -} - -// method: setObjectSamplerState:lodMinClamp:lodMaxClamp:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); -} - -// method: setObjectSamplerStates:lodMinClamps:lodMaxClamps:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerStates(const MTL::SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); -} - -// method: setObjectThreadgroupMemoryLength:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupMemoryLength_atIndex_), length, index); -} - -// method: setMeshBytes:length:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBytes(const void* bytes, NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBytes_length_atIndex_), bytes, length, index); -} - -// method: setMeshBuffer:offset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setMeshBufferOffset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBufferOffset(NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBufferOffset_atIndex_), offset, index); -} - -// method: setMeshBuffers:offsets:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setMeshTexture:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshTexture_atIndex_), texture, index); -} - -// method: setMeshTextures:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshTextures_withRange_), textures, range); -} - -// method: setMeshSamplerState:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerState_atIndex_), sampler, index); -} - -// method: setMeshSamplerStates:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerStates_withRange_), samplers, range); -} - -// method: setMeshSamplerState:lodMinClamp:lodMaxClamp:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); -} - -// method: setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerStates(const MTL::SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); -} - -// method: drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup: -_MTL_INLINE void MTL::RenderCommandEncoder::drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroups_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadgroupsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); -} - -// method: drawMeshThreads:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup: -_MTL_INLINE void MTL::RenderCommandEncoder::drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreads_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); -} - -// method: drawMeshThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup: -_MTL_INLINE void MTL::RenderCommandEncoder::drawMeshThreadgroups(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), indirectBuffer, indirectBufferOffset, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); -} - -// method: drawPrimitives:vertexStart:vertexCount:instanceCount: -_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_), primitiveType, vertexStart, vertexCount, instanceCount); -} - -// method: drawPrimitives:vertexStart:vertexCount: -_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_), primitiveType, vertexStart, vertexCount); -} - -// method: drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount: -_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset, instanceCount); -} - -// method: drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset: -_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset); -} - -// method: drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance: -_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_baseInstance_), primitiveType, vertexStart, vertexCount, instanceCount, baseInstance); -} - -// method: drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance: -_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_baseVertex_baseInstance_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset, instanceCount, baseVertex, baseInstance); -} - -// method: drawPrimitives:indirectBuffer:indirectBufferOffset: -_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_indirectBuffer_indirectBufferOffset_), primitiveType, indirectBuffer, indirectBufferOffset); -} - -// method: drawIndexedPrimitives:indexType:indexBuffer:indexBufferOffset:indirectBuffer:indirectBufferOffset: -_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexType_indexBuffer_indexBufferOffset_indirectBuffer_indirectBufferOffset_), primitiveType, indexType, indexBuffer, indexBufferOffset, indirectBuffer, indirectBufferOffset); -} - -// method: textureBarrier -_MTL_INLINE void MTL::RenderCommandEncoder::textureBarrier() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(textureBarrier)); -} - -// method: updateFence:afterStages: -_MTL_INLINE void MTL::RenderCommandEncoder::updateFence(const MTL::Fence* fence, MTL::RenderStages stages) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_afterStages_), fence, stages); -} - -// method: waitForFence:beforeStages: -_MTL_INLINE void MTL::RenderCommandEncoder::waitForFence(const MTL::Fence* fence, MTL::RenderStages stages) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_beforeStages_), fence, stages); -} - -// method: setTessellationFactorBuffer:offset:instanceStride: -_MTL_INLINE void MTL::RenderCommandEncoder::setTessellationFactorBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorBuffer_offset_instanceStride_), buffer, offset, instanceStride); -} - -// method: setTessellationFactorScale: -_MTL_INLINE void MTL::RenderCommandEncoder::setTessellationFactorScale(float scale) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorScale_), scale); -} - -// method: drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance: -_MTL_INLINE void MTL::RenderCommandEncoder::drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_instanceCount_baseInstance_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, instanceCount, baseInstance); -} - -// method: drawPatches:patchIndexBuffer:patchIndexBufferOffset:indirectBuffer:indirectBufferOffset: -_MTL_INLINE void MTL::RenderCommandEncoder::drawPatches(NS::UInteger numberOfPatchControlPoints, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPatches_patchIndexBuffer_patchIndexBufferOffset_indirectBuffer_indirectBufferOffset_), numberOfPatchControlPoints, patchIndexBuffer, patchIndexBufferOffset, indirectBuffer, indirectBufferOffset); -} - -// method: drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance: -_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_instanceCount_baseInstance_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, controlPointIndexBuffer, controlPointIndexBufferOffset, instanceCount, baseInstance); -} - -// method: drawIndexedPatches:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:indirectBuffer:indirectBufferOffset: -_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPatches_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_indirectBuffer_indirectBufferOffset_), numberOfPatchControlPoints, patchIndexBuffer, patchIndexBufferOffset, controlPointIndexBuffer, controlPointIndexBufferOffset, indirectBuffer, indirectBufferOffset); -} - -// property: tileWidth -_MTL_INLINE NS::UInteger MTL::RenderCommandEncoder::tileWidth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileWidth)); -} - -// property: tileHeight -_MTL_INLINE NS::UInteger MTL::RenderCommandEncoder::tileHeight() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileHeight)); -} - -// method: setTileBytes:length:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileBytes(const void* bytes, NS::UInteger length, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBytes_length_atIndex_), bytes, length, index); -} - -// method: setTileBuffer:offset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBuffer_offset_atIndex_), buffer, offset, index); -} - -// method: setTileBufferOffset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileBufferOffset(NS::UInteger offset, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBufferOffset_atIndex_), offset, index); -} - -// method: setTileBuffers:offsets:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBuffers_offsets_withRange_), buffers, offsets, range); -} - -// method: setTileTexture:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileTexture(const MTL::Texture* texture, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileTexture_atIndex_), texture, index); -} - -// method: setTileTextures:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileTextures(const MTL::Texture* const textures[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileTextures_withRange_), textures, range); -} - -// method: setTileSamplerState:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerState_atIndex_), sampler, index); -} - -// method: setTileSamplerStates:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerStates_withRange_), samplers, range); -} - -// method: setTileSamplerState:lodMinClamp:lodMaxClamp:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); -} - -// method: setTileSamplerStates:lodMinClamps:lodMaxClamps:withRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); -} - -// method: setTileVisibleFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); -} - -// method: setTileVisibleFunctionTables:withBufferRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileVisibleFunctionTables_withBufferRange_), functionTables, range); -} - -// method: setTileIntersectionFunctionTable:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); -} - -// method: setTileIntersectionFunctionTables:withBufferRange: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); -} - -// method: setTileAccelerationStructure:atBufferIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setTileAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); -} - -// method: dispatchThreadsPerTile: _MTL_INLINE void MTL::RenderCommandEncoder::dispatchThreadsPerTile(MTL::Size threadsPerTile) { Object::sendMessage(this, _MTL_PRIVATE_SEL(dispatchThreadsPerTile_), threadsPerTile); } -// method: setThreadgroupMemoryLength:offset:atIndex: -_MTL_INLINE void MTL::RenderCommandEncoder::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger offset, NS::UInteger index) +_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_offset_atIndex_), length, offset, index); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_instanceCount_baseInstance_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, controlPointIndexBuffer, controlPointIndexBufferOffset, instanceCount, baseInstance); } -// method: useResource:usage: -_MTL_INLINE void MTL::RenderCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage) +_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPatches(NS::UInteger numberOfPatchControlPoints, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* controlPointIndexBuffer, NS::UInteger controlPointIndexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_), resource, usage); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPatches_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_indirectBuffer_indirectBufferOffset_), numberOfPatchControlPoints, patchIndexBuffer, patchIndexBufferOffset, controlPointIndexBuffer, controlPointIndexBufferOffset, indirectBuffer, indirectBufferOffset); } -// method: useResources:count:usage: -_MTL_INLINE void MTL::RenderCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage) +_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_), resources, count, usage); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset, instanceCount); } -// method: useResource:usage:stages: -_MTL_INLINE void MTL::RenderCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage, MTL::RenderStages stages) +_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_stages_), resource, usage, stages); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset); } -// method: useResources:count:usage:stages: -_MTL_INLINE void MTL::RenderCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage, MTL::RenderStages stages) +_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger indexCount, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, NS::UInteger instanceCount, NS::Integer baseVertex, NS::UInteger baseInstance) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_stages_), resources, count, usage, stages); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_baseVertex_baseInstance_), primitiveType, indexCount, indexType, indexBuffer, indexBufferOffset, instanceCount, baseVertex, baseInstance); } -// method: useHeap: -_MTL_INLINE void MTL::RenderCommandEncoder::useHeap(const MTL::Heap* heap) +_MTL_INLINE void MTL::RenderCommandEncoder::drawIndexedPrimitives(MTL::PrimitiveType primitiveType, MTL::IndexType indexType, const MTL::Buffer* indexBuffer, NS::UInteger indexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_), heap); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawIndexedPrimitives_indexType_indexBuffer_indexBufferOffset_indirectBuffer_indirectBufferOffset_), primitiveType, indexType, indexBuffer, indexBufferOffset, indirectBuffer, indirectBufferOffset); } -// method: useHeaps:count: -_MTL_INLINE void MTL::RenderCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count) +_MTL_INLINE void MTL::RenderCommandEncoder::drawMeshThreadgroups(MTL::Size threadgroupsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_), heaps, count); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroups_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadgroupsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); } -// method: useHeap:stages: -_MTL_INLINE void MTL::RenderCommandEncoder::useHeap(const MTL::Heap* heap, MTL::RenderStages stages) +_MTL_INLINE void MTL::RenderCommandEncoder::drawMeshThreadgroups(const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_stages_), heap, stages); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), indirectBuffer, indirectBufferOffset, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); } -// method: useHeaps:count:stages: -_MTL_INLINE void MTL::RenderCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count, MTL::RenderStages stages) +_MTL_INLINE void MTL::RenderCommandEncoder::drawMeshThreads(MTL::Size threadsPerGrid, MTL::Size threadsPerObjectThreadgroup, MTL::Size threadsPerMeshThreadgroup) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_stages_), heaps, count, stages); + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawMeshThreads_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup_), threadsPerGrid, threadsPerObjectThreadgroup, threadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::drawPatches(NS::UInteger numberOfPatchControlPoints, NS::UInteger patchStart, NS::UInteger patchCount, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, NS::UInteger instanceCount, NS::UInteger baseInstance) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_instanceCount_baseInstance_), numberOfPatchControlPoints, patchStart, patchCount, patchIndexBuffer, patchIndexBufferOffset, instanceCount, baseInstance); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::drawPatches(NS::UInteger numberOfPatchControlPoints, const MTL::Buffer* patchIndexBuffer, NS::UInteger patchIndexBufferOffset, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPatches_patchIndexBuffer_patchIndexBufferOffset_indirectBuffer_indirectBufferOffset_), numberOfPatchControlPoints, patchIndexBuffer, patchIndexBufferOffset, indirectBuffer, indirectBufferOffset); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_), primitiveType, vertexStart, vertexCount, instanceCount); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_), primitiveType, vertexStart, vertexCount); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, NS::UInteger vertexStart, NS::UInteger vertexCount, NS::UInteger instanceCount, NS::UInteger baseInstance) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_vertexStart_vertexCount_instanceCount_baseInstance_), primitiveType, vertexStart, vertexCount, instanceCount, baseInstance); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::drawPrimitives(MTL::PrimitiveType primitiveType, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(drawPrimitives_indirectBuffer_indirectBufferOffset_), primitiveType, indirectBuffer, indirectBufferOffset); } -// method: executeCommandsInBuffer:withRange: _MTL_INLINE void MTL::RenderCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::Range executionRange) { Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_withRange_), indirectCommandBuffer, executionRange); } -// method: executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: _MTL_INLINE void MTL::RenderCommandEncoder::executeCommandsInBuffer(const MTL::IndirectCommandBuffer* indirectCommandbuffer, const MTL::Buffer* indirectRangeBuffer, NS::UInteger indirectBufferOffset) { Object::sendMessage(this, _MTL_PRIVATE_SEL(executeCommandsInBuffer_indirectBuffer_indirectBufferOffset_), indirectCommandbuffer, indirectRangeBuffer, indirectBufferOffset); } -// method: memoryBarrierWithScope:afterStages:beforeStages: _MTL_INLINE void MTL::RenderCommandEncoder::memoryBarrier(MTL::BarrierScope scope, MTL::RenderStages after, MTL::RenderStages before) { Object::sendMessage(this, _MTL_PRIVATE_SEL(memoryBarrierWithScope_afterStages_beforeStages_), scope, after, before); } -// method: memoryBarrierWithResources:count:afterStages:beforeStages: _MTL_INLINE void MTL::RenderCommandEncoder::memoryBarrier(const MTL::Resource* const resources[], NS::UInteger count, MTL::RenderStages after, MTL::RenderStages before) { Object::sendMessage(this, _MTL_PRIVATE_SEL(memoryBarrierWithResources_count_afterStages_beforeStages_), resources, count, after, before); } -// method: sampleCountersInBuffer:atSampleIndex:withBarrier: _MTL_INLINE void MTL::RenderCommandEncoder::sampleCountersInBuffer(const MTL::CounterSampleBuffer* sampleBuffer, NS::UInteger sampleIndex, bool barrier) { Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCountersInBuffer_atSampleIndex_withBarrier_), sampleBuffer, sampleIndex, barrier); } + +_MTL_INLINE void MTL::RenderCommandEncoder::setBlendColor(float red, float green, float blue, float alpha) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBlendColorRed_green_blue_alpha_), red, green, blue, alpha); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setColorAttachmentMap(const MTL::LogicalToPhysicalColorAttachmentMap* mapping) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorAttachmentMap_), mapping); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setColorStoreAction(MTL::StoreAction storeAction, NS::UInteger colorAttachmentIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreAction_atIndex_), storeAction, colorAttachmentIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setColorStoreActionOptions(MTL::StoreActionOptions storeActionOptions, NS::UInteger colorAttachmentIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setColorStoreActionOptions_atIndex_), storeActionOptions, colorAttachmentIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setCullMode(MTL::CullMode cullMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCullMode_), cullMode); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setDepthBias(float depthBias, float slopeScale, float clamp) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthBias_slopeScale_clamp_), depthBias, slopeScale, clamp); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setDepthClipMode(MTL::DepthClipMode depthClipMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthClipMode_), depthClipMode); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setDepthStencilState(const MTL::DepthStencilState* depthStencilState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStencilState_), depthStencilState); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setDepthStoreAction(MTL::StoreAction storeAction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreAction_), storeAction); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setDepthStoreActionOptions(MTL::StoreActionOptions storeActionOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthStoreActionOptions_), storeActionOptions); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setDepthTestBounds(float minBound, float maxBound) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthTestMinBound_maxBound_), minBound, maxBound); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBufferOffset(NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBufferOffset_atIndex_), offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentBytes(const void* bytes, NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentBytes_length_atIndex_), bytes, length, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerState_atIndex_), sampler, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerStates_withRange_), samplers, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentTexture(const MTL::Texture* texture, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentTexture_atIndex_), texture, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentTextures(const MTL::Texture* const textures[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentTextures_withRange_), textures, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFragmentVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentVisibleFunctionTables_withBufferRange_), functionTables, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setFrontFacingWinding(MTL::Winding frontFacingWinding) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFrontFacingWinding_), frontFacingWinding); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBufferOffset(NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBufferOffset_atIndex_), offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshBytes(const void* bytes, NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshBytes_length_atIndex_), bytes, length, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerState_atIndex_), sampler, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerStates_withRange_), samplers, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshSamplerStates(const MTL::SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshTexture(const MTL::Texture* texture, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshTexture_atIndex_), texture, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setMeshTextures(const MTL::Texture* const textures[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshTextures_withRange_), textures, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBufferOffset(NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBufferOffset_atIndex_), offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectBytes(const void* bytes, NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectBytes_length_atIndex_), bytes, length, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerState_atIndex_), sampler, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerStates_withRange_), samplers, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectSamplerStates(const MTL::SamplerState* const samplers[], const float* lodMinClamps, const float* lodMaxClamps, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectTexture(const MTL::Texture* texture, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectTexture_atIndex_), texture, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectTextures(const MTL::Texture* const textures[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectTextures_withRange_), textures, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setObjectThreadgroupMemoryLength(NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupMemoryLength_atIndex_), length, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setRenderPipelineState(const MTL::RenderPipelineState* pipelineState) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderPipelineState_), pipelineState); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setScissorRect(MTL::ScissorRect rect) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setScissorRect_), rect); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setScissorRects(const MTL::ScissorRect* scissorRects, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setScissorRects_count_), scissorRects, count); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setStencilReferenceValue(uint32_t referenceValue) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilReferenceValue_), referenceValue); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setStencilReferenceValues(uint32_t frontReferenceValue, uint32_t backReferenceValue) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilFrontReferenceValue_backReferenceValue_), frontReferenceValue, backReferenceValue); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setStencilStoreAction(MTL::StoreAction storeAction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreAction_), storeAction); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setStencilStoreActionOptions(MTL::StoreActionOptions storeActionOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilStoreActionOptions_), storeActionOptions); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTessellationFactorBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger instanceStride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorBuffer_offset_instanceStride_), buffer, offset, instanceStride); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTessellationFactorScale(float scale) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorScale_), scale); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setThreadgroupMemoryLength(NS::UInteger length, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_offset_atIndex_), length, offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileBufferOffset(NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBufferOffset_atIndex_), offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileBytes(const void* bytes, NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileBytes_length_atIndex_), bytes, length, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerState_atIndex_), sampler, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerStates_withRange_), samplers, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileTexture(const MTL::Texture* texture, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileTexture_atIndex_), texture, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileTextures(const MTL::Texture* const textures[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileTextures_withRange_), textures, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTileVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileVisibleFunctionTables_withBufferRange_), functionTables, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setTriangleFillMode(MTL::TriangleFillMode fillMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTriangleFillMode_), fillMode); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAccelerationStructure_atBufferIndex_), accelerationStructure, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexAmplificationCount(NS::UInteger count, const MTL::VertexAmplificationViewMapping* viewMappings) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAmplificationCount_viewMappings_), count, viewMappings); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_offset_atIndex_), buffer, offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffer_offset_attributeStride_atIndex_), buffer, offset, stride, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBufferOffset(NS::UInteger offset, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBufferOffset_atIndex_), offset, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBufferOffset(NS::UInteger offset, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBufferOffset_attributeStride_atIndex_), offset, stride, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBuffers(const MTL::Buffer* const buffers[], const NS::UInteger offsets[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffers_offsets_withRange_), buffers, offsets, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBuffers(const MTL::Buffer* const buffers[], const NS::UInteger* offsets, const NS::UInteger* strides, NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBuffers_offsets_attributeStrides_withRange_), buffers, offsets, strides, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBytes(const void* bytes, NS::UInteger length, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBytes_length_atIndex_), bytes, length, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexBytes(const void* bytes, NS::UInteger length, NS::UInteger stride, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexBytes_length_attributeStride_atIndex_), bytes, length, stride, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexIntersectionFunctionTable_atBufferIndex_), intersectionFunctionTable, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexIntersectionFunctionTables(const MTL::IntersectionFunctionTable* const intersectionFunctionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexIntersectionFunctionTables_withBufferRange_), intersectionFunctionTables, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerState(const MTL::SamplerState* sampler, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerState_atIndex_), sampler, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerState(const MTL::SamplerState* sampler, float lodMinClamp, float lodMaxClamp, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerState_lodMinClamp_lodMaxClamp_atIndex_), sampler, lodMinClamp, lodMaxClamp, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerStates(const MTL::SamplerState* const samplers[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerStates_withRange_), samplers, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexSamplerStates(const MTL::SamplerState* const samplers[], const float lodMinClamps[], const float lodMaxClamps[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexSamplerStates_lodMinClamps_lodMaxClamps_withRange_), samplers, lodMinClamps, lodMaxClamps, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexTexture(const MTL::Texture* texture, NS::UInteger index) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexTexture_atIndex_), texture, index); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexTextures(const MTL::Texture* const textures[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexTextures_withRange_), textures, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVertexVisibleFunctionTables(const MTL::VisibleFunctionTable* const functionTables[], NS::Range range) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexVisibleFunctionTables_withBufferRange_), functionTables, range); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setViewport(MTL::Viewport viewport) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setViewport_), viewport); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setViewports(const MTL::Viewport* viewports, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setViewports_count_), viewports, count); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::setVisibilityResultMode(MTL::VisibilityResultMode mode, NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultMode_offset_), mode, offset); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::textureBarrier() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(textureBarrier)); +} + +_MTL_INLINE NS::UInteger MTL::RenderCommandEncoder::tileHeight() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileHeight)); +} + +_MTL_INLINE NS::UInteger MTL::RenderCommandEncoder::tileWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileWidth)); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::updateFence(const MTL::Fence* fence, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_afterStages_), fence, stages); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useHeap(const MTL::Heap* heap) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_), heap); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useHeap(const MTL::Heap* heap, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeap_stages_), heap, stages); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_), heaps, count); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useHeaps(const MTL::Heap* const heaps[], NS::UInteger count, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useHeaps_count_stages_), heaps, count, stages); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_), resource, usage); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useResource(const MTL::Resource* resource, MTL::ResourceUsage usage, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResource_usage_stages_), resource, usage, stages); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_), resources, count, usage); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::useResources(const MTL::Resource* const resources[], NS::UInteger count, MTL::ResourceUsage usage, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(useResources_count_usage_stages_), resources, count, usage, stages); +} + +_MTL_INLINE void MTL::RenderCommandEncoder::waitForFence(const MTL::Fence* fence, MTL::RenderStages stages) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_beforeStages_), fence, stages); +} diff --git a/vendor/metal-cpp/Metal/MTLRenderPass.hpp b/vendor/metal-cpp/Metal/MTLRenderPass.hpp index 087b4467c..ed2172d73 100644 --- a/vendor/metal-cpp/Metal/MTLRenderPass.hpp +++ b/vendor/metal-cpp/Metal/MTLRenderPass.hpp @@ -2,7 +2,7 @@ // // Metal/MTLRenderPass.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,30 +20,27 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLRenderPass.hpp" +#include namespace MTL { -struct ClearColor -{ - static ClearColor Make(double red, double green, double blue, double alpha); - - ClearColor() = default; - - ClearColor(double red, double green, double blue, double alpha); - - double red; - double green; - double blue; - double alpha; -} _MTL_PACKED; - +class Buffer; +class CounterSampleBuffer; +class RasterizationRateMap; +class RenderPassAttachmentDescriptor; +class RenderPassColorAttachmentDescriptor; +class RenderPassColorAttachmentDescriptorArray; +class RenderPassDepthAttachmentDescriptor; +class RenderPassDescriptor; +class RenderPassSampleBufferAttachmentDescriptor; +class RenderPassSampleBufferAttachmentDescriptorArray; +class RenderPassStencilAttachmentDescriptor; +struct SamplePosition; +class Texture; _MTL_ENUM(NS::UInteger, LoadAction) { LoadActionDontCare = 0, LoadActionLoad = 1, @@ -59,62 +56,9 @@ _MTL_ENUM(NS::UInteger, StoreAction) { StoreActionCustomSampleDepthStore = 5, }; -_MTL_OPTIONS(NS::UInteger, StoreActionOptions) { - StoreActionOptionNone = 0, - StoreActionOptionValidMask = 1, - StoreActionOptionCustomSamplePositions = 1, -}; - -class RenderPassAttachmentDescriptor : public NS::Copying -{ -public: - static class RenderPassAttachmentDescriptor* alloc(); - - class RenderPassAttachmentDescriptor* init(); - - class Texture* texture() const; - void setTexture(const class Texture* texture); - - NS::UInteger level() const; - void setLevel(NS::UInteger level); - - NS::UInteger slice() const; - void setSlice(NS::UInteger slice); - - NS::UInteger depthPlane() const; - void setDepthPlane(NS::UInteger depthPlane); - - class Texture* resolveTexture() const; - void setResolveTexture(const class Texture* resolveTexture); - - NS::UInteger resolveLevel() const; - void setResolveLevel(NS::UInteger resolveLevel); - - NS::UInteger resolveSlice() const; - void setResolveSlice(NS::UInteger resolveSlice); - - NS::UInteger resolveDepthPlane() const; - void setResolveDepthPlane(NS::UInteger resolveDepthPlane); - - MTL::LoadAction loadAction() const; - void setLoadAction(MTL::LoadAction loadAction); - - MTL::StoreAction storeAction() const; - void setStoreAction(MTL::StoreAction storeAction); - - MTL::StoreActionOptions storeActionOptions() const; - void setStoreActionOptions(MTL::StoreActionOptions storeActionOptions); -}; - -class RenderPassColorAttachmentDescriptor : public NS::Copying -{ -public: - static class RenderPassColorAttachmentDescriptor* alloc(); - - class RenderPassColorAttachmentDescriptor* init(); - - MTL::ClearColor clearColor() const; - void setClearColor(MTL::ClearColor clearColor); +_MTL_ENUM(NS::Integer, VisibilityResultType) { + VisibilityResultTypeReset = 0, + VisibilityResultTypeAccumulate = 1, }; _MTL_ENUM(NS::UInteger, MultisampleDepthResolveFilter) { @@ -123,140 +67,248 @@ _MTL_ENUM(NS::UInteger, MultisampleDepthResolveFilter) { MultisampleDepthResolveFilterMax = 2, }; -class RenderPassDepthAttachmentDescriptor : public NS::Copying -{ -public: - static class RenderPassDepthAttachmentDescriptor* alloc(); - - class RenderPassDepthAttachmentDescriptor* init(); - - double clearDepth() const; - void setClearDepth(double clearDepth); - - MTL::MultisampleDepthResolveFilter depthResolveFilter() const; - void setDepthResolveFilter(MTL::MultisampleDepthResolveFilter depthResolveFilter); -}; - _MTL_ENUM(NS::UInteger, MultisampleStencilResolveFilter) { MultisampleStencilResolveFilterSample0 = 0, MultisampleStencilResolveFilterDepthResolvedSample = 1, }; -class RenderPassStencilAttachmentDescriptor : public NS::Copying -{ -public: - static class RenderPassStencilAttachmentDescriptor* alloc(); - - class RenderPassStencilAttachmentDescriptor* init(); - - uint32_t clearStencil() const; - void setClearStencil(uint32_t clearStencil); - - MTL::MultisampleStencilResolveFilter stencilResolveFilter() const; - void setStencilResolveFilter(MTL::MultisampleStencilResolveFilter stencilResolveFilter); +_MTL_OPTIONS(NS::UInteger, StoreActionOptions) { + StoreActionOptionNone = 0, + StoreActionOptionCustomSamplePositions = 1, + StoreActionOptionValidMask = 1, }; +struct ClearColor +{ + ClearColor() = default; + + ClearColor(double red, double green, double blue, double alpha); + + static ClearColor Make(double red, double green, double blue, double alpha); + + double red; + double green; + double blue; + double alpha; +} _MTL_PACKED; + +class RenderPassAttachmentDescriptor : public NS::Copying +{ +public: + static RenderPassAttachmentDescriptor* alloc(); + + NS::UInteger depthPlane() const; + + RenderPassAttachmentDescriptor* init(); + + NS::UInteger level() const; + + LoadAction loadAction() const; + + NS::UInteger resolveDepthPlane() const; + + NS::UInteger resolveLevel() const; + + NS::UInteger resolveSlice() const; + + Texture* resolveTexture() const; + + void setDepthPlane(NS::UInteger depthPlane); + + void setLevel(NS::UInteger level); + + void setLoadAction(MTL::LoadAction loadAction); + + void setResolveDepthPlane(NS::UInteger resolveDepthPlane); + + void setResolveLevel(NS::UInteger resolveLevel); + + void setResolveSlice(NS::UInteger resolveSlice); + + void setResolveTexture(const MTL::Texture* resolveTexture); + + void setSlice(NS::UInteger slice); + + void setStoreAction(MTL::StoreAction storeAction); + void setStoreActionOptions(MTL::StoreActionOptions storeActionOptions); + + void setTexture(const MTL::Texture* texture); + + NS::UInteger slice() const; + + StoreAction storeAction() const; + StoreActionOptions storeActionOptions() const; + + Texture* texture() const; +}; +class RenderPassColorAttachmentDescriptor : public NS::Copying +{ +public: + static RenderPassColorAttachmentDescriptor* alloc(); + + ClearColor clearColor() const; + + RenderPassColorAttachmentDescriptor* init(); + + void setClearColor(MTL::ClearColor clearColor); +}; +class RenderPassDepthAttachmentDescriptor : public NS::Copying +{ +public: + static RenderPassDepthAttachmentDescriptor* alloc(); + + double clearDepth() const; + + MultisampleDepthResolveFilter depthResolveFilter() const; + + RenderPassDepthAttachmentDescriptor* init(); + + void setClearDepth(double clearDepth); + + void setDepthResolveFilter(MTL::MultisampleDepthResolveFilter depthResolveFilter); +}; +class RenderPassStencilAttachmentDescriptor : public NS::Copying +{ +public: + static RenderPassStencilAttachmentDescriptor* alloc(); + + uint32_t clearStencil() const; + + RenderPassStencilAttachmentDescriptor* init(); + + void setClearStencil(uint32_t clearStencil); + + void setStencilResolveFilter(MTL::MultisampleStencilResolveFilter stencilResolveFilter); + MultisampleStencilResolveFilter stencilResolveFilter() const; +}; class RenderPassColorAttachmentDescriptorArray : public NS::Referencing { public: - static class RenderPassColorAttachmentDescriptorArray* alloc(); + static RenderPassColorAttachmentDescriptorArray* alloc(); - class RenderPassColorAttachmentDescriptorArray* init(); + RenderPassColorAttachmentDescriptorArray* init(); - class RenderPassColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class RenderPassColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + RenderPassColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::RenderPassColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class RenderPassSampleBufferAttachmentDescriptor : public NS::Copying { public: - static class RenderPassSampleBufferAttachmentDescriptor* alloc(); + static RenderPassSampleBufferAttachmentDescriptor* alloc(); - class RenderPassSampleBufferAttachmentDescriptor* init(); + NS::UInteger endOfFragmentSampleIndex() const; - class CounterSampleBuffer* sampleBuffer() const; - void setSampleBuffer(const class CounterSampleBuffer* sampleBuffer); + NS::UInteger endOfVertexSampleIndex() const; - NS::UInteger startOfVertexSampleIndex() const; - void setStartOfVertexSampleIndex(NS::UInteger startOfVertexSampleIndex); + RenderPassSampleBufferAttachmentDescriptor* init(); - NS::UInteger endOfVertexSampleIndex() const; - void setEndOfVertexSampleIndex(NS::UInteger endOfVertexSampleIndex); + CounterSampleBuffer* sampleBuffer() const; - NS::UInteger startOfFragmentSampleIndex() const; - void setStartOfFragmentSampleIndex(NS::UInteger startOfFragmentSampleIndex); + void setEndOfFragmentSampleIndex(NS::UInteger endOfFragmentSampleIndex); - NS::UInteger endOfFragmentSampleIndex() const; - void setEndOfFragmentSampleIndex(NS::UInteger endOfFragmentSampleIndex); + void setEndOfVertexSampleIndex(NS::UInteger endOfVertexSampleIndex); + + void setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer); + + void setStartOfFragmentSampleIndex(NS::UInteger startOfFragmentSampleIndex); + + void setStartOfVertexSampleIndex(NS::UInteger startOfVertexSampleIndex); + + NS::UInteger startOfFragmentSampleIndex() const; + + NS::UInteger startOfVertexSampleIndex() const; }; - class RenderPassSampleBufferAttachmentDescriptorArray : public NS::Referencing { public: - static class RenderPassSampleBufferAttachmentDescriptorArray* alloc(); + static RenderPassSampleBufferAttachmentDescriptorArray* alloc(); - class RenderPassSampleBufferAttachmentDescriptorArray* init(); + RenderPassSampleBufferAttachmentDescriptorArray* init(); - class RenderPassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class RenderPassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + RenderPassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::RenderPassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class RenderPassDescriptor : public NS::Copying { public: - static class RenderPassDescriptor* alloc(); + static RenderPassDescriptor* alloc(); - class RenderPassDescriptor* init(); + RenderPassColorAttachmentDescriptorArray* colorAttachments() const; - static class RenderPassDescriptor* renderPassDescriptor(); + NS::UInteger defaultRasterSampleCount() const; - class RenderPassColorAttachmentDescriptorArray* colorAttachments() const; + RenderPassDepthAttachmentDescriptor* depthAttachment() const; - class RenderPassDepthAttachmentDescriptor* depthAttachment() const; - void setDepthAttachment(const class RenderPassDepthAttachmentDescriptor* depthAttachment); + NS::UInteger getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count); - class RenderPassStencilAttachmentDescriptor* stencilAttachment() const; - void setStencilAttachment(const class RenderPassStencilAttachmentDescriptor* stencilAttachment); + NS::UInteger imageblockSampleLength() const; - class Buffer* visibilityResultBuffer() const; - void setVisibilityResultBuffer(const class Buffer* visibilityResultBuffer); + RenderPassDescriptor* init(); - NS::UInteger renderTargetArrayLength() const; - void setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength); + RasterizationRateMap* rasterizationRateMap() const; - NS::UInteger imageblockSampleLength() const; - void setImageblockSampleLength(NS::UInteger imageblockSampleLength); + static RenderPassDescriptor* renderPassDescriptor(); - NS::UInteger threadgroupMemoryLength() const; - void setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength); + NS::UInteger renderTargetArrayLength() const; - NS::UInteger tileWidth() const; - void setTileWidth(NS::UInteger tileWidth); + NS::UInteger renderTargetHeight() const; - NS::UInteger tileHeight() const; - void setTileHeight(NS::UInteger tileHeight); + NS::UInteger renderTargetWidth() const; - NS::UInteger defaultRasterSampleCount() const; - void setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount); + RenderPassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; - NS::UInteger renderTargetWidth() const; - void setRenderTargetWidth(NS::UInteger renderTargetWidth); + void setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount); - NS::UInteger renderTargetHeight() const; - void setRenderTargetHeight(NS::UInteger renderTargetHeight); + void setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment); - void setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count); + void setImageblockSampleLength(NS::UInteger imageblockSampleLength); - NS::UInteger getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count); + void setRasterizationRateMap(const MTL::RasterizationRateMap* rasterizationRateMap); - class RasterizationRateMap* rasterizationRateMap() const; - void setRasterizationRateMap(const class RasterizationRateMap* rasterizationRateMap); + void setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength); - class RenderPassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; + void setRenderTargetHeight(NS::UInteger renderTargetHeight); + + void setRenderTargetWidth(NS::UInteger renderTargetWidth); + + void setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count); + + void setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment); + + void setSupportColorAttachmentMapping(bool supportColorAttachmentMapping); + + void setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength); + + void setTileHeight(NS::UInteger tileHeight); + + void setTileWidth(NS::UInteger tileWidth); + + void setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer); + + void setVisibilityResultType(MTL::VisibilityResultType visibilityResultType); + + RenderPassStencilAttachmentDescriptor* stencilAttachment() const; + + bool supportColorAttachmentMapping() const; + + NS::UInteger threadgroupMemoryLength() const; + + NS::UInteger tileHeight() const; + + NS::UInteger tileWidth() const; + + Buffer* visibilityResultBuffer() const; + + VisibilityResultType visibilityResultType() const; }; +} +_MTL_INLINE MTL::ClearColor::ClearColor(double red, double green, double blue, double alpha) + : red(red) + , green(green) + , blue(blue) + , alpha(alpha) +{ } _MTL_INLINE MTL::ClearColor MTL::ClearColor::Make(double red, double green, double blue, double alpha) @@ -264,63 +316,49 @@ _MTL_INLINE MTL::ClearColor MTL::ClearColor::Make(double red, double green, doub return ClearColor(red, green, blue, alpha); } -_MTL_INLINE MTL::ClearColor::ClearColor(double _red, double _green, double _blue, double _alpha) - : red(_red) - , green(_green) - , blue(_blue) - , alpha(_alpha) -{ -} - -// static method: alloc _MTL_INLINE MTL::RenderPassAttachmentDescriptor* MTL::RenderPassAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassAttachmentDescriptor)); } -// method: init +_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::depthPlane() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthPlane)); +} + _MTL_INLINE MTL::RenderPassAttachmentDescriptor* MTL::RenderPassAttachmentDescriptor::init() { return NS::Object::init(); } -// property: texture -_MTL_INLINE MTL::Texture* MTL::RenderPassAttachmentDescriptor::texture() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(texture)); -} - -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setTexture(const MTL::Texture* texture) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_), texture); -} - -// property: level _MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::level() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(level)); } -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setLevel(NS::UInteger level) +_MTL_INLINE MTL::LoadAction MTL::RenderPassAttachmentDescriptor::loadAction() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLevel_), level); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(loadAction)); } -// property: slice -_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::slice() const +_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::resolveDepthPlane() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(slice)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveDepthPlane)); } -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setSlice(NS::UInteger slice) +_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::resolveLevel() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSlice_), slice); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveLevel)); } -// property: depthPlane -_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::depthPlane() const +_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::resolveSlice() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthPlane)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveSlice)); +} + +_MTL_INLINE MTL::Texture* MTL::RenderPassAttachmentDescriptor::resolveTexture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveTexture)); } _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setDepthPlane(NS::UInteger depthPlane) @@ -328,54 +366,9 @@ _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setDepthPlane(NS::UInteger Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthPlane_), depthPlane); } -// property: resolveTexture -_MTL_INLINE MTL::Texture* MTL::RenderPassAttachmentDescriptor::resolveTexture() const +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setLevel(NS::UInteger level) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveTexture)); -} - -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveTexture(const MTL::Texture* resolveTexture) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveTexture_), resolveTexture); -} - -// property: resolveLevel -_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::resolveLevel() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveLevel)); -} - -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveLevel(NS::UInteger resolveLevel) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveLevel_), resolveLevel); -} - -// property: resolveSlice -_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::resolveSlice() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveSlice)); -} - -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveSlice(NS::UInteger resolveSlice) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveSlice_), resolveSlice); -} - -// property: resolveDepthPlane -_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::resolveDepthPlane() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resolveDepthPlane)); -} - -_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveDepthPlane(NS::UInteger resolveDepthPlane) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveDepthPlane_), resolveDepthPlane); -} - -// property: loadAction -_MTL_INLINE MTL::LoadAction MTL::RenderPassAttachmentDescriptor::loadAction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(loadAction)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLevel_), level); } _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setLoadAction(MTL::LoadAction loadAction) @@ -383,10 +376,29 @@ _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setLoadAction(MTL::LoadAct Object::sendMessage(this, _MTL_PRIVATE_SEL(setLoadAction_), loadAction); } -// property: storeAction -_MTL_INLINE MTL::StoreAction MTL::RenderPassAttachmentDescriptor::storeAction() const +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveDepthPlane(NS::UInteger resolveDepthPlane) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storeAction)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveDepthPlane_), resolveDepthPlane); +} + +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveLevel(NS::UInteger resolveLevel) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveLevel_), resolveLevel); +} + +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveSlice(NS::UInteger resolveSlice) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveSlice_), resolveSlice); +} + +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setResolveTexture(const MTL::Texture* resolveTexture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResolveTexture_), resolveTexture); +} + +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setSlice(NS::UInteger slice) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSlice_), slice); } _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setStoreAction(MTL::StoreAction storeAction) @@ -394,192 +406,159 @@ _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setStoreAction(MTL::StoreA Object::sendMessage(this, _MTL_PRIVATE_SEL(setStoreAction_), storeAction); } -// property: storeActionOptions -_MTL_INLINE MTL::StoreActionOptions MTL::RenderPassAttachmentDescriptor::storeActionOptions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storeActionOptions)); -} - _MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setStoreActionOptions(MTL::StoreActionOptions storeActionOptions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStoreActionOptions_), storeActionOptions); } -// static method: alloc +_MTL_INLINE void MTL::RenderPassAttachmentDescriptor::setTexture(const MTL::Texture* texture) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTexture_), texture); +} + +_MTL_INLINE NS::UInteger MTL::RenderPassAttachmentDescriptor::slice() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(slice)); +} + +_MTL_INLINE MTL::StoreAction MTL::RenderPassAttachmentDescriptor::storeAction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storeAction)); +} + +_MTL_INLINE MTL::StoreActionOptions MTL::RenderPassAttachmentDescriptor::storeActionOptions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storeActionOptions)); +} + +_MTL_INLINE MTL::Texture* MTL::RenderPassAttachmentDescriptor::texture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(texture)); +} + _MTL_INLINE MTL::RenderPassColorAttachmentDescriptor* MTL::RenderPassColorAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassColorAttachmentDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPassColorAttachmentDescriptor* MTL::RenderPassColorAttachmentDescriptor::init() -{ - return NS::Object::init(); -} - -// property: clearColor _MTL_INLINE MTL::ClearColor MTL::RenderPassColorAttachmentDescriptor::clearColor() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(clearColor)); } +_MTL_INLINE MTL::RenderPassColorAttachmentDescriptor* MTL::RenderPassColorAttachmentDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::RenderPassColorAttachmentDescriptor::setClearColor(MTL::ClearColor clearColor) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setClearColor_), clearColor); } -// static method: alloc _MTL_INLINE MTL::RenderPassDepthAttachmentDescriptor* MTL::RenderPassDepthAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassDepthAttachmentDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPassDepthAttachmentDescriptor* MTL::RenderPassDepthAttachmentDescriptor::init() -{ - return NS::Object::init(); -} - -// property: clearDepth _MTL_INLINE double MTL::RenderPassDepthAttachmentDescriptor::clearDepth() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(clearDepth)); } +_MTL_INLINE MTL::MultisampleDepthResolveFilter MTL::RenderPassDepthAttachmentDescriptor::depthResolveFilter() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthResolveFilter)); +} + +_MTL_INLINE MTL::RenderPassDepthAttachmentDescriptor* MTL::RenderPassDepthAttachmentDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::RenderPassDepthAttachmentDescriptor::setClearDepth(double clearDepth) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setClearDepth_), clearDepth); } -// property: depthResolveFilter -_MTL_INLINE MTL::MultisampleDepthResolveFilter MTL::RenderPassDepthAttachmentDescriptor::depthResolveFilter() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthResolveFilter)); -} - _MTL_INLINE void MTL::RenderPassDepthAttachmentDescriptor::setDepthResolveFilter(MTL::MultisampleDepthResolveFilter depthResolveFilter) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthResolveFilter_), depthResolveFilter); } -// static method: alloc _MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL::RenderPassStencilAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassStencilAttachmentDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL::RenderPassStencilAttachmentDescriptor::init() -{ - return NS::Object::init(); -} - -// property: clearStencil _MTL_INLINE uint32_t MTL::RenderPassStencilAttachmentDescriptor::clearStencil() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(clearStencil)); } +_MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL::RenderPassStencilAttachmentDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::RenderPassStencilAttachmentDescriptor::setClearStencil(uint32_t clearStencil) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setClearStencil_), clearStencil); } -// property: stencilResolveFilter -_MTL_INLINE MTL::MultisampleStencilResolveFilter MTL::RenderPassStencilAttachmentDescriptor::stencilResolveFilter() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilResolveFilter)); -} - _MTL_INLINE void MTL::RenderPassStencilAttachmentDescriptor::setStencilResolveFilter(MTL::MultisampleStencilResolveFilter stencilResolveFilter) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilResolveFilter_), stencilResolveFilter); } -// static method: alloc +_MTL_INLINE MTL::MultisampleStencilResolveFilter MTL::RenderPassStencilAttachmentDescriptor::stencilResolveFilter() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilResolveFilter)); +} + _MTL_INLINE MTL::RenderPassColorAttachmentDescriptorArray* MTL::RenderPassColorAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassColorAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::RenderPassColorAttachmentDescriptorArray* MTL::RenderPassColorAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::RenderPassColorAttachmentDescriptor* MTL::RenderPassColorAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::RenderPassColorAttachmentDescriptorArray::setObject(const MTL::RenderPassColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptor* MTL::RenderPassSampleBufferAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassSampleBufferAttachmentDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptor* MTL::RenderPassSampleBufferAttachmentDescriptor::init() +_MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::endOfFragmentSampleIndex() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfFragmentSampleIndex)); } -// property: sampleBuffer -_MTL_INLINE MTL::CounterSampleBuffer* MTL::RenderPassSampleBufferAttachmentDescriptor::sampleBuffer() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBuffer)); -} - -_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); -} - -// property: startOfVertexSampleIndex -_MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::startOfVertexSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfVertexSampleIndex)); -} - -_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setStartOfVertexSampleIndex(NS::UInteger startOfVertexSampleIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfVertexSampleIndex_), startOfVertexSampleIndex); -} - -// property: endOfVertexSampleIndex _MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::endOfVertexSampleIndex() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfVertexSampleIndex)); } -_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setEndOfVertexSampleIndex(NS::UInteger endOfVertexSampleIndex) +_MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptor* MTL::RenderPassSampleBufferAttachmentDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfVertexSampleIndex_), endOfVertexSampleIndex); + return NS::Object::init(); } -// property: startOfFragmentSampleIndex -_MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::startOfFragmentSampleIndex() const +_MTL_INLINE MTL::CounterSampleBuffer* MTL::RenderPassSampleBufferAttachmentDescriptor::sampleBuffer() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfFragmentSampleIndex)); -} - -_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setStartOfFragmentSampleIndex(NS::UInteger startOfFragmentSampleIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfFragmentSampleIndex_), startOfFragmentSampleIndex); -} - -// property: endOfFragmentSampleIndex -_MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::endOfFragmentSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfFragmentSampleIndex)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBuffer)); } _MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setEndOfFragmentSampleIndex(NS::UInteger endOfFragmentSampleIndex) @@ -587,146 +566,119 @@ _MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setEndOfFragme Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfFragmentSampleIndex_), endOfFragmentSampleIndex); } -// static method: alloc +_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setEndOfVertexSampleIndex(NS::UInteger endOfVertexSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfVertexSampleIndex_), endOfVertexSampleIndex); +} + +_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); +} + +_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setStartOfFragmentSampleIndex(NS::UInteger startOfFragmentSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfFragmentSampleIndex_), startOfFragmentSampleIndex); +} + +_MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptor::setStartOfVertexSampleIndex(NS::UInteger startOfVertexSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfVertexSampleIndex_), startOfVertexSampleIndex); +} + +_MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::startOfFragmentSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfFragmentSampleIndex)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPassSampleBufferAttachmentDescriptor::startOfVertexSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfVertexSampleIndex)); +} + _MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptorArray* MTL::RenderPassSampleBufferAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassSampleBufferAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptorArray* MTL::RenderPassSampleBufferAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptor* MTL::RenderPassSampleBufferAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::RenderPassSampleBufferAttachmentDescriptorArray::setObject(const MTL::RenderPassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::RenderPassDescriptor* MTL::RenderPassDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPassDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPassDescriptor* MTL::RenderPassDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: renderPassDescriptor -_MTL_INLINE MTL::RenderPassDescriptor* MTL::RenderPassDescriptor::renderPassDescriptor() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRenderPassDescriptor), _MTL_PRIVATE_SEL(renderPassDescriptor)); -} - -// property: colorAttachments _MTL_INLINE MTL::RenderPassColorAttachmentDescriptorArray* MTL::RenderPassDescriptor::colorAttachments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); } -// property: depthAttachment +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::defaultRasterSampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(defaultRasterSampleCount)); +} + _MTL_INLINE MTL::RenderPassDepthAttachmentDescriptor* MTL::RenderPassDescriptor::depthAttachment() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthAttachment)); } -_MTL_INLINE void MTL::RenderPassDescriptor::setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment) +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthAttachment_), depthAttachment); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(getSamplePositions_count_), positions, count); } -// property: stencilAttachment -_MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL::RenderPassDescriptor::stencilAttachment() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachment)); -} - -_MTL_INLINE void MTL::RenderPassDescriptor::setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilAttachment_), stencilAttachment); -} - -// property: visibilityResultBuffer -_MTL_INLINE MTL::Buffer* MTL::RenderPassDescriptor::visibilityResultBuffer() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(visibilityResultBuffer)); -} - -_MTL_INLINE void MTL::RenderPassDescriptor::setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultBuffer_), visibilityResultBuffer); -} - -// property: renderTargetArrayLength -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::renderTargetArrayLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetArrayLength)); -} - -_MTL_INLINE void MTL::RenderPassDescriptor::setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetArrayLength_), renderTargetArrayLength); -} - -// property: imageblockSampleLength _MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::imageblockSampleLength() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockSampleLength)); } -_MTL_INLINE void MTL::RenderPassDescriptor::setImageblockSampleLength(NS::UInteger imageblockSampleLength) +_MTL_INLINE MTL::RenderPassDescriptor* MTL::RenderPassDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockSampleLength_), imageblockSampleLength); + return NS::Object::init(); } -// property: threadgroupMemoryLength -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::threadgroupMemoryLength() const +_MTL_INLINE MTL::RasterizationRateMap* MTL::RenderPassDescriptor::rasterizationRateMap() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryLength)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterizationRateMap)); } -_MTL_INLINE void MTL::RenderPassDescriptor::setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength) +_MTL_INLINE MTL::RenderPassDescriptor* MTL::RenderPassDescriptor::renderPassDescriptor() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_), threadgroupMemoryLength); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLRenderPassDescriptor), _MTL_PRIVATE_SEL(renderPassDescriptor)); } -// property: tileWidth -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::tileWidth() const +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::renderTargetArrayLength() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileWidth)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetArrayLength)); } -_MTL_INLINE void MTL::RenderPassDescriptor::setTileWidth(NS::UInteger tileWidth) +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::renderTargetHeight() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileWidth_), tileWidth); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetHeight)); } -// property: tileHeight -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::tileHeight() const +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::renderTargetWidth() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileHeight)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetWidth)); } -_MTL_INLINE void MTL::RenderPassDescriptor::setTileHeight(NS::UInteger tileHeight) +_MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptorArray* MTL::RenderPassDescriptor::sampleBufferAttachments() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileHeight_), tileHeight); -} - -// property: defaultRasterSampleCount -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::defaultRasterSampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(defaultRasterSampleCount)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); } _MTL_INLINE void MTL::RenderPassDescriptor::setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount) @@ -734,44 +686,14 @@ _MTL_INLINE void MTL::RenderPassDescriptor::setDefaultRasterSampleCount(NS::UInt Object::sendMessage(this, _MTL_PRIVATE_SEL(setDefaultRasterSampleCount_), defaultRasterSampleCount); } -// property: renderTargetWidth -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::renderTargetWidth() const +_MTL_INLINE void MTL::RenderPassDescriptor::setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetWidth)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthAttachment_), depthAttachment); } -_MTL_INLINE void MTL::RenderPassDescriptor::setRenderTargetWidth(NS::UInteger renderTargetWidth) +_MTL_INLINE void MTL::RenderPassDescriptor::setImageblockSampleLength(NS::UInteger imageblockSampleLength) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetWidth_), renderTargetWidth); -} - -// property: renderTargetHeight -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::renderTargetHeight() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(renderTargetHeight)); -} - -_MTL_INLINE void MTL::RenderPassDescriptor::setRenderTargetHeight(NS::UInteger renderTargetHeight) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetHeight_), renderTargetHeight); -} - -// method: setSamplePositions:count: -_MTL_INLINE void MTL::RenderPassDescriptor::setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplePositions_count_), positions, count); -} - -// method: getSamplePositions:count: -_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(getSamplePositions_count_), positions, count); -} - -// property: rasterizationRateMap -_MTL_INLINE MTL::RasterizationRateMap* MTL::RenderPassDescriptor::rasterizationRateMap() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterizationRateMap)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setImageblockSampleLength_), imageblockSampleLength); } _MTL_INLINE void MTL::RenderPassDescriptor::setRasterizationRateMap(const MTL::RasterizationRateMap* rasterizationRateMap) @@ -779,8 +701,92 @@ _MTL_INLINE void MTL::RenderPassDescriptor::setRasterizationRateMap(const MTL::R Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationRateMap_), rasterizationRateMap); } -// property: sampleBufferAttachments -_MTL_INLINE MTL::RenderPassSampleBufferAttachmentDescriptorArray* MTL::RenderPassDescriptor::sampleBufferAttachments() const +_MTL_INLINE void MTL::RenderPassDescriptor::setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetArrayLength_), renderTargetArrayLength); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setRenderTargetHeight(NS::UInteger renderTargetHeight) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetHeight_), renderTargetHeight); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setRenderTargetWidth(NS::UInteger renderTargetWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRenderTargetWidth_), renderTargetWidth); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSamplePositions_count_), positions, count); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilAttachment_), stencilAttachment); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setSupportColorAttachmentMapping(bool supportColorAttachmentMapping) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportColorAttachmentMapping_), supportColorAttachmentMapping); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_), threadgroupMemoryLength); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setTileHeight(NS::UInteger tileHeight) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileHeight_), tileHeight); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setTileWidth(NS::UInteger tileWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileWidth_), tileWidth); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultBuffer_), visibilityResultBuffer); +} + +_MTL_INLINE void MTL::RenderPassDescriptor::setVisibilityResultType(MTL::VisibilityResultType visibilityResultType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVisibilityResultType_), visibilityResultType); +} + +_MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL::RenderPassDescriptor::stencilAttachment() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachment)); +} + +_MTL_INLINE bool MTL::RenderPassDescriptor::supportColorAttachmentMapping() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportColorAttachmentMapping)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::threadgroupMemoryLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupMemoryLength)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::tileHeight() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileHeight)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPassDescriptor::tileWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileWidth)); +} + +_MTL_INLINE MTL::Buffer* MTL::RenderPassDescriptor::visibilityResultBuffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(visibilityResultBuffer)); +} + +_MTL_INLINE MTL::VisibilityResultType MTL::RenderPassDescriptor::visibilityResultType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(visibilityResultType)); } diff --git a/vendor/metal-cpp/Metal/MTLRenderPipeline.hpp b/vendor/metal-cpp/Metal/MTLRenderPipeline.hpp index 69cdb73d2..aaa9cdad6 100644 --- a/vendor/metal-cpp/Metal/MTLRenderPipeline.hpp +++ b/vendor/metal-cpp/Metal/MTLRenderPipeline.hpp @@ -2,7 +2,7 @@ // // Metal/MTLRenderPipeline.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,17 +20,48 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLAllocation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" -#include "MTLPrivate.hpp" - -#include - +#include "MTLPipeline.hpp" #include "MTLPixelFormat.hpp" +#include "MTLPrivate.hpp" #include "MTLRenderCommandEncoder.hpp" -#include "MTLRenderPipeline.hpp" #include "MTLTypes.hpp" +namespace MTL +{ +class Device; +class Function; +class FunctionHandle; +class IntersectionFunctionTable; +class IntersectionFunctionTableDescriptor; +class LinkedFunctions; +class LogicalToPhysicalColorAttachmentMap; +class MeshRenderPipelineDescriptor; +class PipelineBufferDescriptorArray; +class RenderPipelineColorAttachmentDescriptor; +class RenderPipelineColorAttachmentDescriptorArray; +class RenderPipelineDescriptor; +class RenderPipelineFunctionsDescriptor; +class RenderPipelineReflection; +class RenderPipelineState; +class TileRenderPipelineColorAttachmentDescriptor; +class TileRenderPipelineColorAttachmentDescriptorArray; +class TileRenderPipelineDescriptor; +class VertexDescriptor; +class VisibleFunctionTable; +class VisibleFunctionTableDescriptor; + +} +namespace MTL4 +{ +class BinaryFunction; +class PipelineDescriptor; +class RenderPipelineBinaryFunctionsDescriptor; + +} namespace MTL { _MTL_ENUM(NS::UInteger, BlendFactor) { @@ -53,6 +84,7 @@ _MTL_ENUM(NS::UInteger, BlendFactor) { BlendFactorOneMinusSource1Color = 16, BlendFactorSource1Alpha = 17, BlendFactorOneMinusSource1Alpha = 18, + BlendFactorUnspecialized = 19, }; _MTL_ENUM(NS::UInteger, BlendOperation) { @@ -61,15 +93,7 @@ _MTL_ENUM(NS::UInteger, BlendOperation) { BlendOperationReverseSubtract = 2, BlendOperationMin = 3, BlendOperationMax = 4, -}; - -_MTL_OPTIONS(NS::UInteger, ColorWriteMask) { - ColorWriteMaskNone = 0, - ColorWriteMaskAlpha = 1, - ColorWriteMaskBlue = 2, - ColorWriteMaskGreen = 4, - ColorWriteMaskRed = 8, - ColorWriteMaskAll = 15, + BlendOperationUnspecialized = 5, }; _MTL_ENUM(NS::UInteger, PrimitiveTopologyClass) { @@ -103,469 +127,582 @@ _MTL_ENUM(NS::UInteger, TessellationControlPointIndexType) { TessellationControlPointIndexTypeUInt32 = 2, }; +_MTL_OPTIONS(NS::UInteger, ColorWriteMask) { + ColorWriteMaskNone = 0, + ColorWriteMaskRed = 1 << 3, + ColorWriteMaskGreen = 1 << 2, + ColorWriteMaskBlue = 1 << 1, + ColorWriteMaskAlpha = 1, + ColorWriteMaskAll = 15, + ColorWriteMaskUnspecialized = 1 << 4, +}; + class RenderPipelineColorAttachmentDescriptor : public NS::Copying { public: - static class RenderPipelineColorAttachmentDescriptor* alloc(); + static RenderPipelineColorAttachmentDescriptor* alloc(); - class RenderPipelineColorAttachmentDescriptor* init(); + BlendOperation alphaBlendOperation() const; - MTL::PixelFormat pixelFormat() const; - void setPixelFormat(MTL::PixelFormat pixelFormat); + [[deprecated("please use isBlendingEnabled instead")]] + bool blendingEnabled() const; - bool blendingEnabled() const; - void setBlendingEnabled(bool blendingEnabled); + BlendFactor destinationAlphaBlendFactor() const; - MTL::BlendFactor sourceRGBBlendFactor() const; - void setSourceRGBBlendFactor(MTL::BlendFactor sourceRGBBlendFactor); + BlendFactor destinationRGBBlendFactor() const; - MTL::BlendFactor destinationRGBBlendFactor() const; - void setDestinationRGBBlendFactor(MTL::BlendFactor destinationRGBBlendFactor); + RenderPipelineColorAttachmentDescriptor* init(); - MTL::BlendOperation rgbBlendOperation() const; - void setRgbBlendOperation(MTL::BlendOperation rgbBlendOperation); + bool isBlendingEnabled() const; - MTL::BlendFactor sourceAlphaBlendFactor() const; - void setSourceAlphaBlendFactor(MTL::BlendFactor sourceAlphaBlendFactor); + PixelFormat pixelFormat() const; - MTL::BlendFactor destinationAlphaBlendFactor() const; - void setDestinationAlphaBlendFactor(MTL::BlendFactor destinationAlphaBlendFactor); + BlendOperation rgbBlendOperation() const; - MTL::BlendOperation alphaBlendOperation() const; - void setAlphaBlendOperation(MTL::BlendOperation alphaBlendOperation); + void setAlphaBlendOperation(MTL::BlendOperation alphaBlendOperation); - MTL::ColorWriteMask writeMask() const; - void setWriteMask(MTL::ColorWriteMask writeMask); + void setBlendingEnabled(bool blendingEnabled); + + void setDestinationAlphaBlendFactor(MTL::BlendFactor destinationAlphaBlendFactor); + + void setDestinationRGBBlendFactor(MTL::BlendFactor destinationRGBBlendFactor); + + void setPixelFormat(MTL::PixelFormat pixelFormat); + + void setRgbBlendOperation(MTL::BlendOperation rgbBlendOperation); + + void setSourceAlphaBlendFactor(MTL::BlendFactor sourceAlphaBlendFactor); + + void setSourceRGBBlendFactor(MTL::BlendFactor sourceRGBBlendFactor); + + void setWriteMask(MTL::ColorWriteMask writeMask); + + BlendFactor sourceAlphaBlendFactor() const; + + BlendFactor sourceRGBBlendFactor() const; + + ColorWriteMask writeMask() const; }; +class LogicalToPhysicalColorAttachmentMap : public NS::Copying +{ +public: + static LogicalToPhysicalColorAttachmentMap* alloc(); + NS::UInteger getPhysicalIndex(NS::UInteger logicalIndex); + + LogicalToPhysicalColorAttachmentMap* init(); + + void reset(); + + void setPhysicalIndex(NS::UInteger physicalIndex, NS::UInteger logicalIndex); +}; class RenderPipelineReflection : public NS::Referencing { public: - static class RenderPipelineReflection* alloc(); + static RenderPipelineReflection* alloc(); - class RenderPipelineReflection* init(); + NS::Array* fragmentArguments() const; - NS::Array* vertexBindings() const; + NS::Array* fragmentBindings() const; - NS::Array* fragmentBindings() const; + RenderPipelineReflection* init(); - NS::Array* tileBindings() const; + NS::Array* meshBindings() const; - NS::Array* objectBindings() const; + NS::Array* objectBindings() const; - NS::Array* meshBindings() const; + NS::Array* tileArguments() const; - NS::Array* vertexArguments() const; + NS::Array* tileBindings() const; - NS::Array* fragmentArguments() const; + NS::Array* vertexArguments() const; - NS::Array* tileArguments() const; + NS::Array* vertexBindings() const; }; - class RenderPipelineDescriptor : public NS::Copying { public: - static class RenderPipelineDescriptor* alloc(); + static RenderPipelineDescriptor* alloc(); - class RenderPipelineDescriptor* init(); + [[deprecated("please use isAlphaToCoverageEnabled instead")]] + bool alphaToCoverageEnabled() const; - NS::String* label() const; - void setLabel(const NS::String* label); + [[deprecated("please use isAlphaToOneEnabled instead")]] + bool alphaToOneEnabled() const; - class Function* vertexFunction() const; - void setVertexFunction(const class Function* vertexFunction); + NS::Array* binaryArchives() const; - class Function* fragmentFunction() const; - void setFragmentFunction(const class Function* fragmentFunction); + RenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; - class VertexDescriptor* vertexDescriptor() const; - void setVertexDescriptor(const class VertexDescriptor* vertexDescriptor); + PixelFormat depthAttachmentPixelFormat() const; - NS::UInteger sampleCount() const; - void setSampleCount(NS::UInteger sampleCount); + PipelineBufferDescriptorArray* fragmentBuffers() const; - NS::UInteger rasterSampleCount() const; - void setRasterSampleCount(NS::UInteger rasterSampleCount); + Function* fragmentFunction() const; - bool alphaToCoverageEnabled() const; - void setAlphaToCoverageEnabled(bool alphaToCoverageEnabled); + LinkedFunctions* fragmentLinkedFunctions() const; - bool alphaToOneEnabled() const; - void setAlphaToOneEnabled(bool alphaToOneEnabled); + NS::Array* fragmentPreloadedLibraries() const; - bool rasterizationEnabled() const; - void setRasterizationEnabled(bool rasterizationEnabled); + RenderPipelineDescriptor* init(); - NS::UInteger maxVertexAmplificationCount() const; - void setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount); + PrimitiveTopologyClass inputPrimitiveTopology() const; - class RenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; + bool isAlphaToCoverageEnabled() const; - MTL::PixelFormat depthAttachmentPixelFormat() const; - void setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat); + bool isAlphaToOneEnabled() const; - MTL::PixelFormat stencilAttachmentPixelFormat() const; - void setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat); + bool isRasterizationEnabled() const; - MTL::PrimitiveTopologyClass inputPrimitiveTopology() const; - void setInputPrimitiveTopology(MTL::PrimitiveTopologyClass inputPrimitiveTopology); + bool isTessellationFactorScaleEnabled() const; - MTL::TessellationPartitionMode tessellationPartitionMode() const; - void setTessellationPartitionMode(MTL::TessellationPartitionMode tessellationPartitionMode); + NS::String* label() const; - NS::UInteger maxTessellationFactor() const; - void setMaxTessellationFactor(NS::UInteger maxTessellationFactor); + NS::UInteger maxFragmentCallStackDepth() const; - bool tessellationFactorScaleEnabled() const; - void setTessellationFactorScaleEnabled(bool tessellationFactorScaleEnabled); + NS::UInteger maxTessellationFactor() const; - MTL::TessellationFactorFormat tessellationFactorFormat() const; - void setTessellationFactorFormat(MTL::TessellationFactorFormat tessellationFactorFormat); + NS::UInteger maxVertexAmplificationCount() const; - MTL::TessellationControlPointIndexType tessellationControlPointIndexType() const; - void setTessellationControlPointIndexType(MTL::TessellationControlPointIndexType tessellationControlPointIndexType); + NS::UInteger maxVertexCallStackDepth() const; - MTL::TessellationFactorStepFunction tessellationFactorStepFunction() const; - void setTessellationFactorStepFunction(MTL::TessellationFactorStepFunction tessellationFactorStepFunction); + NS::UInteger rasterSampleCount() const; - MTL::Winding tessellationOutputWindingOrder() const; - void setTessellationOutputWindingOrder(MTL::Winding tessellationOutputWindingOrder); + [[deprecated("please use isRasterizationEnabled instead")]] + bool rasterizationEnabled() const; - class PipelineBufferDescriptorArray* vertexBuffers() const; + void reset(); - class PipelineBufferDescriptorArray* fragmentBuffers() const; + NS::UInteger sampleCount() const; - bool supportIndirectCommandBuffers() const; - void setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers); + void setAlphaToCoverageEnabled(bool alphaToCoverageEnabled); - NS::Array* binaryArchives() const; - void setBinaryArchives(const NS::Array* binaryArchives); + void setAlphaToOneEnabled(bool alphaToOneEnabled); - NS::Array* vertexPreloadedLibraries() const; - void setVertexPreloadedLibraries(const NS::Array* vertexPreloadedLibraries); + void setBinaryArchives(const NS::Array* binaryArchives); - NS::Array* fragmentPreloadedLibraries() const; - void setFragmentPreloadedLibraries(const NS::Array* fragmentPreloadedLibraries); + void setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat); - class LinkedFunctions* vertexLinkedFunctions() const; - void setVertexLinkedFunctions(const class LinkedFunctions* vertexLinkedFunctions); + void setFragmentFunction(const MTL::Function* fragmentFunction); - class LinkedFunctions* fragmentLinkedFunctions() const; - void setFragmentLinkedFunctions(const class LinkedFunctions* fragmentLinkedFunctions); + void setFragmentLinkedFunctions(const MTL::LinkedFunctions* fragmentLinkedFunctions); - bool supportAddingVertexBinaryFunctions() const; - void setSupportAddingVertexBinaryFunctions(bool supportAddingVertexBinaryFunctions); + void setFragmentPreloadedLibraries(const NS::Array* fragmentPreloadedLibraries); - bool supportAddingFragmentBinaryFunctions() const; - void setSupportAddingFragmentBinaryFunctions(bool supportAddingFragmentBinaryFunctions); + void setInputPrimitiveTopology(MTL::PrimitiveTopologyClass inputPrimitiveTopology); - NS::UInteger maxVertexCallStackDepth() const; - void setMaxVertexCallStackDepth(NS::UInteger maxVertexCallStackDepth); + void setLabel(const NS::String* label); - NS::UInteger maxFragmentCallStackDepth() const; - void setMaxFragmentCallStackDepth(NS::UInteger maxFragmentCallStackDepth); + void setMaxFragmentCallStackDepth(NS::UInteger maxFragmentCallStackDepth); - void reset(); + void setMaxTessellationFactor(NS::UInteger maxTessellationFactor); + + void setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount); + + void setMaxVertexCallStackDepth(NS::UInteger maxVertexCallStackDepth); + + void setRasterSampleCount(NS::UInteger rasterSampleCount); + + void setRasterizationEnabled(bool rasterizationEnabled); + + void setSampleCount(NS::UInteger sampleCount); + + void setShaderValidation(MTL::ShaderValidation shaderValidation); + + void setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat); + + void setSupportAddingFragmentBinaryFunctions(bool supportAddingFragmentBinaryFunctions); + + void setSupportAddingVertexBinaryFunctions(bool supportAddingVertexBinaryFunctions); + + void setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers); + + void setTessellationControlPointIndexType(MTL::TessellationControlPointIndexType tessellationControlPointIndexType); + + void setTessellationFactorFormat(MTL::TessellationFactorFormat tessellationFactorFormat); + + void setTessellationFactorScaleEnabled(bool tessellationFactorScaleEnabled); + + void setTessellationFactorStepFunction(MTL::TessellationFactorStepFunction tessellationFactorStepFunction); + + void setTessellationOutputWindingOrder(MTL::Winding tessellationOutputWindingOrder); + + void setTessellationPartitionMode(MTL::TessellationPartitionMode tessellationPartitionMode); + + void setVertexDescriptor(const MTL::VertexDescriptor* vertexDescriptor); + + void setVertexFunction(const MTL::Function* vertexFunction); + + void setVertexLinkedFunctions(const MTL::LinkedFunctions* vertexLinkedFunctions); + + void setVertexPreloadedLibraries(const NS::Array* vertexPreloadedLibraries); + + ShaderValidation shaderValidation() const; + + PixelFormat stencilAttachmentPixelFormat() const; + + bool supportAddingFragmentBinaryFunctions() const; + + bool supportAddingVertexBinaryFunctions() const; + + bool supportIndirectCommandBuffers() const; + + TessellationControlPointIndexType tessellationControlPointIndexType() const; + + TessellationFactorFormat tessellationFactorFormat() const; + + [[deprecated("please use isTessellationFactorScaleEnabled instead")]] + bool tessellationFactorScaleEnabled() const; + + TessellationFactorStepFunction tessellationFactorStepFunction() const; + + Winding tessellationOutputWindingOrder() const; + + TessellationPartitionMode tessellationPartitionMode() const; + + PipelineBufferDescriptorArray* vertexBuffers() const; + + VertexDescriptor* vertexDescriptor() const; + + Function* vertexFunction() const; + + LinkedFunctions* vertexLinkedFunctions() const; + + NS::Array* vertexPreloadedLibraries() const; }; - class RenderPipelineFunctionsDescriptor : public NS::Copying { public: - static class RenderPipelineFunctionsDescriptor* alloc(); + static RenderPipelineFunctionsDescriptor* alloc(); - class RenderPipelineFunctionsDescriptor* init(); + NS::Array* fragmentAdditionalBinaryFunctions() const; - NS::Array* vertexAdditionalBinaryFunctions() const; - void setVertexAdditionalBinaryFunctions(const NS::Array* vertexAdditionalBinaryFunctions); + RenderPipelineFunctionsDescriptor* init(); - NS::Array* fragmentAdditionalBinaryFunctions() const; - void setFragmentAdditionalBinaryFunctions(const NS::Array* fragmentAdditionalBinaryFunctions); + void setFragmentAdditionalBinaryFunctions(const NS::Array* fragmentAdditionalBinaryFunctions); - NS::Array* tileAdditionalBinaryFunctions() const; - void setTileAdditionalBinaryFunctions(const NS::Array* tileAdditionalBinaryFunctions); + void setTileAdditionalBinaryFunctions(const NS::Array* tileAdditionalBinaryFunctions); + + void setVertexAdditionalBinaryFunctions(const NS::Array* vertexAdditionalBinaryFunctions); + + NS::Array* tileAdditionalBinaryFunctions() const; + + NS::Array* vertexAdditionalBinaryFunctions() const; }; - -class RenderPipelineState : public NS::Referencing +class RenderPipelineState : public NS::Referencing { public: - NS::String* label() const; + Device* device() const; - class Device* device() const; + FunctionHandle* functionHandle(const NS::String* name, MTL::RenderStages stage); + FunctionHandle* functionHandle(const MTL4::BinaryFunction* function, MTL::RenderStages stage); + FunctionHandle* functionHandle(const MTL::Function* function, MTL::RenderStages stage); - NS::UInteger maxTotalThreadsPerThreadgroup() const; + ResourceID gpuResourceID() const; - bool threadgroupSizeMatchesTileSize() const; + NS::UInteger imageblockMemoryLength(MTL::Size imageblockDimensions); - NS::UInteger imageblockSampleLength() const; + NS::UInteger imageblockSampleLength() const; - NS::UInteger imageblockMemoryLength(MTL::Size imageblockDimensions); + NS::String* label() const; - bool supportIndirectCommandBuffers() const; + NS::UInteger maxTotalThreadgroupsPerMeshGrid() const; - NS::UInteger maxTotalThreadsPerObjectThreadgroup() const; + NS::UInteger maxTotalThreadsPerMeshThreadgroup() const; - NS::UInteger maxTotalThreadsPerMeshThreadgroup() const; + NS::UInteger maxTotalThreadsPerObjectThreadgroup() const; - NS::UInteger objectThreadExecutionWidth() const; + NS::UInteger maxTotalThreadsPerThreadgroup() const; - NS::UInteger meshThreadExecutionWidth() const; + NS::UInteger meshThreadExecutionWidth() const; - NS::UInteger maxTotalThreadgroupsPerMeshGrid() const; + IntersectionFunctionTable* newIntersectionFunctionTable(const MTL::IntersectionFunctionTableDescriptor* descriptor, MTL::RenderStages stage); - MTL::ResourceID gpuResourceID() const; + MTL4::PipelineDescriptor* newRenderPipelineDescriptor(); - class FunctionHandle* functionHandle(const class Function* function, MTL::RenderStages stage); + RenderPipelineState* newRenderPipelineState(const MTL4::RenderPipelineBinaryFunctionsDescriptor* binaryFunctionsDescriptor, NS::Error** error); + RenderPipelineState* newRenderPipelineState(const MTL::RenderPipelineFunctionsDescriptor* additionalBinaryFunctions, NS::Error** error); - class VisibleFunctionTable* newVisibleFunctionTable(const class VisibleFunctionTableDescriptor* descriptor, MTL::RenderStages stage); + VisibleFunctionTable* newVisibleFunctionTable(const MTL::VisibleFunctionTableDescriptor* descriptor, MTL::RenderStages stage); - class IntersectionFunctionTable* newIntersectionFunctionTable(const class IntersectionFunctionTableDescriptor* descriptor, MTL::RenderStages stage); + NS::UInteger objectThreadExecutionWidth() const; - class RenderPipelineState* newRenderPipelineState(const class RenderPipelineFunctionsDescriptor* additionalBinaryFunctions, NS::Error** error); + RenderPipelineReflection* reflection() const; + + Size requiredThreadsPerMeshThreadgroup() const; + + Size requiredThreadsPerObjectThreadgroup() const; + + Size requiredThreadsPerTileThreadgroup() const; + + ShaderValidation shaderValidation() const; + + bool supportIndirectCommandBuffers() const; + + bool threadgroupSizeMatchesTileSize() const; }; - class RenderPipelineColorAttachmentDescriptorArray : public NS::Referencing { public: - static class RenderPipelineColorAttachmentDescriptorArray* alloc(); + static RenderPipelineColorAttachmentDescriptorArray* alloc(); - class RenderPipelineColorAttachmentDescriptorArray* init(); + RenderPipelineColorAttachmentDescriptorArray* init(); - class RenderPipelineColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class RenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + RenderPipelineColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::RenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class TileRenderPipelineColorAttachmentDescriptor : public NS::Copying { public: - static class TileRenderPipelineColorAttachmentDescriptor* alloc(); + static TileRenderPipelineColorAttachmentDescriptor* alloc(); - class TileRenderPipelineColorAttachmentDescriptor* init(); + TileRenderPipelineColorAttachmentDescriptor* init(); - MTL::PixelFormat pixelFormat() const; - void setPixelFormat(MTL::PixelFormat pixelFormat); + PixelFormat pixelFormat() const; + void setPixelFormat(MTL::PixelFormat pixelFormat); }; - class TileRenderPipelineColorAttachmentDescriptorArray : public NS::Referencing { public: - static class TileRenderPipelineColorAttachmentDescriptorArray* alloc(); + static TileRenderPipelineColorAttachmentDescriptorArray* alloc(); - class TileRenderPipelineColorAttachmentDescriptorArray* init(); + TileRenderPipelineColorAttachmentDescriptorArray* init(); - class TileRenderPipelineColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class TileRenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + TileRenderPipelineColorAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::TileRenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class TileRenderPipelineDescriptor : public NS::Copying { public: - static class TileRenderPipelineDescriptor* alloc(); + static TileRenderPipelineDescriptor* alloc(); - class TileRenderPipelineDescriptor* init(); + NS::Array* binaryArchives() const; - NS::String* label() const; - void setLabel(const NS::String* label); + TileRenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; - class Function* tileFunction() const; - void setTileFunction(const class Function* tileFunction); + TileRenderPipelineDescriptor* init(); - NS::UInteger rasterSampleCount() const; - void setRasterSampleCount(NS::UInteger rasterSampleCount); + NS::String* label() const; - class TileRenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; + LinkedFunctions* linkedFunctions() const; - bool threadgroupSizeMatchesTileSize() const; - void setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize); + NS::UInteger maxCallStackDepth() const; - class PipelineBufferDescriptorArray* tileBuffers() const; + NS::UInteger maxTotalThreadsPerThreadgroup() const; - NS::UInteger maxTotalThreadsPerThreadgroup() const; - void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + NS::Array* preloadedLibraries() const; - NS::Array* binaryArchives() const; - void setBinaryArchives(const NS::Array* binaryArchives); + NS::UInteger rasterSampleCount() const; - NS::Array* preloadedLibraries() const; - void setPreloadedLibraries(const NS::Array* preloadedLibraries); + Size requiredThreadsPerThreadgroup() const; - class LinkedFunctions* linkedFunctions() const; - void setLinkedFunctions(const class LinkedFunctions* linkedFunctions); + void reset(); - bool supportAddingBinaryFunctions() const; - void setSupportAddingBinaryFunctions(bool supportAddingBinaryFunctions); + void setBinaryArchives(const NS::Array* binaryArchives); - NS::UInteger maxCallStackDepth() const; - void setMaxCallStackDepth(NS::UInteger maxCallStackDepth); + void setLabel(const NS::String* label); - void reset(); + void setLinkedFunctions(const MTL::LinkedFunctions* linkedFunctions); + + void setMaxCallStackDepth(NS::UInteger maxCallStackDepth); + + void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup); + + void setPreloadedLibraries(const NS::Array* preloadedLibraries); + + void setRasterSampleCount(NS::UInteger rasterSampleCount); + + void setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup); + + void setShaderValidation(MTL::ShaderValidation shaderValidation); + + void setSupportAddingBinaryFunctions(bool supportAddingBinaryFunctions); + + void setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize); + + void setTileFunction(const MTL::Function* tileFunction); + + ShaderValidation shaderValidation() const; + + bool supportAddingBinaryFunctions() const; + + bool threadgroupSizeMatchesTileSize() const; + + PipelineBufferDescriptorArray* tileBuffers() const; + + Function* tileFunction() const; }; - class MeshRenderPipelineDescriptor : public NS::Copying { public: - static class MeshRenderPipelineDescriptor* alloc(); + static MeshRenderPipelineDescriptor* alloc(); - class MeshRenderPipelineDescriptor* init(); + [[deprecated("please use isAlphaToCoverageEnabled instead")]] + bool alphaToCoverageEnabled() const; - NS::String* label() const; - void setLabel(const NS::String* label); + [[deprecated("please use isAlphaToOneEnabled instead")]] + bool alphaToOneEnabled() const; - class Function* objectFunction() const; - void setObjectFunction(const class Function* objectFunction); + NS::Array* binaryArchives() const; - class Function* meshFunction() const; - void setMeshFunction(const class Function* meshFunction); + RenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; - class Function* fragmentFunction() const; - void setFragmentFunction(const class Function* fragmentFunction); + PixelFormat depthAttachmentPixelFormat() const; - NS::UInteger maxTotalThreadsPerObjectThreadgroup() const; - void setMaxTotalThreadsPerObjectThreadgroup(NS::UInteger maxTotalThreadsPerObjectThreadgroup); + PipelineBufferDescriptorArray* fragmentBuffers() const; - NS::UInteger maxTotalThreadsPerMeshThreadgroup() const; - void setMaxTotalThreadsPerMeshThreadgroup(NS::UInteger maxTotalThreadsPerMeshThreadgroup); + Function* fragmentFunction() const; - bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth() const; - void setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth); + LinkedFunctions* fragmentLinkedFunctions() const; - bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth() const; - void setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth); + MeshRenderPipelineDescriptor* init(); - NS::UInteger payloadMemoryLength() const; - void setPayloadMemoryLength(NS::UInteger payloadMemoryLength); + bool isAlphaToCoverageEnabled() const; - NS::UInteger maxTotalThreadgroupsPerMeshGrid() const; - void setMaxTotalThreadgroupsPerMeshGrid(NS::UInteger maxTotalThreadgroupsPerMeshGrid); + bool isAlphaToOneEnabled() const; - class PipelineBufferDescriptorArray* objectBuffers() const; + bool isRasterizationEnabled() const; - class PipelineBufferDescriptorArray* meshBuffers() const; + NS::String* label() const; - class PipelineBufferDescriptorArray* fragmentBuffers() const; + NS::UInteger maxTotalThreadgroupsPerMeshGrid() const; - NS::UInteger rasterSampleCount() const; - void setRasterSampleCount(NS::UInteger rasterSampleCount); + NS::UInteger maxTotalThreadsPerMeshThreadgroup() const; - bool alphaToCoverageEnabled() const; - void setAlphaToCoverageEnabled(bool alphaToCoverageEnabled); + NS::UInteger maxTotalThreadsPerObjectThreadgroup() const; - bool alphaToOneEnabled() const; - void setAlphaToOneEnabled(bool alphaToOneEnabled); + NS::UInteger maxVertexAmplificationCount() const; - bool rasterizationEnabled() const; - void setRasterizationEnabled(bool rasterizationEnabled); + PipelineBufferDescriptorArray* meshBuffers() const; - NS::UInteger maxVertexAmplificationCount() const; - void setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount); + Function* meshFunction() const; - class RenderPipelineColorAttachmentDescriptorArray* colorAttachments() const; + LinkedFunctions* meshLinkedFunctions() const; - MTL::PixelFormat depthAttachmentPixelFormat() const; - void setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat); + bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth() const; - MTL::PixelFormat stencilAttachmentPixelFormat() const; - void setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat); + PipelineBufferDescriptorArray* objectBuffers() const; - void reset(); + Function* objectFunction() const; + + LinkedFunctions* objectLinkedFunctions() const; + + bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth() const; + + NS::UInteger payloadMemoryLength() const; + + NS::UInteger rasterSampleCount() const; + + [[deprecated("please use isRasterizationEnabled instead")]] + bool rasterizationEnabled() const; + + Size requiredThreadsPerMeshThreadgroup() const; + + Size requiredThreadsPerObjectThreadgroup() const; + + void reset(); + + void setAlphaToCoverageEnabled(bool alphaToCoverageEnabled); + + void setAlphaToOneEnabled(bool alphaToOneEnabled); + + void setBinaryArchives(const NS::Array* binaryArchives); + + void setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat); + + void setFragmentFunction(const MTL::Function* fragmentFunction); + + void setFragmentLinkedFunctions(const MTL::LinkedFunctions* fragmentLinkedFunctions); + + void setLabel(const NS::String* label); + + void setMaxTotalThreadgroupsPerMeshGrid(NS::UInteger maxTotalThreadgroupsPerMeshGrid); + + void setMaxTotalThreadsPerMeshThreadgroup(NS::UInteger maxTotalThreadsPerMeshThreadgroup); + + void setMaxTotalThreadsPerObjectThreadgroup(NS::UInteger maxTotalThreadsPerObjectThreadgroup); + + void setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount); + + void setMeshFunction(const MTL::Function* meshFunction); + + void setMeshLinkedFunctions(const MTL::LinkedFunctions* meshLinkedFunctions); + + void setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth); + + void setObjectFunction(const MTL::Function* objectFunction); + + void setObjectLinkedFunctions(const MTL::LinkedFunctions* objectLinkedFunctions); + + void setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth); + + void setPayloadMemoryLength(NS::UInteger payloadMemoryLength); + + void setRasterSampleCount(NS::UInteger rasterSampleCount); + + void setRasterizationEnabled(bool rasterizationEnabled); + + void setRequiredThreadsPerMeshThreadgroup(MTL::Size requiredThreadsPerMeshThreadgroup); + + void setRequiredThreadsPerObjectThreadgroup(MTL::Size requiredThreadsPerObjectThreadgroup); + + void setShaderValidation(MTL::ShaderValidation shaderValidation); + + void setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat); + + void setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers); + + ShaderValidation shaderValidation() const; + + PixelFormat stencilAttachmentPixelFormat() const; + + bool supportIndirectCommandBuffers() const; }; } - -// static method: alloc _MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptor* MTL::RenderPipelineColorAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPipelineColorAttachmentDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptor* MTL::RenderPipelineColorAttachmentDescriptor::init() +_MTL_INLINE MTL::BlendOperation MTL::RenderPipelineColorAttachmentDescriptor::alphaBlendOperation() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaBlendOperation)); } -// property: pixelFormat -_MTL_INLINE MTL::PixelFormat MTL::RenderPipelineColorAttachmentDescriptor::pixelFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); -} - -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); -} - -// property: blendingEnabled _MTL_INLINE bool MTL::RenderPipelineColorAttachmentDescriptor::blendingEnabled() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(isBlendingEnabled)); } -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setBlendingEnabled(bool blendingEnabled) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setBlendingEnabled_), blendingEnabled); -} - -// property: sourceRGBBlendFactor -_MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::sourceRGBBlendFactor() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sourceRGBBlendFactor)); -} - -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setSourceRGBBlendFactor(MTL::BlendFactor sourceRGBBlendFactor) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSourceRGBBlendFactor_), sourceRGBBlendFactor); -} - -// property: destinationRGBBlendFactor -_MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::destinationRGBBlendFactor() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(destinationRGBBlendFactor)); -} - -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setDestinationRGBBlendFactor(MTL::BlendFactor destinationRGBBlendFactor) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestinationRGBBlendFactor_), destinationRGBBlendFactor); -} - -// property: rgbBlendOperation -_MTL_INLINE MTL::BlendOperation MTL::RenderPipelineColorAttachmentDescriptor::rgbBlendOperation() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(rgbBlendOperation)); -} - -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setRgbBlendOperation(MTL::BlendOperation rgbBlendOperation) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRgbBlendOperation_), rgbBlendOperation); -} - -// property: sourceAlphaBlendFactor -_MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::sourceAlphaBlendFactor() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sourceAlphaBlendFactor)); -} - -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setSourceAlphaBlendFactor(MTL::BlendFactor sourceAlphaBlendFactor) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSourceAlphaBlendFactor_), sourceAlphaBlendFactor); -} - -// property: destinationAlphaBlendFactor _MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::destinationAlphaBlendFactor() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(destinationAlphaBlendFactor)); } -_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setDestinationAlphaBlendFactor(MTL::BlendFactor destinationAlphaBlendFactor) +_MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::destinationRGBBlendFactor() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestinationAlphaBlendFactor_), destinationAlphaBlendFactor); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(destinationRGBBlendFactor)); } -// property: alphaBlendOperation -_MTL_INLINE MTL::BlendOperation MTL::RenderPipelineColorAttachmentDescriptor::alphaBlendOperation() const +_MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptor* MTL::RenderPipelineColorAttachmentDescriptor::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(alphaBlendOperation)); + return NS::Object::init(); +} + +_MTL_INLINE bool MTL::RenderPipelineColorAttachmentDescriptor::isBlendingEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isBlendingEnabled)); +} + +_MTL_INLINE MTL::PixelFormat MTL::RenderPipelineColorAttachmentDescriptor::pixelFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); +} + +_MTL_INLINE MTL::BlendOperation MTL::RenderPipelineColorAttachmentDescriptor::rgbBlendOperation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rgbBlendOperation)); } _MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setAlphaBlendOperation(MTL::BlendOperation alphaBlendOperation) @@ -573,10 +710,39 @@ _MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setAlphaBlendOper Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaBlendOperation_), alphaBlendOperation); } -// property: writeMask -_MTL_INLINE MTL::ColorWriteMask MTL::RenderPipelineColorAttachmentDescriptor::writeMask() const +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setBlendingEnabled(bool blendingEnabled) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(writeMask)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBlendingEnabled_), blendingEnabled); +} + +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setDestinationAlphaBlendFactor(MTL::BlendFactor destinationAlphaBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestinationAlphaBlendFactor_), destinationAlphaBlendFactor); +} + +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setDestinationRGBBlendFactor(MTL::BlendFactor destinationRGBBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDestinationRGBBlendFactor_), destinationRGBBlendFactor); +} + +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); +} + +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setRgbBlendOperation(MTL::BlendOperation rgbBlendOperation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRgbBlendOperation_), rgbBlendOperation); +} + +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setSourceAlphaBlendFactor(MTL::BlendFactor sourceAlphaBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSourceAlphaBlendFactor_), sourceAlphaBlendFactor); +} + +_MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setSourceRGBBlendFactor(MTL::BlendFactor sourceRGBBlendFactor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSourceRGBBlendFactor_), sourceRGBBlendFactor); } _MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setWriteMask(MTL::ColorWriteMask writeMask) @@ -584,148 +750,219 @@ _MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptor::setWriteMask(MTL: Object::sendMessage(this, _MTL_PRIVATE_SEL(setWriteMask_), writeMask); } -// static method: alloc +_MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::sourceAlphaBlendFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sourceAlphaBlendFactor)); +} + +_MTL_INLINE MTL::BlendFactor MTL::RenderPipelineColorAttachmentDescriptor::sourceRGBBlendFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sourceRGBBlendFactor)); +} + +_MTL_INLINE MTL::ColorWriteMask MTL::RenderPipelineColorAttachmentDescriptor::writeMask() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(writeMask)); +} + +_MTL_INLINE MTL::LogicalToPhysicalColorAttachmentMap* MTL::LogicalToPhysicalColorAttachmentMap::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLLogicalToPhysicalColorAttachmentMap)); +} + +_MTL_INLINE NS::UInteger MTL::LogicalToPhysicalColorAttachmentMap::getPhysicalIndex(NS::UInteger logicalIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(getPhysicalIndexForLogicalIndex_), logicalIndex); +} + +_MTL_INLINE MTL::LogicalToPhysicalColorAttachmentMap* MTL::LogicalToPhysicalColorAttachmentMap::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE void MTL::LogicalToPhysicalColorAttachmentMap::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE void MTL::LogicalToPhysicalColorAttachmentMap::setPhysicalIndex(NS::UInteger physicalIndex, NS::UInteger logicalIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPhysicalIndex_forLogicalIndex_), physicalIndex, logicalIndex); +} + _MTL_INLINE MTL::RenderPipelineReflection* MTL::RenderPipelineReflection::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPipelineReflection)); } -// method: init -_MTL_INLINE MTL::RenderPipelineReflection* MTL::RenderPipelineReflection::init() -{ - return NS::Object::init(); -} - -// property: vertexBindings -_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::vertexBindings() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBindings)); -} - -// property: fragmentBindings -_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::fragmentBindings() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentBindings)); -} - -// property: tileBindings -_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::tileBindings() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileBindings)); -} - -// property: objectBindings -_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::objectBindings() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectBindings)); -} - -// property: meshBindings -_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::meshBindings() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshBindings)); -} - -// property: vertexArguments -_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::vertexArguments() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexArguments)); -} - -// property: fragmentArguments _MTL_INLINE NS::Array* MTL::RenderPipelineReflection::fragmentArguments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentArguments)); } -// property: tileArguments +_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::fragmentBindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentBindings)); +} + +_MTL_INLINE MTL::RenderPipelineReflection* MTL::RenderPipelineReflection::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::meshBindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshBindings)); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::objectBindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectBindings)); +} + _MTL_INLINE NS::Array* MTL::RenderPipelineReflection::tileArguments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileArguments)); } -// static method: alloc +_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::tileBindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileBindings)); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::vertexArguments() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexArguments)); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineReflection::vertexBindings() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBindings)); +} + _MTL_INLINE MTL::RenderPipelineDescriptor* MTL::RenderPipelineDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPipelineDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPipelineDescriptor* MTL::RenderPipelineDescriptor::init() +_MTL_INLINE bool MTL::RenderPipelineDescriptor::alphaToCoverageEnabled() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToCoverageEnabled)); } -// property: label -_MTL_INLINE NS::String* MTL::RenderPipelineDescriptor::label() const +_MTL_INLINE bool MTL::RenderPipelineDescriptor::alphaToOneEnabled() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToOneEnabled)); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setLabel(const NS::String* label) +_MTL_INLINE NS::Array* MTL::RenderPipelineDescriptor::binaryArchives() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); } -// property: vertexFunction -_MTL_INLINE MTL::Function* MTL::RenderPipelineDescriptor::vertexFunction() const +_MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptorArray* MTL::RenderPipelineDescriptor::colorAttachments() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFunction)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexFunction(const MTL::Function* vertexFunction) +_MTL_INLINE MTL::PixelFormat MTL::RenderPipelineDescriptor::depthAttachmentPixelFormat() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFunction_), vertexFunction); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthAttachmentPixelFormat)); +} + +_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::RenderPipelineDescriptor::fragmentBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentBuffers)); } -// property: fragmentFunction _MTL_INLINE MTL::Function* MTL::RenderPipelineDescriptor::fragmentFunction() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentFunction)); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setFragmentFunction(const MTL::Function* fragmentFunction) +_MTL_INLINE MTL::LinkedFunctions* MTL::RenderPipelineDescriptor::fragmentLinkedFunctions() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentFunction_), fragmentFunction); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentLinkedFunctions)); } -// property: vertexDescriptor -_MTL_INLINE MTL::VertexDescriptor* MTL::RenderPipelineDescriptor::vertexDescriptor() const +_MTL_INLINE NS::Array* MTL::RenderPipelineDescriptor::fragmentPreloadedLibraries() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexDescriptor)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentPreloadedLibraries)); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexDescriptor(const MTL::VertexDescriptor* vertexDescriptor) +_MTL_INLINE MTL::RenderPipelineDescriptor* MTL::RenderPipelineDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexDescriptor_), vertexDescriptor); + return NS::Object::init(); } -// property: sampleCount -_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::sampleCount() const +_MTL_INLINE MTL::PrimitiveTopologyClass MTL::RenderPipelineDescriptor::inputPrimitiveTopology() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(inputPrimitiveTopology)); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setSampleCount(NS::UInteger sampleCount) +_MTL_INLINE bool MTL::RenderPipelineDescriptor::isAlphaToCoverageEnabled() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToCoverageEnabled)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::isAlphaToOneEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToOneEnabled)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::isRasterizationEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::isTessellationFactorScaleEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isTessellationFactorScaleEnabled)); +} + +_MTL_INLINE NS::String* MTL::RenderPipelineDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxFragmentCallStackDepth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxFragmentCallStackDepth)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxTessellationFactor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTessellationFactor)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxVertexAmplificationCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexAmplificationCount)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxVertexCallStackDepth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexCallStackDepth)); } -// property: rasterSampleCount _MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::rasterSampleCount() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +_MTL_INLINE bool MTL::RenderPipelineDescriptor::rasterizationEnabled() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); } -// property: alphaToCoverageEnabled -_MTL_INLINE bool MTL::RenderPipelineDescriptor::alphaToCoverageEnabled() const +_MTL_INLINE void MTL::RenderPipelineDescriptor::reset() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToCoverageEnabled)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::sampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); } _MTL_INLINE void MTL::RenderPipelineDescriptor::setAlphaToCoverageEnabled(bool alphaToCoverageEnabled) @@ -733,226 +970,24 @@ _MTL_INLINE void MTL::RenderPipelineDescriptor::setAlphaToCoverageEnabled(bool a Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToCoverageEnabled_), alphaToCoverageEnabled); } -// property: alphaToOneEnabled -_MTL_INLINE bool MTL::RenderPipelineDescriptor::alphaToOneEnabled() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToOneEnabled)); -} - _MTL_INLINE void MTL::RenderPipelineDescriptor::setAlphaToOneEnabled(bool alphaToOneEnabled) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToOneEnabled_), alphaToOneEnabled); } -// property: rasterizationEnabled -_MTL_INLINE bool MTL::RenderPipelineDescriptor::rasterizationEnabled() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setRasterizationEnabled(bool rasterizationEnabled) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationEnabled_), rasterizationEnabled); -} - -// property: maxVertexAmplificationCount -_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxVertexAmplificationCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexAmplificationCount)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexAmplificationCount_), maxVertexAmplificationCount); -} - -// property: colorAttachments -_MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptorArray* MTL::RenderPipelineDescriptor::colorAttachments() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); -} - -// property: depthAttachmentPixelFormat -_MTL_INLINE MTL::PixelFormat MTL::RenderPipelineDescriptor::depthAttachmentPixelFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthAttachmentPixelFormat)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthAttachmentPixelFormat_), depthAttachmentPixelFormat); -} - -// property: stencilAttachmentPixelFormat -_MTL_INLINE MTL::PixelFormat MTL::RenderPipelineDescriptor::stencilAttachmentPixelFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachmentPixelFormat)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilAttachmentPixelFormat_), stencilAttachmentPixelFormat); -} - -// property: inputPrimitiveTopology -_MTL_INLINE MTL::PrimitiveTopologyClass MTL::RenderPipelineDescriptor::inputPrimitiveTopology() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(inputPrimitiveTopology)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setInputPrimitiveTopology(MTL::PrimitiveTopologyClass inputPrimitiveTopology) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setInputPrimitiveTopology_), inputPrimitiveTopology); -} - -// property: tessellationPartitionMode -_MTL_INLINE MTL::TessellationPartitionMode MTL::RenderPipelineDescriptor::tessellationPartitionMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationPartitionMode)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationPartitionMode(MTL::TessellationPartitionMode tessellationPartitionMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationPartitionMode_), tessellationPartitionMode); -} - -// property: maxTessellationFactor -_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxTessellationFactor() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTessellationFactor)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxTessellationFactor(NS::UInteger maxTessellationFactor) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTessellationFactor_), maxTessellationFactor); -} - -// property: tessellationFactorScaleEnabled -_MTL_INLINE bool MTL::RenderPipelineDescriptor::tessellationFactorScaleEnabled() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isTessellationFactorScaleEnabled)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationFactorScaleEnabled(bool tessellationFactorScaleEnabled) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorScaleEnabled_), tessellationFactorScaleEnabled); -} - -// property: tessellationFactorFormat -_MTL_INLINE MTL::TessellationFactorFormat MTL::RenderPipelineDescriptor::tessellationFactorFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationFactorFormat)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationFactorFormat(MTL::TessellationFactorFormat tessellationFactorFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorFormat_), tessellationFactorFormat); -} - -// property: tessellationControlPointIndexType -_MTL_INLINE MTL::TessellationControlPointIndexType MTL::RenderPipelineDescriptor::tessellationControlPointIndexType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationControlPointIndexType)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationControlPointIndexType(MTL::TessellationControlPointIndexType tessellationControlPointIndexType) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationControlPointIndexType_), tessellationControlPointIndexType); -} - -// property: tessellationFactorStepFunction -_MTL_INLINE MTL::TessellationFactorStepFunction MTL::RenderPipelineDescriptor::tessellationFactorStepFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationFactorStepFunction)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationFactorStepFunction(MTL::TessellationFactorStepFunction tessellationFactorStepFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorStepFunction_), tessellationFactorStepFunction); -} - -// property: tessellationOutputWindingOrder -_MTL_INLINE MTL::Winding MTL::RenderPipelineDescriptor::tessellationOutputWindingOrder() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationOutputWindingOrder)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationOutputWindingOrder(MTL::Winding tessellationOutputWindingOrder) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationOutputWindingOrder_), tessellationOutputWindingOrder); -} - -// property: vertexBuffers -_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::RenderPipelineDescriptor::vertexBuffers() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffers)); -} - -// property: fragmentBuffers -_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::RenderPipelineDescriptor::fragmentBuffers() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentBuffers)); -} - -// property: supportIndirectCommandBuffers -_MTL_INLINE bool MTL::RenderPipelineDescriptor::supportIndirectCommandBuffers() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); -} - -// property: binaryArchives -_MTL_INLINE NS::Array* MTL::RenderPipelineDescriptor::binaryArchives() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); -} - _MTL_INLINE void MTL::RenderPipelineDescriptor::setBinaryArchives(const NS::Array* binaryArchives) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryArchives_), binaryArchives); } -// property: vertexPreloadedLibraries -_MTL_INLINE NS::Array* MTL::RenderPipelineDescriptor::vertexPreloadedLibraries() const +_MTL_INLINE void MTL::RenderPipelineDescriptor::setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexPreloadedLibraries)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthAttachmentPixelFormat_), depthAttachmentPixelFormat); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexPreloadedLibraries(const NS::Array* vertexPreloadedLibraries) +_MTL_INLINE void MTL::RenderPipelineDescriptor::setFragmentFunction(const MTL::Function* fragmentFunction) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexPreloadedLibraries_), vertexPreloadedLibraries); -} - -// property: fragmentPreloadedLibraries -_MTL_INLINE NS::Array* MTL::RenderPipelineDescriptor::fragmentPreloadedLibraries() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentPreloadedLibraries)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setFragmentPreloadedLibraries(const NS::Array* fragmentPreloadedLibraries) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentPreloadedLibraries_), fragmentPreloadedLibraries); -} - -// property: vertexLinkedFunctions -_MTL_INLINE MTL::LinkedFunctions* MTL::RenderPipelineDescriptor::vertexLinkedFunctions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexLinkedFunctions)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexLinkedFunctions(const MTL::LinkedFunctions* vertexLinkedFunctions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexLinkedFunctions_), vertexLinkedFunctions); -} - -// property: fragmentLinkedFunctions -_MTL_INLINE MTL::LinkedFunctions* MTL::RenderPipelineDescriptor::fragmentLinkedFunctions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentLinkedFunctions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentFunction_), fragmentFunction); } _MTL_INLINE void MTL::RenderPipelineDescriptor::setFragmentLinkedFunctions(const MTL::LinkedFunctions* fragmentLinkedFunctions) @@ -960,43 +995,19 @@ _MTL_INLINE void MTL::RenderPipelineDescriptor::setFragmentLinkedFunctions(const Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentLinkedFunctions_), fragmentLinkedFunctions); } -// property: supportAddingVertexBinaryFunctions -_MTL_INLINE bool MTL::RenderPipelineDescriptor::supportAddingVertexBinaryFunctions() const +_MTL_INLINE void MTL::RenderPipelineDescriptor::setFragmentPreloadedLibraries(const NS::Array* fragmentPreloadedLibraries) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingVertexBinaryFunctions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentPreloadedLibraries_), fragmentPreloadedLibraries); } -_MTL_INLINE void MTL::RenderPipelineDescriptor::setSupportAddingVertexBinaryFunctions(bool supportAddingVertexBinaryFunctions) +_MTL_INLINE void MTL::RenderPipelineDescriptor::setInputPrimitiveTopology(MTL::PrimitiveTopologyClass inputPrimitiveTopology) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAddingVertexBinaryFunctions_), supportAddingVertexBinaryFunctions); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInputPrimitiveTopology_), inputPrimitiveTopology); } -// property: supportAddingFragmentBinaryFunctions -_MTL_INLINE bool MTL::RenderPipelineDescriptor::supportAddingFragmentBinaryFunctions() const +_MTL_INLINE void MTL::RenderPipelineDescriptor::setLabel(const NS::String* label) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingFragmentBinaryFunctions)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setSupportAddingFragmentBinaryFunctions(bool supportAddingFragmentBinaryFunctions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAddingFragmentBinaryFunctions_), supportAddingFragmentBinaryFunctions); -} - -// property: maxVertexCallStackDepth -_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxVertexCallStackDepth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexCallStackDepth)); -} - -_MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxVertexCallStackDepth(NS::UInteger maxVertexCallStackDepth) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexCallStackDepth_), maxVertexCallStackDepth); -} - -// property: maxFragmentCallStackDepth -_MTL_INLINE NS::UInteger MTL::RenderPipelineDescriptor::maxFragmentCallStackDepth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxFragmentCallStackDepth)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } _MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxFragmentCallStackDepth(NS::UInteger maxFragmentCallStackDepth) @@ -1004,196 +1015,391 @@ _MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxFragmentCallStackDepth(NS: Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxFragmentCallStackDepth_), maxFragmentCallStackDepth); } -// method: reset -_MTL_INLINE void MTL::RenderPipelineDescriptor::reset() +_MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxTessellationFactor(NS::UInteger maxTessellationFactor) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTessellationFactor_), maxTessellationFactor); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexAmplificationCount_), maxVertexAmplificationCount); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setMaxVertexCallStackDepth(NS::UInteger maxVertexCallStackDepth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexCallStackDepth_), maxVertexCallStackDepth); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setRasterizationEnabled(bool rasterizationEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationEnabled_), rasterizationEnabled); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setSampleCount(NS::UInteger sampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setShaderValidation(MTL::ShaderValidation shaderValidation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setShaderValidation_), shaderValidation); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilAttachmentPixelFormat_), stencilAttachmentPixelFormat); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setSupportAddingFragmentBinaryFunctions(bool supportAddingFragmentBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAddingFragmentBinaryFunctions_), supportAddingFragmentBinaryFunctions); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setSupportAddingVertexBinaryFunctions(bool supportAddingVertexBinaryFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAddingVertexBinaryFunctions_), supportAddingVertexBinaryFunctions); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationControlPointIndexType(MTL::TessellationControlPointIndexType tessellationControlPointIndexType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationControlPointIndexType_), tessellationControlPointIndexType); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationFactorFormat(MTL::TessellationFactorFormat tessellationFactorFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorFormat_), tessellationFactorFormat); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationFactorScaleEnabled(bool tessellationFactorScaleEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorScaleEnabled_), tessellationFactorScaleEnabled); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationFactorStepFunction(MTL::TessellationFactorStepFunction tessellationFactorStepFunction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationFactorStepFunction_), tessellationFactorStepFunction); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationOutputWindingOrder(MTL::Winding tessellationOutputWindingOrder) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationOutputWindingOrder_), tessellationOutputWindingOrder); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setTessellationPartitionMode(MTL::TessellationPartitionMode tessellationPartitionMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTessellationPartitionMode_), tessellationPartitionMode); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexDescriptor(const MTL::VertexDescriptor* vertexDescriptor) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexDescriptor_), vertexDescriptor); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexFunction(const MTL::Function* vertexFunction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexFunction_), vertexFunction); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexLinkedFunctions(const MTL::LinkedFunctions* vertexLinkedFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexLinkedFunctions_), vertexLinkedFunctions); +} + +_MTL_INLINE void MTL::RenderPipelineDescriptor::setVertexPreloadedLibraries(const NS::Array* vertexPreloadedLibraries) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexPreloadedLibraries_), vertexPreloadedLibraries); +} + +_MTL_INLINE MTL::ShaderValidation MTL::RenderPipelineDescriptor::shaderValidation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE MTL::PixelFormat MTL::RenderPipelineDescriptor::stencilAttachmentPixelFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachmentPixelFormat)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::supportAddingFragmentBinaryFunctions() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingFragmentBinaryFunctions)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::supportAddingVertexBinaryFunctions() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingVertexBinaryFunctions)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::supportIndirectCommandBuffers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE MTL::TessellationControlPointIndexType MTL::RenderPipelineDescriptor::tessellationControlPointIndexType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationControlPointIndexType)); +} + +_MTL_INLINE MTL::TessellationFactorFormat MTL::RenderPipelineDescriptor::tessellationFactorFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationFactorFormat)); +} + +_MTL_INLINE bool MTL::RenderPipelineDescriptor::tessellationFactorScaleEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isTessellationFactorScaleEnabled)); +} + +_MTL_INLINE MTL::TessellationFactorStepFunction MTL::RenderPipelineDescriptor::tessellationFactorStepFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationFactorStepFunction)); +} + +_MTL_INLINE MTL::Winding MTL::RenderPipelineDescriptor::tessellationOutputWindingOrder() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationOutputWindingOrder)); +} + +_MTL_INLINE MTL::TessellationPartitionMode MTL::RenderPipelineDescriptor::tessellationPartitionMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tessellationPartitionMode)); +} + +_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::RenderPipelineDescriptor::vertexBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexBuffers)); +} + +_MTL_INLINE MTL::VertexDescriptor* MTL::RenderPipelineDescriptor::vertexDescriptor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexDescriptor)); +} + +_MTL_INLINE MTL::Function* MTL::RenderPipelineDescriptor::vertexFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexFunction)); +} + +_MTL_INLINE MTL::LinkedFunctions* MTL::RenderPipelineDescriptor::vertexLinkedFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexLinkedFunctions)); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineDescriptor::vertexPreloadedLibraries() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexPreloadedLibraries)); } -// static method: alloc _MTL_INLINE MTL::RenderPipelineFunctionsDescriptor* MTL::RenderPipelineFunctionsDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPipelineFunctionsDescriptor)); } -// method: init -_MTL_INLINE MTL::RenderPipelineFunctionsDescriptor* MTL::RenderPipelineFunctionsDescriptor::init() -{ - return NS::Object::init(); -} - -// property: vertexAdditionalBinaryFunctions -_MTL_INLINE NS::Array* MTL::RenderPipelineFunctionsDescriptor::vertexAdditionalBinaryFunctions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexAdditionalBinaryFunctions)); -} - -_MTL_INLINE void MTL::RenderPipelineFunctionsDescriptor::setVertexAdditionalBinaryFunctions(const NS::Array* vertexAdditionalBinaryFunctions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAdditionalBinaryFunctions_), vertexAdditionalBinaryFunctions); -} - -// property: fragmentAdditionalBinaryFunctions _MTL_INLINE NS::Array* MTL::RenderPipelineFunctionsDescriptor::fragmentAdditionalBinaryFunctions() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentAdditionalBinaryFunctions)); } +_MTL_INLINE MTL::RenderPipelineFunctionsDescriptor* MTL::RenderPipelineFunctionsDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::RenderPipelineFunctionsDescriptor::setFragmentAdditionalBinaryFunctions(const NS::Array* fragmentAdditionalBinaryFunctions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentAdditionalBinaryFunctions_), fragmentAdditionalBinaryFunctions); } -// property: tileAdditionalBinaryFunctions -_MTL_INLINE NS::Array* MTL::RenderPipelineFunctionsDescriptor::tileAdditionalBinaryFunctions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileAdditionalBinaryFunctions)); -} - _MTL_INLINE void MTL::RenderPipelineFunctionsDescriptor::setTileAdditionalBinaryFunctions(const NS::Array* tileAdditionalBinaryFunctions) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileAdditionalBinaryFunctions_), tileAdditionalBinaryFunctions); } -// property: label -_MTL_INLINE NS::String* MTL::RenderPipelineState::label() const +_MTL_INLINE void MTL::RenderPipelineFunctionsDescriptor::setVertexAdditionalBinaryFunctions(const NS::Array* vertexAdditionalBinaryFunctions) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setVertexAdditionalBinaryFunctions_), vertexAdditionalBinaryFunctions); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineFunctionsDescriptor::tileAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileAdditionalBinaryFunctions)); +} + +_MTL_INLINE NS::Array* MTL::RenderPipelineFunctionsDescriptor::vertexAdditionalBinaryFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(vertexAdditionalBinaryFunctions)); } -// property: device _MTL_INLINE MTL::Device* MTL::RenderPipelineState::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: maxTotalThreadsPerThreadgroup -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadsPerThreadgroup() const +_MTL_INLINE MTL::FunctionHandle* MTL::RenderPipelineState::functionHandle(const NS::String* name, MTL::RenderStages stage) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithName_stage_), name, stage); } -// property: threadgroupSizeMatchesTileSize -_MTL_INLINE bool MTL::RenderPipelineState::threadgroupSizeMatchesTileSize() const +_MTL_INLINE MTL::FunctionHandle* MTL::RenderPipelineState::functionHandle(const MTL4::BinaryFunction* function, MTL::RenderStages stage) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupSizeMatchesTileSize)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithBinaryFunction_stage_), function, stage); } -// property: imageblockSampleLength -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::imageblockSampleLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockSampleLength)); -} - -// method: imageblockMemoryLengthForDimensions: -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::imageblockMemoryLength(MTL::Size imageblockDimensions) -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockMemoryLengthForDimensions_), imageblockDimensions); -} - -// property: supportIndirectCommandBuffers -_MTL_INLINE bool MTL::RenderPipelineState::supportIndirectCommandBuffers() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); -} - -// property: maxTotalThreadsPerObjectThreadgroup -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadsPerObjectThreadgroup() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerObjectThreadgroup)); -} - -// property: maxTotalThreadsPerMeshThreadgroup -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadsPerMeshThreadgroup() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerMeshThreadgroup)); -} - -// property: objectThreadExecutionWidth -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::objectThreadExecutionWidth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectThreadExecutionWidth)); -} - -// property: meshThreadExecutionWidth -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::meshThreadExecutionWidth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshThreadExecutionWidth)); -} - -// property: maxTotalThreadgroupsPerMeshGrid -_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadgroupsPerMeshGrid() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadgroupsPerMeshGrid)); -} - -// property: gpuResourceID -_MTL_INLINE MTL::ResourceID MTL::RenderPipelineState::gpuResourceID() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); -} - -// method: functionHandleWithFunction:stage: _MTL_INLINE MTL::FunctionHandle* MTL::RenderPipelineState::functionHandle(const MTL::Function* function, MTL::RenderStages stage) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionHandleWithFunction_stage_), function, stage); } -// method: newVisibleFunctionTableWithDescriptor:stage: -_MTL_INLINE MTL::VisibleFunctionTable* MTL::RenderPipelineState::newVisibleFunctionTable(const MTL::VisibleFunctionTableDescriptor* descriptor, MTL::RenderStages stage) +_MTL_INLINE MTL::ResourceID MTL::RenderPipelineState::gpuResourceID() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newVisibleFunctionTableWithDescriptor_stage_), descriptor, stage); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::imageblockMemoryLength(MTL::Size imageblockDimensions) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockMemoryLengthForDimensions_), imageblockDimensions); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::imageblockSampleLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(imageblockSampleLength)); +} + +_MTL_INLINE NS::String* MTL::RenderPipelineState::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadgroupsPerMeshGrid() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadgroupsPerMeshGrid)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadsPerMeshThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerMeshThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadsPerObjectThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerObjectThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::maxTotalThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::meshThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshThreadExecutionWidth)); } -// method: newIntersectionFunctionTableWithDescriptor:stage: _MTL_INLINE MTL::IntersectionFunctionTable* MTL::RenderPipelineState::newIntersectionFunctionTable(const MTL::IntersectionFunctionTableDescriptor* descriptor, MTL::RenderStages stage) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newIntersectionFunctionTableWithDescriptor_stage_), descriptor, stage); } -// method: newRenderPipelineStateWithAdditionalBinaryFunctions:error: +_MTL_INLINE MTL4::PipelineDescriptor* MTL::RenderPipelineState::newRenderPipelineDescriptor() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineDescriptorForSpecialization)); +} + +_MTL_INLINE MTL::RenderPipelineState* MTL::RenderPipelineState::newRenderPipelineState(const MTL4::RenderPipelineBinaryFunctionsDescriptor* binaryFunctionsDescriptor, NS::Error** error) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithBinaryFunctions_error_), binaryFunctionsDescriptor, error); +} + _MTL_INLINE MTL::RenderPipelineState* MTL::RenderPipelineState::newRenderPipelineState(const MTL::RenderPipelineFunctionsDescriptor* additionalBinaryFunctions, NS::Error** error) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRenderPipelineStateWithAdditionalBinaryFunctions_error_), additionalBinaryFunctions, error); } -// static method: alloc +_MTL_INLINE MTL::VisibleFunctionTable* MTL::RenderPipelineState::newVisibleFunctionTable(const MTL::VisibleFunctionTableDescriptor* descriptor, MTL::RenderStages stage) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newVisibleFunctionTableWithDescriptor_stage_), descriptor, stage); +} + +_MTL_INLINE NS::UInteger MTL::RenderPipelineState::objectThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectThreadExecutionWidth)); +} + +_MTL_INLINE MTL::RenderPipelineReflection* MTL::RenderPipelineState::reflection() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(reflection)); +} + +_MTL_INLINE MTL::Size MTL::RenderPipelineState::requiredThreadsPerMeshThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerMeshThreadgroup)); +} + +_MTL_INLINE MTL::Size MTL::RenderPipelineState::requiredThreadsPerObjectThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerObjectThreadgroup)); +} + +_MTL_INLINE MTL::Size MTL::RenderPipelineState::requiredThreadsPerTileThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerTileThreadgroup)); +} + +_MTL_INLINE MTL::ShaderValidation MTL::RenderPipelineState::shaderValidation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE bool MTL::RenderPipelineState::supportIndirectCommandBuffers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); +} + +_MTL_INLINE bool MTL::RenderPipelineState::threadgroupSizeMatchesTileSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupSizeMatchesTileSize)); +} + _MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptorArray* MTL::RenderPipelineColorAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLRenderPipelineColorAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptorArray* MTL::RenderPipelineColorAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptor* MTL::RenderPipelineColorAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::RenderPipelineColorAttachmentDescriptorArray::setObject(const MTL::RenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptor* MTL::TileRenderPipelineColorAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTileRenderPipelineColorAttachmentDescriptor)); } -// method: init _MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptor* MTL::TileRenderPipelineColorAttachmentDescriptor::init() { return NS::Object::init(); } -// property: pixelFormat _MTL_INLINE MTL::PixelFormat MTL::TileRenderPipelineColorAttachmentDescriptor::pixelFormat() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); @@ -1204,113 +1410,84 @@ _MTL_INLINE void MTL::TileRenderPipelineColorAttachmentDescriptor::setPixelForma Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); } -// static method: alloc _MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptorArray* MTL::TileRenderPipelineColorAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTileRenderPipelineColorAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptorArray* MTL::TileRenderPipelineColorAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptor* MTL::TileRenderPipelineColorAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::TileRenderPipelineColorAttachmentDescriptorArray::setObject(const MTL::TileRenderPipelineColorAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::TileRenderPipelineDescriptor* MTL::TileRenderPipelineDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTileRenderPipelineDescriptor)); } -// method: init -_MTL_INLINE MTL::TileRenderPipelineDescriptor* MTL::TileRenderPipelineDescriptor::init() +_MTL_INLINE NS::Array* MTL::TileRenderPipelineDescriptor::binaryArchives() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); } -// property: label -_MTL_INLINE NS::String* MTL::TileRenderPipelineDescriptor::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setLabel(const NS::String* label) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); -} - -// property: tileFunction -_MTL_INLINE MTL::Function* MTL::TileRenderPipelineDescriptor::tileFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileFunction)); -} - -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setTileFunction(const MTL::Function* tileFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileFunction_), tileFunction); -} - -// property: rasterSampleCount -_MTL_INLINE NS::UInteger MTL::TileRenderPipelineDescriptor::rasterSampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); -} - -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); -} - -// property: colorAttachments _MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptorArray* MTL::TileRenderPipelineDescriptor::colorAttachments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); } -// property: threadgroupSizeMatchesTileSize -_MTL_INLINE bool MTL::TileRenderPipelineDescriptor::threadgroupSizeMatchesTileSize() const +_MTL_INLINE MTL::TileRenderPipelineDescriptor* MTL::TileRenderPipelineDescriptor::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupSizeMatchesTileSize)); + return NS::Object::init(); } -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize) +_MTL_INLINE NS::String* MTL::TileRenderPipelineDescriptor::label() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupSizeMatchesTileSize_), threadgroupSizeMatchesTileSize); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -// property: tileBuffers -_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::TileRenderPipelineDescriptor::tileBuffers() const +_MTL_INLINE MTL::LinkedFunctions* MTL::TileRenderPipelineDescriptor::linkedFunctions() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileBuffers)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(linkedFunctions)); +} + +_MTL_INLINE NS::UInteger MTL::TileRenderPipelineDescriptor::maxCallStackDepth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCallStackDepth)); } -// property: maxTotalThreadsPerThreadgroup _MTL_INLINE NS::UInteger MTL::TileRenderPipelineDescriptor::maxTotalThreadsPerThreadgroup() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup)); } -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) +_MTL_INLINE NS::Array* MTL::TileRenderPipelineDescriptor::preloadedLibraries() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(preloadedLibraries)); } -// property: binaryArchives -_MTL_INLINE NS::Array* MTL::TileRenderPipelineDescriptor::binaryArchives() const +_MTL_INLINE NS::UInteger MTL::TileRenderPipelineDescriptor::rasterSampleCount() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); +} + +_MTL_INLINE MTL::Size MTL::TileRenderPipelineDescriptor::requiredThreadsPerThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup)); +} + +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } _MTL_INLINE void MTL::TileRenderPipelineDescriptor::setBinaryArchives(const NS::Array* binaryArchives) @@ -1318,21 +1495,9 @@ _MTL_INLINE void MTL::TileRenderPipelineDescriptor::setBinaryArchives(const NS:: Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryArchives_), binaryArchives); } -// property: preloadedLibraries -_MTL_INLINE NS::Array* MTL::TileRenderPipelineDescriptor::preloadedLibraries() const +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setLabel(const NS::String* label) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(preloadedLibraries)); -} - -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setPreloadedLibraries(const NS::Array* preloadedLibraries) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreloadedLibraries_), preloadedLibraries); -} - -// property: linkedFunctions -_MTL_INLINE MTL::LinkedFunctions* MTL::TileRenderPipelineDescriptor::linkedFunctions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(linkedFunctions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } _MTL_INLINE void MTL::TileRenderPipelineDescriptor::setLinkedFunctions(const MTL::LinkedFunctions* linkedFunctions) @@ -1340,10 +1505,34 @@ _MTL_INLINE void MTL::TileRenderPipelineDescriptor::setLinkedFunctions(const MTL Object::sendMessage(this, _MTL_PRIVATE_SEL(setLinkedFunctions_), linkedFunctions); } -// property: supportAddingBinaryFunctions -_MTL_INLINE bool MTL::TileRenderPipelineDescriptor::supportAddingBinaryFunctions() const +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setMaxCallStackDepth(NS::UInteger maxCallStackDepth) { - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingBinaryFunctions)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCallStackDepth_), maxCallStackDepth); +} + +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setPreloadedLibraries(const NS::Array* preloadedLibraries) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPreloadedLibraries_), preloadedLibraries); +} + +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); +} + +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerThreadgroup_), requiredThreadsPerThreadgroup); +} + +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setShaderValidation(MTL::ShaderValidation shaderValidation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setShaderValidation_), shaderValidation); } _MTL_INLINE void MTL::TileRenderPipelineDescriptor::setSupportAddingBinaryFunctions(bool supportAddingBinaryFunctions) @@ -1351,178 +1540,199 @@ _MTL_INLINE void MTL::TileRenderPipelineDescriptor::setSupportAddingBinaryFuncti Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportAddingBinaryFunctions_), supportAddingBinaryFunctions); } -// property: maxCallStackDepth -_MTL_INLINE NS::UInteger MTL::TileRenderPipelineDescriptor::maxCallStackDepth() const +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxCallStackDepth)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setThreadgroupSizeMatchesTileSize_), threadgroupSizeMatchesTileSize); } -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setMaxCallStackDepth(NS::UInteger maxCallStackDepth) +_MTL_INLINE void MTL::TileRenderPipelineDescriptor::setTileFunction(const MTL::Function* tileFunction) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxCallStackDepth_), maxCallStackDepth); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTileFunction_), tileFunction); } -// method: reset -_MTL_INLINE void MTL::TileRenderPipelineDescriptor::reset() +_MTL_INLINE MTL::ShaderValidation MTL::TileRenderPipelineDescriptor::shaderValidation() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE bool MTL::TileRenderPipelineDescriptor::supportAddingBinaryFunctions() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportAddingBinaryFunctions)); +} + +_MTL_INLINE bool MTL::TileRenderPipelineDescriptor::threadgroupSizeMatchesTileSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(threadgroupSizeMatchesTileSize)); +} + +_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::TileRenderPipelineDescriptor::tileBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileBuffers)); +} + +_MTL_INLINE MTL::Function* MTL::TileRenderPipelineDescriptor::tileFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tileFunction)); } -// static method: alloc _MTL_INLINE MTL::MeshRenderPipelineDescriptor* MTL::MeshRenderPipelineDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLMeshRenderPipelineDescriptor)); } -// method: init -_MTL_INLINE MTL::MeshRenderPipelineDescriptor* MTL::MeshRenderPipelineDescriptor::init() +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::alphaToCoverageEnabled() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToCoverageEnabled)); } -// property: label -_MTL_INLINE NS::String* MTL::MeshRenderPipelineDescriptor::label() const +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::alphaToOneEnabled() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToOneEnabled)); } -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setLabel(const NS::String* label) +_MTL_INLINE NS::Array* MTL::MeshRenderPipelineDescriptor::binaryArchives() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(binaryArchives)); } -// property: objectFunction -_MTL_INLINE MTL::Function* MTL::MeshRenderPipelineDescriptor::objectFunction() const +_MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptorArray* MTL::MeshRenderPipelineDescriptor::colorAttachments() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectFunction)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); } -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setObjectFunction(const MTL::Function* objectFunction) +_MTL_INLINE MTL::PixelFormat MTL::MeshRenderPipelineDescriptor::depthAttachmentPixelFormat() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectFunction_), objectFunction); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthAttachmentPixelFormat)); } -// property: meshFunction -_MTL_INLINE MTL::Function* MTL::MeshRenderPipelineDescriptor::meshFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshFunction)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMeshFunction(const MTL::Function* meshFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshFunction_), meshFunction); -} - -// property: fragmentFunction -_MTL_INLINE MTL::Function* MTL::MeshRenderPipelineDescriptor::fragmentFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentFunction)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setFragmentFunction(const MTL::Function* fragmentFunction) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentFunction_), fragmentFunction); -} - -// property: maxTotalThreadsPerObjectThreadgroup -_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxTotalThreadsPerObjectThreadgroup() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerObjectThreadgroup)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxTotalThreadsPerObjectThreadgroup(NS::UInteger maxTotalThreadsPerObjectThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerObjectThreadgroup_), maxTotalThreadsPerObjectThreadgroup); -} - -// property: maxTotalThreadsPerMeshThreadgroup -_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxTotalThreadsPerMeshThreadgroup() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerMeshThreadgroup)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxTotalThreadsPerMeshThreadgroup(NS::UInteger maxTotalThreadsPerMeshThreadgroup) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerMeshThreadgroup_), maxTotalThreadsPerMeshThreadgroup); -} - -// property: objectThreadgroupSizeIsMultipleOfThreadExecutionWidth -_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::objectThreadgroupSizeIsMultipleOfThreadExecutionWidth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth_), objectThreadgroupSizeIsMultipleOfThreadExecutionWidth); -} - -// property: meshThreadgroupSizeIsMultipleOfThreadExecutionWidth -_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::meshThreadgroupSizeIsMultipleOfThreadExecutionWidth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth_), meshThreadgroupSizeIsMultipleOfThreadExecutionWidth); -} - -// property: payloadMemoryLength -_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::payloadMemoryLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(payloadMemoryLength)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setPayloadMemoryLength(NS::UInteger payloadMemoryLength) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPayloadMemoryLength_), payloadMemoryLength); -} - -// property: maxTotalThreadgroupsPerMeshGrid -_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxTotalThreadgroupsPerMeshGrid() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadgroupsPerMeshGrid)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxTotalThreadgroupsPerMeshGrid(NS::UInteger maxTotalThreadgroupsPerMeshGrid) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadgroupsPerMeshGrid_), maxTotalThreadgroupsPerMeshGrid); -} - -// property: objectBuffers -_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::MeshRenderPipelineDescriptor::objectBuffers() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectBuffers)); -} - -// property: meshBuffers -_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::MeshRenderPipelineDescriptor::meshBuffers() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshBuffers)); -} - -// property: fragmentBuffers _MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::MeshRenderPipelineDescriptor::fragmentBuffers() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentBuffers)); } -// property: rasterSampleCount +_MTL_INLINE MTL::Function* MTL::MeshRenderPipelineDescriptor::fragmentFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentFunction)); +} + +_MTL_INLINE MTL::LinkedFunctions* MTL::MeshRenderPipelineDescriptor::fragmentLinkedFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(fragmentLinkedFunctions)); +} + +_MTL_INLINE MTL::MeshRenderPipelineDescriptor* MTL::MeshRenderPipelineDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::isAlphaToCoverageEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToCoverageEnabled)); +} + +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::isAlphaToOneEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToOneEnabled)); +} + +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::isRasterizationEnabled() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); +} + +_MTL_INLINE NS::String* MTL::MeshRenderPipelineDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxTotalThreadgroupsPerMeshGrid() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadgroupsPerMeshGrid)); +} + +_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxTotalThreadsPerMeshThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerMeshThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxTotalThreadsPerObjectThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerObjectThreadgroup)); +} + +_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxVertexAmplificationCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexAmplificationCount)); +} + +_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::MeshRenderPipelineDescriptor::meshBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshBuffers)); +} + +_MTL_INLINE MTL::Function* MTL::MeshRenderPipelineDescriptor::meshFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshFunction)); +} + +_MTL_INLINE MTL::LinkedFunctions* MTL::MeshRenderPipelineDescriptor::meshLinkedFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshLinkedFunctions)); +} + +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::meshThreadgroupSizeIsMultipleOfThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth)); +} + +_MTL_INLINE MTL::PipelineBufferDescriptorArray* MTL::MeshRenderPipelineDescriptor::objectBuffers() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectBuffers)); +} + +_MTL_INLINE MTL::Function* MTL::MeshRenderPipelineDescriptor::objectFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectFunction)); +} + +_MTL_INLINE MTL::LinkedFunctions* MTL::MeshRenderPipelineDescriptor::objectLinkedFunctions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectLinkedFunctions)); +} + +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::objectThreadgroupSizeIsMultipleOfThreadExecutionWidth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth)); +} + +_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::payloadMemoryLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(payloadMemoryLength)); +} + _MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::rasterSampleCount() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(rasterSampleCount)); } -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::rasterizationEnabled() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); } -// property: alphaToCoverageEnabled -_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::alphaToCoverageEnabled() const +_MTL_INLINE MTL::Size MTL::MeshRenderPipelineDescriptor::requiredThreadsPerMeshThreadgroup() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToCoverageEnabled)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerMeshThreadgroup)); +} + +_MTL_INLINE MTL::Size MTL::MeshRenderPipelineDescriptor::requiredThreadsPerObjectThreadgroup() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(requiredThreadsPerObjectThreadgroup)); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setAlphaToCoverageEnabled(bool alphaToCoverageEnabled) @@ -1530,49 +1740,14 @@ _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setAlphaToCoverageEnabled(bo Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToCoverageEnabled_), alphaToCoverageEnabled); } -// property: alphaToOneEnabled -_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::alphaToOneEnabled() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAlphaToOneEnabled)); -} - _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setAlphaToOneEnabled(bool alphaToOneEnabled) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setAlphaToOneEnabled_), alphaToOneEnabled); } -// property: rasterizationEnabled -_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::rasterizationEnabled() const +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setBinaryArchives(const NS::Array* binaryArchives) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isRasterizationEnabled)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setRasterizationEnabled(bool rasterizationEnabled) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationEnabled_), rasterizationEnabled); -} - -// property: maxVertexAmplificationCount -_MTL_INLINE NS::UInteger MTL::MeshRenderPipelineDescriptor::maxVertexAmplificationCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxVertexAmplificationCount)); -} - -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexAmplificationCount_), maxVertexAmplificationCount); -} - -// property: colorAttachments -_MTL_INLINE MTL::RenderPipelineColorAttachmentDescriptorArray* MTL::MeshRenderPipelineDescriptor::colorAttachments() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(colorAttachments)); -} - -// property: depthAttachmentPixelFormat -_MTL_INLINE MTL::PixelFormat MTL::MeshRenderPipelineDescriptor::depthAttachmentPixelFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depthAttachmentPixelFormat)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setBinaryArchives_), binaryArchives); } _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setDepthAttachmentPixelFormat(MTL::PixelFormat depthAttachmentPixelFormat) @@ -1580,10 +1755,99 @@ _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setDepthAttachmentPixelForma Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepthAttachmentPixelFormat_), depthAttachmentPixelFormat); } -// property: stencilAttachmentPixelFormat -_MTL_INLINE MTL::PixelFormat MTL::MeshRenderPipelineDescriptor::stencilAttachmentPixelFormat() const +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setFragmentFunction(const MTL::Function* fragmentFunction) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachmentPixelFormat)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentFunction_), fragmentFunction); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setFragmentLinkedFunctions(const MTL::LinkedFunctions* fragmentLinkedFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFragmentLinkedFunctions_), fragmentLinkedFunctions); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxTotalThreadgroupsPerMeshGrid(NS::UInteger maxTotalThreadgroupsPerMeshGrid) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadgroupsPerMeshGrid_), maxTotalThreadgroupsPerMeshGrid); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxTotalThreadsPerMeshThreadgroup(NS::UInteger maxTotalThreadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerMeshThreadgroup_), maxTotalThreadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxTotalThreadsPerObjectThreadgroup(NS::UInteger maxTotalThreadsPerObjectThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerObjectThreadgroup_), maxTotalThreadsPerObjectThreadgroup); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMaxVertexAmplificationCount(NS::UInteger maxVertexAmplificationCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxVertexAmplificationCount_), maxVertexAmplificationCount); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMeshFunction(const MTL::Function* meshFunction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshFunction_), meshFunction); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMeshLinkedFunctions(const MTL::LinkedFunctions* meshLinkedFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshLinkedFunctions_), meshLinkedFunctions); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool meshThreadgroupSizeIsMultipleOfThreadExecutionWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth_), meshThreadgroupSizeIsMultipleOfThreadExecutionWidth); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setObjectFunction(const MTL::Function* objectFunction) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectFunction_), objectFunction); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setObjectLinkedFunctions(const MTL::LinkedFunctions* objectLinkedFunctions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectLinkedFunctions_), objectLinkedFunctions); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(bool objectThreadgroupSizeIsMultipleOfThreadExecutionWidth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth_), objectThreadgroupSizeIsMultipleOfThreadExecutionWidth); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setPayloadMemoryLength(NS::UInteger payloadMemoryLength) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPayloadMemoryLength_), payloadMemoryLength); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setRasterizationEnabled(bool rasterizationEnabled) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRasterizationEnabled_), rasterizationEnabled); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setRequiredThreadsPerMeshThreadgroup(MTL::Size requiredThreadsPerMeshThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerMeshThreadgroup_), requiredThreadsPerMeshThreadgroup); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setRequiredThreadsPerObjectThreadgroup(MTL::Size requiredThreadsPerObjectThreadgroup) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerObjectThreadgroup_), requiredThreadsPerObjectThreadgroup); +} + +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setShaderValidation(MTL::ShaderValidation shaderValidation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setShaderValidation_), shaderValidation); } _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setStencilAttachmentPixelFormat(MTL::PixelFormat stencilAttachmentPixelFormat) @@ -1591,8 +1855,22 @@ _MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setStencilAttachmentPixelFor Object::sendMessage(this, _MTL_PRIVATE_SEL(setStencilAttachmentPixelFormat_), stencilAttachmentPixelFormat); } -// method: reset -_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::reset() +_MTL_INLINE void MTL::MeshRenderPipelineDescriptor::setSupportIndirectCommandBuffers(bool supportIndirectCommandBuffers) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportIndirectCommandBuffers_), supportIndirectCommandBuffers); +} + +_MTL_INLINE MTL::ShaderValidation MTL::MeshRenderPipelineDescriptor::shaderValidation() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(shaderValidation)); +} + +_MTL_INLINE MTL::PixelFormat MTL::MeshRenderPipelineDescriptor::stencilAttachmentPixelFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stencilAttachmentPixelFormat)); +} + +_MTL_INLINE bool MTL::MeshRenderPipelineDescriptor::supportIndirectCommandBuffers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportIndirectCommandBuffers)); } diff --git a/vendor/metal-cpp/Metal/MTLResidencySet.hpp b/vendor/metal-cpp/Metal/MTLResidencySet.hpp new file mode 100644 index 000000000..d073972d9 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLResidencySet.hpp @@ -0,0 +1,178 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLResidencySet.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include + +namespace MTL +{ +class Allocation; +class Device; +class ResidencySetDescriptor; + +class ResidencySetDescriptor : public NS::Copying +{ +public: + static ResidencySetDescriptor* alloc(); + + ResidencySetDescriptor* init(); + NS::UInteger initialCapacity() const; + + NS::String* label() const; + + void setInitialCapacity(NS::UInteger initialCapacity); + + void setLabel(const NS::String* label); +}; +class ResidencySet : public NS::Referencing +{ +public: + void addAllocation(const MTL::Allocation* allocation); + void addAllocations(const MTL::Allocation* const allocations[], NS::UInteger count); + + NS::Array* allAllocations() const; + + uint64_t allocatedSize() const; + + NS::UInteger allocationCount() const; + + void commit(); + + bool containsAllocation(const MTL::Allocation* anAllocation); + + Device* device() const; + + void endResidency(); + + NS::String* label() const; + + void removeAllAllocations(); + + void removeAllocation(const MTL::Allocation* allocation); + void removeAllocations(const MTL::Allocation* const allocations[], NS::UInteger count); + + void requestResidency(); +}; + +} +_MTL_INLINE MTL::ResidencySetDescriptor* MTL::ResidencySetDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLResidencySetDescriptor)); +} + +_MTL_INLINE MTL::ResidencySetDescriptor* MTL::ResidencySetDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::UInteger MTL::ResidencySetDescriptor::initialCapacity() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initialCapacity)); +} + +_MTL_INLINE NS::String* MTL::ResidencySetDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL::ResidencySetDescriptor::setInitialCapacity(NS::UInteger initialCapacity) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setInitialCapacity_), initialCapacity); +} + +_MTL_INLINE void MTL::ResidencySetDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL::ResidencySet::addAllocation(const MTL::Allocation* allocation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addAllocation_), allocation); +} + +_MTL_INLINE void MTL::ResidencySet::addAllocations(const MTL::Allocation* const allocations[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(addAllocations_count_), allocations, count); +} + +_MTL_INLINE NS::Array* MTL::ResidencySet::allAllocations() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allAllocations)); +} + +_MTL_INLINE uint64_t MTL::ResidencySet::allocatedSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allocatedSize)); +} + +_MTL_INLINE NS::UInteger MTL::ResidencySet::allocationCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allocationCount)); +} + +_MTL_INLINE void MTL::ResidencySet::commit() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(commit)); +} + +_MTL_INLINE bool MTL::ResidencySet::containsAllocation(const MTL::Allocation* anAllocation) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(containsAllocation_), anAllocation); +} + +_MTL_INLINE MTL::Device* MTL::ResidencySet::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE void MTL::ResidencySet::endResidency() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(endResidency)); +} + +_MTL_INLINE NS::String* MTL::ResidencySet::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE void MTL::ResidencySet::removeAllAllocations() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeAllAllocations)); +} + +_MTL_INLINE void MTL::ResidencySet::removeAllocation(const MTL::Allocation* allocation) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeAllocation_), allocation); +} + +_MTL_INLINE void MTL::ResidencySet::removeAllocations(const MTL::Allocation* const allocations[], NS::UInteger count) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(removeAllocations_count_), allocations, count); +} + +_MTL_INLINE void MTL::ResidencySet::requestResidency() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(requestResidency)); +} diff --git a/vendor/metal-cpp/Metal/MTLResource.hpp b/vendor/metal-cpp/Metal/MTLResource.hpp index 69c57d38d..21e49bb93 100644 --- a/vendor/metal-cpp/Metal/MTLResource.hpp +++ b/vendor/metal-cpp/Metal/MTLResource.hpp @@ -2,7 +2,7 @@ // // Metal/MTLResource.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,17 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLAllocation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLResource.hpp" +#include namespace MTL { +class Device; +class Heap; _MTL_ENUM(NS::UInteger, PurgeableState) { PurgeableStateKeepCurrent = 1, PurgeableStateNonVolatile = 2, @@ -55,124 +56,135 @@ _MTL_ENUM(NS::UInteger, HazardTrackingMode) { HazardTrackingModeTracked = 2, }; -_MTL_OPTIONS(NS::UInteger, ResourceOptions) { - ResourceStorageModeShared = 0, - ResourceHazardTrackingModeDefault = 0, - ResourceCPUCacheModeDefaultCache = 0, - ResourceOptionCPUCacheModeDefault = 0, - ResourceCPUCacheModeWriteCombined = 1, - ResourceOptionCPUCacheModeWriteCombined = 1, - ResourceStorageModeManaged = 16, - ResourceStorageModePrivate = 32, - ResourceStorageModeMemoryless = 48, - ResourceHazardTrackingModeUntracked = 256, - ResourceHazardTrackingModeTracked = 512, +_MTL_ENUM(NS::Integer, SparsePageSize) { + SparsePageSize16 = 101, + SparsePageSize64 = 102, + SparsePageSize256 = 103, }; -class Resource : public NS::Referencing +_MTL_ENUM(NS::Integer, BufferSparseTier) { + BufferSparseTierNone = 0, + BufferSparseTier1 = 1, +}; + +_MTL_ENUM(NS::Integer, TextureSparseTier) { + TextureSparseTierNone = 0, + TextureSparseTier1 = 1, + TextureSparseTier2 = 2, +}; + +_MTL_OPTIONS(NS::UInteger, ResourceOptions) { + ResourceCPUCacheModeDefaultCache = 0, + ResourceCPUCacheModeWriteCombined = 1, + ResourceStorageModeShared = 0, + ResourceStorageModeManaged = 1 << 4, + ResourceStorageModePrivate = 1 << 5, + ResourceStorageModeMemoryless = 1 << 5, + ResourceHazardTrackingModeDefault = 0, + ResourceHazardTrackingModeUntracked = 1 << 8, + ResourceHazardTrackingModeTracked = 1 << 9, + ResourceOptionCPUCacheModeDefault = 0, + ResourceOptionCPUCacheModeWriteCombined = 1, +}; + +class Resource : public NS::Referencing { public: - NS::String* label() const; - void setLabel(const NS::String* label); + NS::UInteger allocatedSize() const; - class Device* device() const; + CPUCacheMode cpuCacheMode() const; - MTL::CPUCacheMode cpuCacheMode() const; + Device* device() const; - MTL::StorageMode storageMode() const; + HazardTrackingMode hazardTrackingMode() const; - MTL::HazardTrackingMode hazardTrackingMode() const; + Heap* heap() const; + NS::UInteger heapOffset() const; - MTL::ResourceOptions resourceOptions() const; + bool isAliasable(); - MTL::PurgeableState setPurgeableState(MTL::PurgeableState state); + NS::String* label() const; - class Heap* heap() const; + void makeAliasable(); - NS::UInteger heapOffset() const; + ResourceOptions resourceOptions() const; - NS::UInteger allocatedSize() const; + void setLabel(const NS::String* label); - void makeAliasable(); + kern_return_t setOwner(task_id_token_t task_id_token); - bool isAliasable(); + PurgeableState setPurgeableState(MTL::PurgeableState state); + + StorageMode storageMode() const; }; } +_MTL_INLINE NS::UInteger MTL::Resource::allocatedSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allocatedSize)); +} + +_MTL_INLINE MTL::CPUCacheMode MTL::Resource::cpuCacheMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); +} + +_MTL_INLINE MTL::Device* MTL::Resource::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE MTL::HazardTrackingMode MTL::Resource::hazardTrackingMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); +} + +_MTL_INLINE MTL::Heap* MTL::Resource::heap() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(heap)); +} + +_MTL_INLINE NS::UInteger MTL::Resource::heapOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapOffset)); +} + +_MTL_INLINE bool MTL::Resource::isAliasable() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAliasable)); +} -// property: label _MTL_INLINE NS::String* MTL::Resource::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } +_MTL_INLINE void MTL::Resource::makeAliasable() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(makeAliasable)); +} + +_MTL_INLINE MTL::ResourceOptions MTL::Resource::resourceOptions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); +} + _MTL_INLINE void MTL::Resource::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: device -_MTL_INLINE MTL::Device* MTL::Resource::device() const +_MTL_INLINE kern_return_t MTL::Resource::setOwner(task_id_token_t task_id_token) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(setOwnerWithIdentity_), task_id_token); } -// property: cpuCacheMode -_MTL_INLINE MTL::CPUCacheMode MTL::Resource::cpuCacheMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); -} - -// property: storageMode -_MTL_INLINE MTL::StorageMode MTL::Resource::storageMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); -} - -// property: hazardTrackingMode -_MTL_INLINE MTL::HazardTrackingMode MTL::Resource::hazardTrackingMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); -} - -// property: resourceOptions -_MTL_INLINE MTL::ResourceOptions MTL::Resource::resourceOptions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); -} - -// method: setPurgeableState: _MTL_INLINE MTL::PurgeableState MTL::Resource::setPurgeableState(MTL::PurgeableState state) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(setPurgeableState_), state); } -// property: heap -_MTL_INLINE MTL::Heap* MTL::Resource::heap() const +_MTL_INLINE MTL::StorageMode MTL::Resource::storageMode() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(heap)); -} - -// property: heapOffset -_MTL_INLINE NS::UInteger MTL::Resource::heapOffset() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(heapOffset)); -} - -// property: allocatedSize -_MTL_INLINE NS::UInteger MTL::Resource::allocatedSize() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(allocatedSize)); -} - -// method: makeAliasable -_MTL_INLINE void MTL::Resource::makeAliasable() -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(makeAliasable)); -} - -// method: isAliasable -_MTL_INLINE bool MTL::Resource::isAliasable() -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isAliasable)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); } diff --git a/vendor/metal-cpp/Metal/MTLResourceStateCommandEncoder.hpp b/vendor/metal-cpp/Metal/MTLResourceStateCommandEncoder.hpp index cf54f387d..3f565c30f 100644 --- a/vendor/metal-cpp/Metal/MTLResourceStateCommandEncoder.hpp +++ b/vendor/metal-cpp/Metal/MTLResourceStateCommandEncoder.hpp @@ -2,7 +2,7 @@ // // Metal/MTLResourceStateCommandEncoder.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,17 +20,20 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLCommandEncoder.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLCommandEncoder.hpp" #include "MTLTypes.hpp" +#include namespace MTL { +class Buffer; +class Fence; +struct Region; +class Texture; _MTL_ENUM(NS::UInteger, SparseTextureMappingMode) { SparseTextureMappingModeMap = 0, SparseTextureMappingModeUnmap = 1, @@ -51,53 +54,45 @@ struct MapIndirectArguments class ResourceStateCommandEncoder : public NS::Referencing { public: - 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); + void moveTextureMappingsFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); - void updateTextureMapping(const class Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Region region, const NS::UInteger mipLevel, const NS::UInteger slice); + void updateFence(const MTL::Fence* fence); - void updateTextureMapping(const class Texture* texture, const MTL::SparseTextureMappingMode mode, const class Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); + void updateTextureMapping(const MTL::Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Region region, const NS::UInteger mipLevel, const NS::UInteger slice); + void updateTextureMapping(const MTL::Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset); + void updateTextureMappings(const MTL::Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Region* regions, const NS::UInteger* mipLevels, const NS::UInteger* slices, NS::UInteger numRegions); - void updateFence(const class Fence* fence); - - void waitForFence(const class Fence* fence); - - void moveTextureMappingsFromTexture(const class Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const class Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin); + void waitForFence(const MTL::Fence* fence); }; } -// method: updateTextureMappings:mode:regions:mipLevels:slices:numRegions: -_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) +_MTL_INLINE void MTL::ResourceStateCommandEncoder::moveTextureMappingsFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMappings_mode_regions_mipLevels_slices_numRegions_), texture, mode, regions, mipLevels, slices, numRegions); + Object::sendMessage(this, _MTL_PRIVATE_SEL(moveTextureMappingsFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); } -// method: updateTextureMapping:mode:region:mipLevel:slice: -_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) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMapping_mode_region_mipLevel_slice_), texture, mode, region, mipLevel, slice); -} - -// method: updateTextureMapping:mode:indirectBuffer:indirectBufferOffset: -_MTL_INLINE void MTL::ResourceStateCommandEncoder::updateTextureMapping(const MTL::Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMapping_mode_indirectBuffer_indirectBufferOffset_), texture, mode, indirectBuffer, indirectBufferOffset); -} - -// method: updateFence: _MTL_INLINE void MTL::ResourceStateCommandEncoder::updateFence(const MTL::Fence* fence) { Object::sendMessage(this, _MTL_PRIVATE_SEL(updateFence_), fence); } -// method: waitForFence: +_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) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMapping_mode_region_mipLevel_slice_), texture, mode, region, mipLevel, slice); +} + +_MTL_INLINE void MTL::ResourceStateCommandEncoder::updateTextureMapping(const MTL::Texture* texture, const MTL::SparseTextureMappingMode mode, const MTL::Buffer* indirectBuffer, NS::UInteger indirectBufferOffset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMapping_mode_indirectBuffer_indirectBufferOffset_), texture, mode, indirectBuffer, indirectBufferOffset); +} + +_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) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(updateTextureMappings_mode_regions_mipLevels_slices_numRegions_), texture, mode, regions, mipLevels, slices, numRegions); +} + _MTL_INLINE void MTL::ResourceStateCommandEncoder::waitForFence(const MTL::Fence* fence) { Object::sendMessage(this, _MTL_PRIVATE_SEL(waitForFence_), fence); } - -// method: moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin: -_MTL_INLINE void MTL::ResourceStateCommandEncoder::moveTextureMappingsFromTexture(const MTL::Texture* sourceTexture, NS::UInteger sourceSlice, NS::UInteger sourceLevel, MTL::Origin sourceOrigin, MTL::Size sourceSize, const MTL::Texture* destinationTexture, NS::UInteger destinationSlice, NS::UInteger destinationLevel, MTL::Origin destinationOrigin) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(moveTextureMappingsFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_), sourceTexture, sourceSlice, sourceLevel, sourceOrigin, sourceSize, destinationTexture, destinationSlice, destinationLevel, destinationOrigin); -} diff --git a/vendor/metal-cpp/Metal/MTLResourceStatePass.hpp b/vendor/metal-cpp/Metal/MTLResourceStatePass.hpp index 3c759b1a5..f3689012e 100644 --- a/vendor/metal-cpp/Metal/MTLResourceStatePass.hpp +++ b/vendor/metal-cpp/Metal/MTLResourceStatePass.hpp @@ -2,7 +2,7 @@ // // Metal/MTLResourceStatePass.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,145 +20,134 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - namespace MTL { +class CounterSampleBuffer; +class ResourceStatePassDescriptor; +class ResourceStatePassSampleBufferAttachmentDescriptor; +class ResourceStatePassSampleBufferAttachmentDescriptorArray; + class ResourceStatePassSampleBufferAttachmentDescriptor : public NS::Copying { public: - static class ResourceStatePassSampleBufferAttachmentDescriptor* alloc(); + static ResourceStatePassSampleBufferAttachmentDescriptor* alloc(); - class ResourceStatePassSampleBufferAttachmentDescriptor* init(); + NS::UInteger endOfEncoderSampleIndex() const; - class CounterSampleBuffer* sampleBuffer() const; - void setSampleBuffer(const class CounterSampleBuffer* sampleBuffer); + ResourceStatePassSampleBufferAttachmentDescriptor* init(); - NS::UInteger startOfEncoderSampleIndex() const; - void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + CounterSampleBuffer* sampleBuffer() const; - NS::UInteger endOfEncoderSampleIndex() const; - void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + void setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex); + + void setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer); + + void setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex); + NS::UInteger startOfEncoderSampleIndex() const; }; - class ResourceStatePassSampleBufferAttachmentDescriptorArray : public NS::Referencing { public: - static class ResourceStatePassSampleBufferAttachmentDescriptorArray* alloc(); + static ResourceStatePassSampleBufferAttachmentDescriptorArray* alloc(); - class ResourceStatePassSampleBufferAttachmentDescriptorArray* init(); + ResourceStatePassSampleBufferAttachmentDescriptorArray* init(); - class ResourceStatePassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); - - void setObject(const class ResourceStatePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); + ResourceStatePassSampleBufferAttachmentDescriptor* object(NS::UInteger attachmentIndex); + void setObject(const MTL::ResourceStatePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex); }; - class ResourceStatePassDescriptor : public NS::Copying { public: - static class ResourceStatePassDescriptor* alloc(); + static ResourceStatePassDescriptor* alloc(); - class ResourceStatePassDescriptor* init(); + ResourceStatePassDescriptor* init(); - static class ResourceStatePassDescriptor* resourceStatePassDescriptor(); + static ResourceStatePassDescriptor* resourceStatePassDescriptor(); - class ResourceStatePassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; + ResourceStatePassSampleBufferAttachmentDescriptorArray* sampleBufferAttachments() const; }; } - -// static method: alloc _MTL_INLINE MTL::ResourceStatePassSampleBufferAttachmentDescriptor* MTL::ResourceStatePassSampleBufferAttachmentDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLResourceStatePassSampleBufferAttachmentDescriptor)); } -// method: init +_MTL_INLINE NS::UInteger MTL::ResourceStatePassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::ResourceStatePassSampleBufferAttachmentDescriptor* MTL::ResourceStatePassSampleBufferAttachmentDescriptor::init() { return NS::Object::init(); } -// property: sampleBuffer _MTL_INLINE MTL::CounterSampleBuffer* MTL::ResourceStatePassSampleBufferAttachmentDescriptor::sampleBuffer() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBuffer)); } -_MTL_INLINE void MTL::ResourceStatePassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); -} - -// property: startOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::ResourceStatePassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); -} - -_MTL_INLINE void MTL::ResourceStatePassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); -} - -// property: endOfEncoderSampleIndex -_MTL_INLINE NS::UInteger MTL::ResourceStatePassSampleBufferAttachmentDescriptor::endOfEncoderSampleIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(endOfEncoderSampleIndex)); -} - _MTL_INLINE void MTL::ResourceStatePassSampleBufferAttachmentDescriptor::setEndOfEncoderSampleIndex(NS::UInteger endOfEncoderSampleIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setEndOfEncoderSampleIndex_), endOfEncoderSampleIndex); } -// static method: alloc +_MTL_INLINE void MTL::ResourceStatePassSampleBufferAttachmentDescriptor::setSampleBuffer(const MTL::CounterSampleBuffer* sampleBuffer) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleBuffer_), sampleBuffer); +} + +_MTL_INLINE void MTL::ResourceStatePassSampleBufferAttachmentDescriptor::setStartOfEncoderSampleIndex(NS::UInteger startOfEncoderSampleIndex) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStartOfEncoderSampleIndex_), startOfEncoderSampleIndex); +} + +_MTL_INLINE NS::UInteger MTL::ResourceStatePassSampleBufferAttachmentDescriptor::startOfEncoderSampleIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(startOfEncoderSampleIndex)); +} + _MTL_INLINE MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray* MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLResourceStatePassSampleBufferAttachmentDescriptorArray)); } -// method: init _MTL_INLINE MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray* MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::ResourceStatePassSampleBufferAttachmentDescriptor* MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray::object(NS::UInteger attachmentIndex) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), attachmentIndex); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray::setObject(const MTL::ResourceStatePassSampleBufferAttachmentDescriptor* attachment, NS::UInteger attachmentIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attachment, attachmentIndex); } -// static method: alloc _MTL_INLINE MTL::ResourceStatePassDescriptor* MTL::ResourceStatePassDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLResourceStatePassDescriptor)); } -// method: init _MTL_INLINE MTL::ResourceStatePassDescriptor* MTL::ResourceStatePassDescriptor::init() { return NS::Object::init(); } -// static method: resourceStatePassDescriptor _MTL_INLINE MTL::ResourceStatePassDescriptor* MTL::ResourceStatePassDescriptor::resourceStatePassDescriptor() { return Object::sendMessage(_MTL_PRIVATE_CLS(MTLResourceStatePassDescriptor), _MTL_PRIVATE_SEL(resourceStatePassDescriptor)); } -// property: sampleBufferAttachments _MTL_INLINE MTL::ResourceStatePassSampleBufferAttachmentDescriptorArray* MTL::ResourceStatePassDescriptor::sampleBufferAttachments() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleBufferAttachments)); diff --git a/vendor/metal-cpp/Metal/MTLResourceViewPool.hpp b/vendor/metal-cpp/Metal/MTLResourceViewPool.hpp new file mode 100644 index 000000000..aa8bfda35 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLResourceViewPool.hpp @@ -0,0 +1,118 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLResourceViewPool.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLTypes.hpp" + +namespace MTL +{ +class Device; +class ResourceViewPool; +class ResourceViewPoolDescriptor; + +class ResourceViewPoolDescriptor : public NS::Copying +{ +public: + static ResourceViewPoolDescriptor* alloc(); + + ResourceViewPoolDescriptor* init(); + + NS::String* label() const; + + NS::UInteger resourceViewCount() const; + + void setLabel(const NS::String* label); + + void setResourceViewCount(NS::UInteger resourceViewCount); +}; +class ResourceViewPool : public NS::Referencing +{ +public: + ResourceID baseResourceID() const; + + ResourceID copyResourceViewsFromPool(const MTL::ResourceViewPool* sourcePool, NS::Range sourceRange, NS::UInteger destinationIndex); + + Device* device() const; + + NS::String* label() const; + + NS::UInteger resourceViewCount() const; +}; + +} +_MTL_INLINE MTL::ResourceViewPoolDescriptor* MTL::ResourceViewPoolDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLResourceViewPoolDescriptor)); +} + +_MTL_INLINE MTL::ResourceViewPoolDescriptor* MTL::ResourceViewPoolDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE NS::String* MTL::ResourceViewPoolDescriptor::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::ResourceViewPoolDescriptor::resourceViewCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceViewCount)); +} + +_MTL_INLINE void MTL::ResourceViewPoolDescriptor::setLabel(const NS::String* label) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); +} + +_MTL_INLINE void MTL::ResourceViewPoolDescriptor::setResourceViewCount(NS::UInteger resourceViewCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResourceViewCount_), resourceViewCount); +} + +_MTL_INLINE MTL::ResourceID MTL::ResourceViewPool::baseResourceID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(baseResourceID)); +} + +_MTL_INLINE MTL::ResourceID MTL::ResourceViewPool::copyResourceViewsFromPool(const MTL::ResourceViewPool* sourcePool, NS::Range sourceRange, NS::UInteger destinationIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(copyResourceViewsFromPool_sourceRange_destinationIndex_), sourcePool, sourceRange, destinationIndex); +} + +_MTL_INLINE MTL::Device* MTL::ResourceViewPool::device() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); +} + +_MTL_INLINE NS::String* MTL::ResourceViewPool::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} + +_MTL_INLINE NS::UInteger MTL::ResourceViewPool::resourceViewCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceViewCount)); +} diff --git a/vendor/metal-cpp/Metal/MTLSampler.hpp b/vendor/metal-cpp/Metal/MTLSampler.hpp index b086744a6..f2286656f 100644 --- a/vendor/metal-cpp/Metal/MTLSampler.hpp +++ b/vendor/metal-cpp/Metal/MTLSampler.hpp @@ -2,7 +2,7 @@ // // Metal/MTLSampler.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,18 +20,17 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" +#include "MTLDepthStencil.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - -#include "MTLDepthStencil.hpp" -#include "MTLSampler.hpp" #include "MTLTypes.hpp" namespace MTL { +class Device; +class SamplerDescriptor; _MTL_ENUM(NS::UInteger, SamplerMinMagFilter) { SamplerMinMagFilterNearest = 0, SamplerMinMagFilterLinear = 1, @@ -58,164 +57,181 @@ _MTL_ENUM(NS::UInteger, SamplerBorderColor) { SamplerBorderColorOpaqueWhite = 2, }; +_MTL_ENUM(NS::UInteger, SamplerReductionMode) { + SamplerReductionModeWeightedAverage = 0, + SamplerReductionModeMinimum = 1, + SamplerReductionModeMaximum = 2, +}; + class SamplerDescriptor : public NS::Copying { public: - static class SamplerDescriptor* alloc(); + static SamplerDescriptor* alloc(); - class SamplerDescriptor* init(); + SamplerBorderColor borderColor() const; - MTL::SamplerMinMagFilter minFilter() const; - void setMinFilter(MTL::SamplerMinMagFilter minFilter); + CompareFunction compareFunction() const; - MTL::SamplerMinMagFilter magFilter() const; - void setMagFilter(MTL::SamplerMinMagFilter magFilter); + SamplerDescriptor* init(); - MTL::SamplerMipFilter mipFilter() const; - void setMipFilter(MTL::SamplerMipFilter mipFilter); + NS::String* label() const; - NS::UInteger maxAnisotropy() const; - void setMaxAnisotropy(NS::UInteger maxAnisotropy); + bool lodAverage() const; - MTL::SamplerAddressMode sAddressMode() const; - void setSAddressMode(MTL::SamplerAddressMode sAddressMode); + float lodBias() const; - MTL::SamplerAddressMode tAddressMode() const; - void setTAddressMode(MTL::SamplerAddressMode tAddressMode); + float lodMaxClamp() const; - MTL::SamplerAddressMode rAddressMode() const; - void setRAddressMode(MTL::SamplerAddressMode rAddressMode); + float lodMinClamp() const; - MTL::SamplerBorderColor borderColor() const; - void setBorderColor(MTL::SamplerBorderColor borderColor); + SamplerMinMagFilter magFilter() const; - bool normalizedCoordinates() const; - void setNormalizedCoordinates(bool normalizedCoordinates); + NS::UInteger maxAnisotropy() const; - float lodMinClamp() const; - void setLodMinClamp(float lodMinClamp); + SamplerMinMagFilter minFilter() const; - float lodMaxClamp() const; - void setLodMaxClamp(float lodMaxClamp); + SamplerMipFilter mipFilter() const; - bool lodAverage() const; - void setLodAverage(bool lodAverage); + bool normalizedCoordinates() const; - MTL::CompareFunction compareFunction() const; - void setCompareFunction(MTL::CompareFunction compareFunction); + SamplerAddressMode rAddressMode() const; - bool supportArgumentBuffers() const; - void setSupportArgumentBuffers(bool supportArgumentBuffers); + SamplerReductionMode reductionMode() const; - NS::String* label() const; - void setLabel(const NS::String* label); + SamplerAddressMode sAddressMode() const; + + void setBorderColor(MTL::SamplerBorderColor borderColor); + + void setCompareFunction(MTL::CompareFunction compareFunction); + + void setLabel(const NS::String* label); + + void setLodAverage(bool lodAverage); + + void setLodBias(float lodBias); + + void setLodMaxClamp(float lodMaxClamp); + + void setLodMinClamp(float lodMinClamp); + + void setMagFilter(MTL::SamplerMinMagFilter magFilter); + + void setMaxAnisotropy(NS::UInteger maxAnisotropy); + + void setMinFilter(MTL::SamplerMinMagFilter minFilter); + + void setMipFilter(MTL::SamplerMipFilter mipFilter); + + void setNormalizedCoordinates(bool normalizedCoordinates); + + void setRAddressMode(MTL::SamplerAddressMode rAddressMode); + + void setReductionMode(MTL::SamplerReductionMode reductionMode); + + void setSAddressMode(MTL::SamplerAddressMode sAddressMode); + + void setSupportArgumentBuffers(bool supportArgumentBuffers); + + void setTAddressMode(MTL::SamplerAddressMode tAddressMode); + + bool supportArgumentBuffers() const; + + SamplerAddressMode tAddressMode() const; }; - class SamplerState : public NS::Referencing { public: - NS::String* label() const; + Device* device() const; - class Device* device() const; + ResourceID gpuResourceID() const; - MTL::ResourceID gpuResourceID() const; + NS::String* label() const; }; } - -// static method: alloc _MTL_INLINE MTL::SamplerDescriptor* MTL::SamplerDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLSamplerDescriptor)); } -// method: init +_MTL_INLINE MTL::SamplerBorderColor MTL::SamplerDescriptor::borderColor() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(borderColor)); +} + +_MTL_INLINE MTL::CompareFunction MTL::SamplerDescriptor::compareFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(compareFunction)); +} + _MTL_INLINE MTL::SamplerDescriptor* MTL::SamplerDescriptor::init() { return NS::Object::init(); } -// property: minFilter -_MTL_INLINE MTL::SamplerMinMagFilter MTL::SamplerDescriptor::minFilter() const +_MTL_INLINE NS::String* MTL::SamplerDescriptor::label() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(minFilter)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -_MTL_INLINE void MTL::SamplerDescriptor::setMinFilter(MTL::SamplerMinMagFilter minFilter) +_MTL_INLINE bool MTL::SamplerDescriptor::lodAverage() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMinFilter_), minFilter); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodAverage)); +} + +_MTL_INLINE float MTL::SamplerDescriptor::lodBias() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodBias)); +} + +_MTL_INLINE float MTL::SamplerDescriptor::lodMaxClamp() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodMaxClamp)); +} + +_MTL_INLINE float MTL::SamplerDescriptor::lodMinClamp() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodMinClamp)); } -// property: magFilter _MTL_INLINE MTL::SamplerMinMagFilter MTL::SamplerDescriptor::magFilter() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(magFilter)); } -_MTL_INLINE void MTL::SamplerDescriptor::setMagFilter(MTL::SamplerMinMagFilter magFilter) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMagFilter_), magFilter); -} - -// property: mipFilter -_MTL_INLINE MTL::SamplerMipFilter MTL::SamplerDescriptor::mipFilter() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(mipFilter)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setMipFilter(MTL::SamplerMipFilter mipFilter) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMipFilter_), mipFilter); -} - -// property: maxAnisotropy _MTL_INLINE NS::UInteger MTL::SamplerDescriptor::maxAnisotropy() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(maxAnisotropy)); } -_MTL_INLINE void MTL::SamplerDescriptor::setMaxAnisotropy(NS::UInteger maxAnisotropy) +_MTL_INLINE MTL::SamplerMinMagFilter MTL::SamplerDescriptor::minFilter() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxAnisotropy_), maxAnisotropy); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(minFilter)); } -// property: sAddressMode -_MTL_INLINE MTL::SamplerAddressMode MTL::SamplerDescriptor::sAddressMode() const +_MTL_INLINE MTL::SamplerMipFilter MTL::SamplerDescriptor::mipFilter() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sAddressMode)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(mipFilter)); } -_MTL_INLINE void MTL::SamplerDescriptor::setSAddressMode(MTL::SamplerAddressMode sAddressMode) +_MTL_INLINE bool MTL::SamplerDescriptor::normalizedCoordinates() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSAddressMode_), sAddressMode); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(normalizedCoordinates)); } -// property: tAddressMode -_MTL_INLINE MTL::SamplerAddressMode MTL::SamplerDescriptor::tAddressMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tAddressMode)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setTAddressMode(MTL::SamplerAddressMode tAddressMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTAddressMode_), tAddressMode); -} - -// property: rAddressMode _MTL_INLINE MTL::SamplerAddressMode MTL::SamplerDescriptor::rAddressMode() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(rAddressMode)); } -_MTL_INLINE void MTL::SamplerDescriptor::setRAddressMode(MTL::SamplerAddressMode rAddressMode) +_MTL_INLINE MTL::SamplerReductionMode MTL::SamplerDescriptor::reductionMode() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setRAddressMode_), rAddressMode); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(reductionMode)); } -// property: borderColor -_MTL_INLINE MTL::SamplerBorderColor MTL::SamplerDescriptor::borderColor() const +_MTL_INLINE MTL::SamplerAddressMode MTL::SamplerDescriptor::sAddressMode() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(borderColor)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sAddressMode)); } _MTL_INLINE void MTL::SamplerDescriptor::setBorderColor(MTL::SamplerBorderColor borderColor) @@ -223,97 +239,107 @@ _MTL_INLINE void MTL::SamplerDescriptor::setBorderColor(MTL::SamplerBorderColor Object::sendMessage(this, _MTL_PRIVATE_SEL(setBorderColor_), borderColor); } -// property: normalizedCoordinates -_MTL_INLINE bool MTL::SamplerDescriptor::normalizedCoordinates() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(normalizedCoordinates)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setNormalizedCoordinates(bool normalizedCoordinates) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setNormalizedCoordinates_), normalizedCoordinates); -} - -// property: lodMinClamp -_MTL_INLINE float MTL::SamplerDescriptor::lodMinClamp() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodMinClamp)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setLodMinClamp(float lodMinClamp) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodMinClamp_), lodMinClamp); -} - -// property: lodMaxClamp -_MTL_INLINE float MTL::SamplerDescriptor::lodMaxClamp() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodMaxClamp)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setLodMaxClamp(float lodMaxClamp) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodMaxClamp_), lodMaxClamp); -} - -// property: lodAverage -_MTL_INLINE bool MTL::SamplerDescriptor::lodAverage() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(lodAverage)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setLodAverage(bool lodAverage) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodAverage_), lodAverage); -} - -// property: compareFunction -_MTL_INLINE MTL::CompareFunction MTL::SamplerDescriptor::compareFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(compareFunction)); -} - _MTL_INLINE void MTL::SamplerDescriptor::setCompareFunction(MTL::CompareFunction compareFunction) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setCompareFunction_), compareFunction); } -// property: supportArgumentBuffers -_MTL_INLINE bool MTL::SamplerDescriptor::supportArgumentBuffers() const -{ - return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportArgumentBuffers)); -} - -_MTL_INLINE void MTL::SamplerDescriptor::setSupportArgumentBuffers(bool supportArgumentBuffers) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportArgumentBuffers_), supportArgumentBuffers); -} - -// property: label -_MTL_INLINE NS::String* MTL::SamplerDescriptor::label() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); -} - _MTL_INLINE void MTL::SamplerDescriptor::setLabel(const NS::String* label) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setLabel_), label); } -// property: label -_MTL_INLINE NS::String* MTL::SamplerState::label() const +_MTL_INLINE void MTL::SamplerDescriptor::setLodAverage(bool lodAverage) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodAverage_), lodAverage); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setLodBias(float lodBias) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodBias_), lodBias); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setLodMaxClamp(float lodMaxClamp) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodMaxClamp_), lodMaxClamp); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setLodMinClamp(float lodMinClamp) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLodMinClamp_), lodMinClamp); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setMagFilter(MTL::SamplerMinMagFilter magFilter) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMagFilter_), magFilter); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setMaxAnisotropy(NS::UInteger maxAnisotropy) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMaxAnisotropy_), maxAnisotropy); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setMinFilter(MTL::SamplerMinMagFilter minFilter) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMinFilter_), minFilter); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setMipFilter(MTL::SamplerMipFilter mipFilter) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMipFilter_), mipFilter); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setNormalizedCoordinates(bool normalizedCoordinates) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setNormalizedCoordinates_), normalizedCoordinates); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setRAddressMode(MTL::SamplerAddressMode rAddressMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setRAddressMode_), rAddressMode); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setReductionMode(MTL::SamplerReductionMode reductionMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setReductionMode_), reductionMode); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setSAddressMode(MTL::SamplerAddressMode sAddressMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSAddressMode_), sAddressMode); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setSupportArgumentBuffers(bool supportArgumentBuffers) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSupportArgumentBuffers_), supportArgumentBuffers); +} + +_MTL_INLINE void MTL::SamplerDescriptor::setTAddressMode(MTL::SamplerAddressMode tAddressMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTAddressMode_), tAddressMode); +} + +_MTL_INLINE bool MTL::SamplerDescriptor::supportArgumentBuffers() const +{ + return Object::sendMessageSafe(this, _MTL_PRIVATE_SEL(supportArgumentBuffers)); +} + +_MTL_INLINE MTL::SamplerAddressMode MTL::SamplerDescriptor::tAddressMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tAddressMode)); } -// property: device _MTL_INLINE MTL::Device* MTL::SamplerState::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: gpuResourceID _MTL_INLINE MTL::ResourceID MTL::SamplerState::gpuResourceID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); } + +_MTL_INLINE NS::String* MTL::SamplerState::label() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); +} diff --git a/vendor/metal-cpp/Metal/MTLStageInputOutputDescriptor.hpp b/vendor/metal-cpp/Metal/MTLStageInputOutputDescriptor.hpp index e75abf374..b9a7a4839 100644 --- a/vendor/metal-cpp/Metal/MTLStageInputOutputDescriptor.hpp +++ b/vendor/metal-cpp/Metal/MTLStageInputOutputDescriptor.hpp @@ -2,7 +2,7 @@ // // Metal/MTLStageInputOutputDescriptor.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,19 @@ #pragma once +#include "../Foundation/Foundation.hpp" +#include "MTLArgument.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLStageInputOutputDescriptor.hpp" - namespace MTL { +class AttributeDescriptor; +class AttributeDescriptorArray; +class BufferLayoutDescriptor; +class BufferLayoutDescriptorArray; +class StageInputOutputDescriptor; _MTL_ENUM(NS::UInteger, AttributeFormat) { AttributeFormatInvalid = 0, AttributeFormatUChar2 = 1, @@ -83,11 +86,8 @@ _MTL_ENUM(NS::UInteger, AttributeFormat) { AttributeFormatUShortNormalized = 51, AttributeFormatShortNormalized = 52, AttributeFormatHalf = 53, -}; - -_MTL_ENUM(NS::UInteger, IndexType) { - IndexTypeUInt16 = 0, - IndexTypeUInt32 = 1, + AttributeFormatFloatRG11B10 = 54, + AttributeFormatFloatRGB9E5 = 55, }; _MTL_ENUM(NS::UInteger, StepFunction) { @@ -105,268 +105,239 @@ _MTL_ENUM(NS::UInteger, StepFunction) { class BufferLayoutDescriptor : public NS::Copying { public: - static class BufferLayoutDescriptor* alloc(); + static BufferLayoutDescriptor* alloc(); - class BufferLayoutDescriptor* init(); + BufferLayoutDescriptor* init(); - NS::UInteger stride() const; - void setStride(NS::UInteger stride); + void setStepFunction(MTL::StepFunction stepFunction); - MTL::StepFunction stepFunction() const; - void setStepFunction(MTL::StepFunction stepFunction); + void setStepRate(NS::UInteger stepRate); - NS::UInteger stepRate() const; - void setStepRate(NS::UInteger stepRate); + void setStride(NS::UInteger stride); + + StepFunction stepFunction() const; + + NS::UInteger stepRate() const; + + NS::UInteger stride() const; }; - class BufferLayoutDescriptorArray : public NS::Referencing { public: - static class BufferLayoutDescriptorArray* alloc(); + static BufferLayoutDescriptorArray* alloc(); - class BufferLayoutDescriptorArray* init(); + BufferLayoutDescriptorArray* init(); - class BufferLayoutDescriptor* object(NS::UInteger index); - - void setObject(const class BufferLayoutDescriptor* bufferDesc, NS::UInteger index); + BufferLayoutDescriptor* object(NS::UInteger index); + void setObject(const MTL::BufferLayoutDescriptor* bufferDesc, NS::UInteger index); }; - class AttributeDescriptor : public NS::Copying { public: - static class AttributeDescriptor* alloc(); + static AttributeDescriptor* alloc(); - class AttributeDescriptor* init(); + NS::UInteger bufferIndex() const; - MTL::AttributeFormat format() const; - void setFormat(MTL::AttributeFormat format); + AttributeFormat format() const; - NS::UInteger offset() const; - void setOffset(NS::UInteger offset); + AttributeDescriptor* init(); - NS::UInteger bufferIndex() const; - void setBufferIndex(NS::UInteger bufferIndex); + NS::UInteger offset() const; + + void setBufferIndex(NS::UInteger bufferIndex); + + void setFormat(MTL::AttributeFormat format); + + void setOffset(NS::UInteger offset); }; - class AttributeDescriptorArray : public NS::Referencing { public: - static class AttributeDescriptorArray* alloc(); + static AttributeDescriptorArray* alloc(); - class AttributeDescriptorArray* init(); + AttributeDescriptorArray* init(); - class AttributeDescriptor* object(NS::UInteger index); - - void setObject(const class AttributeDescriptor* attributeDesc, NS::UInteger index); + AttributeDescriptor* object(NS::UInteger index); + void setObject(const MTL::AttributeDescriptor* attributeDesc, NS::UInteger index); }; - class StageInputOutputDescriptor : public NS::Copying { public: - static class StageInputOutputDescriptor* alloc(); + static StageInputOutputDescriptor* alloc(); - class StageInputOutputDescriptor* init(); + AttributeDescriptorArray* attributes() const; - static class StageInputOutputDescriptor* stageInputOutputDescriptor(); + NS::UInteger indexBufferIndex() const; - class BufferLayoutDescriptorArray* layouts() const; + IndexType indexType() const; - class AttributeDescriptorArray* attributes() const; + StageInputOutputDescriptor* init(); - MTL::IndexType indexType() const; - void setIndexType(MTL::IndexType indexType); + BufferLayoutDescriptorArray* layouts() const; - NS::UInteger indexBufferIndex() const; - void setIndexBufferIndex(NS::UInteger indexBufferIndex); + void reset(); - void reset(); + void setIndexBufferIndex(NS::UInteger indexBufferIndex); + + void setIndexType(MTL::IndexType indexType); + + static StageInputOutputDescriptor* stageInputOutputDescriptor(); }; } - -// static method: alloc _MTL_INLINE MTL::BufferLayoutDescriptor* MTL::BufferLayoutDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLBufferLayoutDescriptor)); } -// method: init _MTL_INLINE MTL::BufferLayoutDescriptor* MTL::BufferLayoutDescriptor::init() { return NS::Object::init(); } -// property: stride -_MTL_INLINE NS::UInteger MTL::BufferLayoutDescriptor::stride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stride)); -} - -_MTL_INLINE void MTL::BufferLayoutDescriptor::setStride(NS::UInteger stride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStride_), stride); -} - -// property: stepFunction -_MTL_INLINE MTL::StepFunction MTL::BufferLayoutDescriptor::stepFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepFunction)); -} - _MTL_INLINE void MTL::BufferLayoutDescriptor::setStepFunction(MTL::StepFunction stepFunction) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStepFunction_), stepFunction); } -// property: stepRate -_MTL_INLINE NS::UInteger MTL::BufferLayoutDescriptor::stepRate() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepRate)); -} - _MTL_INLINE void MTL::BufferLayoutDescriptor::setStepRate(NS::UInteger stepRate) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStepRate_), stepRate); } -// static method: alloc +_MTL_INLINE void MTL::BufferLayoutDescriptor::setStride(NS::UInteger stride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStride_), stride); +} + +_MTL_INLINE MTL::StepFunction MTL::BufferLayoutDescriptor::stepFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepFunction)); +} + +_MTL_INLINE NS::UInteger MTL::BufferLayoutDescriptor::stepRate() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepRate)); +} + +_MTL_INLINE NS::UInteger MTL::BufferLayoutDescriptor::stride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stride)); +} + _MTL_INLINE MTL::BufferLayoutDescriptorArray* MTL::BufferLayoutDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLBufferLayoutDescriptorArray)); } -// method: init _MTL_INLINE MTL::BufferLayoutDescriptorArray* MTL::BufferLayoutDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::BufferLayoutDescriptor* MTL::BufferLayoutDescriptorArray::object(NS::UInteger index) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), index); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::BufferLayoutDescriptorArray::setObject(const MTL::BufferLayoutDescriptor* bufferDesc, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), bufferDesc, index); } -// static method: alloc _MTL_INLINE MTL::AttributeDescriptor* MTL::AttributeDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAttributeDescriptor)); } -// method: init -_MTL_INLINE MTL::AttributeDescriptor* MTL::AttributeDescriptor::init() +_MTL_INLINE NS::UInteger MTL::AttributeDescriptor::bufferIndex() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferIndex)); } -// property: format _MTL_INLINE MTL::AttributeFormat MTL::AttributeDescriptor::format() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(format)); } -_MTL_INLINE void MTL::AttributeDescriptor::setFormat(MTL::AttributeFormat format) +_MTL_INLINE MTL::AttributeDescriptor* MTL::AttributeDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFormat_), format); + return NS::Object::init(); } -// property: offset _MTL_INLINE NS::UInteger MTL::AttributeDescriptor::offset() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(offset)); } -_MTL_INLINE void MTL::AttributeDescriptor::setOffset(NS::UInteger offset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setOffset_), offset); -} - -// property: bufferIndex -_MTL_INLINE NS::UInteger MTL::AttributeDescriptor::bufferIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferIndex)); -} - _MTL_INLINE void MTL::AttributeDescriptor::setBufferIndex(NS::UInteger bufferIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBufferIndex_), bufferIndex); } -// static method: alloc +_MTL_INLINE void MTL::AttributeDescriptor::setFormat(MTL::AttributeFormat format) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFormat_), format); +} + +_MTL_INLINE void MTL::AttributeDescriptor::setOffset(NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOffset_), offset); +} + _MTL_INLINE MTL::AttributeDescriptorArray* MTL::AttributeDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLAttributeDescriptorArray)); } -// method: init _MTL_INLINE MTL::AttributeDescriptorArray* MTL::AttributeDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::AttributeDescriptor* MTL::AttributeDescriptorArray::object(NS::UInteger index) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), index); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::AttributeDescriptorArray::setObject(const MTL::AttributeDescriptor* attributeDesc, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attributeDesc, index); } -// static method: alloc _MTL_INLINE MTL::StageInputOutputDescriptor* MTL::StageInputOutputDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLStageInputOutputDescriptor)); } -// method: init -_MTL_INLINE MTL::StageInputOutputDescriptor* MTL::StageInputOutputDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: stageInputOutputDescriptor -_MTL_INLINE MTL::StageInputOutputDescriptor* MTL::StageInputOutputDescriptor::stageInputOutputDescriptor() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLStageInputOutputDescriptor), _MTL_PRIVATE_SEL(stageInputOutputDescriptor)); -} - -// property: layouts -_MTL_INLINE MTL::BufferLayoutDescriptorArray* MTL::StageInputOutputDescriptor::layouts() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(layouts)); -} - -// property: attributes _MTL_INLINE MTL::AttributeDescriptorArray* MTL::StageInputOutputDescriptor::attributes() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributes)); } -// property: indexType +_MTL_INLINE NS::UInteger MTL::StageInputOutputDescriptor::indexBufferIndex() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferIndex)); +} + _MTL_INLINE MTL::IndexType MTL::StageInputOutputDescriptor::indexType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexType)); } -_MTL_INLINE void MTL::StageInputOutputDescriptor::setIndexType(MTL::IndexType indexType) +_MTL_INLINE MTL::StageInputOutputDescriptor* MTL::StageInputOutputDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); + return NS::Object::init(); } -// property: indexBufferIndex -_MTL_INLINE NS::UInteger MTL::StageInputOutputDescriptor::indexBufferIndex() const +_MTL_INLINE MTL::BufferLayoutDescriptorArray* MTL::StageInputOutputDescriptor::layouts() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(indexBufferIndex)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(layouts)); +} + +_MTL_INLINE void MTL::StageInputOutputDescriptor::reset() +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } _MTL_INLINE void MTL::StageInputOutputDescriptor::setIndexBufferIndex(NS::UInteger indexBufferIndex) @@ -374,8 +345,12 @@ _MTL_INLINE void MTL::StageInputOutputDescriptor::setIndexBufferIndex(NS::UInteg Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexBufferIndex_), indexBufferIndex); } -// method: reset -_MTL_INLINE void MTL::StageInputOutputDescriptor::reset() +_MTL_INLINE void MTL::StageInputOutputDescriptor::setIndexType(MTL::IndexType indexType) { - Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setIndexType_), indexType); +} + +_MTL_INLINE MTL::StageInputOutputDescriptor* MTL::StageInputOutputDescriptor::stageInputOutputDescriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLStageInputOutputDescriptor), _MTL_PRIVATE_SEL(stageInputOutputDescriptor)); } diff --git a/vendor/metal-cpp/Metal/MTLTensor.hpp b/vendor/metal-cpp/Metal/MTLTensor.hpp new file mode 100644 index 000000000..221b8c9f1 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLTensor.hpp @@ -0,0 +1,297 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLTensor.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLResource.hpp" +#include "MTLTypes.hpp" + +namespace MTL +{ +class Buffer; +class TensorDescriptor; +class TensorExtents; + +_MTL_CONST(NS::ErrorDomain, TensorDomain); + +_MTL_ENUM(NS::Integer, TensorDataType) { + TensorDataTypeNone = 0, + TensorDataTypeFloat32 = 3, + TensorDataTypeFloat16 = 16, + TensorDataTypeBFloat16 = 121, + TensorDataTypeInt8 = 45, + TensorDataTypeUInt8 = 49, + TensorDataTypeInt16 = 37, + TensorDataTypeUInt16 = 41, + TensorDataTypeInt32 = 29, + TensorDataTypeUInt32 = 33, +}; + +_MTL_ENUM(NS::Integer, TensorError) { + TensorErrorNone = 0, + TensorErrorInternalError = 1, + TensorErrorInvalidDescriptor = 2, +}; + +_MTL_OPTIONS(NS::UInteger, TensorUsage) { + TensorUsageCompute = 1, + TensorUsageRender = 1 << 1, + TensorUsageMachineLearning = 1 << 2, +}; + +class TensorExtents : public NS::Referencing +{ +public: + static TensorExtents* alloc(); + + NS::Integer extentAtDimensionIndex(NS::UInteger dimensionIndex); + + TensorExtents* init(); + TensorExtents* init(NS::UInteger rank, const NS::Integer* values); + + NS::UInteger rank() const; +}; +class TensorDescriptor : public NS::Copying +{ +public: + static TensorDescriptor* alloc(); + + CPUCacheMode cpuCacheMode() const; + + TensorDataType dataType() const; + + TensorExtents* dimensions() const; + + HazardTrackingMode hazardTrackingMode() const; + + TensorDescriptor* init(); + + ResourceOptions resourceOptions() const; + + void setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode); + + void setDataType(MTL::TensorDataType dataType); + + void setDimensions(const MTL::TensorExtents* dimensions); + + void setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode); + + void setResourceOptions(MTL::ResourceOptions resourceOptions); + + void setStorageMode(MTL::StorageMode storageMode); + + void setStrides(const MTL::TensorExtents* strides); + + void setUsage(MTL::TensorUsage usage); + + StorageMode storageMode() const; + + TensorExtents* strides() const; + + TensorUsage usage() const; +}; +class Tensor : public NS::Referencing +{ +public: + Buffer* buffer() const; + NS::UInteger bufferOffset() const; + + TensorDataType dataType() const; + + TensorExtents* dimensions() const; + + void getBytes(void* bytes, const MTL::TensorExtents* strides, const MTL::TensorExtents* sliceOrigin, const MTL::TensorExtents* sliceDimensions); + + ResourceID gpuResourceID() const; + + void replaceSliceOrigin(const MTL::TensorExtents* sliceOrigin, const MTL::TensorExtents* sliceDimensions, const void* bytes, const MTL::TensorExtents* strides); + + TensorExtents* strides() const; + + TensorUsage usage() const; +}; + +} + +_MTL_PRIVATE_DEF_CONST(NS::ErrorDomain, TensorDomain); + +_MTL_INLINE MTL::TensorExtents* MTL::TensorExtents::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTensorExtents)); +} + +_MTL_INLINE NS::Integer MTL::TensorExtents::extentAtDimensionIndex(NS::UInteger dimensionIndex) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(extentAtDimensionIndex_), dimensionIndex); +} + +_MTL_INLINE MTL::TensorExtents* MTL::TensorExtents::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::TensorExtents* MTL::TensorExtents::init(NS::UInteger rank, const NS::Integer* values) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(initWithRank_values_), rank, values); +} + +_MTL_INLINE NS::UInteger MTL::TensorExtents::rank() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rank)); +} + +_MTL_INLINE MTL::TensorDescriptor* MTL::TensorDescriptor::alloc() +{ + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTensorDescriptor)); +} + +_MTL_INLINE MTL::CPUCacheMode MTL::TensorDescriptor::cpuCacheMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); +} + +_MTL_INLINE MTL::TensorDataType MTL::TensorDescriptor::dataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); +} + +_MTL_INLINE MTL::TensorExtents* MTL::TensorDescriptor::dimensions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dimensions)); +} + +_MTL_INLINE MTL::HazardTrackingMode MTL::TensorDescriptor::hazardTrackingMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); +} + +_MTL_INLINE MTL::TensorDescriptor* MTL::TensorDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::ResourceOptions MTL::TensorDescriptor::resourceOptions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); +} + +_MTL_INLINE void MTL::TensorDescriptor::setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCpuCacheMode_), cpuCacheMode); +} + +_MTL_INLINE void MTL::TensorDescriptor::setDataType(MTL::TensorDataType dataType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDataType_), dataType); +} + +_MTL_INLINE void MTL::TensorDescriptor::setDimensions(const MTL::TensorExtents* dimensions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDimensions_), dimensions); +} + +_MTL_INLINE void MTL::TensorDescriptor::setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setHazardTrackingMode_), hazardTrackingMode); +} + +_MTL_INLINE void MTL::TensorDescriptor::setResourceOptions(MTL::ResourceOptions resourceOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResourceOptions_), resourceOptions); +} + +_MTL_INLINE void MTL::TensorDescriptor::setStorageMode(MTL::StorageMode storageMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); +} + +_MTL_INLINE void MTL::TensorDescriptor::setStrides(const MTL::TensorExtents* strides) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStrides_), strides); +} + +_MTL_INLINE void MTL::TensorDescriptor::setUsage(MTL::TensorUsage usage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setUsage_), usage); +} + +_MTL_INLINE MTL::StorageMode MTL::TensorDescriptor::storageMode() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); +} + +_MTL_INLINE MTL::TensorExtents* MTL::TensorDescriptor::strides() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(strides)); +} + +_MTL_INLINE MTL::TensorUsage MTL::TensorDescriptor::usage() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); +} + +_MTL_INLINE MTL::Buffer* MTL::Tensor::buffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffer)); +} + +_MTL_INLINE NS::UInteger MTL::Tensor::bufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferOffset)); +} + +_MTL_INLINE MTL::TensorDataType MTL::Tensor::dataType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dataType)); +} + +_MTL_INLINE MTL::TensorExtents* MTL::Tensor::dimensions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(dimensions)); +} + +_MTL_INLINE void MTL::Tensor::getBytes(void* bytes, const MTL::TensorExtents* strides, const MTL::TensorExtents* sliceOrigin, const MTL::TensorExtents* sliceDimensions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(getBytes_strides_fromSliceOrigin_sliceDimensions_), bytes, strides, sliceOrigin, sliceDimensions); +} + +_MTL_INLINE MTL::ResourceID MTL::Tensor::gpuResourceID() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); +} + +_MTL_INLINE void MTL::Tensor::replaceSliceOrigin(const MTL::TensorExtents* sliceOrigin, const MTL::TensorExtents* sliceDimensions, const void* bytes, const MTL::TensorExtents* strides) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(replaceSliceOrigin_sliceDimensions_withBytes_strides_), sliceOrigin, sliceDimensions, bytes, strides); +} + +_MTL_INLINE MTL::TensorExtents* MTL::Tensor::strides() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(strides)); +} + +_MTL_INLINE MTL::TensorUsage MTL::Tensor::usage() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); +} diff --git a/vendor/metal-cpp/Metal/MTLTexture.hpp b/vendor/metal-cpp/Metal/MTLTexture.hpp index 8d18c736b..631d9202f 100644 --- a/vendor/metal-cpp/Metal/MTLTexture.hpp +++ b/vendor/metal-cpp/Metal/MTLTexture.hpp @@ -2,7 +2,7 @@ // // Metal/MTLTexture.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,18 +20,26 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" -#include "MTLPrivate.hpp" - -#include - #include "MTLPixelFormat.hpp" +#include "MTLPrivate.hpp" #include "MTLResource.hpp" -#include "MTLTexture.hpp" #include "MTLTypes.hpp" #include +namespace MTL +{ +class Buffer; +class Device; +class Resource; +class SharedTextureHandle; +class Texture; +class TextureDescriptor; +class TextureViewDescriptor; +} + namespace MTL { _MTL_ENUM(NS::UInteger, TextureType) { @@ -56,382 +64,352 @@ _MTL_ENUM(uint8_t, TextureSwizzle) { TextureSwizzleAlpha = 5, }; -struct TextureSwizzleChannels -{ - MTL::TextureSwizzle red; - MTL::TextureSwizzle green; - MTL::TextureSwizzle blue; - MTL::TextureSwizzle alpha; -} _MTL_PACKED; - -class SharedTextureHandle : public NS::SecureCoding -{ -public: - static class SharedTextureHandle* alloc(); - - class SharedTextureHandle* init(); - - class Device* device() const; - - NS::String* label() const; -}; - -_MTL_OPTIONS(NS::UInteger, TextureUsage) { - TextureUsageUnknown = 0, - TextureUsageShaderRead = 1, - TextureUsageShaderWrite = 2, - TextureUsageRenderTarget = 4, - TextureUsagePixelFormatView = 16, -}; - _MTL_ENUM(NS::Integer, TextureCompressionType) { TextureCompressionTypeLossless = 0, TextureCompressionTypeLossy = 1, }; +_MTL_OPTIONS(NS::UInteger, TextureUsage) { + TextureUsageUnknown = 0, + TextureUsageShaderRead = 1, + TextureUsageShaderWrite = 1 << 1, + TextureUsageRenderTarget = 1 << 2, + TextureUsagePixelFormatView = 1 << 4, + TextureUsageShaderAtomic = 1 << 5, +}; + +struct TextureSwizzleChannels +{ + + TextureSwizzleChannels(MTL::TextureSwizzle r, MTL::TextureSwizzle g, MTL::TextureSwizzle b, MTL::TextureSwizzle a); + + TextureSwizzleChannels(); + + static TextureSwizzleChannels Default(); + + static TextureSwizzleChannels Make(MTL::TextureSwizzle r, MTL::TextureSwizzle g, MTL::TextureSwizzle b, MTL::TextureSwizzle a); + + MTL::TextureSwizzle red; + MTL::TextureSwizzle green; + MTL::TextureSwizzle blue; + MTL::TextureSwizzle alpha; +} _MTL_PACKED; + +class SharedTextureHandle : public NS::SecureCoding +{ +public: + static SharedTextureHandle* alloc(); + + Device* device() const; + + SharedTextureHandle* init(); + + NS::String* label() const; +}; class TextureDescriptor : public NS::Copying { public: - static class TextureDescriptor* alloc(); + static TextureDescriptor* alloc(); - class TextureDescriptor* init(); + bool allowGPUOptimizedContents() const; - static class TextureDescriptor* texture2DDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, NS::UInteger height, bool mipmapped); + NS::UInteger arrayLength() const; - static class TextureDescriptor* textureCubeDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger size, bool mipmapped); + TextureCompressionType compressionType() const; - static class TextureDescriptor* textureBufferDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, MTL::ResourceOptions resourceOptions, MTL::TextureUsage usage); + CPUCacheMode cpuCacheMode() const; - MTL::TextureType textureType() const; - void setTextureType(MTL::TextureType textureType); + NS::UInteger depth() const; - MTL::PixelFormat pixelFormat() const; - void setPixelFormat(MTL::PixelFormat pixelFormat); + HazardTrackingMode hazardTrackingMode() const; - NS::UInteger width() const; - void setWidth(NS::UInteger width); + NS::UInteger height() const; - NS::UInteger height() const; - void setHeight(NS::UInteger height); + TextureDescriptor* init(); - NS::UInteger depth() const; - void setDepth(NS::UInteger depth); + NS::UInteger mipmapLevelCount() const; - NS::UInteger mipmapLevelCount() const; - void setMipmapLevelCount(NS::UInteger mipmapLevelCount); + PixelFormat pixelFormat() const; - NS::UInteger sampleCount() const; - void setSampleCount(NS::UInteger sampleCount); + SparsePageSize placementSparsePageSize() const; - NS::UInteger arrayLength() const; - void setArrayLength(NS::UInteger arrayLength); + ResourceOptions resourceOptions() const; - MTL::ResourceOptions resourceOptions() const; - void setResourceOptions(MTL::ResourceOptions resourceOptions); + NS::UInteger sampleCount() const; - MTL::CPUCacheMode cpuCacheMode() const; - void setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode); + void setAllowGPUOptimizedContents(bool allowGPUOptimizedContents); - MTL::StorageMode storageMode() const; - void setStorageMode(MTL::StorageMode storageMode); + void setArrayLength(NS::UInteger arrayLength); - MTL::HazardTrackingMode hazardTrackingMode() const; - void setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode); + void setCompressionType(MTL::TextureCompressionType compressionType); - MTL::TextureUsage usage() const; - void setUsage(MTL::TextureUsage usage); + void setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode); - bool allowGPUOptimizedContents() const; - void setAllowGPUOptimizedContents(bool allowGPUOptimizedContents); + void setDepth(NS::UInteger depth); - MTL::TextureCompressionType compressionType() const; - void setCompressionType(MTL::TextureCompressionType compressionType); + void setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode); - MTL::TextureSwizzleChannels swizzle() const; - void setSwizzle(MTL::TextureSwizzleChannels swizzle); + void setHeight(NS::UInteger height); + + void setMipmapLevelCount(NS::UInteger mipmapLevelCount); + + void setPixelFormat(MTL::PixelFormat pixelFormat); + + void setPlacementSparsePageSize(MTL::SparsePageSize placementSparsePageSize); + + void setResourceOptions(MTL::ResourceOptions resourceOptions); + + void setSampleCount(NS::UInteger sampleCount); + + void setStorageMode(MTL::StorageMode storageMode); + + void setSwizzle(MTL::TextureSwizzleChannels swizzle); + + void setTextureType(MTL::TextureType textureType); + + void setUsage(MTL::TextureUsage usage); + + void setWidth(NS::UInteger width); + + StorageMode storageMode() const; + + TextureSwizzleChannels swizzle() const; + + static TextureDescriptor* texture2DDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, NS::UInteger height, bool mipmapped); + + static TextureDescriptor* textureBufferDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, MTL::ResourceOptions resourceOptions, MTL::TextureUsage usage); + + static TextureDescriptor* textureCubeDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger size, bool mipmapped); + + TextureType textureType() const; + + TextureUsage usage() const; + + NS::UInteger width() const; }; +class TextureViewDescriptor : public NS::Copying +{ +public: + static TextureViewDescriptor* alloc(); + TextureViewDescriptor* init(); + + NS::Range levelRange() const; + + PixelFormat pixelFormat() const; + + void setLevelRange(NS::Range levelRange); + + void setPixelFormat(MTL::PixelFormat pixelFormat); + + void setSliceRange(NS::Range sliceRange); + + void setSwizzle(MTL::TextureSwizzleChannels swizzle); + + void setTextureType(MTL::TextureType textureType); + + NS::Range sliceRange() const; + + TextureSwizzleChannels swizzle() const; + + TextureType textureType() const; +}; class Texture : public NS::Referencing { public: - class Resource* rootResource() const; + bool allowGPUOptimizedContents() const; - class Texture* parentTexture() const; + NS::UInteger arrayLength() const; - NS::UInteger parentRelativeLevel() const; + Buffer* buffer() const; + NS::UInteger bufferBytesPerRow() const; - NS::UInteger parentRelativeSlice() const; + NS::UInteger bufferOffset() const; - class Buffer* buffer() const; + TextureCompressionType compressionType() const; - NS::UInteger bufferOffset() const; + NS::UInteger depth() const; - NS::UInteger bufferBytesPerRow() const; + NS::UInteger firstMipmapInTail() const; - IOSurfaceRef iosurface() const; + [[deprecated("please use isFramebufferOnly instead")]] + bool framebufferOnly() const; - NS::UInteger iosurfacePlane() const; + void getBytes(void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage, MTL::Region region, NS::UInteger level, NS::UInteger slice); + void getBytes(void* pixelBytes, NS::UInteger bytesPerRow, MTL::Region region, NS::UInteger level); - MTL::TextureType textureType() const; + ResourceID gpuResourceID() const; - MTL::PixelFormat pixelFormat() const; + NS::UInteger height() const; - NS::UInteger width() const; + IOSurfaceRef iosurface() const; + NS::UInteger iosurfacePlane() const; - NS::UInteger height() const; + bool isFramebufferOnly() const; - NS::UInteger depth() const; + bool isShareable() const; - NS::UInteger mipmapLevelCount() const; + bool isSparse() const; - NS::UInteger sampleCount() const; + NS::UInteger mipmapLevelCount() const; - NS::UInteger arrayLength() const; + Texture* newRemoteTextureViewForDevice(const MTL::Device* device); - MTL::TextureUsage usage() const; + SharedTextureHandle* newSharedTextureHandle(); - bool shareable() const; + Texture* newTextureView(MTL::PixelFormat pixelFormat); + Texture* newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange); + Texture* newTextureView(const MTL::TextureViewDescriptor* descriptor); + Texture* newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange, MTL::TextureSwizzleChannels swizzle); - bool framebufferOnly() const; + NS::UInteger parentRelativeLevel() const; - NS::UInteger firstMipmapInTail() const; + NS::UInteger parentRelativeSlice() const; - NS::UInteger tailSizeInBytes() const; + Texture* parentTexture() const; - bool isSparse() const; + PixelFormat pixelFormat() const; - bool allowGPUOptimizedContents() const; + Texture* remoteStorageTexture() const; - MTL::TextureCompressionType compressionType() const; + void replaceRegion(MTL::Region region, NS::UInteger level, NS::UInteger slice, const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage); + void replaceRegion(MTL::Region region, NS::UInteger level, const void* pixelBytes, NS::UInteger bytesPerRow); - MTL::ResourceID gpuResourceID() const; + Resource* rootResource() const; - void getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage, MTL::Region region, NS::UInteger level, NS::UInteger slice); + NS::UInteger sampleCount() const; - void replaceRegion(MTL::Region region, NS::UInteger level, NS::UInteger slice, const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage); + [[deprecated("please use isShareable instead")]] + bool shareable() const; - void getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, MTL::Region region, NS::UInteger level); + TextureSparseTier sparseTextureTier() const; - void replaceRegion(MTL::Region region, NS::UInteger level, const void* pixelBytes, NS::UInteger bytesPerRow); + TextureSwizzleChannels swizzle() const; - class Texture* newTextureView(MTL::PixelFormat pixelFormat); + NS::UInteger tailSizeInBytes() const; - class Texture* newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange); + TextureType textureType() const; - class SharedTextureHandle* newSharedTextureHandle(); + TextureUsage usage() const; - class Texture* remoteStorageTexture() const; - - class Texture* newRemoteTextureViewForDevice(const class Device* device); - - MTL::TextureSwizzleChannels swizzle() const; - - class Texture* newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange, MTL::TextureSwizzleChannels swizzle); + NS::UInteger width() const; }; } +_MTL_INLINE MTL::TextureSwizzleChannels::TextureSwizzleChannels(MTL::TextureSwizzle r, MTL::TextureSwizzle g, MTL::TextureSwizzle b, MTL::TextureSwizzle a) + : red(r) + , green(g) + , blue(b) + , alpha(a) +{ +} + +_MTL_INLINE MTL::TextureSwizzleChannels::TextureSwizzleChannels() + : red(MTL::TextureSwizzleRed) + , green(MTL::TextureSwizzleGreen) + , blue(MTL::TextureSwizzleBlue) + , alpha(MTL::TextureSwizzleAlpha) +{ +} + +_MTL_INLINE MTL::TextureSwizzleChannels MTL::TextureSwizzleChannels::Default() +{ + return MTL::TextureSwizzleChannels(); +} + +_MTL_INLINE MTL::TextureSwizzleChannels MTL::TextureSwizzleChannels::Make(MTL::TextureSwizzle r, MTL::TextureSwizzle g, MTL::TextureSwizzle b, MTL::TextureSwizzle a) +{ + return TextureSwizzleChannels(r, g, b, a); +} -// static method: alloc _MTL_INLINE MTL::SharedTextureHandle* MTL::SharedTextureHandle::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLSharedTextureHandle)); } -// method: init -_MTL_INLINE MTL::SharedTextureHandle* MTL::SharedTextureHandle::init() -{ - return NS::Object::init(); -} - -// property: device _MTL_INLINE MTL::Device* MTL::SharedTextureHandle::device() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(device)); } -// property: label +_MTL_INLINE MTL::SharedTextureHandle* MTL::SharedTextureHandle::init() +{ + return NS::Object::init(); +} + _MTL_INLINE NS::String* MTL::SharedTextureHandle::label() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(label)); } -// static method: alloc _MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTextureDescriptor)); } -// method: init -_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::init() +_MTL_INLINE bool MTL::TextureDescriptor::allowGPUOptimizedContents() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowGPUOptimizedContents)); } -// static method: texture2DDescriptorWithPixelFormat:width:height:mipmapped: -_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::texture2DDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, NS::UInteger height, bool mipmapped) -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(texture2DDescriptorWithPixelFormat_width_height_mipmapped_), pixelFormat, width, height, mipmapped); -} - -// static method: textureCubeDescriptorWithPixelFormat:size:mipmapped: -_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::textureCubeDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger size, bool mipmapped) -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(textureCubeDescriptorWithPixelFormat_size_mipmapped_), pixelFormat, size, mipmapped); -} - -// static method: textureBufferDescriptorWithPixelFormat:width:resourceOptions:usage: -_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::textureBufferDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, MTL::ResourceOptions resourceOptions, MTL::TextureUsage usage) -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(textureBufferDescriptorWithPixelFormat_width_resourceOptions_usage_), pixelFormat, width, resourceOptions, usage); -} - -// property: textureType -_MTL_INLINE MTL::TextureType MTL::TextureDescriptor::textureType() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setTextureType(MTL::TextureType textureType) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureType_), textureType); -} - -// property: pixelFormat -_MTL_INLINE MTL::PixelFormat MTL::TextureDescriptor::pixelFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); -} - -// property: width -_MTL_INLINE NS::UInteger MTL::TextureDescriptor::width() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(width)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setWidth(NS::UInteger width) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setWidth_), width); -} - -// property: height -_MTL_INLINE NS::UInteger MTL::TextureDescriptor::height() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(height)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setHeight(NS::UInteger height) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setHeight_), height); -} - -// property: depth -_MTL_INLINE NS::UInteger MTL::TextureDescriptor::depth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depth)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setDepth(NS::UInteger depth) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepth_), depth); -} - -// property: mipmapLevelCount -_MTL_INLINE NS::UInteger MTL::TextureDescriptor::mipmapLevelCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(mipmapLevelCount)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setMipmapLevelCount(NS::UInteger mipmapLevelCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setMipmapLevelCount_), mipmapLevelCount); -} - -// property: sampleCount -_MTL_INLINE NS::UInteger MTL::TextureDescriptor::sampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setSampleCount(NS::UInteger sampleCount) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount); -} - -// property: arrayLength _MTL_INLINE NS::UInteger MTL::TextureDescriptor::arrayLength() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); } -_MTL_INLINE void MTL::TextureDescriptor::setArrayLength(NS::UInteger arrayLength) +_MTL_INLINE MTL::TextureCompressionType MTL::TextureDescriptor::compressionType() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setArrayLength_), arrayLength); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(compressionType)); } -// property: resourceOptions -_MTL_INLINE MTL::ResourceOptions MTL::TextureDescriptor::resourceOptions() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setResourceOptions(MTL::ResourceOptions resourceOptions) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setResourceOptions_), resourceOptions); -} - -// property: cpuCacheMode _MTL_INLINE MTL::CPUCacheMode MTL::TextureDescriptor::cpuCacheMode() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(cpuCacheMode)); } -_MTL_INLINE void MTL::TextureDescriptor::setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode) +_MTL_INLINE NS::UInteger MTL::TextureDescriptor::depth() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setCpuCacheMode_), cpuCacheMode); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depth)); } -// property: storageMode -_MTL_INLINE MTL::StorageMode MTL::TextureDescriptor::storageMode() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); -} - -_MTL_INLINE void MTL::TextureDescriptor::setStorageMode(MTL::StorageMode storageMode) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); -} - -// property: hazardTrackingMode _MTL_INLINE MTL::HazardTrackingMode MTL::TextureDescriptor::hazardTrackingMode() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(hazardTrackingMode)); } -_MTL_INLINE void MTL::TextureDescriptor::setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode) +_MTL_INLINE NS::UInteger MTL::TextureDescriptor::height() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setHazardTrackingMode_), hazardTrackingMode); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(height)); } -// property: usage -_MTL_INLINE MTL::TextureUsage MTL::TextureDescriptor::usage() const +_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); + return NS::Object::init(); } -_MTL_INLINE void MTL::TextureDescriptor::setUsage(MTL::TextureUsage usage) +_MTL_INLINE NS::UInteger MTL::TextureDescriptor::mipmapLevelCount() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setUsage_), usage); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(mipmapLevelCount)); } -// property: allowGPUOptimizedContents -_MTL_INLINE bool MTL::TextureDescriptor::allowGPUOptimizedContents() const +_MTL_INLINE MTL::PixelFormat MTL::TextureDescriptor::pixelFormat() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowGPUOptimizedContents)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); +} + +_MTL_INLINE MTL::SparsePageSize MTL::TextureDescriptor::placementSparsePageSize() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(placementSparsePageSize)); +} + +_MTL_INLINE MTL::ResourceOptions MTL::TextureDescriptor::resourceOptions() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(resourceOptions)); +} + +_MTL_INLINE NS::UInteger MTL::TextureDescriptor::sampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); } _MTL_INLINE void MTL::TextureDescriptor::setAllowGPUOptimizedContents(bool allowGPUOptimizedContents) @@ -439,10 +417,9 @@ _MTL_INLINE void MTL::TextureDescriptor::setAllowGPUOptimizedContents(bool allow Object::sendMessage(this, _MTL_PRIVATE_SEL(setAllowGPUOptimizedContents_), allowGPUOptimizedContents); } -// property: compressionType -_MTL_INLINE MTL::TextureCompressionType MTL::TextureDescriptor::compressionType() const +_MTL_INLINE void MTL::TextureDescriptor::setArrayLength(NS::UInteger arrayLength) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(compressionType)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setArrayLength_), arrayLength); } _MTL_INLINE void MTL::TextureDescriptor::setCompressionType(MTL::TextureCompressionType compressionType) @@ -450,10 +427,54 @@ _MTL_INLINE void MTL::TextureDescriptor::setCompressionType(MTL::TextureCompress Object::sendMessage(this, _MTL_PRIVATE_SEL(setCompressionType_), compressionType); } -// property: swizzle -_MTL_INLINE MTL::TextureSwizzleChannels MTL::TextureDescriptor::swizzle() const +_MTL_INLINE void MTL::TextureDescriptor::setCpuCacheMode(MTL::CPUCacheMode cpuCacheMode) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(swizzle)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setCpuCacheMode_), cpuCacheMode); +} + +_MTL_INLINE void MTL::TextureDescriptor::setDepth(NS::UInteger depth) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setDepth_), depth); +} + +_MTL_INLINE void MTL::TextureDescriptor::setHazardTrackingMode(MTL::HazardTrackingMode hazardTrackingMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setHazardTrackingMode_), hazardTrackingMode); +} + +_MTL_INLINE void MTL::TextureDescriptor::setHeight(NS::UInteger height) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setHeight_), height); +} + +_MTL_INLINE void MTL::TextureDescriptor::setMipmapLevelCount(NS::UInteger mipmapLevelCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setMipmapLevelCount_), mipmapLevelCount); +} + +_MTL_INLINE void MTL::TextureDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); +} + +_MTL_INLINE void MTL::TextureDescriptor::setPlacementSparsePageSize(MTL::SparsePageSize placementSparsePageSize) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPlacementSparsePageSize_), placementSparsePageSize); +} + +_MTL_INLINE void MTL::TextureDescriptor::setResourceOptions(MTL::ResourceOptions resourceOptions) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setResourceOptions_), resourceOptions); +} + +_MTL_INLINE void MTL::TextureDescriptor::setSampleCount(NS::UInteger sampleCount) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSampleCount_), sampleCount); +} + +_MTL_INLINE void MTL::TextureDescriptor::setStorageMode(MTL::StorageMode storageMode) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStorageMode_), storageMode); } _MTL_INLINE void MTL::TextureDescriptor::setSwizzle(MTL::TextureSwizzleChannels swizzle) @@ -461,224 +482,322 @@ _MTL_INLINE void MTL::TextureDescriptor::setSwizzle(MTL::TextureSwizzleChannels Object::sendMessage(this, _MTL_PRIVATE_SEL(setSwizzle_), swizzle); } -// property: rootResource -_MTL_INLINE MTL::Resource* MTL::Texture::rootResource() const +_MTL_INLINE void MTL::TextureDescriptor::setTextureType(MTL::TextureType textureType) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(rootResource)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureType_), textureType); } -// property: parentTexture -_MTL_INLINE MTL::Texture* MTL::Texture::parentTexture() const +_MTL_INLINE void MTL::TextureDescriptor::setUsage(MTL::TextureUsage usage) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(parentTexture)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setUsage_), usage); } -// property: parentRelativeLevel -_MTL_INLINE NS::UInteger MTL::Texture::parentRelativeLevel() const +_MTL_INLINE void MTL::TextureDescriptor::setWidth(NS::UInteger width) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(parentRelativeLevel)); + Object::sendMessage(this, _MTL_PRIVATE_SEL(setWidth_), width); } -// property: parentRelativeSlice -_MTL_INLINE NS::UInteger MTL::Texture::parentRelativeSlice() const +_MTL_INLINE MTL::StorageMode MTL::TextureDescriptor::storageMode() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(parentRelativeSlice)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(storageMode)); } -// property: buffer -_MTL_INLINE MTL::Buffer* MTL::Texture::buffer() const +_MTL_INLINE MTL::TextureSwizzleChannels MTL::TextureDescriptor::swizzle() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffer)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(swizzle)); } -// property: bufferOffset -_MTL_INLINE NS::UInteger MTL::Texture::bufferOffset() const +_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::texture2DDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, NS::UInteger height, bool mipmapped) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferOffset)); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(texture2DDescriptorWithPixelFormat_width_height_mipmapped_), pixelFormat, width, height, mipmapped); } -// property: bufferBytesPerRow -_MTL_INLINE NS::UInteger MTL::Texture::bufferBytesPerRow() const +_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::textureBufferDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger width, MTL::ResourceOptions resourceOptions, MTL::TextureUsage usage) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferBytesPerRow)); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(textureBufferDescriptorWithPixelFormat_width_resourceOptions_usage_), pixelFormat, width, resourceOptions, usage); } -// property: iosurface -_MTL_INLINE IOSurfaceRef MTL::Texture::iosurface() const +_MTL_INLINE MTL::TextureDescriptor* MTL::TextureDescriptor::textureCubeDescriptor(MTL::PixelFormat pixelFormat, NS::UInteger size, bool mipmapped) { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(iosurface)); + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLTextureDescriptor), _MTL_PRIVATE_SEL(textureCubeDescriptorWithPixelFormat_size_mipmapped_), pixelFormat, size, mipmapped); } -// property: iosurfacePlane -_MTL_INLINE NS::UInteger MTL::Texture::iosurfacePlane() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(iosurfacePlane)); -} - -// property: textureType -_MTL_INLINE MTL::TextureType MTL::Texture::textureType() const +_MTL_INLINE MTL::TextureType MTL::TextureDescriptor::textureType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); } -// property: pixelFormat -_MTL_INLINE MTL::PixelFormat MTL::Texture::pixelFormat() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); -} - -// property: width -_MTL_INLINE NS::UInteger MTL::Texture::width() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(width)); -} - -// property: height -_MTL_INLINE NS::UInteger MTL::Texture::height() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(height)); -} - -// property: depth -_MTL_INLINE NS::UInteger MTL::Texture::depth() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(depth)); -} - -// property: mipmapLevelCount -_MTL_INLINE NS::UInteger MTL::Texture::mipmapLevelCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(mipmapLevelCount)); -} - -// property: sampleCount -_MTL_INLINE NS::UInteger MTL::Texture::sampleCount() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); -} - -// property: arrayLength -_MTL_INLINE NS::UInteger MTL::Texture::arrayLength() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); -} - -// property: usage -_MTL_INLINE MTL::TextureUsage MTL::Texture::usage() const +_MTL_INLINE MTL::TextureUsage MTL::TextureDescriptor::usage() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); } -// property: shareable -_MTL_INLINE bool MTL::Texture::shareable() const +_MTL_INLINE NS::UInteger MTL::TextureDescriptor::width() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isShareable)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(width)); } -// property: framebufferOnly -_MTL_INLINE bool MTL::Texture::framebufferOnly() const +_MTL_INLINE MTL::TextureViewDescriptor* MTL::TextureViewDescriptor::alloc() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isFramebufferOnly)); + return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLTextureViewDescriptor)); } -// property: firstMipmapInTail -_MTL_INLINE NS::UInteger MTL::Texture::firstMipmapInTail() const +_MTL_INLINE MTL::TextureViewDescriptor* MTL::TextureViewDescriptor::init() { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(firstMipmapInTail)); + return NS::Object::init(); } -// property: tailSizeInBytes -_MTL_INLINE NS::UInteger MTL::Texture::tailSizeInBytes() const +_MTL_INLINE NS::Range MTL::TextureViewDescriptor::levelRange() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(tailSizeInBytes)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(levelRange)); } -// property: isSparse -_MTL_INLINE bool MTL::Texture::isSparse() const +_MTL_INLINE MTL::PixelFormat MTL::TextureViewDescriptor::pixelFormat() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(isSparse)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); +} + +_MTL_INLINE void MTL::TextureViewDescriptor::setLevelRange(NS::Range levelRange) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setLevelRange_), levelRange); +} + +_MTL_INLINE void MTL::TextureViewDescriptor::setPixelFormat(MTL::PixelFormat pixelFormat) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setPixelFormat_), pixelFormat); +} + +_MTL_INLINE void MTL::TextureViewDescriptor::setSliceRange(NS::Range sliceRange) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSliceRange_), sliceRange); +} + +_MTL_INLINE void MTL::TextureViewDescriptor::setSwizzle(MTL::TextureSwizzleChannels swizzle) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setSwizzle_), swizzle); +} + +_MTL_INLINE void MTL::TextureViewDescriptor::setTextureType(MTL::TextureType textureType) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureType_), textureType); +} + +_MTL_INLINE NS::Range MTL::TextureViewDescriptor::sliceRange() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sliceRange)); +} + +_MTL_INLINE MTL::TextureSwizzleChannels MTL::TextureViewDescriptor::swizzle() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(swizzle)); +} + +_MTL_INLINE MTL::TextureType MTL::TextureViewDescriptor::textureType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); } -// property: allowGPUOptimizedContents _MTL_INLINE bool MTL::Texture::allowGPUOptimizedContents() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(allowGPUOptimizedContents)); } -// property: compressionType +_MTL_INLINE NS::UInteger MTL::Texture::arrayLength() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(arrayLength)); +} + +_MTL_INLINE MTL::Buffer* MTL::Texture::buffer() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(buffer)); +} + +_MTL_INLINE NS::UInteger MTL::Texture::bufferBytesPerRow() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferBytesPerRow)); +} + +_MTL_INLINE NS::UInteger MTL::Texture::bufferOffset() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferOffset)); +} + _MTL_INLINE MTL::TextureCompressionType MTL::Texture::compressionType() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(compressionType)); } -// property: gpuResourceID +_MTL_INLINE NS::UInteger MTL::Texture::depth() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(depth)); +} + +_MTL_INLINE NS::UInteger MTL::Texture::firstMipmapInTail() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(firstMipmapInTail)); +} + +_MTL_INLINE bool MTL::Texture::framebufferOnly() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isFramebufferOnly)); +} + +_MTL_INLINE void MTL::Texture::getBytes(void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage, MTL::Region region, NS::UInteger level, NS::UInteger slice) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_slice_), pixelBytes, bytesPerRow, bytesPerImage, region, level, slice); +} + +_MTL_INLINE void MTL::Texture::getBytes(void* pixelBytes, NS::UInteger bytesPerRow, MTL::Region region, NS::UInteger level) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(getBytes_bytesPerRow_fromRegion_mipmapLevel_), pixelBytes, bytesPerRow, region, level); +} + _MTL_INLINE MTL::ResourceID MTL::Texture::gpuResourceID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); } -// method: getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice: -_MTL_INLINE void MTL::Texture::getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage, MTL::Region region, NS::UInteger level, NS::UInteger slice) +_MTL_INLINE NS::UInteger MTL::Texture::height() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_slice_), pixelBytes, bytesPerRow, bytesPerImage, region, level, slice); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(height)); } -// method: replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage: -_MTL_INLINE void MTL::Texture::replaceRegion(MTL::Region region, NS::UInteger level, NS::UInteger slice, const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage) +_MTL_INLINE IOSurfaceRef MTL::Texture::iosurface() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(replaceRegion_mipmapLevel_slice_withBytes_bytesPerRow_bytesPerImage_), region, level, slice, pixelBytes, bytesPerRow, bytesPerImage); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(iosurface)); } -// method: getBytes:bytesPerRow:fromRegion:mipmapLevel: -_MTL_INLINE void MTL::Texture::getBytes(const void* pixelBytes, NS::UInteger bytesPerRow, MTL::Region region, NS::UInteger level) +_MTL_INLINE NS::UInteger MTL::Texture::iosurfacePlane() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(getBytes_bytesPerRow_fromRegion_mipmapLevel_), pixelBytes, bytesPerRow, region, level); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(iosurfacePlane)); } -// method: replaceRegion:mipmapLevel:withBytes:bytesPerRow: -_MTL_INLINE void MTL::Texture::replaceRegion(MTL::Region region, NS::UInteger level, const void* pixelBytes, NS::UInteger bytesPerRow) +_MTL_INLINE bool MTL::Texture::isFramebufferOnly() const { - Object::sendMessage(this, _MTL_PRIVATE_SEL(replaceRegion_mipmapLevel_withBytes_bytesPerRow_), region, level, pixelBytes, bytesPerRow); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isFramebufferOnly)); } -// method: newTextureViewWithPixelFormat: -_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat) +_MTL_INLINE bool MTL::Texture::isShareable() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_), pixelFormat); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isShareable)); } -// method: newTextureViewWithPixelFormat:textureType:levels:slices: -_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange) +_MTL_INLINE bool MTL::Texture::isSparse() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_), pixelFormat, textureType, levelRange, sliceRange); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isSparse)); } -// method: newSharedTextureHandle -_MTL_INLINE MTL::SharedTextureHandle* MTL::Texture::newSharedTextureHandle() +_MTL_INLINE NS::UInteger MTL::Texture::mipmapLevelCount() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedTextureHandle)); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(mipmapLevelCount)); } -// property: remoteStorageTexture -_MTL_INLINE MTL::Texture* MTL::Texture::remoteStorageTexture() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(remoteStorageTexture)); -} - -// method: newRemoteTextureViewForDevice: _MTL_INLINE MTL::Texture* MTL::Texture::newRemoteTextureViewForDevice(const MTL::Device* device) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(newRemoteTextureViewForDevice_), device); } -// property: swizzle +_MTL_INLINE MTL::SharedTextureHandle* MTL::Texture::newSharedTextureHandle() +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newSharedTextureHandle)); +} + +_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_), pixelFormat); +} + +_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_), pixelFormat, textureType, levelRange, sliceRange); +} + +_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(const MTL::TextureViewDescriptor* descriptor) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithDescriptor_), descriptor); +} + +_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange, MTL::TextureSwizzleChannels swizzle) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_swizzle_), pixelFormat, textureType, levelRange, sliceRange, swizzle); +} + +_MTL_INLINE NS::UInteger MTL::Texture::parentRelativeLevel() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(parentRelativeLevel)); +} + +_MTL_INLINE NS::UInteger MTL::Texture::parentRelativeSlice() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(parentRelativeSlice)); +} + +_MTL_INLINE MTL::Texture* MTL::Texture::parentTexture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(parentTexture)); +} + +_MTL_INLINE MTL::PixelFormat MTL::Texture::pixelFormat() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(pixelFormat)); +} + +_MTL_INLINE MTL::Texture* MTL::Texture::remoteStorageTexture() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(remoteStorageTexture)); +} + +_MTL_INLINE void MTL::Texture::replaceRegion(MTL::Region region, NS::UInteger level, NS::UInteger slice, const void* pixelBytes, NS::UInteger bytesPerRow, NS::UInteger bytesPerImage) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(replaceRegion_mipmapLevel_slice_withBytes_bytesPerRow_bytesPerImage_), region, level, slice, pixelBytes, bytesPerRow, bytesPerImage); +} + +_MTL_INLINE void MTL::Texture::replaceRegion(MTL::Region region, NS::UInteger level, const void* pixelBytes, NS::UInteger bytesPerRow) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(replaceRegion_mipmapLevel_withBytes_bytesPerRow_), region, level, pixelBytes, bytesPerRow); +} + +_MTL_INLINE MTL::Resource* MTL::Texture::rootResource() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(rootResource)); +} + +_MTL_INLINE NS::UInteger MTL::Texture::sampleCount() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sampleCount)); +} + +_MTL_INLINE bool MTL::Texture::shareable() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(isShareable)); +} + +_MTL_INLINE MTL::TextureSparseTier MTL::Texture::sparseTextureTier() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(sparseTextureTier)); +} + _MTL_INLINE MTL::TextureSwizzleChannels MTL::Texture::swizzle() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(swizzle)); } -// method: newTextureViewWithPixelFormat:textureType:levels:slices:swizzle: -_MTL_INLINE MTL::Texture* MTL::Texture::newTextureView(MTL::PixelFormat pixelFormat, MTL::TextureType textureType, NS::Range levelRange, NS::Range sliceRange, MTL::TextureSwizzleChannels swizzle) +_MTL_INLINE NS::UInteger MTL::Texture::tailSizeInBytes() const { - return Object::sendMessage(this, _MTL_PRIVATE_SEL(newTextureViewWithPixelFormat_textureType_levels_slices_swizzle_), pixelFormat, textureType, levelRange, sliceRange, swizzle); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(tailSizeInBytes)); +} + +_MTL_INLINE MTL::TextureType MTL::Texture::textureType() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(textureType)); +} + +_MTL_INLINE MTL::TextureUsage MTL::Texture::usage() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(usage)); +} + +_MTL_INLINE NS::UInteger MTL::Texture::width() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(width)); } diff --git a/vendor/metal-cpp/Metal/MTLTextureViewPool.hpp b/vendor/metal-cpp/Metal/MTLTextureViewPool.hpp new file mode 100644 index 000000000..cb7556f56 --- /dev/null +++ b/vendor/metal-cpp/Metal/MTLTextureViewPool.hpp @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// Metal/MTLTextureViewPool.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +#include "../Foundation/Foundation.hpp" +#include "MTLDefines.hpp" +#include "MTLHeaderBridge.hpp" +#include "MTLPrivate.hpp" +#include "MTLResourceViewPool.hpp" +#include "MTLTypes.hpp" + +namespace MTL +{ +class Buffer; +class Texture; +class TextureDescriptor; +class TextureViewDescriptor; + +class TextureViewPool : public NS::Referencing +{ +public: + ResourceID setTextureView(const MTL::Texture* texture, NS::UInteger index); + ResourceID setTextureView(const MTL::Texture* texture, const MTL::TextureViewDescriptor* descriptor, NS::UInteger index); + ResourceID setTextureViewFromBuffer(const MTL::Buffer* buffer, const MTL::TextureDescriptor* descriptor, NS::UInteger offset, NS::UInteger bytesPerRow, NS::UInteger index); +}; + +} +_MTL_INLINE MTL::ResourceID MTL::TextureViewPool::setTextureView(const MTL::Texture* texture, NS::UInteger index) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureView_atIndex_), texture, index); +} + +_MTL_INLINE MTL::ResourceID MTL::TextureViewPool::setTextureView(const MTL::Texture* texture, const MTL::TextureViewDescriptor* descriptor, NS::UInteger index) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureView_descriptor_atIndex_), texture, descriptor, index); +} + +_MTL_INLINE MTL::ResourceID MTL::TextureViewPool::setTextureViewFromBuffer(const MTL::Buffer* buffer, const MTL::TextureDescriptor* descriptor, NS::UInteger offset, NS::UInteger bytesPerRow, NS::UInteger index) +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(setTextureViewFromBuffer_descriptor_offset_bytesPerRow_atIndex_), buffer, descriptor, offset, bytesPerRow, index); +} diff --git a/vendor/metal-cpp/Metal/MTLTypes.hpp b/vendor/metal-cpp/Metal/MTLTypes.hpp index 09a81840c..c6bbc031f 100644 --- a/vendor/metal-cpp/Metal/MTLTypes.hpp +++ b/vendor/metal-cpp/Metal/MTLTypes.hpp @@ -2,7 +2,7 @@ // // Metal/MTLTypes.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,17 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLTypes.hpp" - namespace MTL { +struct SamplePosition; + +using Coordinate2D = MTL::SamplePosition; + struct Origin { Origin() = default; @@ -76,15 +77,11 @@ struct Region MTL::Size size; } _MTL_PACKED; -struct SamplePosition; - -using Coordinate2D = SamplePosition; - struct SamplePosition { SamplePosition() = default; - SamplePosition(float _x, float _y); + SamplePosition(float x, float y); static SamplePosition Make(float x, float y); @@ -98,11 +95,10 @@ struct ResourceID } _MTL_PACKED; } - -_MTL_INLINE MTL::Origin::Origin(NS::UInteger _x, NS::UInteger _y, NS::UInteger _z) - : x(_x) - , y(_y) - , z(_z) +_MTL_INLINE MTL::Origin::Origin(NS::UInteger x, NS::UInteger y, NS::UInteger z) + : x(x) + , y(y) + , z(z) { } @@ -111,10 +107,10 @@ _MTL_INLINE MTL::Origin MTL::Origin::Make(NS::UInteger x, NS::UInteger y, NS::UI return Origin(x, y, z); } -_MTL_INLINE MTL::Size::Size(NS::UInteger _width, NS::UInteger _height, NS::UInteger _depth) - : width(_width) - , height(_height) - , depth(_depth) +_MTL_INLINE MTL::Size::Size(NS::UInteger width, NS::UInteger height, NS::UInteger depth) + : width(width) + , height(height) + , depth(depth) { } @@ -156,9 +152,9 @@ _MTL_INLINE MTL::Region MTL::Region::Make3D(NS::UInteger x, NS::UInteger y, NS:: return Region(x, y, z, width, height, depth); } -_MTL_INLINE MTL::SamplePosition::SamplePosition(float _x, float _y) - : x(_x) - , y(_y) +_MTL_INLINE MTL::SamplePosition::SamplePosition(float x, float y) + : x(x) + , y(y) { } diff --git a/vendor/metal-cpp/Metal/MTLVersion.hpp b/vendor/metal-cpp/Metal/MTLVersion.hpp index bb03684d9..d35039724 100644 --- a/vendor/metal-cpp/Metal/MTLVersion.hpp +++ b/vendor/metal-cpp/Metal/MTLVersion.hpp @@ -2,7 +2,7 @@ // // Metal/MTLVersion.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,9 +22,9 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- -#define METALCPP_VERSION_MAJOR 306 -#define METALCPP_VERSION_MINOR 5 -#define METALCPP_VERSION_PATCH 16 +#define METALCPP_VERSION_MAJOR 370 +#define METALCPP_VERSION_MINOR 63 +#define METALCPP_VERSION_PATCH 1 #define METALCPP_SUPPORTS_VERSION(major, minor, patch) \ ((major < METALCPP_VERSION_MAJOR) || \ diff --git a/vendor/metal-cpp/Metal/MTLVertexDescriptor.hpp b/vendor/metal-cpp/Metal/MTLVertexDescriptor.hpp index 80bdc4e03..4a38f3bc6 100644 --- a/vendor/metal-cpp/Metal/MTLVertexDescriptor.hpp +++ b/vendor/metal-cpp/Metal/MTLVertexDescriptor.hpp @@ -2,7 +2,7 @@ // // Metal/MTLVertexDescriptor.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,18 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" -#include - -#include "MTLVertexDescriptor.hpp" - namespace MTL { +class VertexAttributeDescriptor; +class VertexAttributeDescriptorArray; +class VertexBufferLayoutDescriptor; +class VertexBufferLayoutDescriptorArray; +class VertexDescriptor; _MTL_ENUM(NS::UInteger, VertexFormat) { VertexFormatInvalid = 0, VertexFormatUChar2 = 1, @@ -83,6 +85,8 @@ _MTL_ENUM(NS::UInteger, VertexFormat) { VertexFormatUShortNormalized = 51, VertexFormatShortNormalized = 52, VertexFormatHalf = 53, + VertexFormatFloatRG11B10 = 54, + VertexFormatFloatRGB9E5 = 55, }; _MTL_ENUM(NS::UInteger, VertexStepFunction) { @@ -93,252 +97,230 @@ _MTL_ENUM(NS::UInteger, VertexStepFunction) { VertexStepFunctionPerPatchControlPoint = 4, }; +static const NS::UInteger BufferLayoutStrideDynamic = NS::UIntegerMax; + class VertexBufferLayoutDescriptor : public NS::Copying { public: - static class VertexBufferLayoutDescriptor* alloc(); + static VertexBufferLayoutDescriptor* alloc(); - class VertexBufferLayoutDescriptor* init(); + VertexBufferLayoutDescriptor* init(); - NS::UInteger stride() const; - void setStride(NS::UInteger stride); + void setStepFunction(MTL::VertexStepFunction stepFunction); - MTL::VertexStepFunction stepFunction() const; - void setStepFunction(MTL::VertexStepFunction stepFunction); + void setStepRate(NS::UInteger stepRate); - NS::UInteger stepRate() const; - void setStepRate(NS::UInteger stepRate); + void setStride(NS::UInteger stride); + + VertexStepFunction stepFunction() const; + + NS::UInteger stepRate() const; + + NS::UInteger stride() const; }; - class VertexBufferLayoutDescriptorArray : public NS::Referencing { public: - static class VertexBufferLayoutDescriptorArray* alloc(); + static VertexBufferLayoutDescriptorArray* alloc(); - class VertexBufferLayoutDescriptorArray* init(); + VertexBufferLayoutDescriptorArray* init(); - class VertexBufferLayoutDescriptor* object(NS::UInteger index); - - void setObject(const class VertexBufferLayoutDescriptor* bufferDesc, NS::UInteger index); + VertexBufferLayoutDescriptor* object(NS::UInteger index); + void setObject(const MTL::VertexBufferLayoutDescriptor* bufferDesc, NS::UInteger index); }; - class VertexAttributeDescriptor : public NS::Copying { public: - static class VertexAttributeDescriptor* alloc(); + static VertexAttributeDescriptor* alloc(); - class VertexAttributeDescriptor* init(); + NS::UInteger bufferIndex() const; - MTL::VertexFormat format() const; - void setFormat(MTL::VertexFormat format); + VertexFormat format() const; - NS::UInteger offset() const; - void setOffset(NS::UInteger offset); + VertexAttributeDescriptor* init(); - NS::UInteger bufferIndex() const; - void setBufferIndex(NS::UInteger bufferIndex); + NS::UInteger offset() const; + + void setBufferIndex(NS::UInteger bufferIndex); + + void setFormat(MTL::VertexFormat format); + + void setOffset(NS::UInteger offset); }; - class VertexAttributeDescriptorArray : public NS::Referencing { public: - static class VertexAttributeDescriptorArray* alloc(); + static VertexAttributeDescriptorArray* alloc(); - class VertexAttributeDescriptorArray* init(); + VertexAttributeDescriptorArray* init(); - class VertexAttributeDescriptor* object(NS::UInteger index); - - void setObject(const class VertexAttributeDescriptor* attributeDesc, NS::UInteger index); + VertexAttributeDescriptor* object(NS::UInteger index); + void setObject(const MTL::VertexAttributeDescriptor* attributeDesc, NS::UInteger index); }; - class VertexDescriptor : public NS::Copying { public: - static class VertexDescriptor* alloc(); + static VertexDescriptor* alloc(); - class VertexDescriptor* init(); + VertexAttributeDescriptorArray* attributes() const; - static class VertexDescriptor* vertexDescriptor(); + VertexDescriptor* init(); - class VertexBufferLayoutDescriptorArray* layouts() const; + VertexBufferLayoutDescriptorArray* layouts() const; - class VertexAttributeDescriptorArray* attributes() const; + void reset(); - void reset(); + static VertexDescriptor* vertexDescriptor(); }; } -// static method: alloc _MTL_INLINE MTL::VertexBufferLayoutDescriptor* MTL::VertexBufferLayoutDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexBufferLayoutDescriptor)); } -// method: init _MTL_INLINE MTL::VertexBufferLayoutDescriptor* MTL::VertexBufferLayoutDescriptor::init() { return NS::Object::init(); } -// property: stride -_MTL_INLINE NS::UInteger MTL::VertexBufferLayoutDescriptor::stride() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stride)); -} - -_MTL_INLINE void MTL::VertexBufferLayoutDescriptor::setStride(NS::UInteger stride) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setStride_), stride); -} - -// property: stepFunction -_MTL_INLINE MTL::VertexStepFunction MTL::VertexBufferLayoutDescriptor::stepFunction() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepFunction)); -} - _MTL_INLINE void MTL::VertexBufferLayoutDescriptor::setStepFunction(MTL::VertexStepFunction stepFunction) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStepFunction_), stepFunction); } -// property: stepRate -_MTL_INLINE NS::UInteger MTL::VertexBufferLayoutDescriptor::stepRate() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepRate)); -} - _MTL_INLINE void MTL::VertexBufferLayoutDescriptor::setStepRate(NS::UInteger stepRate) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setStepRate_), stepRate); } -// static method: alloc +_MTL_INLINE void MTL::VertexBufferLayoutDescriptor::setStride(NS::UInteger stride) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setStride_), stride); +} + +_MTL_INLINE MTL::VertexStepFunction MTL::VertexBufferLayoutDescriptor::stepFunction() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepFunction)); +} + +_MTL_INLINE NS::UInteger MTL::VertexBufferLayoutDescriptor::stepRate() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stepRate)); +} + +_MTL_INLINE NS::UInteger MTL::VertexBufferLayoutDescriptor::stride() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(stride)); +} + _MTL_INLINE MTL::VertexBufferLayoutDescriptorArray* MTL::VertexBufferLayoutDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexBufferLayoutDescriptorArray)); } -// method: init _MTL_INLINE MTL::VertexBufferLayoutDescriptorArray* MTL::VertexBufferLayoutDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::VertexBufferLayoutDescriptor* MTL::VertexBufferLayoutDescriptorArray::object(NS::UInteger index) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), index); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::VertexBufferLayoutDescriptorArray::setObject(const MTL::VertexBufferLayoutDescriptor* bufferDesc, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), bufferDesc, index); } -// static method: alloc _MTL_INLINE MTL::VertexAttributeDescriptor* MTL::VertexAttributeDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexAttributeDescriptor)); } -// method: init -_MTL_INLINE MTL::VertexAttributeDescriptor* MTL::VertexAttributeDescriptor::init() +_MTL_INLINE NS::UInteger MTL::VertexAttributeDescriptor::bufferIndex() const { - return NS::Object::init(); + return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferIndex)); } -// property: format _MTL_INLINE MTL::VertexFormat MTL::VertexAttributeDescriptor::format() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(format)); } -_MTL_INLINE void MTL::VertexAttributeDescriptor::setFormat(MTL::VertexFormat format) +_MTL_INLINE MTL::VertexAttributeDescriptor* MTL::VertexAttributeDescriptor::init() { - Object::sendMessage(this, _MTL_PRIVATE_SEL(setFormat_), format); + return NS::Object::init(); } -// property: offset _MTL_INLINE NS::UInteger MTL::VertexAttributeDescriptor::offset() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(offset)); } -_MTL_INLINE void MTL::VertexAttributeDescriptor::setOffset(NS::UInteger offset) -{ - Object::sendMessage(this, _MTL_PRIVATE_SEL(setOffset_), offset); -} - -// property: bufferIndex -_MTL_INLINE NS::UInteger MTL::VertexAttributeDescriptor::bufferIndex() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(bufferIndex)); -} - _MTL_INLINE void MTL::VertexAttributeDescriptor::setBufferIndex(NS::UInteger bufferIndex) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setBufferIndex_), bufferIndex); } -// static method: alloc +_MTL_INLINE void MTL::VertexAttributeDescriptor::setFormat(MTL::VertexFormat format) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setFormat_), format); +} + +_MTL_INLINE void MTL::VertexAttributeDescriptor::setOffset(NS::UInteger offset) +{ + Object::sendMessage(this, _MTL_PRIVATE_SEL(setOffset_), offset); +} + _MTL_INLINE MTL::VertexAttributeDescriptorArray* MTL::VertexAttributeDescriptorArray::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexAttributeDescriptorArray)); } -// method: init _MTL_INLINE MTL::VertexAttributeDescriptorArray* MTL::VertexAttributeDescriptorArray::init() { return NS::Object::init(); } -// method: objectAtIndexedSubscript: _MTL_INLINE MTL::VertexAttributeDescriptor* MTL::VertexAttributeDescriptorArray::object(NS::UInteger index) { return Object::sendMessage(this, _MTL_PRIVATE_SEL(objectAtIndexedSubscript_), index); } -// method: setObject:atIndexedSubscript: _MTL_INLINE void MTL::VertexAttributeDescriptorArray::setObject(const MTL::VertexAttributeDescriptor* attributeDesc, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setObject_atIndexedSubscript_), attributeDesc, index); } -// static method: alloc _MTL_INLINE MTL::VertexDescriptor* MTL::VertexDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVertexDescriptor)); } -// method: init -_MTL_INLINE MTL::VertexDescriptor* MTL::VertexDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: vertexDescriptor -_MTL_INLINE MTL::VertexDescriptor* MTL::VertexDescriptor::vertexDescriptor() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLVertexDescriptor), _MTL_PRIVATE_SEL(vertexDescriptor)); -} - -// property: layouts -_MTL_INLINE MTL::VertexBufferLayoutDescriptorArray* MTL::VertexDescriptor::layouts() const -{ - return Object::sendMessage(this, _MTL_PRIVATE_SEL(layouts)); -} - -// property: attributes _MTL_INLINE MTL::VertexAttributeDescriptorArray* MTL::VertexDescriptor::attributes() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(attributes)); } -// method: reset +_MTL_INLINE MTL::VertexDescriptor* MTL::VertexDescriptor::init() +{ + return NS::Object::init(); +} + +_MTL_INLINE MTL::VertexBufferLayoutDescriptorArray* MTL::VertexDescriptor::layouts() const +{ + return Object::sendMessage(this, _MTL_PRIVATE_SEL(layouts)); +} + _MTL_INLINE void MTL::VertexDescriptor::reset() { Object::sendMessage(this, _MTL_PRIVATE_SEL(reset)); } + +_MTL_INLINE MTL::VertexDescriptor* MTL::VertexDescriptor::vertexDescriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLVertexDescriptor), _MTL_PRIVATE_SEL(vertexDescriptor)); +} diff --git a/vendor/metal-cpp/Metal/MTLVisibleFunctionTable.hpp b/vendor/metal-cpp/Metal/MTLVisibleFunctionTable.hpp index 88e8fb1e9..de144ea2b 100644 --- a/vendor/metal-cpp/Metal/MTLVisibleFunctionTable.hpp +++ b/vendor/metal-cpp/Metal/MTLVisibleFunctionTable.hpp @@ -2,7 +2,7 @@ // // Metal/MTLVisibleFunctionTable.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2025 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,84 +20,76 @@ #pragma once +#include "../Foundation/Foundation.hpp" #include "MTLDefines.hpp" #include "MTLHeaderBridge.hpp" #include "MTLPrivate.hpp" - -#include - #include "MTLResource.hpp" #include "MTLTypes.hpp" namespace MTL { +class FunctionHandle; +class VisibleFunctionTableDescriptor; + class VisibleFunctionTableDescriptor : public NS::Copying { public: - static class VisibleFunctionTableDescriptor* alloc(); + static VisibleFunctionTableDescriptor* alloc(); - class VisibleFunctionTableDescriptor* init(); + NS::UInteger functionCount() const; - static class VisibleFunctionTableDescriptor* visibleFunctionTableDescriptor(); + VisibleFunctionTableDescriptor* init(); - NS::UInteger functionCount() const; - void setFunctionCount(NS::UInteger functionCount); + void setFunctionCount(NS::UInteger functionCount); + + static VisibleFunctionTableDescriptor* visibleFunctionTableDescriptor(); }; - class VisibleFunctionTable : public NS::Referencing { public: - MTL::ResourceID gpuResourceID() const; + ResourceID gpuResourceID() const; - void setFunction(const class FunctionHandle* function, NS::UInteger index); - - void setFunctions(const class FunctionHandle* const functions[], NS::Range range); + void setFunction(const MTL::FunctionHandle* function, NS::UInteger index); + void setFunctions(const MTL::FunctionHandle* const functions[], NS::Range range); }; } - -// static method: alloc _MTL_INLINE MTL::VisibleFunctionTableDescriptor* MTL::VisibleFunctionTableDescriptor::alloc() { return NS::Object::alloc(_MTL_PRIVATE_CLS(MTLVisibleFunctionTableDescriptor)); } -// method: init -_MTL_INLINE MTL::VisibleFunctionTableDescriptor* MTL::VisibleFunctionTableDescriptor::init() -{ - return NS::Object::init(); -} - -// static method: visibleFunctionTableDescriptor -_MTL_INLINE MTL::VisibleFunctionTableDescriptor* MTL::VisibleFunctionTableDescriptor::visibleFunctionTableDescriptor() -{ - return Object::sendMessage(_MTL_PRIVATE_CLS(MTLVisibleFunctionTableDescriptor), _MTL_PRIVATE_SEL(visibleFunctionTableDescriptor)); -} - -// property: functionCount _MTL_INLINE NS::UInteger MTL::VisibleFunctionTableDescriptor::functionCount() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(functionCount)); } +_MTL_INLINE MTL::VisibleFunctionTableDescriptor* MTL::VisibleFunctionTableDescriptor::init() +{ + return NS::Object::init(); +} + _MTL_INLINE void MTL::VisibleFunctionTableDescriptor::setFunctionCount(NS::UInteger functionCount) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctionCount_), functionCount); } -// property: gpuResourceID +_MTL_INLINE MTL::VisibleFunctionTableDescriptor* MTL::VisibleFunctionTableDescriptor::visibleFunctionTableDescriptor() +{ + return Object::sendMessage(_MTL_PRIVATE_CLS(MTLVisibleFunctionTableDescriptor), _MTL_PRIVATE_SEL(visibleFunctionTableDescriptor)); +} + _MTL_INLINE MTL::ResourceID MTL::VisibleFunctionTable::gpuResourceID() const { return Object::sendMessage(this, _MTL_PRIVATE_SEL(gpuResourceID)); } -// method: setFunction:atIndex: _MTL_INLINE void MTL::VisibleFunctionTable::setFunction(const MTL::FunctionHandle* function, NS::UInteger index) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunction_atIndex_), function, index); } -// method: setFunctions:withRange: _MTL_INLINE void MTL::VisibleFunctionTable::setFunctions(const MTL::FunctionHandle* const functions[], NS::Range range) { Object::sendMessage(this, _MTL_PRIVATE_SEL(setFunctions_withRange_), functions, range); diff --git a/vendor/metal-cpp/Metal/Metal.hpp b/vendor/metal-cpp/Metal/Metal.hpp index 6ea7adf3a..0d89cc044 100644 --- a/vendor/metal-cpp/Metal/Metal.hpp +++ b/vendor/metal-cpp/Metal/Metal.hpp @@ -2,7 +2,7 @@ // // Metal/Metal.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include "MTLAccelerationStructure.hpp" #include "MTLAccelerationStructureCommandEncoder.hpp" #include "MTLAccelerationStructureTypes.hpp" +#include "MTLAllocation.hpp" #include "MTLArgument.hpp" #include "MTLArgumentEncoder.hpp" #include "MTLBinaryArchive.hpp" @@ -62,6 +63,7 @@ #include "MTLIOCompressor.hpp" #include "MTLLibrary.hpp" #include "MTLLinkedFunctions.hpp" +#include "MTLLogState.hpp" #include "MTLParallelRenderCommandEncoder.hpp" #include "MTLPipeline.hpp" #include "MTLPixelFormat.hpp" @@ -70,6 +72,7 @@ #include "MTLRenderCommandEncoder.hpp" #include "MTLRenderPass.hpp" #include "MTLRenderPipeline.hpp" +#include "MTLResidencySet.hpp" #include "MTLResource.hpp" #include "MTLResourceStateCommandEncoder.hpp" #include "MTLResourceStatePass.hpp" @@ -80,5 +83,38 @@ #include "MTLVertexDescriptor.hpp" #include "MTLVisibleFunctionTable.hpp" #include "MTLVersion.hpp" +#include "MTLTensor.hpp" +#include "MTLResourceViewPool.hpp" +#include "MTLTextureViewPool.hpp" +#include "MTLDataType.hpp" +#include "MTL4ArgumentTable.hpp" +#include "MTL4BinaryFunction.hpp" +#include "MTL4CommandAllocator.hpp" +#include "MTL4CommandBuffer.hpp" +#include "MTL4CommandEncoder.hpp" +#include "MTL4CommandQueue.hpp" +#include "MTL4Counters.hpp" +#include "MTL4RenderPass.hpp" +#include "MTL4RenderCommandEncoder.hpp" +#include "MTL4ComputeCommandEncoder.hpp" +#include "MTL4MachineLearningCommandEncoder.hpp" +#include "MTL4Compiler.hpp" +#include "MTL4CompilerTask.hpp" +#include "MTL4LibraryDescriptor.hpp" +#include "MTL4FunctionDescriptor.hpp" +#include "MTL4LibraryFunctionDescriptor.hpp" +#include "MTL4SpecializedFunctionDescriptor.hpp" +#include "MTL4StitchedFunctionDescriptor.hpp" +#include "MTL4PipelineState.hpp" +#include "MTL4ComputePipeline.hpp" +#include "MTL4RenderPipeline.hpp" +#include "MTL4MachineLearningPipeline.hpp" +#include "MTL4TileRenderPipeline.hpp" +#include "MTL4MeshRenderPipeline.hpp" +#include "MTL4PipelineDataSetSerializer.hpp" +#include "MTL4Archive.hpp" +#include "MTL4CommitFeedback.hpp" +#include "MTL4BinaryFunctionDescriptor.hpp" +#include "MTL4LinkingDescriptor.hpp" //------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX.hpp b/vendor/metal-cpp/MetalFX.hpp new file mode 100644 index 000000000..20e647e84 --- /dev/null +++ b/vendor/metal-cpp/MetalFX.hpp @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MetalFX.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXSpatialScaler.hpp" +#include "MTLFXTemporalScaler.hpp" +#include "MTLFXTemporalDenoisedScaler.hpp" +#include "MTLFXFrameInterpolator.hpp" + +#include "MTL4FXSpatialScaler.hpp" +#include "MTL4FXTemporalScaler.hpp" +#include "MTL4FXTemporalDenoisedScaler.hpp" +#include "MTL4FXFrameInterpolator.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MTL4FXFrameInterpolator.hpp b/vendor/metal-cpp/MetalFX/MTL4FXFrameInterpolator.hpp new file mode 100644 index 000000000..1c50ec9e9 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTL4FXFrameInterpolator.hpp @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTL4FXFrameInterpolator.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXFrameInterpolator.hpp" +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class FrameInterpolator : public NS::Referencing + { + public: + void encodeToCommandBuffer(MTL4::CommandBuffer* commandBuffer); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::FrameInterpolator::encodeToCommandBuffer(MTL4::CommandBuffer* commandBuffer) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MetalFX/MTL4FXSpatialScaler.hpp b/vendor/metal-cpp/MetalFX/MTL4FXSpatialScaler.hpp new file mode 100644 index 000000000..8ea8dfdd5 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTL4FXSpatialScaler.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTL4FXSpatialScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXSpatialScaler.hpp" +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class SpatialScaler : public NS::Referencing< SpatialScaler, MTLFX::SpatialScalerBase > + { + public: + void encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::SpatialScaler::encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MTL4FXTemporalDenoisedScaler.hpp b/vendor/metal-cpp/MetalFX/MTL4FXTemporalDenoisedScaler.hpp new file mode 100644 index 000000000..73014bbc2 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTL4FXTemporalDenoisedScaler.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXTemporalDenoisedScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXTemporalDenoisedScaler.hpp" +#include "../Metal/Metal.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalDenoisedScaler : public NS::Referencing< TemporalDenoisedScaler, MTLFX::TemporalDenoisedScalerBase > + { + public: + void encodeToCommandBuffer(MTL4::CommandBuffer* commandBuffer); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::TemporalDenoisedScaler::encodeToCommandBuffer( MTL4::CommandBuffer* commandBuffer ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MetalFX/MTL4FXTemporalScaler.hpp b/vendor/metal-cpp/MetalFX/MTL4FXTemporalScaler.hpp new file mode 100644 index 000000000..3bda5dca8 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTL4FXTemporalScaler.hpp @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTL4FXTemporalScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "MTLFXTemporalScaler.hpp" +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalScaler : public NS::Referencing< TemporalScaler, MTLFX::TemporalScalerBase > + { + public: + void encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTL4FX::TemporalScaler::encodeToCommandBuffer( MTL4::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MTLFXDefines.hpp b/vendor/metal-cpp/MetalFX/MTLFXDefines.hpp new file mode 100644 index 000000000..320e0aa84 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTLFXDefines.hpp @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXDefines.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "../Foundation/NSDefines.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#define _MTLFX_EXPORT _NS_EXPORT +#define _MTLFX_EXTERN _NS_EXTERN +#define _MTLFX_INLINE _NS_INLINE +#define _MTLFX_PACKED _NS_PACKED + +#define _MTLFX_CONST( type, name ) _NS_CONST( type, name ) +#define _MTLFX_ENUM( type, name ) _NS_ENUM( type, name ) +#define _MTLFX_OPTIONS( type, name ) _NS_OPTIONS( type, name ) + +#define _MTLFX_VALIDATE_SIZE( mtlfx, name ) _NS_VALIDATE_SIZE( mtlfx, name ) +#define _MTLFX_VALIDATE_ENUM( mtlfx, name ) _NS_VALIDATE_ENUM( mtlfx, name ) + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MTLFXFrameInterpolator.hpp b/vendor/metal-cpp/MetalFX/MTLFXFrameInterpolator.hpp new file mode 100644 index 000000000..10ff69cbc --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTLFXFrameInterpolator.hpp @@ -0,0 +1,719 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXFrameInterpolator.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" +#include "MTLFXTemporalScaler.hpp" + +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalScaler; + class TemporalDenoisedScaler; + class FrameInterpolator; +} + +namespace MTLFX +{ + class FrameInterpolatorDescriptor : public NS::Copying< FrameInterpolatorDescriptor > + { + public: + static FrameInterpolatorDescriptor* alloc(); + FrameInterpolatorDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat(MTL::PixelFormat colorTextureFormat); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat(MTL::PixelFormat outputTextureFormat); + + MTL::PixelFormat depthTextureFormat() const; + void setDepthTextureFormat(MTL::PixelFormat depthTextureFormat); + + MTL::PixelFormat motionTextureFormat() const; + void setMotionTextureFormat(MTL::PixelFormat motionTextureFormat); + + MTL::PixelFormat uiTextureFormat() const; + void setUITextureFormat(MTL::PixelFormat uiTextureFormat); + + MTLFX::FrameInterpolatableScaler* scaler() const; + void setScaler(MTLFX::FrameInterpolatableScaler* scaler); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger inputWidth ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger inputHeight ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger outputWidth ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger outputHeight ); + + class FrameInterpolator* newFrameInterpolator( const MTL::Device* pDevice) const; + MTL4FX::FrameInterpolator* newFrameInterpolator( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler) const; + + static bool supportsMetal4FX(MTL::Device* device); + static bool supportsDevice(MTL::Device* device); + }; + + class FrameInterpolatorBase : public NS::Referencing + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + MTL::TextureUsage depthTextureUsage() const; + MTL::TextureUsage motionTextureUsage() const; + MTL::TextureUsage uiTextureUsage() const; + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat depthTextureFormat() const; + MTL::PixelFormat motionTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + MTL::PixelFormat uiTextureFormat() const; + + MTL::Texture* colorTexture() const; + void setColorTexture(MTL::Texture* colorTexture); + + MTL::Texture* prevColorTexture() const; + void setPrevColorTexture(MTL::Texture* prevColorTexture); + + MTL::Texture* depthTexture() const; + void setDepthTexture(MTL::Texture* depthTexture); + + MTL::Texture* motionTexture() const; + void setMotionTexture(MTL::Texture* motionTexture); + + float motionVectorScaleX() const; + void setMotionVectorScaleX(float scaleX); + + float motionVectorScaleY() const; + void setMotionVectorScaleY(float scaleY); + + float deltaTime() const; + void setDeltaTime( float deltaTime ); + + float nearPlane() const; + void setNearPlane( float nearPlane ); + + float farPlane() const; + void setFarPlane( float farPlane ); + + float fieldOfView() const; + void setFieldOfView( float fieldOfView ); + + float aspectRatio() const; + void setAspectRatio( float aspectRatio ); + + MTL::Texture* uiTexture() const; + void setUITexture(MTL::Texture* uiTexture); + + float jitterOffsetX() const; + void setJitterOffsetX( float jitterOffsetX ); + + float jitterOffsetY() const; + void setJitterOffsetY( float jitterOffsetY ); + + bool isUITextureComposited() const; + void setIsUITextureComposited( bool uiTextureComposited ); + + bool shouldResetHistory() const; + void setShouldResetHistory( bool shouldResetHistory ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* outputTexture ); + + MTL::Fence* fence() const; + void setFence( MTL::Fence* fence ); + + bool isDepthReversed() const; + void setDepthReversed( bool depthReversed ); + }; + + class FrameInterpolator : public NS::Referencing + { + public: + void encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer); + }; + +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolatorDescriptor* MTLFX::FrameInterpolatorDescriptor::alloc() +{ + return NS::Object::alloc< FrameInterpolatorDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXFrameInterpolatorDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolatorDescriptor* MTLFX::FrameInterpolatorDescriptor::init() +{ + return NS::Object::init< FrameInterpolatorDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setColorTextureFormat( MTL::PixelFormat colorTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), colorTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputTextureFormat( MTL::PixelFormat outputTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), outputTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setDepthTextureFormat( MTL::PixelFormat depthTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), depthTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setMotionTextureFormat( MTL::PixelFormat motionTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), motionTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::uiTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( uiTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setUITextureFormat( MTL::PixelFormat uiTextureFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setUITextureFormat_ ), uiTextureFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolatableScaler* MTLFX::FrameInterpolatorDescriptor::scaler() const +{ + return NS::Object::sendMessage< MTLFX::FrameInterpolatableScaler* >( this, _MTLFX_PRIVATE_SEL( scaler ) ); +} + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setScaler(MTLFX::FrameInterpolatableScaler* scaler) +{ + NS::Object::sendMessage< void >(this, _MTLFX_PRIVATE_SEL( setScaler_ ), scaler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setInputWidth( NS::UInteger inputWidth ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), inputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setInputHeight( NS::UInteger inputHeight ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), inputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputWidth( NS::UInteger outputWidth ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), outputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputHeight( NS::UInteger outputHeight ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), outputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::FrameInterpolator* MTLFX::FrameInterpolatorDescriptor::newFrameInterpolator( const MTL::Device* device ) const +{ + return NS::Object::sendMessage< MTLFX::FrameInterpolator* >( this, _MTLFX_PRIVATE_SEL( newFrameInterpolatorWithDevice_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::FrameInterpolator* MTLFX::FrameInterpolatorDescriptor::newFrameInterpolator( const MTL::Device* device, const MTL4::Compiler* compiler ) const +{ + return NS::Object::sendMessage< MTL4FX::FrameInterpolator* >( this, _MTLFX_PRIVATE_SEL( newFrameInterpolatorWithDevice_compiler_ ), device, compiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorDescriptor::supportsMetal4FX(MTL::Device* device) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXFrameInterpolatorDescriptor), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorDescriptor::supportsDevice(MTL::Device* device) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXFrameInterpolatorDescriptor), _MTLFX_PRIVATE_SEL( supportsDevice_ ), device ); +} + + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::colorTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::outputTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::depthTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::motionTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::uiTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( uiTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::uiTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( uiTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::colorTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setColorTexture(MTL::Texture* colorTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), colorTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::prevColorTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( prevColorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setPrevColorTexture(MTL::Texture* prevColorTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPrevColorTexture_ ), prevColorTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::depthTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthTexture(MTL::Texture* depthTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), depthTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::motionTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionTexture(MTL::Texture* motionTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), motionTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::motionVectorScaleX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionVectorScaleX(float scaleX) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), scaleX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::motionVectorScaleY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionVectorScaleY(float scaleY) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), scaleY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::deltaTime() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( deltaTime ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDeltaTime( float deltaTime ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDeltaTime_ ), deltaTime ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::nearPlane() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( nearPlane ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setNearPlane( float nearPlane ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNearPlane_ ), nearPlane ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::farPlane() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( farPlane ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFarPlane( float farPlane ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFarPlane_ ), farPlane ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::fieldOfView() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( fieldOfView ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFieldOfView( float fieldOfView ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFieldOfView_ ), fieldOfView ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::aspectRatio() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( aspectRatio ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setAspectRatio( float aspectRatio ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAspectRatio_ ), aspectRatio ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::uiTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( uiTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setUITexture(MTL::Texture* uiTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setUITexture_ ), uiTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::jitterOffsetX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setJitterOffsetX( float jitterOffsetX ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), jitterOffsetX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::jitterOffsetY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setJitterOffsetY( float jitterOffsetY ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), jitterOffsetY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::isUITextureComposited() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isUITextureComposited ) ); +} + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setIsUITextureComposited( bool uiTextureComposited ) +{ + NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setIsUITextureComposited_ ), uiTextureComposited ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::shouldResetHistory() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( shouldResetHistory ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setShouldResetHistory(bool shouldResetHistory) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setShouldResetHistory_ ), shouldResetHistory ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::outputTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setOutputTexture(MTL::Texture* outputTexture) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), outputTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::FrameInterpolatorBase::fence() const +{ + return NS::Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFence(MTL::Fence* fence) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), fence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::isDepthReversed() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthReversed(bool depthReversed) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::FrameInterpolator::encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MetalFX/MTLFXPrivate.hpp b/vendor/metal-cpp/MetalFX/MTLFXPrivate.hpp new file mode 100644 index 000000000..21fd728e4 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTLFXPrivate.hpp @@ -0,0 +1,482 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXPrivate.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#define _MTLFX_PRIVATE_CLS( symbol ) ( MTLFX::Private::Class::s_k##symbol ) +#define _MTLFX_PRIVATE_SEL( accessor ) ( MTLFX::Private::Selector::s_k##accessor ) + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#if defined( MTLFX_PRIVATE_IMPLEMENTATION ) + +#if defined( METALCPP_SYMBOL_VISIBILITY_HIDDEN ) +#define _MTLFX_PRIVATE_VISIBILITY __attribute__( ( visibility("hidden" ) ) ) +#else +#define _MTLFX_PRIVATE_VISIBILITY __attribute__( ( visibility("default" ) ) ) +#endif // METALCPP_SYMBOL_VISIBILITY_HIDDEN + +#define _MTLFX_PRIVATE_IMPORT __attribute__( ( weak_import ) ) + +#ifdef __OBJC__ +#define _MTLFX_PRIVATE_OBJC_LOOKUP_CLASS( symbol ) ( ( __bridge void* ) objc_lookUpClass( #symbol ) ) +#define _MTLFX_PRIVATE_OBJC_GET_PROTOCOL( symbol ) ( ( __bridge void* ) objc_getProtocol( #symbol ) ) +#else +#define _MTLFX_PRIVATE_OBJC_LOOKUP_CLASS( symbol ) objc_lookUpClass(#symbol) +#define _MTLFX_PRIVATE_OBJC_GET_PROTOCOL( symbol ) objc_getProtocol(#symbol) +#endif // __OBJC__ + +#define _MTLFX_PRIVATE_DEF_CLS( symbol ) void* s_k##symbol _MTLFX_PRIVATE_VISIBILITY = _MTLFX_PRIVATE_OBJC_LOOKUP_CLASS( symbol ) +#define _MTLFX_PRIVATE_DEF_PRO( symbol ) void* s_k##symbol _MTLFX_PRIVATE_VISIBILITY = _MTLFX_PRIVATE_OBJC_GET_PROTOCOL( symbol ) +#define _MTLFX_PRIVATE_DEF_SEL( accessor, symbol ) SEL s_k##accessor _MTLFX_PRIVATE_VISIBILITY = sel_registerName( symbol ) + +#include +#define MTLFX_DEF_FUNC( name, signature ) using Fn##name = signature; \ + Fn##name name = reinterpret_cast< Fn##name >( dlsym( RTLD_DEFAULT, #name ) ) + +namespace MTLFX::Private +{ + template + + inline _Type const LoadSymbol(const char* pSymbol) + { + const _Type* pAddress = static_cast<_Type*>(dlsym(RTLD_DEFAULT, pSymbol)); + + return pAddress ? *pAddress : nullptr; + } +} // MTLFX::Private + +#if defined(__MAC_26_0) || defined(__IPHONE_26_0) || defined(__TVOS_26_0) + +#define _MTLFX_PRIVATE_DEF_STR( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##symbol _MTLFX_PRIVATE_IMPORT; \ + type const MTLFX::symbol = ( nullptr != &MTLFX##symbol ) ? MTLFX##ssymbol : nullptr + +#define _MTLFX_PRIVATE_DEF_CONST( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol _MTLFX_PRIVATE_IMPORT; \ + type const MTLFX::symbol = (nullptr != &MTLFX##ssymbol) ? MTLFX##ssymbol : nullptr + +#define _MTLFX_PRIVATE_DEF_WEAK_CONST( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol; \ + type const MTLFX::symbol = Private::LoadSymbol< type >( "MTLFX" #symbol ) + +#else + +#define _MTLFX_PRIVATE_DEF_STR( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol; \ + type const MTLFX::symbol = Private::LoadSymbol< type >( "MTLFX" #symbol ) + +#define _MTLFX_PRIVATE_DEF_CONST( type, symbol ) \ + _MTLFX_EXTERN type const MTLFX##ssymbol; \ + type const MTLFX::symbol = Private::LoadSymbol< type >( "MTLFX" #symbol ) + +#define _MTLFX_PRIVATE_DEF_WEAK_CONST( type, symbol ) _MTLFX_PRIVATE_DEF_CONST( type, symbol ) + +#endif + +#else + +#define _MTLFX_PRIVATE_DEF_CLS( symbol ) extern void* s_k##symbol +#define _MTLFX_PRIVATE_DEF_PRO( symbol ) extern void* s_k##symbol +#define _MTLFX_PRIVATE_DEF_SEL( accessor, symbol ) extern SEL s_k##accessor +#define _MTLFX_PRIVATE_DEF_STR( type, symbol ) extern type const MTLFX::symbol +#define _MTLFX_PRIVATE_DEF_CONST( type, symbol ) extern type const MTLFX::symbol +#define _MTLFX_PRIVATE_DEF_WEAK_CONST( type, symbol ) extern type const MTLFX::symbol + +#endif // MTLFX_PRIVATE_IMPLEMENTATION + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTLFX +{ + namespace Private + { + namespace Class + { + _MTLFX_PRIVATE_DEF_CLS( MTLFXSpatialScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTLFXTemporalScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTLFXFrameInterpolatorDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTLFXTemporalDenoisedScalerDescriptor ); + + _MTLFX_PRIVATE_DEF_CLS( MTL4FXSpatialScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTL4FXTemporalScalerDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTL4FXFrameInterpolatorDescriptor ); + _MTLFX_PRIVATE_DEF_CLS( MTL4FXTemporalDenoisedScalerDescriptor ); + } // Class + } // Private +} // MTLFX + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTLFX +{ + namespace Private + { + namespace Protocol + { + _MTLFX_PRIVATE_DEF_PRO( MTLFXSpatialScaler ); + _MTLFX_PRIVATE_DEF_PRO( MTLFXTemporalScaler ); + } // Protocol + } // Private +} // MTLFX + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTLFX +{ + namespace Private + { + namespace Selector + { + _MTLFX_PRIVATE_DEF_SEL( aspectRatio, + "aspectRatio" ); + _MTLFX_PRIVATE_DEF_SEL( colorProcessingMode, + "colorProcessingMode" ); + _MTLFX_PRIVATE_DEF_SEL( colorTexture, + "colorTexture" ); + _MTLFX_PRIVATE_DEF_SEL( colorTextureFormat, + "colorTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( colorTextureUsage, + "colorTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( deltaTime, + "deltaTime" ); + _MTLFX_PRIVATE_DEF_SEL( denoiseStrengthMaskTexture, + "denoiseStrengthMaskTexture" ); + _MTLFX_PRIVATE_DEF_SEL( denoiseStrengthMaskTextureFormat, + "denoiseStrengthMaskTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( denoiseStrengthMaskTextureUsage, + "denoiseStrengthMaskTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( depthTexture, + "depthTexture" ); + _MTLFX_PRIVATE_DEF_SEL( depthTextureFormat, + "depthTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( depthTextureUsage, + "depthTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( diffuseAlbedoTexture, + "diffuseAlbedoTexture" ); + _MTLFX_PRIVATE_DEF_SEL( diffuseAlbedoTextureFormat, + "diffuseAlbedoTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( diffuseAlbedoTextureUsage, + "diffuseAlbedoTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( encodeToCommandBuffer_, + "encodeToCommandBuffer:" ); + _MTLFX_PRIVATE_DEF_SEL( exposureTexture, + "exposureTexture" ); + _MTLFX_PRIVATE_DEF_SEL( farPlane, + "farPlane" ); + _MTLFX_PRIVATE_DEF_SEL( fence, + "fence" ); + _MTLFX_PRIVATE_DEF_SEL( fieldOfView, + "fieldOfView" ); + _MTLFX_PRIVATE_DEF_SEL( height, + "height" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentHeight, + "inputContentHeight" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentMaxScale, + "inputContentMaxScale" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentMinScale, + "inputContentMinScale" ); + _MTLFX_PRIVATE_DEF_SEL( inputContentWidth, + "inputContentWidth" ); + _MTLFX_PRIVATE_DEF_SEL( inputHeight, + "inputHeight" ); + _MTLFX_PRIVATE_DEF_SEL( inputWidth, + "inputWidth" ); + _MTLFX_PRIVATE_DEF_SEL( isAutoExposureEnabled, + "isAutoExposureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isDenoiseStrengthMaskTextureEnabled, + "isDenoiseStrengthMaskTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isDepthReversed, + "isDepthReversed" ); + _MTLFX_PRIVATE_DEF_SEL( isInputContentPropertiesEnabled, + "isInputContentPropertiesEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isTransparencyOverlayTextureEnabled, + "isTransparencyOverlayTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isReactiveMaskTextureEnabled, + "isReactiveMaskTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isSpecularHitDistanceTextureEnabled, + "isSpecularHitDistanceTextureEnabled" ); + _MTLFX_PRIVATE_DEF_SEL( isUITextureComposited, + "isUITextureComposited" ); + _MTLFX_PRIVATE_DEF_SEL( jitterOffsetX, + "jitterOffsetX" ); + _MTLFX_PRIVATE_DEF_SEL( jitterOffsetY, + "jitterOffsetY" ); + _MTLFX_PRIVATE_DEF_SEL( maskTexture, + "maskTexture" ); + _MTLFX_PRIVATE_DEF_SEL( maskTextureFormat, + "maskTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( maskTextureUsage, + "maskTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( motionTexture, + "motionTexture" ); + _MTLFX_PRIVATE_DEF_SEL( motionTextureFormat, + "motionTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( motionTextureUsage, + "motionTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( motionVectorScaleX, + "motionVectorScaleX" ); + _MTLFX_PRIVATE_DEF_SEL( motionVectorScaleY, + "motionVectorScaleY" ); + _MTLFX_PRIVATE_DEF_SEL( nearPlane, + "nearPlane" ); + _MTLFX_PRIVATE_DEF_SEL( newFrameInterpolatorWithDevice_, + "newFrameInterpolatorWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newFrameInterpolatorWithDevice_compiler_, + "newFrameInterpolatorWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalDenoisedScalerWithDevice_, + "newTemporalDenoisedScalerWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalDenoisedScalerWithDevice_compiler_, + "newTemporalDenoisedScalerWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( newSpatialScalerWithDevice_, + "newSpatialScalerWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newSpatialScalerWithDevice_compiler_, + "newSpatialScalerWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalScalerWithDevice_, + "newTemporalScalerWithDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( newTemporalScalerWithDevice_compiler_, + "newTemporalScalerWithDevice:compiler:" ); + _MTLFX_PRIVATE_DEF_SEL( normalTexture, + "normalTexture" ); + _MTLFX_PRIVATE_DEF_SEL( normalTextureFormat, + "normalTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( normalTextureUsage, + "normalTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( outputHeight, + "outputHeight" ); + _MTLFX_PRIVATE_DEF_SEL( outputTexture, + "outputTexture" ); + _MTLFX_PRIVATE_DEF_SEL( outputTextureFormat, + "outputTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( outputTextureUsage, + "outputTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( outputWidth, + "outputWidth" ); + _MTLFX_PRIVATE_DEF_SEL( preExposure, + "preExposure" ); + _MTLFX_PRIVATE_DEF_SEL( transparencyOverlayTextureFormat, + "transparencyOverlayTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( transparencyOverlayTextureUsage, + "transparencyOverlayTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( prevColorTexture, + "prevColorTexture" ); + _MTLFX_PRIVATE_DEF_SEL( reactiveMaskTextureFormat, + "reactiveMaskTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( reactiveTextureUsage, + "reactiveTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( reactiveMaskTexture, + "reactiveMaskTexture" ); + _MTLFX_PRIVATE_DEF_SEL( reset, + "reset" ); + _MTLFX_PRIVATE_DEF_SEL( requiresSynchronousInitialization, + "requiresSynchronousInitialization" ); + _MTLFX_PRIVATE_DEF_SEL( roughnessTextureFormat, + "roughnessTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( roughnessTextureUsage, + "roughnessTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( scaler, + "scaler" ); + _MTLFX_PRIVATE_DEF_SEL( scaler4, + "scaler4" ); + _MTLFX_PRIVATE_DEF_SEL( setAspectRatio_, + "setAspectRatio:" ); + _MTLFX_PRIVATE_DEF_SEL( setAutoExposureEnabled_, + "setAutoExposureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setColorProcessingMode_, + "setColorProcessingMode:" ); + _MTLFX_PRIVATE_DEF_SEL( setColorTexture_, + "setColorTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setColorTextureFormat_, + "setColorTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setDeltaTime_, + "setDeltaTime:" ); + _MTLFX_PRIVATE_DEF_SEL( setDenoiseStrengthMaskTexture_, + "setDenoiseStrengthMaskTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setDenoiseStrengthMaskTextureEnabled_, + "setDenoiseStrengthMaskTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setDenoiseStrengthMaskTextureFormat_, + "setDenoiseStrengthMaskTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthInverted_, + "setDepthInverted:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthReversed_, + "setDepthReversed:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthTexture_, + "setDepthTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setDepthTextureFormat_, + "setDepthTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setDiffuseAlbedoTexture_, + "setDiffuseAlbedoTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setDiffuseAlbedoTextureFormat_, + "setDiffuseAlbedoTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setExposureTexture_, + "setExposureTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setFarPlane_, + "setFarPlane:" ); + _MTLFX_PRIVATE_DEF_SEL( setFence_, + "setFence:" ); + _MTLFX_PRIVATE_DEF_SEL( setFieldOfView_, + "setFieldOfView:" ); + _MTLFX_PRIVATE_DEF_SEL( setHeight_, + "setHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentHeight_, + "setInputContentHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentMaxScale_, + "setInputContentMaxScale:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentMinScale_, + "setInputContentMinScale:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentPropertiesEnabled_, + "setInputContentPropertiesEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputContentWidth_, + "setInputContentWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputHeight_, + "setInputHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setInputWidth_, + "setInputWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( setIsUITextureComposited_, + "setIsUITextureComposited:" ); + _MTLFX_PRIVATE_DEF_SEL( setJitterOffsetX_, + "setJitterOffsetX:" ); + _MTLFX_PRIVATE_DEF_SEL( setJitterOffsetY_, + "setJitterOffsetY:" ); + _MTLFX_PRIVATE_DEF_SEL( setNearPlane_, + "setNearPlane:" ); + _MTLFX_PRIVATE_DEF_SEL( setMaskTexture_, + "setMaskTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setMaskTextureFormat_, + "setMaskTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionTexture_, + "setMotionTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionTextureFormat_, + "setMotionTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionVectorScaleX_, + "setMotionVectorScaleX:" ); + _MTLFX_PRIVATE_DEF_SEL( setMotionVectorScaleY_, + "setMotionVectorScaleY:" ); + _MTLFX_PRIVATE_DEF_SEL( setNormalTexture_, + "setNormalTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setNormalTextureFormat_, + "setNormalTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputHeight_, + "setOutputHeight:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputTexture_, + "setOutputTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputTextureFormat_, + "setOutputTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setOutputWidth_, + "setOutputWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( transparencyOverlayTexture, + "transparencyOverlayTexture" ); + _MTLFX_PRIVATE_DEF_SEL( setTransparencyOverlayTexture_, + "setTransparencyOverlayTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setTransparencyOverlayTextureEnabled_, + "setTransparencyOverlayTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setPreExposure_, + "setPreExposure:" ); + _MTLFX_PRIVATE_DEF_SEL( setTransparencyOverlayTextureFormat_, + "setTransparencyOverlayTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setPrevColorTexture_, + "setPrevColorTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setReactiveMaskTexture_, + "setReactiveMaskTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setReactiveMaskTextureEnabled_, + "setReactiveMaskTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setReactiveMaskTextureFormat_, + "setReactiveMaskTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setRequiresSynchronousInitialization_, + "setRequiresSynchronousInitialization:" ); + _MTLFX_PRIVATE_DEF_SEL( setReset_, + "setReset:" ); + _MTLFX_PRIVATE_DEF_SEL( roughnessTexture, + "roughnessTexture" ); + _MTLFX_PRIVATE_DEF_SEL( setRoughnessTexture_, + "setRoughnessTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setRoughnessTextureFormat_, + "setRoughnessTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setScaler_, + "setScaler:" ); + _MTLFX_PRIVATE_DEF_SEL( setShouldResetHistory_, + "setShouldResetHistory:" ); + _MTLFX_PRIVATE_DEF_SEL( specularHitDistanceTexture, + "specularHitDistanceTexture" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularHitDistanceTexture_, + "setSpecularHitDistanceTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularHitDistanceTextureEnabled_, + "setSpecularHitDistanceTextureEnabled:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularAlbedoTexture_, + "setSpecularAlbedoTexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularAlbedoTextureFormat_, + "setSpecularAlbedoTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setSpecularHitDistanceTextureFormat_, + "setSpecularHitDistanceTextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setUITexture_, + "setUITexture:" ); + _MTLFX_PRIVATE_DEF_SEL( setUITextureFormat_, + "setUITextureFormat:" ); + _MTLFX_PRIVATE_DEF_SEL( setViewToClipMatrix_, + "setViewToClipMatrix:" ); + _MTLFX_PRIVATE_DEF_SEL( setWidth_, + "setWidth:" ); + _MTLFX_PRIVATE_DEF_SEL( setWorldToViewMatrix_, + "setWorldToViewMatrix:" ); + _MTLFX_PRIVATE_DEF_SEL( shouldResetHistory, + "shouldResetHistory" ); + _MTLFX_PRIVATE_DEF_SEL( specularAlbedoTexture, + "specularAlbedoTexture" ); + _MTLFX_PRIVATE_DEF_SEL( specularAlbedoTextureFormat, + "specularAlbedoTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( specularAlbedoTextureUsage, + "specularAlbedoTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( specularHitDistanceTextureFormat, + "specularHitDistanceTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( specularHitDistanceTextureUsage, + "specularHitDistanceTextureUsage" ); + _MTLFX_PRIVATE_DEF_SEL( supportedInputContentMaxScaleForDevice_, + "supportedInputContentMaxScaleForDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( supportedInputContentMinScaleForDevice_, + "supportedInputContentMinScaleForDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( supportsDevice_, + "supportsDevice:" ); + _MTLFX_PRIVATE_DEF_SEL( supportsMetal4FX_, + "supportsMetal4FX:" ); + _MTLFX_PRIVATE_DEF_SEL( uiTexture, + "uiTexture" ); + _MTLFX_PRIVATE_DEF_SEL( uiTextureFormat, + "uiTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( uiTextureUsage, + "uiTextureFormat" ); + _MTLFX_PRIVATE_DEF_SEL( viewToClipMatrix, + "viewToClipMatrix" ); + _MTLFX_PRIVATE_DEF_SEL( width, + "width" ); + _MTLFX_PRIVATE_DEF_SEL( worldToViewMatrix, + "worldToViewMatrix" ); + } // Selector + } // Private +} // MTLFX + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MTLFXSpatialScaler.hpp b/vendor/metal-cpp/MetalFX/MTLFXSpatialScaler.hpp new file mode 100644 index 000000000..cb1186ed8 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTLFXSpatialScaler.hpp @@ -0,0 +1,397 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXSpatialScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class SpatialScaler; +} + +namespace MTLFX +{ + _MTLFX_ENUM( NS::Integer, SpatialScalerColorProcessingMode ) + { + SpatialScalerColorProcessingModePerceptual = 0, + SpatialScalerColorProcessingModeLinear = 1, + SpatialScalerColorProcessingModeHDR = 2 + }; + + class SpatialScalerDescriptor : public NS::Copying< SpatialScalerDescriptor > + { + public: + static class SpatialScalerDescriptor* alloc(); + class SpatialScalerDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat( MTL::PixelFormat format ); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger width ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger height ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger width ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger height ); + + SpatialScalerColorProcessingMode colorProcessingMode() const; + void setColorProcessingMode( SpatialScalerColorProcessingMode mode ); + + class SpatialScaler* newSpatialScaler( const MTL::Device* pDevice ) const; + MTL4FX::SpatialScaler* newSpatialScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const; + + static bool supportsDevice( const MTL::Device* pDevice); + static bool supportsMetal4FX( const MTL::Device* pDevice ); + }; + + class SpatialScalerBase : public NS::Referencing< SpatialScaler > + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + + NS::UInteger inputContentWidth() const; + void setInputContentWidth( NS::UInteger width ); + + NS::UInteger inputContentHeight() const; + void setInputContentHeight( NS::UInteger height ); + + MTL::Texture* colorTexture() const; + void setColorTexture( MTL::Texture* pTexture ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* pTexture ); + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + SpatialScalerColorProcessingMode colorProcessingMode() const; + + MTL::Fence* fence() const; + void setFence( MTL::Fence* pFence ); + }; + + class SpatialScaler : public NS::Referencing< SpatialScaler, SpatialScalerBase > + { + public: + void encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerDescriptor* MTLFX::SpatialScalerDescriptor::alloc() +{ + return NS::Object::alloc< SpatialScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXSpatialScalerDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerDescriptor* MTLFX::SpatialScalerDescriptor::init() +{ + return NS::Object::init< SpatialScalerDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerDescriptor::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setColorTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerDescriptor::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setInputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setInputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setOutputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerDescriptor::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setOutputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerColorProcessingMode MTLFX::SpatialScalerDescriptor::colorProcessingMode() const +{ + return Object::sendMessage< SpatialScalerColorProcessingMode >( this, _MTLFX_PRIVATE_SEL( colorProcessingMode ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerDescriptor::setColorProcessingMode( SpatialScalerColorProcessingMode mode ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorProcessingMode_ ), mode ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScaler* MTLFX::SpatialScalerDescriptor::newSpatialScaler( const MTL::Device* pDevice ) const +{ + return Object::sendMessage< SpatialScaler* >( this, _MTLFX_PRIVATE_SEL( newSpatialScalerWithDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::SpatialScaler* MTLFX::SpatialScalerDescriptor::newSpatialScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const +{ + return Object::sendMessage< MTL4FX::SpatialScaler* >( this, _MTLFX_PRIVATE_SEL( newSpatialScalerWithDevice_compiler_ ), pDevice, pCompiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::SpatialScalerDescriptor::supportsDevice( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXSpatialScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::SpatialScalerDescriptor::supportsMetal4FX( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXSpatialScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::SpatialScalerBase::colorTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::SpatialScalerBase::outputTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputContentWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setInputContentWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputContentHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setInputContentHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::SpatialScalerBase::colorTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setColorTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::SpatialScalerBase::outputTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setOutputTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerBase::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::SpatialScalerBase::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::SpatialScalerBase::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::SpatialScalerColorProcessingMode MTLFX::SpatialScalerBase::colorProcessingMode() const +{ + return Object::sendMessage< SpatialScalerColorProcessingMode >( this, _MTLFX_PRIVATE_SEL( colorProcessingMode ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::SpatialScalerBase::fence() const +{ + return Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScalerBase::setFence( MTL::Fence* pFence ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), pFence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::SpatialScaler::encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MTLFXTemporalDenoisedScaler.hpp b/vendor/metal-cpp/MetalFX/MTLFXTemporalDenoisedScaler.hpp new file mode 100644 index 000000000..5863e078d --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTLFXTemporalDenoisedScaler.hpp @@ -0,0 +1,1208 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXTemporalDenoisedScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" +#include "MTLFXTemporalScaler.hpp" + +#include "../Metal/Metal.hpp" + +#include + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalDenoisedScaler; +} + +namespace MTLFX +{ + class TemporalDenoisedScalerDescriptor : public NS::Copying< TemporalDenoisedScalerDescriptor > + { + public: + static class TemporalDenoisedScalerDescriptor* alloc(); + class TemporalDenoisedScalerDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat depthTextureFormat() const; + void setDepthTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat motionTextureFormat() const; + void setMotionTextureFormat( MTL::PixelFormat pixelFormal ); + + MTL::PixelFormat diffuseAlbedoTextureFormat() const; + void setDiffuseAlbedoTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat specularAlbedoTextureFormat() const; + void setSpecularAlbedoTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat normalTextureFormat() const; + void setNormalTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat roughnessTextureFormat() const; + void setRoughnessTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat specularHitDistanceTextureFormat() const; + void setSpecularHitDistanceTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat denoiseStrengthMaskTextureFormat() const; + void setDenoiseStrengthMaskTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat transparencyOverlayTextureFormat() const; + void setTransparencyOverlayTextureFormat( MTL::PixelFormat pixelFormat ); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat( MTL::PixelFormat pixelFormat ); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger inputWidth ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger inputHeight ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger outputWidth ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger outputHeight ); + + bool requiresSynchronousInitialization() const; + void setRequiresSynchronousInitialization( bool requiresSynchronousInitialization ); + + bool isAutoExposureEnabled() const; + void setAutoExposureEnabled( bool enabled ); + + bool isInputContentPropertiesEnabled() const; + void setInputContentPropertiesEnabled( bool enabled ); + + float inputContentMinScale() const; + void setInputContentMinScale( float inputContentMinScale ); + + float inputContentMaxScale() const; + void setInputContentMaxScale( float inputContentMaxScale ); + + bool isReactiveMaskTextureEnabled() const; + void setReactiveMaskTextureEnabled( bool enabled ); + + MTL::PixelFormat reactiveMaskTextureFormat() const; + void setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ); + + bool isSpecularHitDistanceTextureEnabled() const; + void setSpecularHitDistanceTextureEnabled( bool enabled ); + + bool isDenoiseStrengthMaskTextureEnabled() const; + void setDenoiseStrengthMaskTextureEnabled( bool enabled ); + + bool isTransparencyOverlayTextureEnabled() const; + void setTransparencyOverlayTextureEnabled( bool enabled ); + + class TemporalDenoisedScaler* newTemporalDenoisedScaler( const MTL::Device* device ) const; + MTL4FX::TemporalDenoisedScaler* newTemporalDenoisedScaler( const MTL::Device* device, const MTL4::Compiler* compiler) const; + + static float supportedInputContentMinScale(MTL::Device* device); + static float supportedInputContentMaxScale(MTL::Device* device); + + static bool supportsMetal4FX( MTL::Device* device); + static bool supportsDevice( MTL::Device* device); + }; + + class TemporalDenoisedScalerBase : public NS::Referencing< TemporalDenoisedScalerBase, FrameInterpolatableScaler > + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage depthTextureUsage() const; + MTL::TextureUsage motionTextureUsage() const; + MTL::TextureUsage reactiveTextureUsage() const; + MTL::TextureUsage diffuseAlbedoTextureUsage() const; + MTL::TextureUsage specularAlbedoTextureUsage() const; + MTL::TextureUsage normalTextureUsage() const; + MTL::TextureUsage roughnessTextureUsage() const; + MTL::TextureUsage specularHitDistanceTextureUsage() const; + MTL::TextureUsage denoiseStrengthMaskTextureUsage() const; + MTL::TextureUsage transparencyOverlayTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + + MTL::Texture* colorTexture() const; + void setColorTexture( MTL::Texture* colorTexture ); + + MTL::Texture* depthTexture() const; + void setDepthTexture( MTL::Texture* depthTexture ); + + MTL::Texture* motionTexture() const; + void setMotionTexture( MTL::Texture* motionTexture ); + + MTL::Texture* diffuseAlbedoTexture() const; + void setDiffuseAlbedoTexture( MTL::Texture* diffuseAlbedoTexture ); + + MTL::Texture* specularAlbedoTexture() const; + void setSpecularAlbedoTexture( MTL::Texture* specularAlbedoTexture ); + + MTL::Texture* normalTexture() const; + void setNormalTexture( MTL::Texture* normalTexture ); + + MTL::Texture* roughnessTexture() const; + void setRoughnessTexture( MTL::Texture* roughnessTexture ); + + MTL::Texture* specularHitDistanceTexture() const; + void setSpecularHitDistanceTexture( MTL::Texture* specularHitDistanceTexture ); + + MTL::Texture* denoiseStrengthMaskTexture() const; + void setDenoiseStrengthMaskTexture( MTL::Texture* denoiseStrengthMaskTexture ); + + MTL::Texture* transparencyOverlayTexture() const; + void setTransparencyOverlayTexture( MTL::Texture* transparencyOverlayTexture ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* outputTexture ); + + MTL::Texture* exposureTexture() const; + void setExposureTexture( MTL::Texture* exposureTexture ); + + float preExposure() const; + void setPreExposure( float preExposure ); + + MTL::Texture* reactiveMaskTexture() const; + void setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ); + + float jitterOffsetX() const; + void setJitterOffsetX( float jitterOffsetX ); + + float jitterOffsetY() const; + void setJitterOffsetY( float jitterOffsetY ); + + float motionVectorScaleX() const; + void setMotionVectorScaleX( float motionVectorScaleX ); + + float motionVectorScaleY() const; + void setMotionVectorScaleY( float motionVectorScaleY ); + + bool shouldResetHistory() const; + void setShouldResetHistory( bool shouldResetHistory ); + + bool isDepthReversed() const; + void setDepthReversed( bool depthReversed ); + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat depthTextureFormat() const; + MTL::PixelFormat motionTextureFormat() const; + MTL::PixelFormat diffuseAlbedoTextureFormat() const; + MTL::PixelFormat specularAlbedoTextureFormat() const; + MTL::PixelFormat normalTextureFormat() const; + MTL::PixelFormat roughnessTextureFormat() const; + MTL::PixelFormat specularHitDistanceTextureFormat() const; + MTL::PixelFormat denoiseStrengthMaskTextureFormat() const; + MTL::PixelFormat transparencyOverlayTextureFormat() const; + MTL::PixelFormat reactiveMaskTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + float inputContentMinScale() const; + float inputContentMaxScale() const; + + simd::float4x4 worldToViewMatrix() const; + void setWorldToViewMatrix( simd::float4x4 worldToViewMatrix ); + + simd::float4x4 viewToClipMatrix() const; + void setViewToClipMatrix( simd::float4x4 viewToClipMatrix ); + + MTL::Fence* fence() const; + void setFence( MTL::Fence* fence ); + }; + + class TemporalDenoisedScaler : public NS::Referencing< TemporalDenoisedScaler, TemporalDenoisedScalerBase > + { + public: + + void encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalDenoisedScalerDescriptor* MTLFX::TemporalDenoisedScalerDescriptor::alloc() +{ + return NS::Object::alloc< TemporalDenoisedScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalDenoisedScalerDescriptor* MTLFX::TemporalDenoisedScalerDescriptor::init() +{ + return NS::Object::init< TemporalDenoisedScalerDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setColorTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDepthTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setMotionTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::diffuseAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDiffuseAlbedoTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDiffuseAlbedoTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::specularAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setSpecularAlbedoTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularAlbedoTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::normalTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( normalTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setNormalTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNormalTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::roughnessTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( roughnessTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setRoughnessTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRoughnessTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::specularHitDistanceTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setSpecularHitDistanceTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularHitDistanceTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::denoiseStrengthMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDenoiseStrengthMaskTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDenoiseStrengthMaskTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::transparencyOverlayTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setTransparencyOverlayTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setTransparencyOverlayTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputWidth( NS::UInteger inputWidth ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), inputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputHeight( NS::UInteger inputHeight ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), inputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setOutputWidth( NS::UInteger outputWidth ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), outputWidth ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerDescriptor::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setOutputHeight( NS::UInteger outputHeight ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), outputHeight ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::requiresSynchronousInitialization() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( requiresSynchronousInitialization ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setRequiresSynchronousInitialization( bool requiresSynchronousInitialization ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRequiresSynchronousInitialization_ ), requiresSynchronousInitialization ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isAutoExposureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isAutoExposureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setAutoExposureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAutoExposureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isInputContentPropertiesEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isInputContentPropertiesEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputContentPropertiesEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentPropertiesEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::inputContentMinScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputContentMinScale( float inputContentMinScale ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMinScale_ ), inputContentMinScale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::inputContentMaxScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setInputContentMaxScale( float inputContentMaxScale ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMaxScale_ ), inputContentMaxScale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isReactiveMaskTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isReactiveMaskTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setReactiveMaskTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerDescriptor::reactiveMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isSpecularHitDistanceTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isSpecularHitDistanceTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setSpecularHitDistanceTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularHitDistanceTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isDenoiseStrengthMaskTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDenoiseStrengthMaskTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setDenoiseStrengthMaskTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDenoiseStrengthMaskTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::isTransparencyOverlayTextureEnabled() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isTransparencyOverlayTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerDescriptor::setTransparencyOverlayTextureEnabled( bool enabled ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setTransparencyOverlayTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalDenoisedScaler* MTLFX::TemporalDenoisedScalerDescriptor::newTemporalDenoisedScaler( const MTL::Device* device ) const +{ + return NS::Object::sendMessage< TemporalDenoisedScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalDenoisedScalerWithDevice_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::TemporalDenoisedScaler* MTLFX::TemporalDenoisedScalerDescriptor::newTemporalDenoisedScaler( const MTL::Device* device, const MTL4::Compiler* compiler ) const +{ + return NS::Object::sendMessage< MTL4FX::TemporalDenoisedScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalDenoisedScalerWithDevice_compiler_ ), device, compiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::supportedInputContentMinScale( MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ), pDevice ); + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerDescriptor::supportedInputContentMaxScale( MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _MTLFX_PRIVATE_CLS( MTLFXTemporalDenoisedScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ), pDevice ); + } + else if ( supportsDevice( pDevice ) ) + { + scale = 2.0f; + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::supportsMetal4FX( MTL::Device* device ) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXTemporalDenoisedScalerDescriptor), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerDescriptor::supportsDevice( MTL::Device* device ) +{ + return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXTemporalDenoisedScalerDescriptor), _MTLFX_PRIVATE_SEL( supportsDevice_ ), device ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::colorTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::depthTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::motionTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::reactiveTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( reactiveTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::diffuseAlbedoTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::specularAlbedoTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::normalTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( normalTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::roughnessTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( roughnessTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::specularHitDistanceTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::denoiseStrengthMaskTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::transparencyOverlayTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalDenoisedScalerBase::outputTextureUsage() const +{ + return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::colorTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setColorTexture( MTL::Texture* colorTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), colorTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::depthTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDepthTexture( MTL::Texture* depthTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), depthTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::motionTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setMotionTexture( MTL::Texture* motionTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), motionTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::diffuseAlbedoTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDiffuseAlbedoTexture( MTL::Texture* diffuseAlbedoTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDiffuseAlbedoTexture_ ), diffuseAlbedoTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::specularAlbedoTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setSpecularAlbedoTexture( MTL::Texture* specularAlbedoTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularAlbedoTexture_ ), specularAlbedoTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::normalTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( normalTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setNormalTexture( MTL::Texture* normalTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNormalTexture_ ), normalTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::roughnessTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( roughnessTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setRoughnessTexture( MTL::Texture* roughnessTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRoughnessTexture_ ), roughnessTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::specularHitDistanceTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setSpecularHitDistanceTexture( MTL::Texture* specularHitDistanceTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setSpecularHitDistanceTexture_ ), specularHitDistanceTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::denoiseStrengthMaskTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDenoiseStrengthMaskTexture( MTL::Texture* denoiseStrengthMaskTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDenoiseStrengthMaskTexture_ ), denoiseStrengthMaskTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::transparencyOverlayTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setTransparencyOverlayTexture( MTL::Texture* transparencyOverlayTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setTransparencyOverlayTexture_ ), transparencyOverlayTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::outputTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setOutputTexture( MTL::Texture* outputTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), outputTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::exposureTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( exposureTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setExposureTexture( MTL::Texture* exposureTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setExposureTexture_ ), exposureTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::preExposure() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( preExposure ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setPreExposure( float preExposure ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPreExposure_ ), preExposure ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalDenoisedScalerBase::reactiveMaskTexture() const +{ + return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTexture_ ), reactiveMaskTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::jitterOffsetX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setJitterOffsetX( float jitterOffsetX ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), jitterOffsetX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::jitterOffsetY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setJitterOffsetY( float jitterOffsetY ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), jitterOffsetY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::motionVectorScaleX() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setMotionVectorScaleX( float motionVectorScaleX ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), motionVectorScaleX ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::motionVectorScaleY() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setMotionVectorScaleY( float motionVectorScaleY ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), motionVectorScaleY ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerBase::shouldResetHistory() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( shouldResetHistory ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setShouldResetHistory( bool shouldResetHistory ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setShouldResetHistory_ ), shouldResetHistory ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalDenoisedScalerBase::isDepthReversed() const +{ + return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setDepthReversed( bool depthReversed ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::colorTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::depthTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::motionTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::diffuseAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( diffuseAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::specularAlbedoTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularAlbedoTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::normalTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( normalTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::roughnessTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( roughnessTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::specularHitDistanceTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( specularHitDistanceTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::denoiseStrengthMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( denoiseStrengthMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::transparencyOverlayTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( transparencyOverlayTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::reactiveMaskTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalDenoisedScalerBase::outputTextureFormat() const +{ + return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::inputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::inputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::outputWidth() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalDenoisedScalerBase::outputHeight() const +{ + return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::inputContentMinScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalDenoisedScalerBase::inputContentMaxScale() const +{ + return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE simd::float4x4 MTLFX::TemporalDenoisedScalerBase::worldToViewMatrix() const +{ + return NS::Object::sendMessage< simd::float4x4 >( this, _MTLFX_PRIVATE_SEL( worldToViewMatrix ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setWorldToViewMatrix( simd::float4x4 worldToViewMatrix ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setWorldToViewMatrix_ ), worldToViewMatrix ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE simd::float4x4 MTLFX::TemporalDenoisedScalerBase::viewToClipMatrix() const +{ + return NS::Object::sendMessage< simd::float4x4 >( this, _MTLFX_PRIVATE_SEL( viewToClipMatrix ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setViewToClipMatrix( simd::float4x4 viewToClipMatrix ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setViewToClipMatrix_ ), viewToClipMatrix ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::TemporalDenoisedScalerBase::fence() const +{ + return NS::Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScalerBase::setFence( MTL::Fence* fence ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), fence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalDenoisedScaler::encodeToCommandBuffer( MTL::CommandBuffer* commandBuffer ) +{ + return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer ); +} diff --git a/vendor/metal-cpp/MetalFX/MTLFXTemporalScaler.hpp b/vendor/metal-cpp/MetalFX/MTLFXTemporalScaler.hpp new file mode 100644 index 000000000..c13d4242a --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MTLFXTemporalScaler.hpp @@ -0,0 +1,803 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MTLFXTemporalScaler.hpp +// +// Copyright 2020-2025 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXDefines.hpp" +#include "MTLFXPrivate.hpp" + +#include "../Metal/Metal.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +namespace MTL4FX +{ + class TemporalScaler; +} + +namespace MTLFX +{ + class TemporalScalerDescriptor : public NS::Copying< TemporalScalerDescriptor > + { + public: + static class TemporalScalerDescriptor* alloc(); + class TemporalScalerDescriptor* init(); + + MTL::PixelFormat colorTextureFormat() const; + void setColorTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat depthTextureFormat() const; + void setDepthTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat motionTextureFormat() const; + void setMotionTextureFormat( MTL::PixelFormat format ); + + MTL::PixelFormat outputTextureFormat() const; + void setOutputTextureFormat( MTL::PixelFormat format ); + + NS::UInteger inputWidth() const; + void setInputWidth( NS::UInteger width ); + + NS::UInteger inputHeight() const; + void setInputHeight( NS::UInteger height ); + + NS::UInteger outputWidth() const; + void setOutputWidth( NS::UInteger width ); + + NS::UInteger outputHeight() const; + void setOutputHeight( NS::UInteger height ); + + bool isAutoExposureEnabled() const; + void setAutoExposureEnabled( bool enabled ); + + bool isInputContentPropertiesEnabled() const; + void setInputContentPropertiesEnabled( bool enabled ); + + bool requiresSynchronousInitialization() const; + void setRequiresSynchronousInitialization(bool requiresSynchronousInitialization); + + bool isReactiveMaskTextureEnabled() const; + void setReactiveMaskTextureEnabled( bool enabled ); + + MTL::PixelFormat reactiveMaskTextureFormat() const; + void setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ); + + float inputContentMinScale() const; + void setInputContentMinScale( float scale ); + + float inputContentMaxScale() const; + void setInputContentMaxScale( float scale ); + + class TemporalScaler* newTemporalScaler( const MTL::Device* pDevice ) const; + MTL4FX::TemporalScaler* newTemporalScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler) const; + + static float supportedInputContentMinScale( const MTL::Device* pDevice ); + static float supportedInputContentMaxScale( const MTL::Device* pDevice ); + + static bool supportsDevice( const MTL::Device* pDevice ); + static bool supportsMetal4FX( const MTL::Device* pDevice ); + }; + + class FrameInterpolatableScaler : public NS::Copying< FrameInterpolatableScaler > + { + }; + + class TemporalScalerBase : public NS::Referencing< TemporalScaler, FrameInterpolatableScaler > + { + public: + MTL::TextureUsage colorTextureUsage() const; + MTL::TextureUsage depthTextureUsage() const; + MTL::TextureUsage motionTextureUsage() const; + MTL::TextureUsage outputTextureUsage() const; + + NS::UInteger inputContentWidth() const; + void setInputContentWidth( NS::UInteger width ); + + NS::UInteger inputContentHeight() const; + void setInputContentHeight( NS::UInteger height ); + + MTL::Texture* colorTexture() const; + void setColorTexture( MTL::Texture* pTexture ); + + MTL::Texture* depthTexture() const; + void setDepthTexture( MTL::Texture* pTexture ); + + MTL::Texture* motionTexture() const; + void setMotionTexture( MTL::Texture* pTexture ); + + MTL::Texture* outputTexture() const; + void setOutputTexture( MTL::Texture* pTexture ); + + MTL::Texture* exposureTexture() const; + void setExposureTexture( MTL::Texture* pTexture ); + + float preExposure() const; + void setPreExposure( float preExposure ); + + float jitterOffsetX() const; + void setJitterOffsetX( float offset ); + + float jitterOffsetY() const; + void setJitterOffsetY( float offset ); + + float motionVectorScaleX() const; + void setMotionVectorScaleX( float scale ); + + float motionVectorScaleY() const; + void setMotionVectorScaleY( float scale ); + + MTL::Texture* reactiveMaskTexture() const; + void setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ); + + MTL::TextureUsage reactiveTextureUsage() const; + + bool reset() const; + void setReset( bool reset ); + + bool isDepthReversed() const; + void setDepthReversed( bool depthReversed ); + + MTL::PixelFormat colorTextureFormat() const; + MTL::PixelFormat depthTextureFormat() const; + MTL::PixelFormat motionTextureFormat() const; + MTL::PixelFormat reactiveTextureFormat() const; + MTL::PixelFormat outputTextureFormat() const; + NS::UInteger inputWidth() const; + NS::UInteger inputHeight() const; + NS::UInteger outputWidth() const; + NS::UInteger outputHeight() const; + float inputContentMinScale() const; + float inputContentMaxScale() const; + + MTL::Fence* fence() const; + void setFence( MTL::Fence* pFence ); + }; + + class TemporalScaler : public NS::Referencing< TemporalScaler, TemporalScalerBase > + { + public: + void encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ); + }; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalScalerDescriptor* MTLFX::TemporalScalerDescriptor::alloc() +{ + return NS::Object::alloc< TemporalScalerDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalScalerDescriptor* MTLFX::TemporalScalerDescriptor::init() +{ + return NS::Object::init< TemporalScalerDescriptor >(); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setColorTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::depthTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setDepthTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::motionTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setMotionTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputTextureFormat( MTL::PixelFormat format ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), format ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerDescriptor::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setOutputHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isAutoExposureEnabled() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isAutoExposureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setAutoExposureEnabled( bool enabled ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAutoExposureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isInputContentPropertiesEnabled() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isInputContentPropertiesEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentPropertiesEnabled( bool enabled ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentPropertiesEnabled_ ), enabled ); +} + + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::requiresSynchronousInitialization() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( requiresSynchronousInitialization ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setRequiresSynchronousInitialization(bool requiresSynchronousInitialization) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setRequiresSynchronousInitialization_ ), requiresSynchronousInitialization ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::isReactiveMaskTextureEnabled() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isReactiveMaskTextureEnabled ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setReactiveMaskTextureEnabled( bool enabled ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureEnabled_ ), enabled ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerDescriptor::reactiveMaskTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setReactiveMaskTextureFormat( MTL::PixelFormat pixelFormat ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTextureFormat_ ), pixelFormat ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::inputContentMinScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentMinScale( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMinScale_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::inputContentMaxScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerDescriptor::setInputContentMaxScale( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentMaxScale_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTLFX::TemporalScaler* MTLFX::TemporalScalerDescriptor::newTemporalScaler( const MTL::Device* pDevice ) const +{ + return Object::sendMessage< TemporalScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalScalerWithDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL4FX::TemporalScaler* MTLFX::TemporalScalerDescriptor::newTemporalScaler( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler ) const +{ + return Object::sendMessage< MTL4FX::TemporalScaler* >( this, _MTLFX_PRIVATE_SEL( newTemporalScalerWithDevice_compiler_ ), pDevice, pCompiler ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::supportedInputContentMinScale( const MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMinScaleForDevice_ ), pDevice ); + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerDescriptor::supportedInputContentMaxScale( const MTL::Device* pDevice ) +{ + float scale = 1.0f; + + if ( nullptr != methodSignatureForSelector( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ) ) ) + { + scale = sendMessage< float >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportedInputContentMaxScaleForDevice_ ), pDevice ); + } + else if ( supportsDevice( pDevice ) ) + { + scale = 2.0f; + } + + return scale; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::supportsDevice( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsDevice_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerDescriptor::supportsMetal4FX( const MTL::Device* pDevice ) +{ + return Object::sendMessageSafe< bool >( _NS_PRIVATE_CLS( MTLFXTemporalScalerDescriptor ), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), pDevice ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::colorTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::depthTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::motionTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::outputTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputContentWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setInputContentWidth( NS::UInteger width ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentWidth_ ), width ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputContentHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputContentHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setInputContentHeight( NS::UInteger height ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputContentHeight_ ), height ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::colorTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setColorTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::depthTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::motionTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::outputTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setOutputTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::exposureTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( exposureTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setExposureTexture( MTL::Texture* pTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setExposureTexture_ ), pTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::preExposure() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( preExposure ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setPreExposure( float preExposure ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPreExposure_ ), preExposure ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::jitterOffsetX() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setJitterOffsetX( float offset ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), offset ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::jitterOffsetY() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setJitterOffsetY( float offset ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), offset ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::motionVectorScaleX() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionVectorScaleX( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::motionVectorScaleY() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setMotionVectorScaleY( float scale ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), scale ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Texture* MTLFX::TemporalScalerBase::reactiveMaskTexture() const +{ + return Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( reactiveMaskTexture ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReactiveMaskTexture( MTL::Texture* reactiveMaskTexture ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReactiveMaskTexture_ ), reactiveMaskTexture ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::TextureUsage MTLFX::TemporalScalerBase::reactiveTextureUsage() const +{ + return Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( reactiveTextureUsage ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerBase::reset() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( reset ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setReset( bool reset ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setReset_ ), reset ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE bool MTLFX::TemporalScalerBase::isDepthReversed() const +{ + return Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setDepthReversed( bool depthReversed ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::colorTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::depthTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::motionTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::PixelFormat MTLFX::TemporalScalerBase::outputTextureFormat() const +{ + return Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::inputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputWidth() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE NS::UInteger MTLFX::TemporalScalerBase::outputHeight() const +{ + return Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::inputContentMinScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMinScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE float MTLFX::TemporalScalerBase::inputContentMaxScale() const +{ + return Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( inputContentMaxScale ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE MTL::Fence* MTLFX::TemporalScalerBase::fence() const +{ + return Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScalerBase::setFence( MTL::Fence* pFence ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), pFence ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_MTLFX_INLINE void MTLFX::TemporalScaler::encodeToCommandBuffer( MTL::CommandBuffer* pCommandBuffer ) +{ + Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), pCommandBuffer ); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/MetalFX/MetalFX.hpp b/vendor/metal-cpp/MetalFX/MetalFX.hpp new file mode 100644 index 000000000..20e647e84 --- /dev/null +++ b/vendor/metal-cpp/MetalFX/MetalFX.hpp @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// MetalFX/MetalFX.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "MTLFXSpatialScaler.hpp" +#include "MTLFXTemporalScaler.hpp" +#include "MTLFXTemporalDenoisedScaler.hpp" +#include "MTLFXFrameInterpolator.hpp" + +#include "MTL4FXSpatialScaler.hpp" +#include "MTL4FXTemporalScaler.hpp" +#include "MTL4FXTemporalDenoisedScaler.hpp" +#include "MTL4FXFrameInterpolator.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/QuartzCore.hpp b/vendor/metal-cpp/QuartzCore.hpp new file mode 100644 index 000000000..681003ad6 --- /dev/null +++ b/vendor/metal-cpp/QuartzCore.hpp @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// QuartzCore/QuartzCore.hpp +// +// Copyright 2020-2024 Apple Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#pragma once + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#include "CAMetalDrawable.hpp" +#include "CAMetalLayer.hpp" + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/vendor/metal-cpp/QuartzCore/CADefines.hpp b/vendor/metal-cpp/QuartzCore/CADefines.hpp index 83f3d8fc0..b0641de05 100644 --- a/vendor/metal-cpp/QuartzCore/CADefines.hpp +++ b/vendor/metal-cpp/QuartzCore/CADefines.hpp @@ -2,7 +2,7 @@ // // QuartzCore/CADefines.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/QuartzCore/CAMetalDrawable.hpp b/vendor/metal-cpp/QuartzCore/CAMetalDrawable.hpp index 99a3872a4..0057773a2 100644 --- a/vendor/metal-cpp/QuartzCore/CAMetalDrawable.hpp +++ b/vendor/metal-cpp/QuartzCore/CAMetalDrawable.hpp @@ -2,7 +2,7 @@ // // QuartzCore/CAMetalDrawable.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/QuartzCore/CAMetalLayer.hpp b/vendor/metal-cpp/QuartzCore/CAMetalLayer.hpp index 904e21888..53f6857d2 100644 --- a/vendor/metal-cpp/QuartzCore/CAMetalLayer.hpp +++ b/vendor/metal-cpp/QuartzCore/CAMetalLayer.hpp @@ -2,7 +2,7 @@ // // QuartzCore/CAMetalDrawable.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,7 +24,10 @@ #include "../Metal/MTLPixelFormat.hpp" #include "../Metal/MTLTexture.hpp" +#include "../Metal/MTLResidencySet.hpp" +#include "../Foundation/NSTypes.hpp" #include +#include #include "CADefines.hpp" #include "CAMetalDrawable.hpp" @@ -53,6 +56,20 @@ public: void setDrawableSize(CGSize drawableSize); class MetalDrawable* nextDrawable(); + + NS::UInteger maximumDrawableCount() const; + void setMaximumDrawableCount(NS::UInteger maximumDrawableCount); + + bool displaySyncEnabled() const; + void setDisplaySyncEnabled(bool displaySyncEnabled); + + CGColorSpaceRef colorspace() const; + void setColorspace(CGColorSpaceRef colorspace); + + bool allowsNextDrawableTimeout() const; + void setAllowsNextDrawableTimeout(bool allowsNextDrawableTimeout); + + MTL::ResidencySet* residencySet() const; }; } // namespace CA @@ -129,3 +146,71 @@ _CA_INLINE CA::MetalDrawable* CA::MetalLayer::nextDrawable() return Object::sendMessage(this, _CA_PRIVATE_SEL(nextDrawable)); } + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE NS::UInteger CA::MetalLayer::maximumDrawableCount() const +{ + return Object::sendMessage(this, + _CA_PRIVATE_SEL(maximumDrawableCount)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setMaximumDrawableCount(NS::UInteger maximumDrawableCount) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setMaximumDrawableCount_), + maximumDrawableCount); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE bool CA::MetalLayer::displaySyncEnabled() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(displaySyncEnabled)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setDisplaySyncEnabled(bool displaySyncEnabled) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setDisplaySyncEnabled_), + displaySyncEnabled); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE CGColorSpaceRef CA::MetalLayer::colorspace() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(colorspace)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setColorspace(CGColorSpaceRef colorspace) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setColorspace_), + colorspace); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE bool CA::MetalLayer::allowsNextDrawableTimeout() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(allowsNextDrawableTimeout)); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE void CA::MetalLayer::setAllowsNextDrawableTimeout(bool allowsNextDrawableTimeout) +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(setAllowsNextDrawableTimeout_), + allowsNextDrawableTimeout); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------- + +_CA_INLINE MTL::ResidencySet* CA::MetalLayer::residencySet() const +{ + return Object::sendMessage(this, _CA_PRIVATE_SEL(residencySet) ); +} diff --git a/vendor/metal-cpp/QuartzCore/CAPrivate.hpp b/vendor/metal-cpp/QuartzCore/CAPrivate.hpp index 701ee0820..0b7486a75 100644 --- a/vendor/metal-cpp/QuartzCore/CAPrivate.hpp +++ b/vendor/metal-cpp/QuartzCore/CAPrivate.hpp @@ -2,7 +2,7 @@ // // QuartzCore/CAPrivate.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -103,24 +103,42 @@ namespace Private { namespace Selector { + _CA_PRIVATE_DEF_SEL(allowsNextDrawableTimeout, + "allowsNextDrawableTimeout"); + _CA_PRIVATE_DEF_SEL(colorspace, + "colorspace"); _CA_PRIVATE_DEF_SEL(device, "device"); + _CA_PRIVATE_DEF_SEL(displaySyncEnabled, + "displaySyncEnabled"); _CA_PRIVATE_DEF_SEL(drawableSize, "drawableSize"); _CA_PRIVATE_DEF_SEL(framebufferOnly, "framebufferOnly"); _CA_PRIVATE_DEF_SEL(layer, "layer"); + _CA_PRIVATE_DEF_SEL(maximumDrawableCount, + "maximumDrawableCount"); _CA_PRIVATE_DEF_SEL(nextDrawable, "nextDrawable"); _CA_PRIVATE_DEF_SEL(pixelFormat, "pixelFormat"); + _CA_PRIVATE_DEF_SEL(residencySet, + "residencySet"); + _CA_PRIVATE_DEF_SEL(setAllowsNextDrawableTimeout_, + "setAllowsNextDrawableTimeout:"); + _CA_PRIVATE_DEF_SEL(setColorspace_, + "setColorspace:"); _CA_PRIVATE_DEF_SEL(setDevice_, "setDevice:"); + _CA_PRIVATE_DEF_SEL(setDisplaySyncEnabled_, + "setDisplaySyncEnabled:"); _CA_PRIVATE_DEF_SEL(setDrawableSize_, "setDrawableSize:"); _CA_PRIVATE_DEF_SEL(setFramebufferOnly_, "setFramebufferOnly:"); + _CA_PRIVATE_DEF_SEL(setMaximumDrawableCount_, + "setMaximumDrawableCount:"); _CA_PRIVATE_DEF_SEL(setPixelFormat_, "setPixelFormat:"); _CA_PRIVATE_DEF_SEL(texture, diff --git a/vendor/metal-cpp/QuartzCore/QuartzCore.hpp b/vendor/metal-cpp/QuartzCore/QuartzCore.hpp index beb57b615..681003ad6 100644 --- a/vendor/metal-cpp/QuartzCore/QuartzCore.hpp +++ b/vendor/metal-cpp/QuartzCore/QuartzCore.hpp @@ -2,7 +2,7 @@ // // QuartzCore/QuartzCore.hpp // -// Copyright 2020-2023 Apple Inc. +// Copyright 2020-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/metal-cpp/README.md b/vendor/metal-cpp/README.md index 51329a4d0..03d628c78 100644 --- a/vendor/metal-cpp/README.md +++ b/vendor/metal-cpp/README.md @@ -14,6 +14,17 @@ - Backwards compatibility: All `bool MTL::Device::supports...()` functions check if their required selectors exist and automatically return `false` if not. - String (`ErrorDomain`) constants are weak linked and automatically set to `nullptr` if not available. +## Changelog + +| Version | Changes | +|-|-| +| macOS 26, iOS 26 | Add all the Metal APIs in macOS 26, iOS 26, including support for the **Apple10** GPU family.
Add support for Metal 4 and new denoiser and temporal scalers in MetalFX.| +| macOS 15, iOS 18 | Add all the Metal APIs in macOS 15 and iOS 18. | +| macOS 14, iOS 17 | Add support for the **MetalFX** framework.
Add all the APIs in macOS 14 and iOS 17. | +| macOS 13.3, iOS 16.4 | Add all the APIs in macOS 13.3 and iOS 16.4. | +| macOS 13, iOS 16| Add all the APIs in macOS 13 and iOS 16.
New optional `NS::SharedPtr` type to assist with memory management.
New convenience function to create a `CA::MetalLayer`.
New `MTLSTR(str)` macro allows faster string creation from literals.
Fix a problem with the signature of functions that take an array of pointers as input.
Fix a problem with the signature of the `setGroups()` function in `MTL::LinkedFunctions`.| +| macOS 12, iOS 15 | Initial release. | + ## Memory Allocation Policy **metal-cpp** follows the object allocation policies of Cocoa, Cocoa Touch, and CoreFoundation. Understanding these rules is especially important when using metal-cpp, as C++ objects are not eligible for automatic reference counting (ARC). @@ -103,7 +114,7 @@ If you want to use the QuartzCore wrapper, add: Purely optional: You can generate a single header file that contains all **metal-cpp** headers via: ```shell -./SingleHeader/MakeSingleHeader.py Foundation/Foundation.hpp QuartzCore/QuartzCore.hpp Metal/Metal.hpp +./SingleHeader/MakeSingleHeader.py Foundation/Foundation.hpp QuartzCore/QuartzCore.hpp Metal/Metal.hpp MetalFX/MetalFX.hpp ``` By default the generator script writes its output to `./SingleHeader/Metal.hpp`. Use the `-o` option to customize output filename. @@ -246,7 +257,7 @@ printf( "string = \"%s\"\n", [string cStringUsingEncoding: NSASCIIStringEncoding ```objc NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSString* string = [NSString stringWithCString: "Hello World" encoding: NSASCIIStringEncoding]; - + printf( "string = \"%s\"\n", [string cStringUsingEncoding: NSASCIIStringEncoding] ); [pool release]; @@ -300,11 +311,3 @@ CA::MetalDrawable* pMetalDrawable = pMetalLayer->nextDrawable(); // ... ``` - -## Changelog - -| Version | Changes | -|-|-| -| macOS 13.3, iOS 16.4 | Add all APIs in macOS 13.3 and iOS 16.4. | -| macOS 13, iOS 16| Add all APIs for macOS 13 and iOS 16.
New optional `NS::SharedPtr` type to assist with memory management.
New convenience function to create a `CA::MetalLayer`.
New `MTLSTR(str)` macro allows faster string creation from literals.
Fix a problem with the signature of functions that take an array of pointers as input.
Fix a problem with the signature of the `setGroups()` function in `MTL::LinkedFunctions`.| -| macOS 12, iOS 15 | Initial release. | diff --git a/vendor/metal-cpp/SingleHeader/MakeSingleHeader.py b/vendor/metal-cpp/SingleHeader/MakeSingleHeader.py index a2e96170b..c8d3715fe 100755 --- a/vendor/metal-cpp/SingleHeader/MakeSingleHeader.py +++ b/vendor/metal-cpp/SingleHeader/MakeSingleHeader.py @@ -4,7 +4,7 @@ # # SingleHeader/MakeSingleHeader.py # -# Copyright 2020-2023 Apple Inc. +# Copyright 2020-2024 Apple Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ class HeaderPrefix( object ): '//\n' '// {meta_data}\n' '//\n' - '// Copyright 2020-2023 Apple Inc.\n' + '// Copyright 2020-2024 Apple Inc.\n' '//\n' '// Licensed under the Apache License, Version 2.0 (the "License");\n' '// you may not use this file except in compliance with the License.\n' @@ -85,7 +85,7 @@ class HeaderPrefix( object ): def __get_date_string( self ): today = datetime.date.today() - + return today.strftime( self.__template_date ) def __meta_data_string( self ): @@ -158,7 +158,7 @@ class SingleHeader( object ): def __process_header( self, header_path ): - out_header = '' + out_header = '' header_path = os.path.realpath( header_path ) @@ -167,7 +167,7 @@ class SingleHeader( object ): self.__base_path.append( os.path.dirname( header_path ) ) self.__included_headers.add( header_path ) - + out_header = self.__read_header( header_path ) out_header = self.__strip_pragma_once( out_header ) out_header = self.__strip_comments( out_header ) @@ -211,7 +211,7 @@ def parse_arguments(): def make_header( args ): prefix = HeaderPrefix( os.path.basename( args.output_path ) ) header = SingleHeader() - + for header_path in args.header_paths: header.append( header_path ) @@ -248,7 +248,7 @@ def write_header( args, content ): if __name__ == '__main__': result = -1 - + try: if sys.getdefaultencoding().lower() == 'ascii': reload( sys )