Comments (6)
Can you detail more with WGSL code what the requested feature is? Right now it almost seems like a question about the Rust WebGPU API in wgpu-rs but since you added the WGSL tag maybe it's not that.
from gpuweb.
I confirm it is all about wgsl syntax.
For example, this struct:
struct Modifier {
translation:Option<TranslationParameters>,
rotation:Option<RotationParameters>
}
This is an example which comes to my mind: with an optional field, you don't have to dig into parameters.
from gpuweb.
There is no Option in WGSL. You need to represent it yourself, e.g.:
struct Modifier {
translation: TranslationParameters,
rotation: RotationParameters,
has_translation: bool,
has_rotation: bool,
}
from gpuweb.
Yes, but do you plan to implement such a feature in the future ?
from gpuweb.
Most likely not directly. In Rust Option
is part of the standard library, and uses lots of features that WGSL doesn't have like generics. There are discussions about maybe adding generics one day but that's very far in the future. Tentatively closing this as not planned.
from gpuweb.
ptr<...>
acts like a generic, so I was expecting option<...>
could be a valuable feature.
I hope this will be the preferred option ;-) instead of NULL.
from gpuweb.
Related Issues (20)
- writing to storage buffers/textures in fragment shaders with multisample targets is not portable. HOT 5
- Should copyExternalImageToTexture allow a slice of a 3d texture as a destination? HOT 4
- Recursive structs? HOT 5
- Support for 3D Textures with ASTC HOT 2
- WGSL API proposal: shaderLog HOT 6
- Consider moving sliced 3D compressed BC texture to an extension. HOT 16
- Define conversion from GPUColor to texture format
- bgra8unorm storage textures without bgra8unorm-storage, should generate WGSL error? HOT 1
- Mistake in recursive decent parser definition? HOT 1
- Clarify that create*PipelineAsync must not generate a validation error HOT 5
- Compatibility Mode: Support OpenGLES devices with zero SSBOs and image uniforms in vertex, fragment stages HOT 9
- Should the definition of "isFiltering" be more explicit?
- Should invalid combinations of storage texture formats and access generate a WGSL error HOT 8
- Depth Bias does not affect line and point primitives. HOT 2
- Compat: Should requesting compat mode on a device that supports core, return core or compat? HOT 1
- Add `subgroups-f16` feature dependency validation to subgroups proposal? HOT 1
- Clarify the timeline of execution of create*PipelineAsync HOT 1
- Implementation Status Page Status Clarification
- clarify stage restrictions for IO attributes: restrictions are scoped to uses as IO/attributes: on params and returns of entry points
- WebGPU and WGSL W3C Working Drafts on Chrome desktop consume way too much RAM: up to 542 MB HOT 4
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 gpuweb.