Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare sokol-shdc for storage buffer support. #120

Merged
merged 121 commits into from
May 9, 2024
Merged

Conversation

floooh
Copy link
Owner

@floooh floooh commented Mar 18, 2024

...which then actually turned into a major refactoring...

Related sokol PR: floooh/sokol#1007

TODO:

  • reflection for depth textures is broken
  • update documentation
  • update changelog
  • fix gl storage buffer bind offset in fragment shader (needs to start at bind slot 8)
  • test via sokol-samples:
    • macOS + Metal
    • macOS + GL
    • iOS + Metal
    • iOS + GL
    • Windows + D3D11
    • Windows + GL
      • reset state cache fails after clear buffer bindings (too many storage buffer bind slots?) => fails at bind index 16
      • ...check if binding fragment storage buffer works (e.g. sokol-shdc uses the right offset, bind slot base must be 0 for vertex and 8 for fragment stage)
    • Linux + GL
    • Android + GL
    • web + WebGL2
    • web + WebGPU
  • fix error lines being off-by-2 (or sometimes off-by-1)
  • only allow readonly storage buffers (for now)
  • fix storage buffer struct alignment (can be 4, 8, 12 or 16) => just use the 'outer' struct size as alignment
  • cannot use struct size as alignment since alignment must be a power of two (error: requested alignment is not a power of 2)
  • refactor generators:
    • C
      • ifdef IMPL
      • remove DECL
    • Zig
    • Nim
    • Rust
    • Odin
    • Bare
    • BareYaml
  • get storage buffer readonly reflection flag
  • fix sdhc crash #104
  • restrict storage buffer interior to a single struct flexible array
  • reflect that single toplevel struct
  • recursively mark all matrixes in storage buffers as col-major this whole col-major patching does in fact nothing and has been removed
  • fix GL codegen error for cgltf-sapp sample: VALIDATE_SHADERDESC_UB_SIZE_MISMATCH: size of uniform block members doesn't match uniform block size
  • bring generators uptodate (storage buffers etc):
    • C
    • Zig
    • Nim
    • Rust
    • Odin
    • Bare
    • BareYaml
  • fix build.zig

@floooh floooh marked this pull request as ready for review May 4, 2024 15:28
@floooh floooh merged commit 2cac6cf into master May 9, 2024
6 checks passed
@floooh floooh deleted the storage-buffers branch May 9, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant