-
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
indexing (not working currently) #116
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you!
.object_at(0) | ||
.unwrap() | ||
.color_attachments()[0] | ||
// .object_at(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.
let's clean up all these comments
.set_pixel_format(MTLPixelFormat::BGRA8Unorm); | ||
|
||
device | ||
.new_render_pipeline_state(&pipeline_state_descriptor) | ||
.unwrap() | ||
} | ||
|
||
fn ppd(desc: &mut RenderPassDescriptorRef) { | ||
// let color_attachment = &desc.color_attachments()[0]; | ||
desc.color_attachments()[0] = desc.color_attachments()[0].to_owned(); |
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.
We can live with the fact this doesn't work. It doesn't have to be provided - users can still do set_object_at
, right?
|
||
pub fn set_object_at(&self, index: usize, buffer_desc: Option<&AttributeDescriptorRef>) { | ||
unsafe { msg_send![self, setObject:buffer_desc atIndexedSubscript:index] } | ||
impl std::ops::IndexMut<NSUInteger> for AttributeDescriptorArrayRef { |
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.
It seems to me that this isn't actually needed. Today, metal-rs doesn't enforce thread guarantees (unfortunately!) so all the methods are &self
. Therefore, there isn't a case where we'd need &mut self
.
In the future, it will definitely be desired to make us properly Send/Sync/Clone/&mut, but this is out of scope of this PR.
@adamnemecek ping. Are you interested to land this one day? |
I’ll revisit this. |
No description provided.