-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
reuse stencilbuffers in prerendering #601
Conversation
var stencil = this.stencilBuffer = gl.createRenderbuffer(); | ||
var stencils = this.painter.prerenderStencils[this.size]; | ||
var stencil = this.stencilBuffer = stencils && stencils.length > 0 ? stencils.pop() : gl.createRenderbuffer(); | ||
stencil.size = this.size; | ||
gl.bindRenderbuffer(gl.RENDERBUFFER, stencil); | ||
gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, this.size, this.size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only be called if the stencil buffer is newly created
Yes, good catch. It should be creating the fbo once per size only binding the stencil buffer the fbo once |
…encilreuse Conflicts: js/render/painter.js js/render/prerendered.js
reuse stencilbuffers in prerendering
I wonder how other's commits (from John & Ansis here) end up in branches like this... What do you use for git? Command line, GitHub app, or something other? |
Ha, I know, sorry -- I rebased (command line) dev-pages onto this so the Travis builds would pass. Not sure if I did it right...? 😕 |
Usually you'd do |
Weird -- that's exactly what I did. Not sure why those commits showed up here and caused merge conflicts within this branch... |
Was the rebase conflicting? How did you resolve conflicts? |
No, the rebase was fine -- I rebased successfully, then tried to push to this branch and got an error that I needed to pull remote changes first, so I did so and had merge conflicts between my previous commit and most recent commit (in |
@lbud oh I see, so here's the culprit. After you rebase, the history is rewritten so that your rebased commits are modified. So when you try to push, it doesn't allow you to because history has diverged, and pulling results in new commits along with new dev-pages commits being merged on top of old commits, which results in a mess. After rebase, just do |
Aha, ok. Very helpful -- thanks :) |
…te to depth buffer (#601)
@ansis does this cover #592 — or should it also be doing something about
fbo
?