From 3dbae482d3bcc4cd45a2bf6d8f9c881a2b79c093 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 11 Dec 2023 16:54:26 -0800 Subject: [PATCH] make a few PostProcessManager methods "package" public we make PostProcessMaterial, getPostProcessMaterial() as well as render(), commitAndRender() public (as in public to filament internals). These methods have no reason to be private to PostProcessManager. --- filament/src/PostProcessManager.h | 82 +++++++++++++++---------------- 1 file changed, 41 insertions(+), 41 deletions(-) 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};