Closed GeraldKimmersdorfer closed 5 months ago
This seems to be done! 🎉
The last point maybe needs some clarification. webGPU imposes a limit on the number of elements ("layers") in a 2d texture array, which is called maxTextureArrayLayers. I noticed, the supported limits to be different when running our native build with Dawn (2048 in my machine) and our wasm build with Google Chrome (256). Only for <25% of devices, this is higher than 256 (according to https://web3dsurvey.com/webgpu/limits/maxTextureArrayLayers)
When exceeding that limit, we use a replacement strategy to replace old tiles with newly fetched ones. Sometimes this can lead to artifacts (see https://github.com/AlpineMapsOrg/renderer/issues/101) based on what tiles are replaced.
Regardless, we want to support more texture layers to be stored on the GPU and used during rendering. Three possible solutions are
For now, I opted to implement (1), as it was pretty straighforward to implement and seems like it would not incur much of a performance penalty (in fact, I didn't notice any difference in FPS when moving around a bit). In the browser, this effectively prevents artifacts based on the tile replacement strategy (by just having more space to spare and needing less replacement).
Forgot to actually use the implementation with multiple draw calls :wasntme:
Fixed in d6cc110499498b6330ca4f116be1455718de60e1.
Issue includes:
Goal:
Non-Goals: