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

feat(core): Address feedback on BufferLayout #1799

Merged
merged 5 commits into from
Aug 26, 2023
Merged

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Aug 26, 2023

For #

Background

Change List

  • Fixes
  • API simplification
  • docs
  • test updates

docs/api-guide/attributes.md Outdated Show resolved Hide resolved
docs/api-reference/core/buffer-layout.md Outdated Show resolved Hide resolved
stepMode: bufferLayout.stepMode,
vertexFormat: bufferLayout.format,
// If offset is needed, use `attributes` field.
byteOffset: 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking of the user-supplied binary buffer case in deck.gl - does this mean we have to format bufferLayout differently depending on whether offset is 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would assume that a framework like deck.gl always uses the extended form with attributes: in which offset is available (even when only having one attribute per buffer). Of course if deck.gl exposes the bufferLayout to deck.gl end users, then users have the option of using the short form when they don't need any customization. i.e. offsets, interleaving or custom byte strides.

At this point I am really just including format on the top level as a short-hand to make small luma examples less verbose and intimidating.

Perhaps it is better to not even offer that shorthand. But... one step at a time, this PR clears up a lot of the overlap that was causing confusion, and as long as deck is only using attributes array should be objectively better. Not hard to drop the shorthand if we find it causes more pain than it is worth.

@ibgreen ibgreen merged commit ea4bc6f into master Aug 26, 2023
1 of 2 checks passed
@ibgreen ibgreen deleted the ib/fix-buffer-layout-3 branch August 26, 2023 16:37
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.

2 participants