Skip to content

Resurrect canvas srgb formats#2551

Draft
kainino0x wants to merge 2 commits intogpuweb:mainfrom
kainino0x:resurrect-canvas-srgb
Draft

Resurrect canvas srgb formats#2551
kainino0x wants to merge 2 commits intogpuweb:mainfrom
kainino0x:resurrect-canvas-srgb

Conversation

@kainino0x
Copy link
Copy Markdown
Contributor

@kainino0x kainino0x commented Jan 29, 2022

We just removed these in #2522 with the intent of just using viewFormat to get -srgb texture views into the canvas.

But I'm proposing adding them back because on some systems (current D3D12, Vulkan without extension), enabling srgb viewFormats are likely more costly than just returning an srgb format. Internally, it may need to be reinterpreted, but hopefully sometimes it doesn't.

Implementation cost should be small (hopefully) and this is slightly more convenient for developers also.

#2537 (reply in thread)
#2540 (comment)


Preview | Diff

@kainino0x kainino0x added for webgpu editors meeting tacit resolution candidate Editors may be able to resolve and move to tacit resolution queue labels Jan 29, 2022
@github-actions
Copy link
Copy Markdown
Contributor

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

@kainino0x kainino0x marked this pull request as ready for review February 7, 2022 23:46
@kainino0x kainino0x added tacit resolution queue Editors have agreed and intend to land if no feedback is given and removed for webgpu editors meeting tacit resolution candidate Editors may be able to resolve and move to tacit resolution queue labels Feb 7, 2022
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2022

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

@jchen10
Copy link
Copy Markdown
Contributor

jchen10 commented Feb 8, 2022

We just removed these in #2522 with the intent of just using viewFormat to get -srgb texture views into the canvas.

But I'm proposing adding them back because on some systems (current D3D12, Vulkan without extension), enabling srgb viewFormats are likely more costly than just returning an srgb format. Internally, it may need to be reinterpreted, but hopefully sometimes it doesn't.

Implementation cost should be small (hopefully) and this is slightly more convenient for developers also.

#2537 (reply in thread) #2540 (comment)

Preview | Diff

Implementation cost may not be small. As far as I know there are no "-srgb" formats in Viz yet.

@kainino0x
Copy link
Copy Markdown
Contributor Author

That's a fair point. I was thinking we could essentially start by just taking a texture view, but of course that's not possible because getCurrentTexture returns a texture.

Maybe we should postpone this change then.

@kainino0x kainino0x removed the tacit resolution queue Editors have agreed and intend to land if no feedback is given label Feb 9, 2022
@kainino0x kainino0x added this to the post-V1 milestone Feb 9, 2022
@kainino0x kainino0x marked this pull request as draft August 25, 2022 01:26
@kainino0x kainino0x added the api WebGPU API label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api WebGPU API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants