RESOLVED FIXED 198890
[WHLSL] Make .length work
https://bugs.webkit.org/show_bug.cgi?id=198890
Summary [WHLSL] Make .length work
Saam Barati
Reported 2019-06-15 10:10:38 PDT
...
Attachments
patch (24.18 KB, patch)
2019-06-17 13:21 PDT, Saam Barati
mmaxfield: review+
Saam Barati
Comment 1 2019-06-17 12:03:06 PDT
patch forthcoming
Saam Barati
Comment 2 2019-06-17 13:21:43 PDT
Myles C. Maxfield
Comment 3 2019-06-17 13:28:42 PDT
Comment on attachment 372267 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=372267&action=review > Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:318 > - stringBuilder.append(makeString("size_t ", lengthTemporaryName, " = ", variableName, '.', lengthElementName, ".x;\n")); > + stringBuilder.append(makeString("size_t ", lengthTemporaryName, " = ", variableName, '.', lengthElementName, ".y;\n")); 👍 > LayoutTests/webgpu/whlsl-buffer-length.html:10 > +compute void computeShader(device float[] buffer : register(u0), float3 threadID : SV_DispatchThreadID) { Can we turn the buffer into a uint[] buffer? That way no casts are needed. Your "numthreads" directive above means that this code is racey. Instead you should just say numthreads(1, 1, 1) and change line 56 below to say (1, 1, 1). > LayoutTests/webgpu/whlsl-buffer-length.html:11 > + buffer[uint(threadID.x)] = buffer[uint(threadID.x)] * 2.0; What's the purpose of this line? > LayoutTests/webgpu/whlsl-buffer-length.html:40 > + for (let i = 0; i < 1337; ++i) { > + bufferFloat32Array[i] = i + 1; > + } Is there a need to fill the whole buffer? Can't you just fill the first item and let it be overridden by the shader?
Saam Barati
Comment 4 2019-06-17 14:29:28 PDT
Spoke to Myles offline, fixing the test to just do the length calculation.
Saam Barati
Comment 5 2019-06-17 14:45:09 PDT
Radar WebKit Bug Importer
Comment 6 2019-06-17 14:49:12 PDT
Note You need to log in before you can comment on or make changes to this bug.