-
Notifications
You must be signed in to change notification settings - Fork 45
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
Remove DeviceLost status from WGPUSurfaceGetCurrentTextureStatus #397
Conversation
We didn't discuss which status we would use for this but "Lost" makes sense. Issue webgpu-native#209
Technically the connection to the X server being severed, and the device being lost are two different things. But IDK that an application can usefully handle one while not handling the other so LGTM. |
176d1bb
to
ea73652
Compare
I just realized... in JS if you getCurrentTexture on a lost device, you just get an invalid texture (well, a texture that you can't observe is valid, because the device is lost). That is probably needs to be done here, to match - it's not exactly possible in JS or on remoting implementations to do what I wrote here, because you don't know synchronously when the device is lost. Hopefully this isn't a problem for non-remoting native.... Revised. |
doc/articles/Surfaces.md
Outdated
@@ -242,8 +242,8 @@ The behavior of `::wgpuSurfaceGetCurrentTexture``(surface, surfaceTexture)` is: | |||
- Validate that `surface.config` is not `None`. | |||
- Validate that `surface.currentFrame` is `None`. | |||
|
|||
- If `surface.config.device` is not alive, set `surfaceTexture->status` to `WGPUSurfaceGetCurrentTextureStatus_DeviceLost` and return. | |||
- If the implementation detects any other problem preventing use of the surface, set `surfaceTexture->status` to an appropriate status (something other than `SuccessOptimal`, `SuccessSuboptimal`, `Error`, or `DeviceLost`) and return. | |||
- If `surface.config.device` is not alive, set `surfaceTexture->status` to `WGPUSurfaceGetCurrentTextureStatus_Success`, set `surfaceTexture->texture` to a new invalid `WGPUTexture`, and return. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still have the correct reflection on that texture.
We didn't discuss which status we would use for this, but "Lost" seems to makes sense.This should behave like JS where we pretend it worked by returning a texture, but you can't use it because the device is lost.
Issue #209