-
Notifications
You must be signed in to change notification settings - Fork 111
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
Finish up the implementation of Binary Archives #207
Conversation
Specfically, if I create a new pipeline function like: pub fn new_render_pipeline_state_with_fail_on_binary_archive_miss(
&self,
descriptor: &RenderPipelineDescriptorRef,
) -> Result<RenderPipelineState, String> {
unsafe {
let pipeline_options =
MTLPipelineOption::FailOnBinaryArchiveMiss;
let pipeline_state: *mut MTLRenderPipelineState = try_objc! { err =>
msg_send![self, newRenderPipelineStateWithDescriptor:descriptor
options:pipeline_options
error:&mut err]
};
Ok(RenderPipelineState::from_ptr(pipeline_state))
}
} and use that, the example crashes with:
I'm installing XCode now to see if that'll give me any more hints. |
Hmm, while running it with XCode I get a different error when
This doesn't happen when running normally with Seems to be the same error as https://developer.apple.com/forums/thread/672049. |
This is working now, so we can probably go ahead and merge this! |
As mentioned in gfx-rs/gfx#3716 (comment), we can use
MTLBinaryArchive
s to cache pipelines to disk. This feature was really not clear to me, and seems to be best documented in the WWDC 2020 video Build GPU Binaries with Metal.Binary Archives were partially implemented, but could not be used so this PR adds that functionality. I modified the circle example to use one but it's possible that making a new example would make more sense. I've tested that the binary archive is indeed written to with the write format,
but I've had some trouble creating a pipeline with.MTLPipelineOption::FailOnBinaryArchiveMiss
to check that they're loaded okay