-
Notifications
You must be signed in to change notification settings - Fork 543
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
Remove Bytes
enum from ShaderSource
#359
Comments
I'm not sure what exactly is supposed to change here. I thought we had the |
@Kimundi We don't need to send it now, so we can instead just have a |
Since the Device isn't behind a task anymore, these don't need to be owned ever. Closes gfx-rs#359
How could I adapt my function to this change? I get lifetime error if I try to give fn load_shader_source(filename: &str) -> IoResult<gfx::ShaderSource> {
let mut f = match File::open(&Path::new(filename)) {
Err(why) => panic!("Could not open {}: {}", filename, why.desc),
Ok(file) => file
};
let mut src = match f.read_to_string() {
Err(why) => panic!("Could not read shader from {}: {}", filename, why.desc),
Ok(src) => src
};
Ok(gfx::ShaderSource {
glsl_120: None,
glsl_130: None,
glsl_140: None,
glsl_150: Some(gfx::OwnedBytes(src.into_bytes()))
})
} |
@gaudecker it's not going to be a one liner for you. As far as I see, you want to (reasonably) detach the shader code reading from shader creation, in which case there needs to be some sort of container with owned data (provided by you). The simplest you could do is to return a |
@gaudecker ooh - you are making this? https://github.com/gaudecker/rust-theft-auto |
359: Make examples work again r=kvark a=GabrielMajeri This PR fixes the C example code to not crash and actually run. I've also added a few assertions to ensure a warning is emitted next time somebody forgots to increase `max_bind_groups` to something non-zero on device creation. To help with debugging the examples, I've configured CMake to include debug info in the builds. Some new Makefile targets for the examples have been added to automate running them. Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
http://www.rust-ci.org/gfx-rs/gfx-rs/doc/device/shade/type.Bytes.html
It was needed when we had an explicit task boundary. No need to wrap owned stuff now.
As a bonus, make sure
shaders!
macro accepts a trailing comma in the parameters.cc @Kimundi
The text was updated successfully, but these errors were encountered: