Skip to content

GL_ASSERTIONS: check for MAX_TEMP_BUFFER_SIZE#26098

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
caiiiycuk:patch-8
Jan 17, 2026
Merged

GL_ASSERTIONS: check for MAX_TEMP_BUFFER_SIZE#26098
sbc100 merged 1 commit intoemscripten-core:mainfrom
caiiiycuk:patch-8

Conversation

@caiiiycuk
Copy link
Contributor

This always happens to me, if you specify not enough MAX_TEMP_BUFFER_SIZE, then you will have non clear error in runtime. With this PR in GL_ASSERTIONS mode, you will have a clean message and information about really needed size of buffer.

Copy link
Collaborator

@sbc100 sbc100 Jan 13, 2026

Choose a reason for hiding this comment

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

Can this just be assert(ringbuffer, `MAX_TEMP_BUFFER_SIZE is not large enough to store a buffer of size ${sizeBytes}`);

@sbc100
Copy link
Collaborator

sbc100 commented Jan 13, 2026

Seems reasonable to me. WDYT @juj?

@caiiiycuk
Copy link
Contributor Author

caiiiycuk commented Jan 14, 2026

I also vote for using an assertion. Maybe it’s worth adding the same check for the index buffer; however, I’ve never encountered any issues with it.

@juj
Copy link
Collaborator

juj commented Jan 15, 2026

Looks good - dev asserts definitely can help improve the error message here.

@sbc100
Copy link
Collaborator

sbc100 commented Jan 15, 2026

@caiiiycuk could you update to use assert here?

@caiiiycuk
Copy link
Contributor Author

Done for vertexBuffers, assert not needed for indexBuffers because they are created by demand

@sbc100
Copy link
Collaborator

sbc100 commented Jan 16, 2026

I think you need to merge or rebase to fix the CI failures.

@caiiiycuk
Copy link
Contributor Author

Rebased

@sbc100 sbc100 merged commit 544bcaf into emscripten-core:main Jan 17, 2026
36 checks passed
inolen pushed a commit to inolen/emscripten that referenced this pull request Feb 13, 2026
This always happens to me, if you specify not enough
MAX_TEMP_BUFFER_SIZE, then you will have non clear error in runtime.
With this PR in GL_ASSERTIONS mode, you will have a clean message and
information about really needed size of buffer.
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.

3 participants

Comments