-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix missing textures in atlas. #3011
Conversation
* | ||
* @private | ||
*/ | ||
RenderState.removeFromCache = function(renderState) { |
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.
We need to reference count these, right? What if someone else created the same render state?
Update CHANGES.md. |
framebuffer._bind(); | ||
newTexture.copyFromFramebuffer(0, 0, 0, 0, oldAtlasWidth, oldAtlasHeight); | ||
command.execute(textureAtlas._context); |
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.
TextureAtlas
is some of the oldest code in Cesium - it predates commands by at least a year.
I am not sure that TextureAtlas
should keep a reference to context
. No one else does that. This allows TextureAtlas
to make WebGL calls whenever it wants regardless of the global state. This is not good for scheduling requestAnimFrame
and for interop for other WebGL engines (#648). I wonder if it is even the source of this issue.
Perhaps we could replace _context
with an update
function and use ComputeCommand
s? How hard is that refactor? Is it too architect astronaut-ish?
@pjcozzi This is ready for another look. I agree that |
Works well and code looks good. Just add unit tests to RenderStateSpec.js. |
@pjcozzi This is ready for another look. I changed how the states are reference counted. The partial keys are reference counted as before, but the full key reference count is now how many partial keys reference the full state. |
Looks good. |
Fix missing textures in atlas.
Render to texture instead of copy from framebuffer on texture atlas resize. For #2997.
Still investigating GL calls for submitting a Chrome bug.