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

Optional renderTexture stencil #6099

Merged
merged 1 commit into from Sep 17, 2019
Merged

Optional renderTexture stencil #6099

merged 1 commit into from Sep 17, 2019

Conversation

ivanpopelyshev
Copy link
Collaborator

@ivanpopelyshev ivanpopelyshev commented Sep 16, 2019

That's for 5.1.4

First part of renderTexture stencil optimization: reduce the memory of renderTexture in case there are no masks. Comparing to v4 that was a downgrade.

Next PR's will add temporary pow2 renderbuffers for filters, and add a setting to allow run pixi in stencil-less webgl.

Open chrome or canary, single page, press SHIFT+ESC, look in GPU process memory

1000 renderTextures of size 256x256.

In windows stencil+depth is 32bit, and STENCIL8 cant help, it always creates both. +33% tax on potential mipmaps for colorbuffer.

That's 350kb colorbuffer per one renderTexture +256kb stencil/depth.

That means 350MB vs 600MB if we use stencil for every texture.

My measurements:

Empty playground, 140M total.
image

Stencil, 800M GPU total in chrome canary: https://www.pixiplayground.com/#/edit/8vkPJSK3IBCisZYdc6YC1
image

This branch, no stencil, 550M
https://www.pixiplayground.com/#/edit/3Bxzpc~OW18PHxsJ3wxcc
image

I dont know where else 60M goes, but I think we can ignore that.

Proof that forceStencil() code works, filter on app.stage : https://www.pixiplayground.com/#/edit/aN_YFvmR5W6UmSl6Han6X

@codecov-io
Copy link

codecov-io commented Sep 16, 2019

Codecov Report

Merging #6099 into master will decrease coverage by 0.14%.
The diff coverage is 5.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6099      +/-   ##
==========================================
- Coverage   70.68%   70.53%   -0.15%     
==========================================
  Files         208      208              
  Lines       10589    10607      +18     
==========================================
- Hits         7485     7482       -3     
- Misses       3104     3125      +21
Impacted Files Coverage Δ
...ckages/core/src/renderTexture/BaseRenderTexture.js 75.86% <ø> (ø) ⬆️
packages/core/src/mask/StencilSystem.js 30.76% <0%> (-0.61%) ⬇️
packages/core/src/framebuffer/FramebufferSystem.js 36.07% <5.88%> (-3.65%) ⬇️
packages/core/src/framebuffer/Framebuffer.js 45.09% <0%> (-7.85%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee5ed4d...a03052b. Read the comment docs.

@ivanpopelyshev ivanpopelyshev added 🔥 High Priority These are PRs or issues that are extremely important to address either because they are from sponsor Priority: High and removed 🔥 High Priority These are PRs or issues that are extremely important to address either because they are from sponsor labels Sep 16, 2019
Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

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

nice work @ivanpopelyshev 👍

@bigtimebuddy bigtimebuddy added this to the v5.1.4 milestone Sep 16, 2019
@bigtimebuddy bigtimebuddy merged commit 7cb9ad2 into master Sep 17, 2019
@bigtimebuddy bigtimebuddy deleted the fix-stencil branch September 17, 2019 19:41
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

5 participants