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

indexing (not working currently) #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

indexing (not working currently) #116

wants to merge 1 commit into from

Conversation

adamnemecek
Copy link
Contributor

No description provided.

Copy link
Member

@kvark kvark left a 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)
Copy link
Member

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();
Copy link
Member

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 {
Copy link
Member

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.

@kvark
Copy link
Member

kvark commented Jan 22, 2021

@adamnemecek ping. Are you interested to land this one day?

@adamnemecek
Copy link
Contributor Author

I’ll revisit this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants