Add view_formats in TextureDescriptor#3237
Conversation
735a35f to
bf9c1c6
Compare
Codecov Report
@@ Coverage Diff @@
## master #3237 +/- ##
==========================================
- Coverage 64.64% 64.63% -0.01%
==========================================
Files 86 86
Lines 42722 42768 +46
==========================================
+ Hits 27616 27645 +29
- Misses 15106 15123 +17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Could the deno webgpu part be implemented fully/properly? |
There was a problem hiding this comment.
Thank you for tackling this one!
The code is fine, but there are two extra parts we need (besides the deno stuff).
First can you add a test to make sure the feature works (read a unorm texture as srgb and validate it does the conversion - and vise versa)
We also need a downlevel feature for this, as gles doesn't support texture views. And afaik we can't polyfill this feature in any way.
|
@crowlKats I'm sorry, I don't know how to properly implement view_formats in deno_webgpu. deno_webgpu's |
|
no, its slightly more than just that. but no worries, i will do it then |
f4dd6fc to
45ea4ca
Compare
0ce9099 to
6fde981
Compare
6fde981 to
577a492
Compare
|
Hi! I'm just a random user of wgpu, so take this whole comment with a grain of salt. Proper sRGB support in the webgpu backend of wgpu is blocked on specifying the view format of the Surface's current_texture (the swapchain image). In webgpu, this is done by setting GPUCanvasConfiguration.viewFormats to the formats you'd like to view the current_texture as, then specifying that format in create_view. (I guess this GPUCanvasConfiguration.viewFormats field is a sort of backdoor to pass in view_formats into the system's internal create_texture for the current_texture?) https://www.w3.org/TR/webgpu/#canvas-configuration In wgpu, the GPUCanvasConfiguration is created here, and I suppose Lines 1037 to 1041 in aa46e82 I suppose SurfaceConfiguration should get a new If you could implement this in this PR or a followup, that would be amazing, but please ping me if you don't plan on doing so and I can try looking into implementing it! |
|
The implementation of this PR is not yet accepted and may need to be modified. I have plans to implement |
cwfitzgerald
left a comment
There was a problem hiding this comment.
Another round, we're very close!
d9db149 to
5cd7541
Compare
cwfitzgerald
left a comment
There was a problem hiding this comment.
Really good stuff, we're almost ready to go!
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
9550278 to
247dc5c
Compare
1c274a2 to
8bbccdd
Compare
|
Thank you for all the hard work! |
Checklist
cargo clippy.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknownif applicable.Connections
WebGPU spec: https://www.w3.org/TR/webgpu/#dom-gputexturedescriptor-viewformats
Description
Closes #3030
Testing
Tested on Metal, Vulkan(--features vulkan-portability) and Dx12 backend.