Repository navigation
Conversation
|
You cannot throw for an invalid configuration? |
|
We can (and I've updated the PR to do so), but there's some subtlety here that means that we may want to accept a configuration that seems "invalid" otherwise. For example, we have the If we want to communicate errors at the time of this call then throwing an error is almost certainly the right approach, it's just a question of whether or not we actually want to do that in some or all cases. |
| readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas; | ||
|
|
||
| undefined configure(GPUCanvasConfiguration configuration); | ||
| undefined unconfigure(); |
There was a problem hiding this comment.
do we still need this? I guess it's a distant relative to buffer.destroy.
Without a configure method it seems strange though. Maybe it should be called destroy?
|
I agree that it feels strange to have an explicit Viable paths I see for this:
|
|
Stating it as a foregone conclusion seems a little weird. Looking forward to the context. |
|
It's not a conclusion, since we'll track conclusions on the issue and the issue is still open; more that toji's tentative proposal in this PR is retracted by toji. |
|
Er, well, I guess we don't have a real issue open. But I guess #2416 is the one we're using to track it (it's attached to the project tracker). |
Not intended for merge!
This builds off of the commits and discussion in #2416 to help understand what it would mean to switch to using
canvas.getContext()as the context configuration mechanism. (Initially proposed in #2416 (comment))The biggest quirks that I found while drafting this:
getPreferredFormatneeds to move, andGPUAdapteris about the only logical place. This means you're getting the preferred format against aHTMLCanvasElementand not a context, which means we'd need to determine what should happen if, say, you pass a canvas which already has a2dcontext, etc.getContext()overload.getContext()again with an invalid configuration. (ie: no device or format). Return the previously valid context without change? Return null? Return the previously valid context but unconfigure? Always return a context and let errors surface ingetCurrentTexture()?unconfigure()feels a little out of place now, though I think the functionality is still needed.💥 Error: 500 Internal Server Error 💥
PR Preview failed to build. (Last tried on Feb 11, 2022, 7:29 PM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 CSS Spec Preprocessor - CSS Spec Preprocessor is the web service used to build Bikeshed specs.
🔗 Related URL
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.