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

bug: GPUCanvasContext.configure() crash with when alphaMode or usage is set #22446

Closed
FuriouZz opened this issue Feb 17, 2024 · 5 comments
Closed
Labels
bug Something isn't working correctly webgpu WebGPU API

Comments

@FuriouZz
Copy link

Version: Deno 1.40.5

With the recent annoucement of BYOW, I created an project to run a three.js application with deno_sdl2.

I noticed that GPUCanvasContext.configure() is quite different that the one described on MDN documentation.

width and height

width and height properties are required

alphaMode

alphaMode accepts "opaque" and "premultiplied" but only "opaque" works.

An error occured when "premultiplied" is set:

TypeError: unknown variant 'premultiplied', expected one of 'auto', 'opaque', 'preMultiplied', 'postMultiplied', 'inherit'

And I got another error if I set "preMultiplied":

TypeError: [object Object]: The provided value 'preMultiplied' is not a valid enum value of type GPUCanvasAlphaMode.

I checked wgpu-types and "preMultiplied" is expected.

Maybe a map from "premultiplied" to "preMultiplied" is required?

usage

usage crash when different than GPUTextureUsage.RENDER_ATTACHMENT (threejs use GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC):

Error: Surface is not configured for presentation
@littledivy littledivy added bug Something isn't working correctly webgpu WebGPU API labels Feb 17, 2024
@littledivy
Copy link
Member

The premultipled casing is fixed upstream. gfx-rs/wgpu#4940.

@Jamesernator
Copy link

Jamesernator commented Apr 22, 2024

Error: Surface is not configured for presentation

I'm getting this error also, though it doesn't seem to be related to usage for me. Rather if I use the default adapter (i.e. the intel integrated gpu) then this error happens but using the high-performance adapter (nividia gpu) then this error goes away.

@lucacasonato
Copy link
Member

This should now be fixed.

@okoibraun
Copy link

okoibraun commented Jun 8, 2024 via email

@lucacasonato
Copy link
Member

lucacasonato commented Jun 8, 2024

Oh, actually nope this is still broken. The correct value is preMultiplied. This should be fixed by just updating wgpu (cc @crowlKats). Sorry for the noise.

Sorry, wrong again. It does seem to be fixed. The correct value is premultiplied (all lowercase).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly webgpu WebGPU API
Projects
None yet
Development

No branches or pull requests

5 participants