-
Notifications
You must be signed in to change notification settings - Fork 316
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
Investigate copying between textures with different formats. #842
Comments
However, one can create a texture view of a different format, and use it for copy. The problem here is the hit on #744, i.e. either source or destination need to have Another alternative on Metal is copying through an intermediate buffer. This is what Vulkan Portability does in the absense of better options. Since we have an option to shape the API, we shouldn't make this path mandatory (i.e. the user can always do this themselves). |
Only if the source and destination have "different component layouts". |
I did some explore about this before. And in vulkan and d3d12, there are compatible rules for texture copy(The final result is that if the texture format has the same component layout, vulkan and d3d12 support them copy to each other). But as @kvark said, Metal has a very strict rules on texture copy. And the only way to bypass this rule is adding And another thing is that the compatible rules need to be 'valid', which means developer can get the correct result with the different dest texture format. From my view, I think the 'valid' pairs to copy to each other is the format that has same component layout but are unorm<-->uint<-->unorm-srgb. Because they have the same contents but different interpreter in shader. But I'm not sure something like copy from rgba16uint to rgba16float is 'valid' or copy from one compress format to another different compress format is 'valid'. |
If we are adding viewFormats in #811 anyway, can we just say you can copy between two textures if they have any overlap in their viewFormats? |
I'm leaving this open for copies between different formats with a view-reinterpretation flag or viewFormats list.
|
The [[interpolate]] attribute can only be used with user-defined IO.
Currently the spec requires texture to texture copies to be between textures with the same format:
However Vulkan allows copying between texture that have "size-compatible" formats (except depth-stencil formats) and I suspect other APIs allow that too. We should investigate if WebGPU can gain that additional flexibility too.
The text was updated successfully, but these errors were encountered: