StarArawn / bevy_ecs_tilemap

A tilemap rendering crate for bevy which is more ECS friendly.
MIT License
943 stars 198 forks source link

Improve workaround for wgpu's gles texture type inference #557

Closed teohhanhui closed 2 weeks ago

teohhanhui commented 2 months ago

To be honest, I can't see any difference with or without the patch. Everything seems to work fine when running the examples through wasm-server-runner without --features atlas anyway... Has the workaround been added somewhere else? (I can't find anything...)

Closes #395 Closes #283

rparrett commented 2 months ago

I should test again, but as far as I remember, #395 is still valid -- it should be tested with atlases consisting of exactly 12 (or other multiples of 6 greater than 6) tiles. It's possible that this was only an issue for native GL. Also possible that something changed on the wgpu side and it's no longer an issue.

teohhanhui commented 2 months ago

You're right. This workaround is needed. I'm trying out bevy_ecs_tilemap and without this patch, I'm getting:

ERROR app:  wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray` log.target = "wgpu_hal::gles";
log.module_path = "wgpu_hal::gles";
log.file = "/home/teohhanhui/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/mod.rs";
log.line = 421;

Just as expected... (and of course the render is wrong too)

teohhanhui commented 2 months ago

/ping @rparrett Please let me know if there are any outstanding concerns.