Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded Metal shader library support #1175
Conversation
kvark
approved these changes
Feb 4, 2017
| @@ -33,4 +33,4 @@ libc = "0.2" | |||
| objc = "0.1.8" | |||
| objc-foundation = "0.1" | |||
| bit-set = "0.4" | |||
| metal-rs = "0.1" | |||
| metal-rs = { git = "https://github.com/fkaa/metal-rs", rev = "5263898c2ce1fb8263653272014366eba45ef88d" } | |||
This comment has been minimized.
This comment has been minimized.
kvark
Feb 4, 2017
Member
Why do you need a git revision here?
We may just ask @fkaa to publish a new version instead.
Although, I don't mind patching this later on.
This comment has been minimized.
This comment has been minimized.
JohnColanduoni
Feb 4, 2017
Author
Member
That revision includes the merging of a pull request I recently submitted (to metal-rs) to add the binding for the newLibraryFromFile method.
I think it might be better to hold off because I plan to keep working on the metal backend which may require some more additions to the bindings, and the metal backend is not on crates.io itself at the moment, but that works too.
| @@ -150,6 +151,64 @@ impl Factory { | |||
|
|
|||
| self.device.new_depth_stencil_state(desc) | |||
| } | |||
|
|
|||
| pub fn create_library<P: AsRef<Path>> | |||
| (&mut self, | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JohnColanduoni
Feb 4, 2017
Author
Member
Sorry, I was replicating what was done elsewhere in the file (e.g. Factory::create_buffer_immutable_raw on line 226) when there was a long return type that wouldn't fit if the usual line breaking (i.e. with &mut self on the same line) wouldn't work. How should I format it?
| -> Result<ShaderLibrary, core::shade::CreateShaderError> { | ||
| use core::shade::CreateShaderError; | ||
|
|
||
| let lib = match self.device.new_library_with_file(file) { |
This comment has been minimized.
This comment has been minimized.
kvark
Feb 4, 2017
Member
nit: might as well make this expression the last one:
match self.device.new_library_with_file(file) {
Ok(lib) => ShaderLibrary { lib: lib },
Err(err) => Err(CreateShaderError::CompilationFailed(err.into())),
}
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks @JohnColanduoni ! |
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
The functions wouldn't do much good if they were private XD |
This comment has been minimized.
This comment has been minimized.
|
@homu r- |
This comment has been minimized.
This comment has been minimized.
|
@homu r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Could you squash it as well please? |
JohnColanduoni
force-pushed the
JohnColanduoni:metallib
branch
from
02fec8e
to
a50a180
Feb 4, 2017
This comment has been minimized.
This comment has been minimized.
|
@homu r- |
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
This comment has been minimized.
This comment has been minimized.
|
|
homu
added a commit
that referenced
this pull request
Feb 4, 2017
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
JohnColanduoni commentedFeb 4, 2017
Fixes #1168