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

Layer composition rendering using RenderPass, optimization #4317

Merged
merged 15 commits into from
Jun 14, 2022

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jun 10, 2022

related to issue: #4271
follow up on PR: #4272
partially implements #2396

new (private) APIs:

GraphicsDevice.startPass(renderPass);
GraphicsDevice.endPass(renderPass);

This PR further implements the FrameGraph / RenderPass rendering architecture, specifically:

  • the frame graph tracks load and store operations for render targets, in order to avoid some wasted loading and storing those to tiled memory
  • the frame graph optimizes resolve and generate mipmaps operations as well

The benefits are mostly visible in projects that render to textures, especially if multi-sampling is used, including rendering to cubemaps.

GPU Performance improvement on some engine examples:
Screenshot 2022-06-10 at 09 55 41

Other changes

  • log tracing added for render passes:
    Screenshot 2022-06-10 at 09 51 28

  • log tracing added for texture / render target allocation / deallocation
    Screenshot 2022-06-10 at 09 54 17

@mvaligursky mvaligursky self-assigned this Jun 10, 2022
@mvaligursky mvaligursky marked this pull request as draft June 10, 2022 08:48
@mvaligursky mvaligursky requested a review from a team June 10, 2022 09:13
@mvaligursky mvaligursky marked this pull request as ready for review June 10, 2022 09:22
Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

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

To infinity and beyond!

src/graphics/graphics-device.js Outdated Show resolved Hide resolved
src/graphics/render-pass.js Outdated Show resolved Hide resolved
src/graphics/render-pass.js Outdated Show resolved Hide resolved
render() {

const device = this.device;
const realPass = this.renderTarget !== undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const realPass = this.renderTarget !== undefined;
const realPass = this.renderTarget !== null;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above. null is a valid 'render target' (a default framebuffer), which is not the same as undefined, which represents no render target.

Copy link
Member

Choose a reason for hiding this comment

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

Still wondering ab this one?

src/graphics/webgl/webgl-graphics-device.js Outdated Show resolved Hide resolved
src/graphics/webgl/webgl-graphics-device.js Show resolved Hide resolved
src/scene/camera.js Outdated Show resolved Hide resolved
src/scene/frame-graph.js Show resolved Hide resolved
mvaligursky and others added 2 commits June 10, 2022 08:54
Co-authored-by: Donovan Hutchence <slimbuck7@gmail.com>
Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

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

Approving based on a layout + spelling + grammar pass. 😄 I'll leave a technical approval to @slimbuck.

Martin Valigursky and others added 11 commits June 13, 2022 15:23
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
@mvaligursky mvaligursky merged commit cda47c1 into main Jun 14, 2022
@mvaligursky mvaligursky deleted the mvaligusky-render-pass-2 branch June 14, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants