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

add attribute resize tracking #15798

Closed
wants to merge 3 commits into from
Closed

Conversation

aardgoose
Copy link
Contributor

Untangle overloading of BufferAttribute.dynamic property, re #14730

.dynamic sets buffer usage expectations as documented.

.updateRange works as documented if dynamic = false. (currently updates entire buffer)

.setArray() and .copy() are safe to use if dynamic = true. (currently produces error)

By default gl.bufferSubData is used for updates except in resize operations.

(a flag to select update mechanism could be added if required )

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 18, 2019

I'm a bit irritated now. I always thought three.js does not allow to resize buffer attributes. If an app needs a bigger attribute buffer for some reasons, it has to create a new attribute. Or create a sufficient sized buffer in the forefront.

@aardgoose
Copy link
Contributor Author

Some developers (not myself) were resizing them it seems, which is what started the initial discussion referred to in #14730.

After the changes I added which allowed you to drop the arrays from the JS side, after the GPU had been updated ( via the onUpload() callback) - this user 'requirement' came out the woodwork resulted in dynamic flag overloading.

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 18, 2019

Does the following error message still make sense?

https://github.com/mrdoob/three.js/pull/15798/files#diff-54f00f0a09b102e7d4bffbf907becd3aR89

@aardgoose
Copy link
Contributor Author

aardgoose commented Feb 18, 2019

Nothing bad appears to happen passing an empty TypedArray in the count = 0 error case.
Tested on Chrome/FF/IE11 on Windows 10, so maybe a pointless error other than pointing to programming error elsewhere.

Maybe errors on other platforms though?

@aardgoose aardgoose closed this Sep 15, 2019
@aardgoose aardgoose deleted the attribute-flags branch August 16, 2022 19:59
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