Comments (2)
So my question is, opengl/std140 is supported by encase?
std140 and WGSL's uniform alignment rules are not that different. The only difference is how matrices of the form matCx2 (matrices with 2 rows and C columns) are laid out. As long as you make sure to not use those you should be fine.
As for officially supporting std140, I don't see a way to nicely fit it in the current architecture but we can leave this issue open and see how sought after support for this would be.
If so, is this kind of structs is supported?
Yeah, but the one with the Vec would only work if it's part of an std430 storage buffer.
If you'd like support for Vec-like data structures in uniform buffers, see #10.
from encase.
Thanks for the clarification, notan is a lib so I cannot rely on the user to not use a matCx2 matrix because there could a case that they need it. But I am looking to use encase eventually for a (future) wgpu backend. Thanks!
from encase.
Related Issues (20)
- Use Encase's Layouting Independent of Uploading HOT 6
- Switch to `coverage_nightly` ? HOT 1
- How can you pad array of structures properly? HOT 2
- Allow a `Vec` newtype to be used within uniform buffers
- nalgebra support: ShaderSize is not implemented for Matrix<f32, Const<3>... HOT 10
- Provide a way to lay out structs with fields that are unknowable at compile time
- New release HOT 1
- Derived ShaderType rust-analyzer error HOT 3
- Consider updating `encase_derive_impl` to use `syn@2` HOT 3
- Provide a way to fetch whether a ShaderType is runtime sized or not HOT 2
- Consider inlining hot functions for primitives, vectors, and matricies HOT 1
- Stride of [f32; 4] fields in struct HOT 1
- Array stride in uniform address space HOT 1
- Not possible to retrieve the *aligned* written size? HOT 1
- Consider reexporting crates for which `ShaderType` are implemented HOT 3
- Specialize write_into for trivially memcpy-able types HOT 4
- Implement `ShaderType` for packed types HOT 2
- MIRI reports UB on `<Vec<u8> as ByteVecExt>::try_extend_zeroed` HOT 2
- Wrong min_size() for struct HOT 4
- Implement `ShaderType` for `u64` and `i64` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from encase.