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

Bump the index/vertex cpu-side buffer sizes a little. #17394

Merged
merged 2 commits into from
May 3, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented May 2, 2023

Replaces #17387

May help fix one of the crashes in #17364

@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label May 2, 2023
@hrydgard hrydgard added this to the v1.15.1 milestone May 2, 2023
Comment on lines 33 to 34
// int maxVerts = DECODED_VERTEX_BUFFER_SIZE / 2 / vertexSize; =~ 54000
// 65536 * 6 * 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could delete this part, I think it's just for the old values.

-[Unknown]

DECODED_VERTEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 64,
DECODED_INDEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 16,
DECODED_VERTEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 2 * 36, // 36 == sizeof(SimpleVertex)
DECODED_INDEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 6 * 6 * 2, // * 6 for spline tessellation, then * 6 again for converting into points/lines, and * 2 for 2 bytes per index
Copy link
Collaborator

Choose a reason for hiding this comment

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

So 4.5MB each, from previously 4MB + 1MB. I think it's worth the increase in memory of 4MB more. Most will hopefully not be committed anyway.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm realizing also that the index buffer here is likely now oversized because if we tessellate splines to the extreme and then convert to lines, we'll run out of vertex space first. Though this didn't happen in the crash.. Oh well. I think we can spare the memory, and then be more systematic about it like a better version of the other change in the next version.

@hrydgard
Copy link
Owner Author

hrydgard commented May 3, 2023

Going with this one and bumping the other to 1.16.

@hrydgard hrydgard merged commit 1d8e549 into master May 3, 2023
@hrydgard hrydgard deleted the vbuffer-ibuffer-sizes branch May 3, 2023 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants