Skip to content

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)

@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.

parameters: {},
parent: null,
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?

chrisgervang and others added 2 commits June 15, 2024 10:18
Co-authored-by: Xiaoji Chen <[email protected]>
Co-authored-by: Xiaoji Chen <[email protected]>
@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.

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 <[email protected]>
@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.

@chrisgervang
Copy link
Collaborator Author

@ibgreen where did we land on this API in luma? I can update this to reflect the latest for 9.1

@ibgreen ibgreen marked this pull request as ready for review December 21, 2024 20:32
@ibgreen
Copy link
Collaborator

ibgreen commented Dec 21, 2024

@ibgreen where did we land on this API in luma? I can update this to reflect the latest for 9.1

Just updated the PR to reflect the latest.

Another noteworthy change that is coming is that luma,gl device now takes createCanvasContext prop with subprops that overlap deck.gl canvas, parent etc. There may need to be some testing to see if both paths work, and perhaps some alignment on the deck side.

While this fiddling with device creation props does take effort and may seem like bikeshedding, the exciting goal here is that on WebGPU we will eventually be able to make deck.gl work with multiple canvases using a single device! So these API changes are worthwhile (we are not just rearranging the deck chairs, so to speak).

@ibgreen ibgreen merged commit f36b2ff into master Dec 21, 2024
2 checks passed
@ibgreen ibgreen deleted the chr/device-props-docs branch December 21, 2024 20:40
@@ -0,0 +1,48 @@
import {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey @ibgreen I think a bunch of files in /typed accidentally made it in here. Was that intentional?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @ibgreen I think a bunch of files in /typed accidentally made it in here. Was that intentional?

Oh no, what a mess...

We need to revert and reapply;

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'm about to push up a revert

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

5 participants