diff --git a/filament/src/PostProcessManager.h b/filament/src/PostProcessManager.h index 79adbab17f..960ff55fd2 100644 --- a/filament/src/PostProcessManager.h +++ b/filament/src/PostProcessManager.h @@ -273,44 +273,6 @@ public: return mHaltonSamples[index & 0xFu]; } -private: - FEngine& mEngine; - class PostProcessMaterial; - - struct BilateralPassConfig { - uint8_t kernelSize = 11; - bool bentNormals = false; - float standardDeviation = 1.0f; - float bilateralThreshold = 0.0625f; - float scale = 1.0f; - }; - - FrameGraphId bilateralBlurPass(FrameGraph& fg, - FrameGraphId input, FrameGraphId depth, - math::int2 axis, float zf, backend::TextureFormat format, - BilateralPassConfig const& config) noexcept; - - BloomPassOutput bloomPass(FrameGraph& fg, - FrameGraphId input, backend::TextureFormat outFormat, - BloomOptions& inoutBloomOptions, math::float2 scale) noexcept; - - FrameGraphId downscalePass(FrameGraph& fg, - FrameGraphId input, - FrameGraphTexture::Descriptor const& outDesc, - bool threshold, float highlight, bool fireflies) noexcept; - - void commitAndRender(FrameGraphResources::RenderPassInfo const& out, - PostProcessMaterial const& material, uint8_t variant, - backend::DriverApi& driver) const noexcept; - - void commitAndRender(FrameGraphResources::RenderPassInfo const& out, - PostProcessMaterial const& material, - backend::DriverApi& driver) const noexcept; - - void render(FrameGraphResources::RenderPassInfo const& out, - backend::PipelineState const& pipeline, - backend::DriverApi& driver) const noexcept; - class PostProcessMaterial { public: PostProcessMaterial() noexcept; @@ -344,15 +306,53 @@ private: utils::FixedCapacityVector mConstants{}; }; + void registerPostProcessMaterial(std::string_view name, MaterialInfo const& info); + + PostProcessMaterial& getPostProcessMaterial(std::string_view name) noexcept; + + void commitAndRender(FrameGraphResources::RenderPassInfo const& out, + PostProcessMaterial const& material, uint8_t variant, + backend::DriverApi& driver) const noexcept; + + void commitAndRender(FrameGraphResources::RenderPassInfo const& out, + PostProcessMaterial const& material, + backend::DriverApi& driver) const noexcept; + + void render(FrameGraphResources::RenderPassInfo const& out, + backend::PipelineState const& pipeline, + backend::DriverApi& driver) const noexcept; + +private: + FEngine& mEngine; + + struct BilateralPassConfig { + uint8_t kernelSize = 11; + bool bentNormals = false; + float standardDeviation = 1.0f; + float bilateralThreshold = 0.0625f; + float scale = 1.0f; + }; + + FrameGraphId bilateralBlurPass(FrameGraph& fg, + FrameGraphId input, FrameGraphId depth, + math::int2 axis, float zf, backend::TextureFormat format, + BilateralPassConfig const& config) noexcept; + + BloomPassOutput bloomPass(FrameGraph& fg, + FrameGraphId input, backend::TextureFormat outFormat, + BloomOptions& inoutBloomOptions, math::float2 scale) noexcept; + + FrameGraphId downscalePass(FrameGraph& fg, + FrameGraphId input, + FrameGraphTexture::Descriptor const& outDesc, + bool threshold, float highlight, bool fireflies) noexcept; + using MaterialRegistryMap = tsl::robin_map< std::string_view, PostProcessMaterial>; MaterialRegistryMap mMaterialRegistry; - void registerPostProcessMaterial(std::string_view name, MaterialInfo const& info); - PostProcessMaterial& getPostProcessMaterial(std::string_view name) noexcept; - backend::Handle mStarburstTexture; std::uniform_real_distribution mUniformDistribution{0.0f, 1.0f};