In WebIDL, "unsigned long (aka u32 in Web GPU)" actually refers to a 32-bit unsigned integer. Replace all instances of "unsigned long" in Web GPU C++ meant to represent "u32" with "unsigned".
<rdar://problem/48055390>
Silly me didn't think harder about why "u32" was the chosen typedef for "unsigned long".
<rdar://problem/48055796>
Created attachment 366231 [details] Patch
Comment on attachment 366231 [details] Patch Clearing flags on attachment: 366231 Committed r243636: <https://trac.webkit.org/changeset/243636>
All reviewed patches have been landed. Closing bug.
Comment on attachment 366231 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366231&action=review > Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp:45 > -void WebGPUBuffer::setSubData(unsigned long long offset, const JSC::ArrayBuffer& data) > +void WebGPUBuffer::setSubData(unsigned long offset, const JSC::ArrayBuffer& data) Possibly wrong, see comment below. > Source/WebCore/Modules/webgpu/WebGPUBuffer.h:51 > - void setSubData(unsigned long long, const JSC::ArrayBuffer&); > + void setSubData(unsigned long, const JSC::ArrayBuffer&); Possibly wrong, see comment below. > Source/WebCore/Modules/webgpu/WebGPUBufferBinding.h:38 > - unsigned long long offset; > - unsigned long long size; > + unsigned long offset; > + unsigned long size; This change seems wrong. It changes 64-bit to 32-bit, and uses the type "unsigned long" for 32-bit, when we would normally use "unsigned" or "uint32_t". I am pretty sure this needs to change back to "unsigned long long". Do these need to be 64-bit? If so, please change back to "unsigned long long". If not, please change to "unsigned". > Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h:50 > - using BindingsMapType = HashMap<unsigned long long, GPUBindGroupLayoutBinding, WTF::IntHash<unsigned long long>, WTF::UnsignedWithZeroKeyHashTraits<unsigned long long>>; > + using BindingsMapType = HashMap<unsigned long, GPUBindGroupLayoutBinding, WTF::IntHash<unsigned long>, WTF::UnsignedWithZeroKeyHashTraits<unsigned long>>; Same problem here. > Source/WebCore/platform/graphics/gpu/GPUBufferBinding.h:38 > - unsigned long long offset; > - unsigned long long size; > + unsigned long offset; > + unsigned long size; And here.
Comment on attachment 366231 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366231&action=review >> Source/WebCore/Modules/webgpu/WebGPUBufferBinding.h:38 >> + unsigned long size; > > This change seems wrong. It changes 64-bit to 32-bit, and uses the type "unsigned long" for 32-bit, when we would normally use "unsigned" or "uint32_t". > > I am pretty sure this needs to change back to "unsigned long long". > > Do these need to be 64-bit? If so, please change back to "unsigned long long". If not, please change to "unsigned". Thanks for the catch. The rest of WebKit backs these with 'uint64_t' so I'll be changing these to that!
Addressing Darin's comments in https://bugs.webkit.org/show_bug.cgi?id=196401