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

Metal: Bind index buffer with offset #96349

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

pkdawson
Copy link
Contributor

Fixes #96348

Referring to the Metal docs, indexBufferOffset is a byte offset, so p_first_index has to be converted.

@akien-mga akien-mga added this to the 4.4 milestone Aug 30, 2024
@akien-mga akien-mga changed the title Metal: bind index buffer with offset Metal: Bind index buffer with offset Aug 30, 2024
@akien-mga
Copy link
Member

CC @stuartcarnie

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh great find – thank you!

@stuartcarnie
Copy link
Contributor

I tested and confirmed it works. Thanks @pkdawson!

@stuartcarnie
Copy link
Contributor

I did notice a separate issue that the frame buffer and attachment formats do not match, which crash when enabling Metal validation. The fix was to update your script, when creating the render pipeline:

		RD.framebuffer_get_format(framebuffer),

vs

		RD.screen_get_framebuffer_format(),

@pkdawson
Copy link
Contributor Author

Oh yeah, that's actually an issue I fixed pretty recently in my real code (Dear ImGui backend). I'm creating a framebuffer that uses RGBA, but Godot's screen format is ABGR (I think), so there's a validation error.

@akien-mga akien-mga merged commit 61598c5 into godotengine:master Aug 30, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Metal driver does not use index offset
3 participants