Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable picking for multiview rendering #8502

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions filament/src/details/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ void FRenderer::renderJob(RootArenaScope& rootArenaScope, FView& view) {
if (isRenderingMultiview) {
hasPostProcess = false;
msaaOptions.enabled = false;

// Picking is not supported for multiview rendering. Clear any pending picking queries.
view.clearPickingQueries();
}
const uint8_t msaaSampleCount = msaaOptions.enabled ? msaaOptions.sampleCount : 1u;

Expand Down
16 changes: 10 additions & 6 deletions filament/src/details/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,7 @@ FView::~FView() noexcept = default;
void FView::terminate(FEngine& engine) {
// Here we would cleanly free resources we've allocated, or we own (currently none).

while (mActivePickingQueriesList) {
FPickingQuery* const pQuery = mActivePickingQueriesList;
mActivePickingQueriesList = pQuery->next;
pQuery->callback(pQuery->result, pQuery);
FPickingQuery::put(pQuery);
}
clearPickingQueries();

DriverApi& driver = engine.getDriverApi();
driver.destroyBufferObject(mLightUbh);
Expand Down Expand Up @@ -1178,6 +1173,15 @@ void FView::executePickingQueries(DriverApi& driver,
}
}

void FView::clearPickingQueries() noexcept {
while (mActivePickingQueriesList) {
FPickingQuery* const pQuery = mActivePickingQueriesList;
mActivePickingQueriesList = pQuery->next;
pQuery->callback(pQuery->result, pQuery);
FPickingQuery::put(pQuery);
}
}

void FView::setTemporalAntiAliasingOptions(TemporalAntiAliasingOptions options) noexcept {
options.feedback = clamp(options.feedback, 0.0f, 1.0f);
options.filterWidth = std::max(0.2f, options.filterWidth); // below 0.2 causes issues
Expand Down
2 changes: 2 additions & 0 deletions filament/src/details/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ class FView : public View {
void executePickingQueries(backend::DriverApi& driver,
backend::RenderTargetHandle handle, math::float2 scale) noexcept;

void clearPickingQueries() noexcept;

void setMaterialGlobal(uint32_t index, math::float4 const& value);

math::float4 getMaterialGlobal(uint32_t index) const;
Expand Down
Loading