Skip to content

Commit

Permalink
Decouple subpass from buffer padding (#8085)
Browse files Browse the repository at this point in the history
Coupling subpass on/off with buffer padding has unintended
consequences when we need to turn subpass off for tests. We
uncouple them in this change.
  • Loading branch information
poweifeng authored Aug 27, 2024
1 parent ba8d429 commit ba54136
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions filament/src/details/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,12 @@ void FRenderer::renderJob(RootArenaScope& rootArenaScope, FView& view) {

CameraInfo cameraInfo = view.computeCameraInfo(engine);

// when colorgrading-as-subpass is active, we know that many other effects are disabled
// such as dof, bloom. Moreover, if fxaa and scaling are not enabled, we're essentially in
// a very fast rendering path -- in this case, we would need an extra blit to "resolve" the
// buffer padding (because there are no other pass that can do it as a side effect).
// In this case, it is better to skip the padding, which won't be helping much.
const bool noBufferPadding = (colorGradingConfig.asSubpass && !hasFXAA && !scaled)
|| engine.debug.renderer.disable_buffer_padding;
// If fxaa and scaling are not enabled, we're essentially in a very fast rendering path -- in
// this case, we would need an extra blit to "resolve" the buffer padding (because there are no
// other pass that can do it as a side effect). In this case, it is better to skip the padding,
// which won't be helping much.
const bool noBufferPadding
= (!hasFXAA && !scaled) || engine.debug.renderer.disable_buffer_padding;

// guardBand must be a multiple of 16 to guarantee the same exact rendering up to 4 mip levels.
float const guardBand = guardBandOptions.enabled ? 16.0f : 0.0f;
Expand Down

0 comments on commit ba54136

Please sign in to comment.