Skip to content

Commit

Permalink
add Renderer::getClearOptions (google#7272)
Browse files Browse the repository at this point in the history
FIXES=[243846268]
  • Loading branch information
pixelflinger authored and plepers committed Dec 9, 2023
1 parent 126aa72 commit ad4fabb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEW_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
- engine: New tone mapper: `AgXTonemapper`.
- matinfo: Add support for viewing ESSL 1.0 shaders
- engine: Add support for stencil buffer when post-processing is disabled (Metal backend only).
- engine: Add `Renderer::getClearOptions()` [b/243846268]
- engine: Fix stable shadows (again) when an IBL rotation is used
6 changes: 6 additions & 0 deletions filament/include/filament/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ class UTILS_PUBLIC Renderer : public FilamentAPI {
*/
void setClearOptions(const ClearOptions& options);

/**
* Returns the ClearOptions currently set.
* @return A reference to a ClearOptions structure.
*/
ClearOptions const& getClearOptions() const noexcept;

/**
* Get the Engine that created this Renderer.
*
Expand Down
4 changes: 4 additions & 0 deletions filament/src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ void Renderer::setClearOptions(const ClearOptions& options) {
downcast(this)->setClearOptions(options);
}

Renderer::ClearOptions const& Renderer::getClearOptions() const noexcept {
return downcast(this)->getClearOptions();
}

void Renderer::renderStandaloneView(View const* view) {
downcast(this)->renderStandaloneView(downcast(view));
}
Expand Down
4 changes: 4 additions & 0 deletions filament/src/details/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ class FRenderer : public Renderer {
mClearOptions = options;
}

ClearOptions const& getClearOptions() const noexcept {
return mClearOptions;
}

private:
friend class Renderer;
using Command = RenderPass::Command;
Expand Down
1 change: 1 addition & 0 deletions web/filament-js/jsbindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ class_<Renderer>("Renderer")
engine->execute();
}), allow_raw_pointers())
.function("_setClearOptions", &Renderer::setClearOptions, allow_raw_pointers())
.function("getClearOptions", &Renderer::getClearOptions)
.function("beginFrame", EMBIND_LAMBDA(bool, (Renderer* self, SwapChain* swapChain), {
return self->beginFrame(swapChain);
}), allow_raw_pointers())
Expand Down

0 comments on commit ad4fabb

Please sign in to comment.