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

Firefox warns WebGL program #629

Closed
hajimehoshi opened this issue Jun 17, 2018 · 3 comments
Closed

Firefox warns WebGL program #629

hajimehoshi opened this issue Jun 17, 2018 · 3 comments

Comments

@hajimehoshi
Copy link
Owner

Error: WebGL warning: drawElements: This operation requires zeroing texture data. This is slow.

Version 60.0.2 (64-bit)

@hajimehoshi
Copy link
Owner Author

pixijs/pixijs#3897

This usually is logged in firefox when you try to read pixels from an out-of-viewport location and render them. Because there are no out-of-viewport pixels to read the browser has to create a buffer filled with zeroes for you, which is slow.

Hmm, I don't understand... Viewport specifies the region of the render target and how is this related to the texture to be read?

@hajimehoshi
Copy link
Owner Author

This happens whatever viewport size is.

@hajimehoshi
Copy link
Owner Author

https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.cpp#636-640

    // This has two usecases:
    // 1. Lazy zeroing of uninitialized textures:
    //    a. Before draw, when FakeBlack isn't viable. (TexStorage + Draw*)
    //    b. Before partial upload. (TexStorage + TexSubImage)
    // 2. Zero subrects from out-of-bounds blits. (CopyTex(Sub)Image)

OK so probably texture is not initialized when it is used. However, not-initializing is intentional in Ebiten for performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant