Sitelet https://github.com/gpuweb/gpuweb/pull/1930
Skip to content

Change context type to 'webgpu' - #1930

Merged
kainino0x merged 2 commits into
mainfrom
webgpu-context
Jul 14, 2021
Merged

kainino0x merged 2 commits into
mainfrom
webgpu-context

Conversation

@toji

@toji toji commented Jul 13, 2021 •

Copy link
Copy Markdown
Member

Fixes #131

Updates the relevant string and interfaces, if 'webgpu' is indeed the context type string that we go with. Given the concerns voiced in the thread about the verb 'present' or 'presentation' I also opted to revert back to GPUCanvasContext for the interface name, since that felt like it matched the new context type string a bit better. (Also, neither Firefox nor Chrome has adopted the interface name GPUPresentationContext yet so, hey! Less work!)

(Kai suggested "WebGPUCanvasContext" at some point, since it's not a GPU object in the same way that, say, a texture is. I don't mind that logic, and it would allow it to map more directly to 'webgpu', but it a distinction that probably not significant to developers and it would mean that this interface wouldn't get grouped with the others properly on, for example, pages that list interfaces alphabetically.)

Similarly I've renamed GPUPresentationConfiguration (previously GPUSwapChainDescriptor) to GPUContextConfiguration, though I'd be just as happy with GPUCanvasConfiguration or the verbose GPUCanvasContextConfiguration if anyone has strong a preference for either of those alternatives.


Preview | Diff

@toji
toji requested review from kainino0x and kvark July 13, 2021 18:58
@github-actions

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (f1f6f97):
WebGPU | IDL
WGSL
Explainer

@kvark

kvark commented Jul 13, 2021

Copy link
Copy Markdown
Contributor

Oh snap, I didn't expect us to be renaming GPUPresentationContext. I think doing so would cause more confusion. The name today is a clear indication that WebGPU uses it to present its work onto a canvas.

@toji

toji commented Jul 13, 2021

Copy link
Copy Markdown
Member Author

We certainly don't have to. I don't have a problem with the name personally. I made the change speculatively here based on comments from #131 like:

I also have a bit of trouble with "presentation" over "rendering", since as has been said elsewhere, the output canvas may not be presented to the screen (sounds even more weird for me when it's called from an OffscreenCanvas).

@kvark

kvark commented Jul 13, 2021

Copy link
Copy Markdown
Contributor

I see. The way I read "presentation context" is not "output canvas presented to screen", but rather "WebGPU can present to this canvas". Hence, I found the GPUPresentationContext to be very clear.

@toji

toji commented Jul 13, 2021

Copy link
Copy Markdown
Member Author

Yeah, that's generally how I interpreted it as well. I can understand, given some of the comments about it, how it might be understood by developers differently, though.

@kainino0x kainino0x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm totally fine either way. My opinion about the gpupresent rename carries through to this: no one is going to be confused for more than the few minutes it takes them to go search for a webgpu tutorial, which they were gonna need anyway.

GPUCanvasOutputContext would be ok too.

@kvark kvark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still think GPUPresentationContext was better, but not going to block on it.
There is another name that needs to be changed though

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (f367f23):
WebGPU | IDL
WGSL
Explainer

@kainino0x
kainino0x merged commit e86e355 into main Jul 14, 2021
@kainino0x
kainino0x deleted the webgpu-context branch July 14, 2021 01:16
github-actions Bot added a commit that referenced this pull request Jul 14, 2021
SHA: e86e355
Reason: push, by @kainino0x

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request Jul 14, 2021
SHA: e86e355
Reason: push, by @kainino0x

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request Jul 14, 2021
SHA: e86e355
Reason: push, by @kainino0x

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Define WebGPURenderingContext contextType DomString

3 participants