#pragma once #include "BsRenderBeastPrerequisites.h" namespace BansheeEngine { /** * @brief Contains data about an overridden sampler states for a single pass stage. */ struct StageSamplerOverrides { SPtr* stateOverrides; UINT32 numStates; }; /** * @brief Contains data about an overridden sampler states for a single pass. */ struct PassSamplerOverrides { StageSamplerOverrides* stages; UINT32 numStages; }; /** * @brief Contains data about an overridden sampler states in the entire material. */ struct MaterialSamplerOverrides { PassSamplerOverrides* passes; UINT32 numPasses; UINT32 refCount; }; /** * @brief Helper class for generating sampler overrides. */ class BS_BSRND_EXPORT SamplerOverrideUtility { public: /** * @brief Generates a set of sampler overrides for the specified material. Overrides are * generates according to the provided render options. */ static MaterialSamplerOverrides* generateSamplerOverrides(const SPtr& material, const SPtr& options); /** * @brief Destroys sampler overrides previously generated with ::generateSamplerOverrides. */ static void destroySamplerOverrides(MaterialSamplerOverrides* overrides); /** * @brief Checks if the provided sampler state requires an override, in case the render options have * requirements not fulfilled by current sampler state (e.g. filtering type). */ static bool checkNeedsOverride(const SPtr& samplerState, const SPtr& options); /** * @brief Generates a new sampler state override using the provided state as the basis. Overridden properties * are taken from the provided render options. */ static SPtr generateSamplerOverride(const SPtr& samplerState, const SPtr& options); }; }