-
Notifications
You must be signed in to change notification settings - Fork 346
Optional clear values #276
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
Conversation
|
Dictionary members are always optional by default if they don't have |
kainino0x
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add some text explaining this.
spec/index.bs
Outdated
| required GPUTextureView attachment; | ||
| GPUTextureView? resolveTarget = null; | ||
|
|
||
| required GPULoadOp loadOp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely spotted!
|
@kainino0x thanks for the quick review! PTAL |
Kangz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well, I'm just not sure how this translates to a C API but that's not the forum.
|
But hey, it translates into a beautiful ADT in rust :) |
kdashg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this simplification, but even still it seems gross to me.
|
@jdashg I'm curious what looks gross to you. Is it the optionals being simple types like |
|
I feel the same way a tiny bit, because it's not immediately obvious that null or unspecified means "load". Null/unspecified sounds like a "nothing" operation whereas "load" is not. What if instead it were: enum GPULoadOp { "load" };
...
(GPULoadOp or GPUColor) loadValue;? Plus it leaves the enum open for future extension. |
I don't see this being the case because there is no longer any "operation" involved. If the user doesn't clear, they don't expect anything to happen (to that texture). |
|
Sort of true, but in actual hardware and modern API concepts, the load isn't considered to be "nothing" either. I wouldn't want our mental model to move away from the native APIs. |
|
I understand the concern. The pit of success is in encouraging the user to use clears where possible. In terms of API, ideally we want to express this type: enum LoadOp {
Load,
Clear(Color),
}Either the PR as it stands, or Kai's comment would at least make this non-redundant. I'm fine with either. |
|
Discussed at the 6 May 2019 teleconference. |
|
Agreement reached to proceed with Kai's suggestion. |
No description provided.