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

The new shader parameter system #116

Merged
merged 20 commits into from
Jul 23, 2014
Merged

The new shader parameter system #116

merged 20 commits into from
Jul 23, 2014

Conversation

kvark
Copy link
Member

@kvark kvark commented Jul 22, 2014

Closes #19

@emberian
Copy link
Contributor

This is awesome.

@@ -1,17 +1,24 @@
#![feature(phase)]
#![crate_name = "triangle"]

#[phase(link, plugin)]
#[phase(plugin)]
extern crate macro;
Copy link
Contributor

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...

Copy link
Member Author

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.

@ghost
Copy link

ghost commented Jul 22, 2014

r+

@kvark kvark mentioned this pull request Jul 22, 2014
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>()));
Copy link
Contributor

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 == ...)?

Copy link
Member Author

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.

Copy link
Contributor

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).

emberian added a commit that referenced this pull request Jul 23, 2014
The new shader parameter system
@emberian emberian merged commit 469b17a into gfx-rs:master Jul 23, 2014
@kvark kvark deleted the plugin branch July 23, 2014 02:13
adamnemecek pushed a commit to adamnemecek/gfx that referenced this pull request Apr 1, 2021
116: Validation bits from 0.2 r=kvark a=kvark

Sibling of gfx-rs#114 

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Design the shader parameters logic
2 participants