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

docs(core) replace glOptions with deviceProps #8945

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chrisgervang
Copy link
Collaborator

Closes #8896

Background

glOptions was removed in v9 and replaced by deviceProps.

Change List

  • removes glOptions (this has not been functional since v9)
  • docs for device and deviceProps
  • upgrade guide
  • type as deviceProps: WebGLDeviceProps | WebGPUDeviceProps (need to update luma)

Signed-off-by: Chris Gervang <chris@gervang.com>
@coveralls
Copy link

Coverage Status

coverage: 89.671% (-0.001%) from 89.672%
when pulling c4c2139 on chr/device-props-docs
into 9351848 on master.

@@ -248,7 +246,6 @@ const defaultProps = {
device: null,
deviceProps: {type: 'webgl'} as DeviceProps,
Copy link
Collaborator

@Pessimistress Pessimistress Jun 11, 2024

Choose a reason for hiding this comment

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

This will not provide any type hint for WebGL context options. Should be something like this?

DeviceProps & (
  ({type: 'webgl'} & WebGLContextAttributes)
  | {type?: 'webgpu'}
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

You may want to specify preserveDrawingBuffer even when omitting Device type or using type: 'best-available'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is type optional? What happens when someone doesn't specify the type on deviceProps, and let's deck define the device?

What will luma.createDevice do by default in deck? I think deck only registers a WebGLDevice in this logic but it's just a little unclear reading the code whether type is required, and if not, what that implies in deck?

docs/api-reference/core/deck.md Outdated Show resolved Hide resolved
docs/api-reference/core/deck.md Outdated Show resolved Hide resolved
chrisgervang and others added 2 commits June 15, 2024 10:18
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
@coveralls
Copy link

Coverage Status

coverage: 89.562% (-0.1%) from 89.672%
when pulling cdd6454 on chr/device-props-docs
into 9351848 on master.

@coveralls
Copy link

Coverage Status

coverage: 89.562% (-0.1%) from 89.672%
when pulling cdd6454 on chr/device-props-docs
into 9351848 on master.

@@ -83,7 +83,7 @@ function App() {
initialViewState={INITIAL_VIEW_STATE}
controller={true}
onWebGLInitialized={setGLContext}
glOptions={{stencil: true}}
deviceProps={{type: 'webgl', stencil: true}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

User's can forget to add type: 'webgl'. Any problem with deck adding it by default if the user hasn't specified? Also technically if the user provides type here it's a luma CreateDeviceProps instead of DeviceProps

@coveralls
Copy link

Coverage Status

coverage: 89.404%. remained the same
when pulling 8d4d4b3 on chr/device-props-docs
into 537f80b on master.

Signed-off-by: Chris Gervang <chris@gervang.com>
@coveralls
Copy link

Coverage Status

coverage: 89.252% (-0.2%) from 89.404%
when pulling 23a76b1 on chr/device-props-docs
into 537f80b on master.

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.

[Bug] html2canvas Fails with preserveDrawingBuffer: true in deck.gl
4 participants