WebKit Bugzilla
Attachment 372572 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]
WIP
bug-195864-20190620110823.patch (text/plain), 7.05 KB, created by
Myles C. Maxfield
on 2019-06-20 11:08:24 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2019-06-20 11:08:24 PDT
Size:
7.05 KB
patch
obsolete
>Subversion Revision: 246631 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 36e14cdb477c375dbac3e0c51b577f5538d3b188..e127b5634cf77816b05664055197a0d9990e8132 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,14 @@ >+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!). >+ >+ Test: webgpu/whlsl-read-modify-write.html >+ >+ * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: >+ > 2019-06-19 Myles C. Maxfield <mmaxfield@apple.com> > > [WHLSL] Hook up common texture functions >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt >index c4ca0c3073807f830ddfb84e599f3ed12197abf6..276b51cd6b8c2985fa8be64b078755b784745d49 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 54305a0c8d8c23d64e9d0d6f8f7aba365f5f3459..2b41132ee3b8859255dfc93f305458f7d878df9b 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-19 Myles C. Maxfield <mmaxfield@apple.com> > > [WHLSL] Hook up common texture functions >diff --git a/LayoutTests/webgpu/whlsl-read-modify-write.html b/LayoutTests/webgpu/whlsl-read-modify-write.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b97b912ed11625cda0e5e8fd025a0b3875ef4631 >--- /dev/null >+++ b/LayoutTests/webgpu/whlsl-read-modify-write.html >@@ -0,0 +1,80 @@ >+<!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; >+} >+`; >+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 * 6; >+ >+ 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"); >+ 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