mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Return the proper texture format for GetPreferredCanvasFormat (#37073)
This follows firefox's implementation:
24d49101ce/dom/webgpu/Instance.h (L68)
It changes the default on most systems to `Bgra8Unorm` but leaves it as
`Rgba8Unorm` on android.
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
cdf5fdd2b4
commit
1d9204b4b1
1 changed files with 6 additions and 2 deletions
|
@ -86,8 +86,12 @@ impl GPUMethods<crate::DomTypeHolder> for GPU {
|
|||
|
||||
/// <https://gpuweb.github.io/gpuweb/#dom-gpu-getpreferredcanvasformat>
|
||||
fn GetPreferredCanvasFormat(&self) -> GPUTextureFormat {
|
||||
// TODO: real implementation
|
||||
GPUTextureFormat::Rgba8unorm
|
||||
// From https://github.com/mozilla-firefox/firefox/blob/24d49101ce17b78c3ba1217d00297fe2891be6b3/dom/webgpu/Instance.h#L68
|
||||
if cfg!(target_os = "android") {
|
||||
GPUTextureFormat::Rgba8unorm
|
||||
} else {
|
||||
GPUTextureFormat::Bgra8unorm
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://www.w3.org/TR/webgpu/#dom-gpu-wgsllanguagefeatures>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue