Bug 191794 - [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
Summary: [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Fan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-16 16:41 PST by Justin Fan
Modified: 2018-11-26 09:56 PST (History)
3 users (show)

See Also:


Attachments
Patch (64.65 KB, patch)
2018-11-16 17:01 PST, Justin Fan
dino: review+
justin_fan: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2018-11-16 16:41:54 PST
[WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
Comment 1 Justin Fan 2018-11-16 17:01:47 PST
Created attachment 355163 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2018-11-16 17:27:32 PST
<rdar://problem/46144874>
Comment 3 Dean Jackson 2018-11-19 14:54:26 PST
Comment on attachment 355163 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=355163&action=review

> Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h:40
> +std::optional<PlatformTextureFormat> convertAndValidate(GPUTextureFormatEnum);

I'm not sure I like this in the WebCore namespace. Do we need it in more than one place? i.e. can it be file static?

It seems it is only used in GPUSwapChainMetal, so I think it can live there for the moment.

> Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl:33
> +    "R8G8B8A8Unorm",
> +    "R8G8B8A8Uint",
> +    "B8G8R8A8Unorm",
> +    "D32FloatS8Uint"

Ugh. I wonder if WebGPU should use better names here. Or maybe those are the names everyone expects?
Comment 4 Dean Jackson 2018-11-19 14:54:45 PST
I might make the small changes and land this patch.
Comment 5 Jon Lee 2018-11-19 15:30:12 PST
Comment on attachment 355163 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=355163&action=review

>> Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl:33
>> +    "D32FloatS8Uint"
> 
> Ugh. I wonder if WebGPU should use better names here. Or maybe those are the names everyone expects?

I think so.
https://docs.rs/vulkano/0.7/vulkano/format/index.html
https://docs.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format
Comment 6 Dean Jackson 2018-11-19 15:34:26 PST
Committed r238382: <https://trac.webkit.org/changeset/238382>
Comment 7 Dean Jackson 2018-11-19 15:38:39 PST
(In reply to Jon Lee from comment #5)
> Comment on attachment 355163 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=355163&action=review
> 
> >> Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl:33
> >> +    "D32FloatS8Uint"
> > 
> > Ugh. I wonder if WebGPU should use better names here. Or maybe those are the names everyone expects?
> 
> I think so.
> https://docs.rs/vulkano/0.7/vulkano/format/index.html
> https://docs.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-
> dxgiformat-dxgi_format

OK! Metal seems to make them a little nicer, in that R8G8B8A8 -> RGBA8, but I guess it doesn't matter.