sokol
sokol copied to clipboard
Resource views update 2
NOTE: Postpone the rest of the implementation until an actual use case pop up.
...postpone the following things into a separate update to not delay the first resource view update too much:
Implemented in https://github.com/floooh/sokol/pull/1328:
- [x] clarify/fix image and view slice counts:
- [x] SG_IMAGETYPE_2D: exactly 1 slice
- [x] SG_IMAGETYPE_CUBE: exactly 6 slices
- [x] SG_IMAGETYPE_ARRAY: 1..N slices
- [x] SG_IMAGETYPE_3D: exactly 1 slice
- [x] validate: if slice count is given in image and view creation, they must be one of the above
- [x] get rid of the idea of separate 'cubemap faces', these are slices!
To be implemented in https://github.com/floooh/sokol/pull/1330:
- [x] make the max-bindings-per-stage constants a runtime limit (well, still keep the max-constants, but make them private and 'big enough') - also max-color-attachments!
Todo:
- [ ] image views can 'cast' to a different compatible pixel format (this requires to extend
sg_image_descby aview_pixel_formats[]array because at least WebGPU needs to know the potential view pixel formats at texture creation time - [ ] also allow to create a view as a different image type(?)
- [ ] clarify/fix rendering/resolve to depth slice (allow a non-zero slice) (note: at least the d3d11 backend allows this, was this a GL limitation?)
- [ ] maybe: make the hardwired 256 alignment for storage buffer offsets dynamic (really not sure about that yet since it requires to explicitly request the limit on WebGPU device creation)