SPB Git

spb/forge Public MIT

Forge — LLM training from scratch in pure C++20 + Metal on Apple Silicon.

C++ 61.2% C 23% Python 7.6% TeX 7.2% CMake 1.1%
45.7 KB · 954 lines cpp
Raw Blame History
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------2//3// MetalFX/MTLFXFrameInterpolator.hpp4//5// Copyright 2020-2025 Apple Inc.6//7// Licensed under the Apache License, Version 2.0 (the "License");8// you may not use this file except in compliance with the License.9// You may obtain a copy of the License at10//11//     http://www.apache.org/licenses/LICENSE-2.012//13// Unless required by applicable law or agreed to in writing, software14// distributed under the License is distributed on an "AS IS" BASIS,15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.16// See the License for the specific language governing permissions and17// limitations under the License.18//19//-------------------------------------------------------------------------------------------------------------------------------------------------------------2021#pragma once2223//-------------------------------------------------------------------------------------------------------------------------------------------------------------2425#include "MTLFXDefines.hpp"26#include "MTLFXPrivate.hpp"27#include "MTLFXTemporalScaler.hpp"2829#include "../Metal/Metal.hpp"3031//-------------------------------------------------------------------------------------------------------------------------------------------------------------3233namespace MTL4FX34{35    class TemporalScaler;36    class TemporalDenoisedScaler;37    class FrameInterpolator;38}3940namespace MTLFX41{42    class FrameInterpolatorDescriptor : public NS::Copying< FrameInterpolatorDescriptor >43    {44    public:45        static FrameInterpolatorDescriptor* alloc();46        FrameInterpolatorDescriptor*        init();4748        MTL::PixelFormat                    colorTextureFormat() const;49        void                                setColorTextureFormat(MTL::PixelFormat colorTextureFormat);5051        MTL::PixelFormat                    outputTextureFormat() const;52        void                                setOutputTextureFormat(MTL::PixelFormat outputTextureFormat);5354        MTL::PixelFormat                    depthTextureFormat() const;55        void                                setDepthTextureFormat(MTL::PixelFormat depthTextureFormat);5657        MTL::PixelFormat                    motionTextureFormat() const;58        void                                setMotionTextureFormat(MTL::PixelFormat motionTextureFormat);5960        MTL::PixelFormat                    uiTextureFormat() const;61        void                                setUITextureFormat(MTL::PixelFormat uiTextureFormat);6263        MTLFX::FrameInterpolatableScaler*   scaler() const;64        void                                setScaler(MTLFX::FrameInterpolatableScaler* scaler);6566        NS::UInteger                        inputWidth() const;67        void                                setInputWidth( NS::UInteger inputWidth );6869        NS::UInteger                        inputHeight() const;70        void                                setInputHeight( NS::UInteger inputHeight );7172        NS::UInteger                        outputWidth() const;73        void                                setOutputWidth( NS::UInteger outputWidth );7475        NS::UInteger                        outputHeight() const;76        void                                setOutputHeight( NS::UInteger outputHeight );7778        NS::UInteger                        isDistortionTextureEnabled() const;79        void                                setDistortionTextureEnabled( bool enabled );8081        class FrameInterpolator*            newFrameInterpolator( const MTL::Device* pDevice) const;82        MTL4FX::FrameInterpolator*          newFrameInterpolator( const MTL::Device* pDevice, const MTL4::Compiler* pCompiler) const;8384        static bool                         supportsMetal4FX(MTL::Device* device);85        static bool                         supportsDevice(MTL::Device* device);86    };8788    class FrameInterpolatorBase : public NS::Referencing<FrameInterpolatorBase>89    {90    public:91        MTL::TextureUsage colorTextureUsage() const;92        MTL::TextureUsage outputTextureUsage() const;93        MTL::TextureUsage depthTextureUsage() const;94        MTL::TextureUsage motionTextureUsage() const;95        MTL::TextureUsage uiTextureUsage() const;9697        MTL::PixelFormat  colorTextureFormat() const;98        MTL::PixelFormat  depthTextureFormat() const;99        MTL::PixelFormat  motionTextureFormat() const;100        MTL::PixelFormat  outputTextureFormat() const;101102        NS::UInteger      inputWidth() const;103        NS::UInteger      inputHeight() const;104        NS::UInteger      outputWidth() const;105        NS::UInteger      outputHeight() const;106        MTL::PixelFormat  uiTextureFormat() const;107108        NS::UInteger      contentWidth() const;109        void              setContentWidth( NS::UInteger contentWidth );110        NS::UInteger      contentHeight() const;111        void              setContentHeight( NS::UInteger contentHeight );112113        NS::UInteger      depthContentOffsetX() const;114        void              setDepthContentOffsetX( NS::UInteger offset );115        NS::UInteger      depthContentOffsetY() const;116        void              setDepthContentOffsetY( NS::UInteger offset );117118        NS::UInteger      motionContentOffsetX() const;119        void              setMotionContentOffsetX( NS::UInteger offset );120        NS::UInteger      motionContentOffsetY() const;121        void              setMotionContentOffsetY( NS::UInteger offset );122123        NS::UInteger      outputOffsetX() const;124        void              setOutputOffsetX( NS::UInteger offset );125        NS::UInteger      outputOffsetY() const;126        void              setOutputOffsetY( NS::UInteger offset );127128        NS::UInteger      distortionOffsetX() const;129        void              setDistortionOffsetX( NS::UInteger offset );130131        NS::UInteger      distortionOffsetY() const;132        void              setDistortionOffsetY( NS::UInteger offset );133134        NS::UInteger      distortionWidth() const;135        void              setDistortionWidth( NS::UInteger width );136137        NS::UInteger      distortionHeight() const;138        void              setDistortionHeight( NS::UInteger height );139140        MTL::Texture*     colorTexture() const;141        void              setColorTexture(MTL::Texture* colorTexture);142143        MTL::Texture*     distortionTexture() const;144        void              setDistortionTexture(MTL::Texture* distortionTexture);145146        MTL::Texture*     prevColorTexture() const;147        void              setPrevColorTexture(MTL::Texture* prevColorTexture);148149        MTL::Texture*     depthTexture() const;150        void              setDepthTexture(MTL::Texture* depthTexture);151152        MTL::Texture*     motionTexture() const;153        void              setMotionTexture(MTL::Texture* motionTexture);154155        float             motionVectorScaleX() const;156        void              setMotionVectorScaleX(float scaleX);157158        float             motionVectorScaleY() const;159        void              setMotionVectorScaleY(float scaleY);160161        float             deltaTime() const;162        void              setDeltaTime( float deltaTime );163164        float             nearPlane() const;165        void              setNearPlane( float nearPlane );166167        float             farPlane() const;168        void              setFarPlane( float farPlane );169170        float             fieldOfView() const;171        void              setFieldOfView( float fieldOfView );172173        float             aspectRatio() const;174        void              setAspectRatio( float aspectRatio );175176        MTL::Texture*     uiTexture() const;177        void              setUITexture(MTL::Texture* uiTexture);178179        float             jitterOffsetX() const;180        void              setJitterOffsetX( float jitterOffsetX );181182        float             jitterOffsetY() const;183        void              setJitterOffsetY( float jitterOffsetY );184185        bool              isUITextureComposited() const;186        void              setIsUITextureComposited( bool uiTextureComposited );187188        bool              shouldResetHistory() const;189        void              setShouldResetHistory( bool shouldResetHistory );190191        MTL::Texture*     outputTexture() const;192        void              setOutputTexture( MTL::Texture* outputTexture );193194        MTL::Fence*       fence() const;195        void              setFence( MTL::Fence* fence );196197        bool              isDepthReversed() const;198        void              setDepthReversed( bool depthReversed );199    };200201    class FrameInterpolator : public NS::Referencing<FrameInterpolator, FrameInterpolatorBase>202    {203    public:204        void              encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer);205    };206207}208209//-------------------------------------------------------------------------------------------------------------------------------------------------------------210211_MTLFX_INLINE MTLFX::FrameInterpolatorDescriptor* MTLFX::FrameInterpolatorDescriptor::alloc()212{213    return NS::Object::alloc< FrameInterpolatorDescriptor >( _MTLFX_PRIVATE_CLS( MTLFXFrameInterpolatorDescriptor ) );214}215216//-------------------------------------------------------------------------------------------------------------------------------------------------------------217218_MTLFX_INLINE MTLFX::FrameInterpolatorDescriptor* MTLFX::FrameInterpolatorDescriptor::init()219{220    return NS::Object::init< FrameInterpolatorDescriptor >();221}222223//-------------------------------------------------------------------------------------------------------------------------------------------------------------224225_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::colorTextureFormat() const226{227    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) );228}229230//-------------------------------------------------------------------------------------------------------------------------------------------------------------231232_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setColorTextureFormat( MTL::PixelFormat colorTextureFormat )233{234    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTextureFormat_ ), colorTextureFormat );235}236237//-------------------------------------------------------------------------------------------------------------------------------------------------------------238239_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::outputTextureFormat() const240{241    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) );242}243244//-------------------------------------------------------------------------------------------------------------------------------------------------------------245246_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputTextureFormat( MTL::PixelFormat outputTextureFormat )247{248    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTextureFormat_ ), outputTextureFormat );249}250251//-------------------------------------------------------------------------------------------------------------------------------------------------------------252253_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::depthTextureFormat() const254{255    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) );256}257258//-------------------------------------------------------------------------------------------------------------------------------------------------------------259260_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setDepthTextureFormat( MTL::PixelFormat depthTextureFormat )261{262    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTextureFormat_ ), depthTextureFormat );263}264265//-------------------------------------------------------------------------------------------------------------------------------------------------------------266267_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::motionTextureFormat() const268{269    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) );270}271272//-------------------------------------------------------------------------------------------------------------------------------------------------------------273274_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setMotionTextureFormat( MTL::PixelFormat motionTextureFormat )275{276    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTextureFormat_ ), motionTextureFormat );277}278279//-------------------------------------------------------------------------------------------------------------------------------------------------------------280281_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorDescriptor::uiTextureFormat() const282{283    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( uiTextureFormat ) );284}285286//-------------------------------------------------------------------------------------------------------------------------------------------------------------287288_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setUITextureFormat( MTL::PixelFormat uiTextureFormat )289{290    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setUITextureFormat_ ), uiTextureFormat );291}292293//-------------------------------------------------------------------------------------------------------------------------------------------------------------294295_MTLFX_INLINE MTLFX::FrameInterpolatableScaler* MTLFX::FrameInterpolatorDescriptor::scaler() const296{297    return NS::Object::sendMessage< MTLFX::FrameInterpolatableScaler* >( this, _MTLFX_PRIVATE_SEL( scaler ) );298}299300_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setScaler(MTLFX::FrameInterpolatableScaler* scaler)301{302    NS::Object::sendMessage< void >(this, _MTLFX_PRIVATE_SEL( setScaler_ ), scaler );303}304305//-------------------------------------------------------------------------------------------------------------------------------------------------------------306307_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::inputWidth() const308{309    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) );310}311312//-------------------------------------------------------------------------------------------------------------------------------------------------------------313314_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setInputWidth( NS::UInteger inputWidth )315{316    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputWidth_ ), inputWidth );317}318319//-------------------------------------------------------------------------------------------------------------------------------------------------------------320321_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::inputHeight() const322{323    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) );324}325326//-------------------------------------------------------------------------------------------------------------------------------------------------------------327328_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setInputHeight( NS::UInteger inputHeight )329{330    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setInputHeight_ ), inputHeight );331}332333//-------------------------------------------------------------------------------------------------------------------------------------------------------------334335_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::outputWidth() const336{337    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) );338}339340//-------------------------------------------------------------------------------------------------------------------------------------------------------------341342_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputWidth( NS::UInteger outputWidth )343{344    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputWidth_ ), outputWidth );345}346347//-------------------------------------------------------------------------------------------------------------------------------------------------------------348349_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::outputHeight() const350{351    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) );352}353354//-------------------------------------------------------------------------------------------------------------------------------------------------------------355356_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setOutputHeight( NS::UInteger outputHeight )357{358    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputHeight_ ), outputHeight );359}360361//-------------------------------------------------------------------------------------------------------------------------------------------------------------362363_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorDescriptor::isDistortionTextureEnabled() const364{365    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( isDistortionTextureEnabled ) );366}367368//-------------------------------------------------------------------------------------------------------------------------------------------------------------369370_MTLFX_INLINE void MTLFX::FrameInterpolatorDescriptor::setDistortionTextureEnabled( bool enabled )371{372    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDistortionTextureEnabled_ ), enabled );373}374375//-------------------------------------------------------------------------------------------------------------------------------------------------------------376377_MTLFX_INLINE MTLFX::FrameInterpolator* MTLFX::FrameInterpolatorDescriptor::newFrameInterpolator( const MTL::Device* device ) const378{379    return NS::Object::sendMessage< MTLFX::FrameInterpolator* >( this, _MTLFX_PRIVATE_SEL( newFrameInterpolatorWithDevice_ ), device );380}381382//-------------------------------------------------------------------------------------------------------------------------------------------------------------383384_MTLFX_INLINE MTL4FX::FrameInterpolator* MTLFX::FrameInterpolatorDescriptor::newFrameInterpolator( const MTL::Device* device, const MTL4::Compiler* compiler ) const385{386    return NS::Object::sendMessage< MTL4FX::FrameInterpolator* >( this, _MTLFX_PRIVATE_SEL( newFrameInterpolatorWithDevice_compiler_ ), device, compiler );387}388389//-------------------------------------------------------------------------------------------------------------------------------------------------------------390391_MTLFX_INLINE bool MTLFX::FrameInterpolatorDescriptor::supportsMetal4FX(MTL::Device* device)392{393    return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXFrameInterpolatorDescriptor), _MTLFX_PRIVATE_SEL( supportsMetal4FX_ ), device );394}395396//-------------------------------------------------------------------------------------------------------------------------------------------------------------397398_MTLFX_INLINE bool MTLFX::FrameInterpolatorDescriptor::supportsDevice(MTL::Device* device)399{400    return NS::Object::sendMessageSafe< bool >( _MTLFX_PRIVATE_CLS(MTLFXFrameInterpolatorDescriptor), _MTLFX_PRIVATE_SEL( supportsDevice_ ), device );401}402403404//-------------------------------------------------------------------------------------------------------------------------------------------------------------405406_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::colorTextureUsage() const407{408    return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( colorTextureUsage ) );409}410411//-------------------------------------------------------------------------------------------------------------------------------------------------------------412413_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::outputTextureUsage() const414{415    return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( outputTextureUsage ) );416}417418//-------------------------------------------------------------------------------------------------------------------------------------------------------------419420_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::depthTextureUsage() const421{422    return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( depthTextureUsage ) );423}424425//-------------------------------------------------------------------------------------------------------------------------------------------------------------426427_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::motionTextureUsage() const428{429    return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( motionTextureUsage ) );430}431432//-------------------------------------------------------------------------------------------------------------------------------------------------------------433434_MTLFX_INLINE MTL::TextureUsage MTLFX::FrameInterpolatorBase::uiTextureUsage() const435{436    return NS::Object::sendMessage< MTL::TextureUsage >( this, _MTLFX_PRIVATE_SEL( uiTextureUsage ) );437}438439//-------------------------------------------------------------------------------------------------------------------------------------------------------------440441_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::colorTextureFormat() const442{443    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( colorTextureFormat ) );444}445446//-------------------------------------------------------------------------------------------------------------------------------------------------------------447448_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::depthTextureFormat() const449{450    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( depthTextureFormat ) );451}452453//-------------------------------------------------------------------------------------------------------------------------------------------------------------454455_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::motionTextureFormat() const456{457    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( motionTextureFormat ) );458}459460//-------------------------------------------------------------------------------------------------------------------------------------------------------------461462_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::outputTextureFormat() const463{464    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( outputTextureFormat ) );465}466467//-------------------------------------------------------------------------------------------------------------------------------------------------------------468469_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::inputWidth() const470{471    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputWidth ) );472}473474//-------------------------------------------------------------------------------------------------------------------------------------------------------------475476_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::inputHeight() const477{478    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( inputHeight ) );479}480481//-------------------------------------------------------------------------------------------------------------------------------------------------------------482483_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputWidth() const484{485    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputWidth ) );486}487488//-------------------------------------------------------------------------------------------------------------------------------------------------------------489490_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputHeight() const491{492    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputHeight ) );493}494495//-------------------------------------------------------------------------------------------------------------------------------------------------------------496497_MTLFX_INLINE MTL::PixelFormat MTLFX::FrameInterpolatorBase::uiTextureFormat() const498{499    return NS::Object::sendMessage< MTL::PixelFormat >( this, _MTLFX_PRIVATE_SEL( uiTextureFormat ) );500}501502//-------------------------------------------------------------------------------------------------------------------------------------------------------------503504_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::contentWidth() const505{506    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( contentWidth ) );507}508509//-------------------------------------------------------------------------------------------------------------------------------------------------------------510511_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setContentWidth( NS::UInteger contentWidth )512{513    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setContentWidth_ ), contentWidth );514}515516//-------------------------------------------------------------------------------------------------------------------------------------------------------------517518_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::contentHeight() const519{520    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( contentHeight ) );521}522523//-------------------------------------------------------------------------------------------------------------------------------------------------------------524525_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setContentHeight( NS::UInteger contentHeight )526{527    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setContentHeight_ ), contentHeight );528}529530//-------------------------------------------------------------------------------------------------------------------------------------------------------------531532_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::depthContentOffsetX() const533{534    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( depthContentOffsetX ) );535}536537//-------------------------------------------------------------------------------------------------------------------------------------------------------------538539_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthContentOffsetX( NS::UInteger offset )540{541    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthContentOffsetX_ ), offset );542}543544//-------------------------------------------------------------------------------------------------------------------------------------------------------------545546_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::depthContentOffsetY() const547{548    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( depthContentOffsetY ) );549}550551//-------------------------------------------------------------------------------------------------------------------------------------------------------------552553_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthContentOffsetY( NS::UInteger offset )554{555    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthContentOffsetY_ ), offset );556}557558//-------------------------------------------------------------------------------------------------------------------------------------------------------------559560_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::motionContentOffsetX() const561{562    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( motionContentOffsetX ) );563}564565//-------------------------------------------------------------------------------------------------------------------------------------------------------------566567_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionContentOffsetX( NS::UInteger offset )568{569    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionContentOffsetX_ ), offset );570}571572//-------------------------------------------------------------------------------------------------------------------------------------------------------------573574_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::motionContentOffsetY() const575{576    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( motionContentOffsetY ) );577}578579//-------------------------------------------------------------------------------------------------------------------------------------------------------------580581_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionContentOffsetY( NS::UInteger offset )582{583    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionContentOffsetY_ ), offset );584}585586//-------------------------------------------------------------------------------------------------------------------------------------------------------------587588_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputOffsetX() const589{590    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputOffsetX ) );591}592593//-------------------------------------------------------------------------------------------------------------------------------------------------------------594595_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setOutputOffsetX( NS::UInteger offset )596{597    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputOffsetX_ ), offset );598}599600//-------------------------------------------------------------------------------------------------------------------------------------------------------------601602_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::outputOffsetY() const603{604    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( outputOffsetY ) );605}606607//-------------------------------------------------------------------------------------------------------------------------------------------------------------608609_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setOutputOffsetY( NS::UInteger offset )610{611    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputOffsetY_ ), offset );612}613614//-------------------------------------------------------------------------------------------------------------------------------------------------------------615616_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::distortionOffsetX() const617{618    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( distortionOffsetX ) );619}620621//-------------------------------------------------------------------------------------------------------------------------------------------------------------622623_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDistortionOffsetX( NS::UInteger offset )624{625    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDistortionOffsetX_ ), offset );626}627628//-------------------------------------------------------------------------------------------------------------------------------------------------------------629630_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::distortionOffsetY() const631{632    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( distortionOffsetY ) );633}634635//-------------------------------------------------------------------------------------------------------------------------------------------------------------636637_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDistortionOffsetY( NS::UInteger offset )638{639    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDistortionOffsetY_ ), offset );640}641642//-------------------------------------------------------------------------------------------------------------------------------------------------------------643644_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::distortionWidth() const645{646    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( distortionWidth ) );647}648649//-------------------------------------------------------------------------------------------------------------------------------------------------------------650651_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDistortionWidth( NS::UInteger width )652{653    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDistortionWidth_ ), width );654}655656//-------------------------------------------------------------------------------------------------------------------------------------------------------------657658_MTLFX_INLINE NS::UInteger MTLFX::FrameInterpolatorBase::distortionHeight() const659{660    return NS::Object::sendMessage< NS::UInteger >( this, _MTLFX_PRIVATE_SEL( distortionHeight ) );661}662663//-------------------------------------------------------------------------------------------------------------------------------------------------------------664665_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDistortionHeight( NS::UInteger height )666{667    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDistortionHeight_ ), height );668}669670//-------------------------------------------------------------------------------------------------------------------------------------------------------------671672_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::colorTexture() const673{674    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( colorTexture ) );675}676677//-------------------------------------------------------------------------------------------------------------------------------------------------------------678679_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setColorTexture(MTL::Texture* colorTexture)680{681    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setColorTexture_ ), colorTexture );682}683684//-------------------------------------------------------------------------------------------------------------------------------------------------------------685686_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::distortionTexture() const687{688    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( distortionTexture ) );689}690691//-------------------------------------------------------------------------------------------------------------------------------------------------------------692693_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDistortionTexture( MTL::Texture* distortionTexture )694{695    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDistortionTexture_ ), distortionTexture );696}697698//-------------------------------------------------------------------------------------------------------------------------------------------------------------699700_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::prevColorTexture() const701{702    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( prevColorTexture ) );703}704705//-------------------------------------------------------------------------------------------------------------------------------------------------------------706707_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setPrevColorTexture(MTL::Texture* prevColorTexture)708{709    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setPrevColorTexture_ ), prevColorTexture );710}711712//-------------------------------------------------------------------------------------------------------------------------------------------------------------713714_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::depthTexture() const715{716    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( depthTexture ) );717}718719//-------------------------------------------------------------------------------------------------------------------------------------------------------------720721_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthTexture(MTL::Texture* depthTexture)722{723    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthTexture_ ), depthTexture );724}725726//-------------------------------------------------------------------------------------------------------------------------------------------------------------727728_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::motionTexture() const729{730    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( motionTexture ) );731}732733//-------------------------------------------------------------------------------------------------------------------------------------------------------------734735_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionTexture(MTL::Texture* motionTexture)736{737    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionTexture_ ), motionTexture );738}739740//-------------------------------------------------------------------------------------------------------------------------------------------------------------741742_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::motionVectorScaleX() const743{744    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleX ) );745}746747//-------------------------------------------------------------------------------------------------------------------------------------------------------------748749_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionVectorScaleX(float scaleX)750{751    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleX_ ), scaleX );752}753754//-------------------------------------------------------------------------------------------------------------------------------------------------------------755756_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::motionVectorScaleY() const757{758    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( motionVectorScaleY ) );759}760761//-------------------------------------------------------------------------------------------------------------------------------------------------------------762763_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setMotionVectorScaleY(float scaleY)764{765    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setMotionVectorScaleY_ ), scaleY );766}767768//-------------------------------------------------------------------------------------------------------------------------------------------------------------769770_MTLFX_INLINE float  MTLFX::FrameInterpolatorBase::deltaTime() const771{772    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( deltaTime ) );773}774775//-------------------------------------------------------------------------------------------------------------------------------------------------------------776777_MTLFX_INLINE void   MTLFX::FrameInterpolatorBase::setDeltaTime( float deltaTime )778{779    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDeltaTime_ ), deltaTime );780}781782//-------------------------------------------------------------------------------------------------------------------------------------------------------------783784_MTLFX_INLINE float  MTLFX::FrameInterpolatorBase::nearPlane() const785{786    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( nearPlane ) );787}788789//-------------------------------------------------------------------------------------------------------------------------------------------------------------790791_MTLFX_INLINE void  MTLFX::FrameInterpolatorBase::setNearPlane( float nearPlane )792{793    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setNearPlane_ ), nearPlane );794}795796//-------------------------------------------------------------------------------------------------------------------------------------------------------------797798_MTLFX_INLINE float  MTLFX::FrameInterpolatorBase::farPlane() const799{800    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( farPlane ) );801}802803//-------------------------------------------------------------------------------------------------------------------------------------------------------------804805_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFarPlane( float farPlane )806{807    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFarPlane_ ), farPlane );808}809810//-------------------------------------------------------------------------------------------------------------------------------------------------------------811812_MTLFX_INLINE float  MTLFX::FrameInterpolatorBase::fieldOfView() const813{814    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( fieldOfView ) );815}816817//-------------------------------------------------------------------------------------------------------------------------------------------------------------818819_MTLFX_INLINE void   MTLFX::FrameInterpolatorBase::setFieldOfView( float fieldOfView )820{821    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFieldOfView_ ), fieldOfView );822}823824//-------------------------------------------------------------------------------------------------------------------------------------------------------------825826_MTLFX_INLINE float  MTLFX::FrameInterpolatorBase::aspectRatio() const827{828    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( aspectRatio ) );829}830831//-------------------------------------------------------------------------------------------------------------------------------------------------------------832833_MTLFX_INLINE void   MTLFX::FrameInterpolatorBase::setAspectRatio( float aspectRatio )834{835    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setAspectRatio_ ), aspectRatio );836}837838//-------------------------------------------------------------------------------------------------------------------------------------------------------------839840_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::uiTexture() const841{842    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( uiTexture ) );843}844845//-------------------------------------------------------------------------------------------------------------------------------------------------------------846847_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setUITexture(MTL::Texture* uiTexture)848{849    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setUITexture_ ), uiTexture );850}851852//-------------------------------------------------------------------------------------------------------------------------------------------------------------853854_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::jitterOffsetX() const855{856    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetX ) );857}858859//-------------------------------------------------------------------------------------------------------------------------------------------------------------860861_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setJitterOffsetX( float jitterOffsetX )862{863    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetX_ ), jitterOffsetX );864}865866//-------------------------------------------------------------------------------------------------------------------------------------------------------------867868_MTLFX_INLINE float MTLFX::FrameInterpolatorBase::jitterOffsetY() const869{870    return NS::Object::sendMessage< float >( this, _MTLFX_PRIVATE_SEL( jitterOffsetY ) );871}872873//-------------------------------------------------------------------------------------------------------------------------------------------------------------874875_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setJitterOffsetY( float jitterOffsetY )876{877    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setJitterOffsetY_ ), jitterOffsetY );878}879880//-------------------------------------------------------------------------------------------------------------------------------------------------------------881882_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::isUITextureComposited() const883{884    return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isUITextureComposited ) );885}886887_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setIsUITextureComposited( bool uiTextureComposited )888{889    NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setIsUITextureComposited_ ), uiTextureComposited );890}891892//-------------------------------------------------------------------------------------------------------------------------------------------------------------893894_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::shouldResetHistory() const895{896    return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( shouldResetHistory ) );897}898899//-------------------------------------------------------------------------------------------------------------------------------------------------------------900901_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setShouldResetHistory(bool shouldResetHistory)902{903    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setShouldResetHistory_ ), shouldResetHistory );904}905906//-------------------------------------------------------------------------------------------------------------------------------------------------------------907908_MTLFX_INLINE MTL::Texture* MTLFX::FrameInterpolatorBase::outputTexture() const909{910    return NS::Object::sendMessage< MTL::Texture* >( this, _MTLFX_PRIVATE_SEL( outputTexture ) );911}912913//-------------------------------------------------------------------------------------------------------------------------------------------------------------914915_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setOutputTexture(MTL::Texture* outputTexture)916{917    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setOutputTexture_ ), outputTexture );918}919920//-------------------------------------------------------------------------------------------------------------------------------------------------------------921922_MTLFX_INLINE MTL::Fence* MTLFX::FrameInterpolatorBase::fence() const923{924    return NS::Object::sendMessage< MTL::Fence* >( this, _MTLFX_PRIVATE_SEL( fence ) );925}926927//-------------------------------------------------------------------------------------------------------------------------------------------------------------928929_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setFence(MTL::Fence* fence)930{931    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setFence_ ), fence );932}933934//-------------------------------------------------------------------------------------------------------------------------------------------------------------935936_MTLFX_INLINE bool MTLFX::FrameInterpolatorBase::isDepthReversed() const937{938    return NS::Object::sendMessage< bool >( this, _MTLFX_PRIVATE_SEL( isDepthReversed ) );939}940941//-------------------------------------------------------------------------------------------------------------------------------------------------------------942943_MTLFX_INLINE void MTLFX::FrameInterpolatorBase::setDepthReversed(bool depthReversed)944{945    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( setDepthReversed_ ), depthReversed );946}947948//-------------------------------------------------------------------------------------------------------------------------------------------------------------949950_MTLFX_INLINE void MTLFX::FrameInterpolator::encodeToCommandBuffer(MTL::CommandBuffer* commandBuffer)951{952    return NS::Object::sendMessage< void >( this, _MTLFX_PRIVATE_SEL( encodeToCommandBuffer_ ), commandBuffer );953}954