Title: [261091] trunk
- Revision
- 261091
- Author
- [email protected]
- Date
- 2020-05-04 11:18:28 -0700 (Mon, 04 May 2020)
Log Message
Source/WebCore:
WebGPU: Textures should be able to have OUTPUT_ATTACHMENT | SAMPLED usage flags
https://bugs.webkit.org/show_bug.cgi?id=211345
<rdar://problem/62264423>
Patch by Guillem Vinals <[email protected]> on 2020-05-04
Reviewed by Myles C. Maxfield.
Added support for off-screen render targets.
Test: webgpu/textures-textureviews.html
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::mtlTextureUsageForGPUTextureUsageFlags):
LayoutTests:
WebGPU: Textures should be able to have OUTPUT_ATTACHEMENT | SAMPLED usage flags
https://bugs.webkit.org/show_bug.cgi?id=211345
Patch by Guillem Vinals <[email protected]> on 2020-05-04
Reviewed by Myles C. Maxfield.
* webgpu/textures-textureviews-expected.txt:
* webgpu/textures-textureviews.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (261090 => 261091)
--- trunk/LayoutTests/ChangeLog 2020-05-04 18:00:44 UTC (rev 261090)
+++ trunk/LayoutTests/ChangeLog 2020-05-04 18:18:28 UTC (rev 261091)
@@ -1,5 +1,15 @@
2020-05-04 Guillem Vinals <[email protected]>
+ WebGPU: Textures should be able to have OUTPUT_ATTACHEMENT | SAMPLED usage flags
+ https://bugs.webkit.org/show_bug.cgi?id=211345
+
+ Reviewed by Myles C. Maxfield.
+
+ * webgpu/textures-textureviews-expected.txt:
+ * webgpu/textures-textureviews.html:
+
+2020-05-04 Guillem Vinals <[email protected]>
+
WebGPU: copyTextureToTexture() has an implementation bug (src copy view info is used also as dst)
https://bugs.webkit.org/show_bug.cgi?id=211303
Modified: trunk/LayoutTests/webgpu/textures-textureviews-expected.txt (261090 => 261091)
--- trunk/LayoutTests/webgpu/textures-textureviews-expected.txt 2020-05-04 18:00:44 UTC (rev 261090)
+++ trunk/LayoutTests/webgpu/textures-textureviews-expected.txt 2020-05-04 18:18:28 UTC (rev 261091)
@@ -3,4 +3,5 @@
PASS Create basic depth texture from device.
PASS Create basic 4x multisampled texture.
PASS Create basic 3D texture from device.
+PASS Create a render target texture (which can be sampled) from device.
Modified: trunk/LayoutTests/webgpu/textures-textureviews.html (261090 => 261091)
--- trunk/LayoutTests/webgpu/textures-textureviews.html 2020-05-04 18:00:44 UTC (rev 261090)
+++ trunk/LayoutTests/webgpu/textures-textureviews.html 2020-05-04 18:18:28 UTC (rev 261091)
@@ -67,6 +67,19 @@
});
}, "Create basic 3D texture from device.");
+promise_test(() => {
+ return getBasicDevice().then(function(device) {
+ texDescriptor.format = "rgba8unorm";
+ texDescriptor.usage = GPUTextureUsage.OUTPUT_ATTACHMENT | GPUTextureUsage.SAMPLED;
+
+ const renderTarget = device.createTexture(texDescriptor);
+ assert_true(renderTarget instanceof GPUTexture, "Successfully created off-screen render target.");
+ const textureView = renderTarget.createDefaultView();
+ assert_true(textureView instanceof GPUTextureView, "Successfully created texture view from off-screen render target.");
+ }, function() {
+ });
+}, "Create a render target texture (which can be sampled) from device.");
+
// FIXME: Add tests for 1D textures, textureArrays, and GPUTextureViews.
</script>
</body>
Modified: trunk/Source/WebCore/ChangeLog (261090 => 261091)
--- trunk/Source/WebCore/ChangeLog 2020-05-04 18:00:44 UTC (rev 261090)
+++ trunk/Source/WebCore/ChangeLog 2020-05-04 18:18:28 UTC (rev 261091)
@@ -1,5 +1,20 @@
2020-05-04 Guillem Vinals <[email protected]>
+ WebGPU: Textures should be able to have OUTPUT_ATTACHMENT | SAMPLED usage flags
+ https://bugs.webkit.org/show_bug.cgi?id=211345
+ <rdar://problem/62264423>
+
+ Reviewed by Myles C. Maxfield.
+
+ Added support for off-screen render targets.
+
+ Test: webgpu/textures-textureviews.html
+
+ * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
+ (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
+
+2020-05-04 Guillem Vinals <[email protected]>
+
WebGPU: copyTextureToTexture() has an implementation bug (src copy view info is used also as dst)
https://bugs.webkit.org/show_bug.cgi?id=211303
Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm (261090 => 261091)
--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm 2020-05-04 18:00:44 UTC (rev 261090)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm 2020-05-04 18:18:28 UTC (rev 261091)
@@ -65,11 +65,6 @@
return WTF::nullopt;
}
- if (flags & GPUTextureUsage::Flags::OutputAttachment && flags.containsAny({ GPUTextureUsage::Flags::Storage, GPUTextureUsage::Flags::Sampled })) {
- LOG(WebGPU, "%s: Texture cannot have OUTPUT_ATTACHMENT usage with STORAGE or SAMPLED usages!", functionName);
- return WTF::nullopt;
- }
-
MTLTextureUsage result = MTLTextureUsagePixelFormatView;
if (flags.contains(GPUTextureUsage::Flags::OutputAttachment))
result |= MTLTextureUsageRenderTarget;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes