-
Notifications
You must be signed in to change notification settings - Fork 550
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
The new shader parameter system #116
Conversation
…type, switched ShaderParam to use generics where needed.
This is awesome. |
@@ -1,17 +1,24 @@ | |||
#![feature(phase)] | |||
#![crate_name = "triangle"] | |||
|
|||
#[phase(link, plugin)] | |||
#[phase(plugin)] | |||
extern crate macro; |
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.
Seeing this example, it could be named gfx_macros
or similar, to avoid confusion...
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 know, right? Fixed now.
r+ |
impl<'a> MetaSink<'a> { | ||
/// Creates a new wrapper | ||
pub fn new(meta: &'a dev::ProgramMeta) -> MetaSink<'a> { | ||
assert_eq!(0, meta.uniforms.len()>>(8*size_of::<MaskUniform>())); |
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.
Could these be debug_assert!(0 == ...)
?
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 thought about it, but then figured - it's not really a big cost for the run-time, since it's only done during initialization.
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.
Even so it can prevent inlining due to generating a lot of code (it turns into a conditional with a fail!()
and some complex formatting).
The new shader parameter system
116: Validation bits from 0.2 r=kvark a=kvark Sibling of gfx-rs#114 Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Closes #19