#ifndef OPENMW_COMPONENTS_FX_PASS_H #define OPENMW_COMPONENTS_FX_PASS_H #include #include #include #include #include #include #include #include #include #include #include #include namespace fx { class Technique; class Pass { public: enum class Order { Forward, Post }; enum class Type { None, Pixel, Compute }; friend class Technique; Pass(Type type = Type::Pixel, Order order = Order::Post, bool ubo = false); void compile(Technique& technique, std::string_view preamble); std::string getTarget() const { return mTarget; } const std::array& getRenderTargets() const { return mRenderTargets; } void prepareStateSet(osg::StateSet* stateSet, const std::string& name) const; std::string getName() const { return mName; } void dirty(); private: std::string getPassHeader(Technique& technique, std::string_view preamble, bool fragOut = false); bool mCompiled; osg::ref_ptr mVertex; osg::ref_ptr mFragment; osg::ref_ptr mCompute; Type mType; Order mOrder; std::string mName; bool mLegacyGLSL; bool mUBO; std::array mRenderTargets; std::string mTarget; std::optional mClearColor; std::optional mBlendSource; std::optional mBlendDest; std::optional mBlendEq; }; } #endif