Skip to content

Commit

Permalink
make a few PostProcessManager methods "package" public
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pixelflinger committed Dec 12, 2023
1 parent 27572e3 commit 3dbae48
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions filament/src/PostProcessManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,44 +273,6 @@ class PostProcessManager {
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<FrameGraphTexture> bilateralBlurPass(FrameGraph& fg,
FrameGraphId<FrameGraphTexture> input, FrameGraphId<FrameGraphTexture> depth,
math::int2 axis, float zf, backend::TextureFormat format,
BilateralPassConfig const& config) noexcept;

BloomPassOutput bloomPass(FrameGraph& fg,
FrameGraphId<FrameGraphTexture> input, backend::TextureFormat outFormat,
BloomOptions& inoutBloomOptions, math::float2 scale) noexcept;

FrameGraphId<FrameGraphTexture> downscalePass(FrameGraph& fg,
FrameGraphId<FrameGraphTexture> 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;
Expand Down Expand Up @@ -344,15 +306,53 @@ class PostProcessManager {
utils::FixedCapacityVector<ConstantInfo> 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<FrameGraphTexture> bilateralBlurPass(FrameGraph& fg,
FrameGraphId<FrameGraphTexture> input, FrameGraphId<FrameGraphTexture> depth,
math::int2 axis, float zf, backend::TextureFormat format,
BilateralPassConfig const& config) noexcept;

BloomPassOutput bloomPass(FrameGraph& fg,
FrameGraphId<FrameGraphTexture> input, backend::TextureFormat outFormat,
BloomOptions& inoutBloomOptions, math::float2 scale) noexcept;

FrameGraphId<FrameGraphTexture> downscalePass(FrameGraph& fg,
FrameGraphId<FrameGraphTexture> 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<backend::HwTexture> mStarburstTexture;

std::uniform_real_distribution<float> mUniformDistribution{0.0f, 1.0f};
Expand Down

0 comments on commit 3dbae48

Please sign in to comment.