WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
238710
[WebGPU] Implement Texture view format compatibility
https://bugs.webkit.org/show_bug.cgi?id=238710
Summary
[WebGPU] Implement Texture view format compatibility
Myles C. Maxfield
Reported
2022-04-02 23:56:24 PDT
.
Attachments
Patch
(18.47 KB, patch)
2022-04-03 00:06 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(21.38 KB, patch)
2022-04-03 00:52 PDT
,
Myles C. Maxfield
mmaxfield
: review-
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(21.25 KB, patch)
2022-04-03 23:21 PDT
,
Myles C. Maxfield
kkinnunen
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2022-04-03 00:06:16 PDT
Created
attachment 456500
[details]
Patch
Myles C. Maxfield
Comment 2
2022-04-03 00:52:00 PDT
Created
attachment 456504
[details]
Patch
Dan Glastonbury
Comment 3
2022-04-03 17:15:13 PDT
Comment on
attachment 456504
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456504&action=review
> Source/WebGPU/WebGPU/Texture.mm:1119 > + return std::nullopt;
There appears to be an inconsistency with the logic in this function. If `WGPUTextureFormat_ASTC4x4Unorm` returns `WGPUTextureFormat_ASTC4x4Unorm`, surely these should return themselves? What am I missing?
> Source/WebGPU/WebGPU/Texture.mm:1243 > + if (canonicalizedFormat1 != canonicalizedFormat1)
Comparison to self?!
Myles C. Maxfield
Comment 4
2022-04-03 23:08:26 PDT
Comment on
attachment 456504
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456504&action=review
>> Source/WebGPU/WebGPU/Texture.mm:1119 >> + return std::nullopt; > > There appears to be an inconsistency with the logic in this function. If `WGPUTextureFormat_ASTC4x4Unorm` returns `WGPUTextureFormat_ASTC4x4Unorm`, surely these should return themselves? What am I missing?
Yeah, I see what you mean. Originally, this function was intended to create equivalence classes via normalization; e.g. RGBA8Unorm and RGBA8UnormSrgb should both be members of the same equivalence class, and this function returns a representative member of that class (sort of like how union set works). ASTC4x4Unorm and ASTC4x4UnormSrgb are in the same equivalence class. I was originally thinking that formats like R8Unorm wouldn't be part of any equivalence class, so they would return nullopt here, but I can also understand where you're coming from about saying R8Unorm should be in an equivalence class of 1. I'll change the implementation to do that.
>> Source/WebGPU/WebGPU/Texture.mm:1243 >> + if (canonicalizedFormat1 != canonicalizedFormat1) > > Comparison to self?!
🤦🏻♂️
Dan Glastonbury
Comment 5
2022-04-03 23:12:38 PDT
Comment on
attachment 456504
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456504&action=review
>>> Source/WebGPU/WebGPU/Texture.mm:1119 >>> + return std::nullopt; >> >> There appears to be an inconsistency with the logic in this function. If `WGPUTextureFormat_ASTC4x4Unorm` returns `WGPUTextureFormat_ASTC4x4Unorm`, surely these should return themselves? What am I missing? > > Yeah, I see what you mean. > > Originally, this function was intended to create equivalence classes via normalization; e.g. RGBA8Unorm and RGBA8UnormSrgb should both be members of the same equivalence class, and this function returns a representative member of that class (sort of like how union set works). ASTC4x4Unorm and ASTC4x4UnormSrgb are in the same equivalence class. I was originally thinking that formats like R8Unorm wouldn't be part of any equivalence class, so they would return nullopt here, but I can also understand where you're coming from about saying R8Unorm should be in an equivalence class of 1. I'll change the implementation to do that.
And with that change this function can be `WGPUTextureFormat Text::removeSRGBSuffix(...)`
Myles C. Maxfield
Comment 6
2022-04-03 23:21:07 PDT
Created
attachment 456533
[details]
Patch
Kimmo Kinnunen
Comment 7
2022-04-07 02:35:12 PDT
Comment on
attachment 456533
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456533&action=review
> Source/WebGPU/WebGPU/Texture.mm:2255 > + bool foundFormat = descriptor.format == m_descriptor.format;
if (descriptor.format != m_descriptor.format && !m_viewFormats.contains(descriptor.format) return false;
Kimmo Kinnunen
Comment 8
2022-04-07 02:40:55 PDT
Comment on
attachment 456533
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456533&action=review
> Source/WebGPU/WebGPU/Texture.mm:2017 > + viewFormats.reserveInitialCapacity(descriptorViewFormats.viewFormatsCount);
viewFormats = Vector { descriptorViewFormats.viewFormats, descriptorViewFormats.viewFormatsCount };
Myles C. Maxfield
Comment 9
2022-04-07 12:20:20 PDT
Committed
r292552
(
249390@trunk
): <
https://commits.webkit.org/249390@trunk
>
Radar WebKit Bug Importer
Comment 10
2022-04-07 12:21:22 PDT
<
rdar://problem/91437290
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug