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

support glDrawBuffers #2530

Merged
merged 1 commit into from
Jul 17, 2014
Merged

support glDrawBuffers #2530

merged 1 commit into from
Jul 17, 2014

Conversation

Daft-Freak
Copy link
Collaborator

No description provided.

#if GL_ASSERTIONS
assert(GL.drawBuffersExt, 'Must have WEBGL_draw_buffers extension to use drawBuffers');
#endif
var bufArray = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel very depressed reading this, but seems like there is no other way to avoid dynamic memory allocation and array push here :/ If there was some way around generating garbage here, that'd be awesome..

Copy link
Member

Choose a reason for hiding this comment

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

We could reuse the same array, by assigning to indexes 0,1,2 etc. as needed (instead of push), then setting .length if it is different than the current length. Should be very fast that way.

@juj
Copy link
Collaborator

juj commented Jul 17, 2014

This looks good. We should have some form of testing for this as well.

juj added a commit that referenced this pull request Jul 17, 2014
@juj juj merged commit b03f00a into emscripten-core:incoming Jul 17, 2014
@Daft-Freak Daft-Freak deleted the drawBuffers branch January 21, 2019 15:58
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