Why doesn't WebGPU tolerate TEXTUREFORMAT_RGB?

I am curious as to why the WebGPU engine does not tolerate TEXTUREFORMAT_RGB. If under the hood , it really needs to follow some RGBA layout , can’t the engine internals handle that conversion?

PlayGround:

6 Likes

Welcome aboard!

It’s better for the user to know that the RGB format is not supported than to hide the problem by using an RGBA format, which will consume more memory than expected. By forcing the user to choose an RGBA format, we ensure that they are fully aware that they will consume more memory than if the RGB format had been available. Note also that Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV is supported by WebGPU (but is still a 32-bits format).

3 Likes

Thanks for the clarification @Evgeni_Popov .