Skip to content

Move preferred format queries to navigator.gpu#2771

Merged
toji merged 5 commits intomainfrom
preferred-format
May 16, 2022
Merged

Move preferred format queries to navigator.gpu#2771
toji merged 5 commits intomainfrom
preferred-format

Conversation

@toji
Copy link
Copy Markdown
Member

@toji toji commented Apr 18, 2022

Fixes #2747
(Assumes that the resolution proposed in #2747 is adopted by the group.)

Removes the need to have a canvas context in order to query a
preferred format. This should help put developers at ease that they
don't need to rebuild all their pipelines when rendering to
multiple canvases.


Preview | Diff

Fixes #2747

Removes the need to have a canvas context in order to query a
preffered format. This should help put developers at ease that they
don't need to rebuild all their pipelines when rendering to
multiple canvases.
@toji toji requested review from Kangz, kdashg and litherum April 18, 2022 18:41
@github-actions
Copy link
Copy Markdown
Contributor

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

@kainino0x
Copy link
Copy Markdown
Contributor

changes lgtm but I think I still prefer navigator.gpu.getPreferredCanvasFormat() for the reasons in #2747.

My proposal is to move preferred format out of GPUCanvasContext.getPreferredFormat(GPUAdapter) (proposal 0), to a global navigator.gpu.getPreferredCanvasFormat() (a function, for extensibility) (proposal 1). Alternatively, it could move to a GPUAdapter.getPreferredCanvasFormat() (proposal 2), but since you may use an adapter other than the one physically connected to a display, this seems mis-associated.

@toji toji force-pushed the preferred-format branch from 140397a to 344bfce Compare April 26, 2022 23:35
@github-actions
Copy link
Copy Markdown
Contributor

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

@toji toji changed the title Move preferred format queries to the adapter Move preferred format queries to navigator.gpu Apr 27, 2022
@kainino0x
Copy link
Copy Markdown
Contributor

This change was approved in the 2022-04-27 meeting.

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@toji toji merged commit fd9df84 into main May 16, 2022
@toji toji deleted the preferred-format branch May 16, 2022 21:27
juj added a commit to juj/wasm_webgpu that referenced this pull request Aug 17, 2022
…n favor of new navigator_gpu_get_preferred_canvas_format(). gpuweb/gpuweb#2771
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.

createRenderPipeline with preferred format is dependent on canvas

3 participants