WebKit Bugzilla
Attachment 372619 Details for
Bug 195864
: [WHLSL] read modify write expressions do no work as expected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-195864-20190621001431.patch (text/plain), 7.51 KB, created by
Myles C. Maxfield
on 2019-06-21 00:14:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2019-06-21 00:14:32 PDT
Size:
7.51 KB
patch
obsolete
>Subversion Revision: 246670 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d68b9d2940f6907bb4fa41680e9f7a7d687cb685..78049b73e296aebefea6af9addab596d2a59e4e5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-06-20 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [WHLSL] read modify write expressions do no work as expected >+ https://bugs.webkit.org/show_bug.cgi?id=195864 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Turns out https://bugs.webkit.org/show_bug.cgi?id=199037 already fixed everything. >+ This patch just adds a test. >+ >+ Test: webgpu/whlsl-read-modify-write.html >+ >+ * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: >+ > 2019-06-20 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Stop pretending WebCore::Widget can have a platform widget >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt >index 1b772921d39f61f193a7c3f3aa4fa6a4df0f5e7a..ed5dcf40d8e700b8814b6c59b47781da8c7a4248 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt >@@ -310,17 +310,6 @@ native operator float(short); > native operator float(int); > native operator float(half); > >-native float operator+(float, float); >-native float operator-(float, float); >-native int operator+(int, int); >-native uint operator+(uint, uint); >-native bool operator<(int, int); >-native bool operator<(uint, uint); >-native bool operator<(float, float); >-native bool operator==(float, float); >-native bool operator==(int, int); >-native float operator*(float, float); >- > // FIXME: These should be auto generated by the compiler. > // https://bugs.webkit.org/show_bug.cgi?id=198861 > native bool operator==(thread int*, thread int*); >@@ -755,6 +744,55 @@ operator uint2(uint x, uint y) { > return result; > } > >+native int operator+(int, int); >+native int operator-(int, int); >+native int operator*(int, int); >+native int operator/(int, int); >+native bool operator==(int, int); >+native bool operator<(int, int); >+native bool operator<=(int, int); >+native bool operator>(int, int); >+native bool operator>=(int, int); >+native uint operator+(uint, uint); >+native uint operator-(uint, uint); >+native uint operator*(uint, uint); >+native uint operator/(uint, uint); >+native bool operator==(uint, uint); >+native bool operator<(uint, uint); >+native bool operator<=(uint, uint); >+native bool operator>(uint, uint); >+native bool operator>=(uint, uint); >+ >+native float operator+(float, float); >+native float operator-(float, float); >+native float operator*(float, float); >+native float operator/(float, float); >+native bool operator==(float, float); >+native bool operator<(float, float); >+native bool operator<=(float, float); >+native bool operator>(float, float); >+native bool operator>=(float, float); >+ >+native int operator&(int, int); >+native int operator|(int, int); >+native int operator^(int, int); >+native int operator~(int); >+native int operator<<(int, uint); >+native int operator>>(int, uint); >+native uint operator&(uint, uint); >+native uint operator|(uint, uint); >+native uint operator^(uint, uint); >+native uint operator~(uint); >+native uint operator<<(uint, uint); >+native uint operator>>(uint, uint); >+ >+int operator++(int value) { >+ return value + 1; >+} >+int operator--(int value) { >+ return value - 1; >+} >+ > native ushort Sample(Texture1D<ushort>, sampler, float location); > native ushort Sample(Texture1DArray<ushort>, sampler, float2 location); > native ushort Sample(Texture2D<ushort>, sampler, float2 location); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1f9186e3fb61a7c7c7213fe7e5687f1fdd00554a..eb410fdb39bde03a88247c542a02161d30193853 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2019-06-20 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [WHLSL] read modify write expressions do no work as expected >+ https://bugs.webkit.org/show_bug.cgi?id=195864 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * webgpu/whlsl-read-modify-write.html: Added. >+ > 2019-06-20 Simon Fraser <simon.fraser@apple.com> > > Make it possible to include clipping in GraphicsLayer tree dumps >diff --git a/LayoutTests/webgpu/whlsl-read-modify-write.html b/LayoutTests/webgpu/whlsl-read-modify-write.html >new file mode 100644 >index 0000000000000000000000000000000000000000..118eaccb437ea53061ba75740a725c86194ee2e2 >--- /dev/null >+++ b/LayoutTests/webgpu/whlsl-read-modify-write.html >@@ -0,0 +1,94 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+const shaderSource = ` >+[numthreads(1, 1, 1)] >+compute void computeShader(device int[] buffer : register(u0)) { >+ buffer[0] = 1; >+ buffer[1] = buffer[0]++; >+ >+ buffer[2] = 1; >+ buffer[3] = ++buffer[2]; >+ >+ buffer[4] = 1; >+ buffer[4] += 5; >+ >+ buffer[5] = 1; >+ buffer[5] *= 7; >+ >+ int total = 14; >+ for (int i = 0; i < 10; i += 2) { >+ total += i; >+ } >+ buffer[6] = total; >+ >+ total = 14; >+ for (int i = 0; i < 10; ++i) { >+ total += i; >+ } >+ buffer[7] = total; >+} >+`; >+let results; >+async function start() { >+ const adapter = await navigator.gpu.requestAdapter(); >+ const device = await adapter.requestDevice(); >+ >+ const shaderModule = device.createShaderModule({code: shaderSource, isWHLSL: true}); >+ const computeStage = {module: shaderModule, entryPoint: "computeShader"}; >+ >+ const bindGroupLayoutDescriptor = {bindings: [{binding: 0, visibility: 7, type: "storage-buffer"}]}; >+ const bindGroupLayout = device.createBindGroupLayout(bindGroupLayoutDescriptor); >+ const pipelineLayoutDescriptor = {bindGroupLayouts: [bindGroupLayout]}; >+ const pipelineLayout = device.createPipelineLayout(pipelineLayoutDescriptor); >+ >+ const computePipelineDescriptor = {computeStage, layout: pipelineLayout}; >+ const computePipeline = device.createComputePipeline(computePipelineDescriptor); >+ >+ const size = Int32Array.BYTES_PER_ELEMENT * 8; >+ >+ const bufferDescriptor = {size, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.MAP_READ}; >+ const buffer = device.createBuffer(bufferDescriptor); >+ >+ const bufferBinding = {buffer: buffer, size}; >+ const bindGroupBinding = {binding: 0, resource: bufferBinding}; >+ const bindGroupDescriptor = {layout: bindGroupLayout, bindings: [bindGroupBinding]}; >+ const bindGroup = device.createBindGroup(bindGroupDescriptor); >+ >+ const commandEncoder = device.createCommandEncoder(); // {} >+ const computePassEncoder = commandEncoder.beginComputePass(); >+ computePassEncoder.setPipeline(computePipeline); >+ computePassEncoder.setBindGroup(0, bindGroup); >+ computePassEncoder.dispatch(1, 1, 1); >+ computePassEncoder.endPass(); >+ const commandBuffer = commandEncoder.finish(); >+ device.getQueue().submit([commandBuffer]); >+ >+ const resultsArrayBuffer = await buffer.mapReadAsync(); >+ results = new Int32Array(resultsArrayBuffer); >+ shouldBe("results[0]", "2"); >+ shouldBe("results[1]", "1"); >+ shouldBe("results[2]", "2"); >+ shouldBe("results[3]", "2"); >+ shouldBe("results[4]", "6"); >+ shouldBe("results[5]", "7"); >+ shouldBe("results[6]", "34"); >+ shouldBe("results[7]", "59"); >+ buffer.unmap(); >+} >+window.jsTestIsAsync = true; >+window.addEventListener("load", function() { >+ start().then(function() { >+ finishJSTest(); >+ }, function() { >+ finishJSTest(); >+ }); >+}); >+</script> >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 195864
:
369881
|
372569
|
372572
| 372619