Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
++
  • Loading branch information
Jonah Williams committed Jul 6, 2023
commit e7c5f3484215d0f34c788c0ea974fb5c083fe1a5
47 changes: 28 additions & 19 deletions impeller/renderer/backend/gles/render_pass_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,25 +450,34 @@ struct RenderPassData {
}
}

// if (gl.DiscardFramebufferEXT.IsAvailable()) {
// std::vector<GLenum> attachments;
// if (pass_data.discard_color_attachment) {
// attachments.push_back(is_default_fbo ? GL_COLOR_EXT
// : GL_COLOR_ATTACHMENT0);
// }
// if (pass_data.discard_depth_attachment) {
// attachments.push_back(is_default_fbo ? GL_DEPTH_EXT
// : GL_DEPTH_ATTACHMENT);
// }
// if (pass_data.discard_stencil_attachment) {
// attachments.push_back(is_default_fbo ? GL_STENCIL_EXT
// : GL_STENCIL_ATTACHMENT);
// }
// gl.DiscardFramebufferEXT(GL_FRAMEBUFFER, // target
// attachments.size(), // attachments to discard
// attachments.data() // size
// );
// }
if (gl.DiscardFramebufferEXT.IsAvailable()) {
std::vector<GLenum> attachments;

if (pass_data.discard_color_attachment) {
attachments.push_back(is_default_fbo ? GL_COLOR_EXT
: GL_COLOR_ATTACHMENT0);
}
if (pass_data.discard_depth_attachment) {
attachments.push_back(is_default_fbo ? GL_DEPTH_EXT
: GL_DEPTH_ATTACHMENT);
}

// TODO(jonahwilliams): discarding the stencil on the default fbo when running
// on Windows. Causes Angle to discard the entire render target. Until we know
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// on Windows. Causes Angle to discard the entire render target. Until we know
// on Windows causes Angle to discard the entire render target. Until we know

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// the reason, default to storing.
#ifdef FML_OS_WIN
if (pass_data.discard_stencil_attachment && !is_default_fbo) {
#else
if (pass_data.discard_stencil_attachment) {
#endif
attachments.push_back(is_default_fbo ? GL_STENCIL_EXT
: GL_STENCIL_ATTACHMENT);
}
gl.DiscardFramebufferEXT(GL_FRAMEBUFFER, // target
attachments.size(), // attachments to discard
attachments.data() // size
);
}

return true;
}
Expand Down