-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Handle unallocated GPU memory for mesh extraction #20112
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1098,7 +1098,11 @@ impl RenderMeshInstanceGpuBuilder { | |
mesh_vertex_slice.range.start, | ||
mesh_vertex_slice.range.end - mesh_vertex_slice.range.start, | ||
), | ||
None => (0, 0), | ||
None => { | ||
// GPU memory for this mesh hasn't been allocated yet. Retry next frame. | ||
meshes_to_reextract_next_frame.insert(entity); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is the fix, we might need to do the same for the I'm unsure why it previously didn't return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, thinking about this more, no, we shouldn't do this for the index_slice because not having indices is a valid case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a case where vertex_slice is ready, but not index_slice? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For non indexed meshes index_slice will never be ready. I'm not sure it's possible for an indexed mesh to not have the index_slice ready. AFAIK they are allocated together but I could be wrong. |
||
return None; | ||
} | ||
}; | ||
let (mesh_is_indexed, first_index_index, index_count) = | ||
match mesh_allocator.mesh_index_slice(&self.shared.mesh_asset_id) { | ||
|
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.
What cases will this occur?
We don't want to end up in an infinite retry loop for failed meshes.
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.
I'm not sure there's a way to detect this here? With that said it's also possible this reextract thing should happen somewhere else and not here.
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.
I really don't like that this is an Option: a Result would have a lot clearer semantics to me.