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

Question: Can we create a linear-space views of SRGB textures or SRGB views of linear-space textures? #3030

Closed
yanchith opened this issue Sep 17, 2022 · 3 comments · Fixed by #3237
Labels
area: validation Issues related to validation, diagnostics, and error handling type: enhancement New feature or request

Comments

@yanchith
Copy link
Contributor

I have a pipeline that is SRGB aware, but after a certain point I'd like to treat it as Rgba8Unorm, because I composite UI on top, and there's colors there that users set in code, so their eye does the correction already.

Tried to achieve this with a texture that is Rgba8Unorm, but creating an Rgba8UnormSrgb write view and a Rgba8Unorm read view. Unfortunately, the validator doesn't like it much:

thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Texture::create_view
    Unable to view texture Rgba8Unorm as Rgba8UnormSrgb

Is there a reason this shouldn't be working?

@cwfitzgerald
Copy link
Member

This is supported in the spec, but we currently don't support this as no one has implemented it yet.

@yanchith
Copy link
Contributor Author

Oh, that's great to hear! I think I'll need it eventually for the engine I am working on, and I'd be happy to implement it in wgpu when that happens (can't commit to specific dates yet, sorry).

I think we can label this as a feature request, meanwhile.

@expenses
Copy link
Contributor

👍 This is needed for using a srgb TextureView for the surface on the web.

@teoxoy teoxoy added this to the WebGPU Specification V1 milestone Dec 5, 2022
@teoxoy teoxoy added type: enhancement New feature or request area: validation Issues related to validation, diagnostics, and error handling labels Dec 5, 2022
cwfitzgerald pushed a commit that referenced this issue Jan 18, 2023
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Closes #3030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Issues related to validation, diagnostics, and error handling type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants