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

copy_texture_to_texture does not work correct in webGL2 with array textures. #3197

Closed
StarArawn opened this issue Nov 9, 2022 · 1 comment · Fixed by #3641
Closed

copy_texture_to_texture does not work correct in webGL2 with array textures. #3197

StarArawn opened this issue Nov 9, 2022 · 1 comment · Fixed by #3641
Labels
backend: gles Issues with GLES or WebGL type: bug Something isn't working

Comments

@StarArawn
Copy link
Contributor

Description
When using copy_texture_to_texture with the webGL2 backend and array textures I get invalid data displayed. It's hard to tell exactly what is going wrong since I can't really debug the code. I tried SpectorJS but it does not show individual textures.

Repro steps
Clone:
https://github.com/StarArawn/bevy_ecs_tilemap

Run(wasm/webGL2/array texture):

cargo build --target wasm32-unknown-unknown --example iso_diamond --release
wasm-server-runner .\target\wasm32-unknown-unknown\release\examples\iso_diamond.wasm

Run(wasm/webGL2/atlas):

cargo build --target wasm32-unknown-unknown --example iso_diamond --release --features atlas
wasm-server-runner .\target\wasm32-unknown-unknown\release\examples\iso_diamond.wasm

Run(desktop)

cargo run --example iso_diamond

Expected vs observed behavior
Compare with the desktop or atlas versions and you can see the issue.

Extra materials
None

Platform
Chrome/WebGL2

@StarArawn
Copy link
Contributor Author

Here are some screenshots from render doc:
image
image
The actual textures as an atlas(converted to array texture with copy_texture_to_texture):
image

As you can see we actually get some data from the original texture. My hunch is that the memory accessed for the atlas texture are incorrect but I'm not even sure where to check within wgpu for webgl2 and copy_texture_to_texture?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: gles Issues with GLES or WebGL type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants