WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 285256
285402
[WebGPU]
https://playground.babylonjs.com/?webgpu#H1LRZ3#39
does not work in Safari Technology Preview
https://bugs.webkit.org/show_bug.cgi?id=285402
Summary
[WebGPU] https://playground.babylonjs.com/?webgpu#H1LRZ3#39 does not work in ...
Mike Wyrzykowski
Reported
2025-01-05 08:36:18 PST
https://playground.babylonjs.com/?webgpu#H1LRZ3#39
shows an empty canvas instead of the lines
Attachments
disabled index buffer validation
(3.17 MB, image/png)
2025-01-05 20:51 PST
,
Mike Wyrzykowski
no flags
Details
OOB stage_in read
(2.64 MB, image/png)
2025-01-05 21:01 PST
,
Mike Wyrzykowski
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Mike Wyrzykowski
Comment 1
2025-01-05 08:44:39 PST
Logging says Babylon.js is creating an invalid render pass but Chrome is allowing it
Radar WebKit Bug Importer
Comment 2
2025-01-05 08:44:48 PST
<
rdar://problem/142382203
>
Mike Wyrzykowski
Comment 3
2025-01-05 15:03:56 PST
I think WebKit is incorrect here, still investigating.
Mike Wyrzykowski
Comment 4
2025-01-05 20:51:22 PST
Created
attachment 473787
[details]
disabled index buffer validation Disabling index buffer validation in WebKit I see the attached image, either WebKit has a bug in the index validation or Babylon.js is attempting to draw out of bounds indices: See WebGPU specification note from
https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindexed
> NOTE: WebGPU applications should never use index data with indices out of bounds of any bound vertex buffer that has GPUVertexStepMode "vertex". WebGPU implementations have different ways of handling this, and therefore a range of behaviors is allowed. Either the whole draw call is discarded, or the access to those attributes out of bounds is described by WGSL’s invalid memory reference.
Mike Wyrzykowski
Comment 5
2025-01-05 21:01:59 PST
Created
attachment 473788
[details]
OOB stage_in read This seems to be duplicate of
https://bugs.webkit.org/show_bug.cgi?id=285256
A 4 byte buffer is getting bound to slot 2, so we reject the draw call. Skipping validation shows an OOB read. The WebGPU spec allows both discarding the draw call or clamping. It appears Blink clamps while WebKit discards the draw.
Mike Wyrzykowski
Comment 6
2025-01-05 21:56:41 PST
This change to WebKit resolves both this issue and 285256. It is unclear why Babylon.js is creating 4 byte empty buffers when the shader appears to use them.
> diff --git a/Source/WebGPU/WebGPU/Buffer.mm b/Source/WebGPU/WebGPU/Buffer.mm > index 43b708cc1be0..d72370580ab1 100644 > --- a/Source/WebGPU/WebGPU/Buffer.mm > +++ b/Source/WebGPU/WebGPU/Buffer.mm > @@ -113,6 +113,8 @@ static MTLStorageMode storageMode(bool deviceHasUnifiedMemory, WGPUBufferUsageFl > > id<MTLBuffer> Device::safeCreateBuffer(NSUInteger length, MTLStorageMode storageMode, MTLCPUCacheMode cpuCacheMode, MTLHazardTrackingMode hazardTrackingMode) const > { > + if (length == 4) > + length = 1024 * 64; > MTLResourceOptions resourceOptions = (cpuCacheMode << MTLResourceCPUCacheModeShift) | (storageMode << MTLResourceStorageModeShift) | (hazardTrackingMode << MTLResourceHazardTrackingModeShift); > id<MTLBuffer> buffer = [m_device newBufferWithLength:std::max<NSUInteger>(1, length) options:resourceOptions]; > setOwnerWithIdentity(buffer);
Mike Wyrzykowski
Comment 7
2025-01-05 21:57:04 PST
*** This bug has been marked as a duplicate of
bug 285256
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug