Textures in OpenGL have three components to them:
- Texture Parameters
- Sampling Parameters
WGPU's approach is very close to this, but they do the following:
- Texture Storage and Texture Parameters are combined together into the
- Sampling Parameters and a Sampler object are dedicated to the
- The best practice of using texture views to immutably get references to slices of the texture storage data is more closely adhered to with the
In OpenGL, when a texture storage is created, immutable storage may be allocated. When objects are immutable, there can be many immutable borrows to the same location in memory. (Rust users should know this too well).
A texture view in OpenGL is a slice, read-only view into an existing immutable texture storage. It need not have the same size as the original texture, for example, it could reference only a portion of the texture or a subset of the mipmap levels.