Wang Hoi's Sponza demo does not run as expected
Categories
(Core :: Graphics: WebGPU, defect, P1)
Tracking
()
People
(Reporter: ErichDonGubler, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: webcompat:platform-bug, webcompat:site-report)
User Story
platform:windows,mac,linux,android impact:site-broken configuration:general affects:some branch:release user-impact-score:60
Steps to reproduce
- Navigate to https://wanghoi.github.io/sponza/melia_runner.html. Observe that the page never progresses beyond a loading screen.
| Reporter | ||
Comment 1•1 year ago
•
|
||
Opening up the console, it seems this page depends on the dual-source-blending feature (which we haven't yet implemented, see bug 1924328), but the diagnostic is not what I was expecting:
Uncaught TypeError: GPUDevice.createRenderPipeline: 'src1-alpha' (value of 'dstFactor' member of GPUBlendComponent) is not a valid value for enumeration GPUBlendFactor.
I was expecting a device feature rejection warning here. Maybe the application isn't requesting it, and it should? I see WGPU WASM symbols here, and I suspect that may be out-of-date; WGPU's dual-source blending implementation only recent became spec-compliant, see wgpu#6402.
I'm also getting internal errors for shader compilation on Metal when using macOS:
program_source:166:278: error: use of undeclared identifier 'clamped_lod_e161' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:303: error: use of undeclared identifier 'clamped_lod_e161' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:496: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:543: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:589: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:614: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:920: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:967: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:1013: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:166:1038: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_795_ = x_795_ + (x_790_ * (in_scattering_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_scattering_tx.get_width(clamped_lod_e161), in_scattering_tx.get_height(clamped_lod_e161), in_scattering_tx.get_depth(clamped_lod_e161)) - 1), clamped_lod_e161).xyz * metal::mix((x_197_ - metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_))) * x_785_, metal::float3(metal::abs((x_781_ * x_778_) - x_783_)), metal::select(metal::float3 {}, x_197_, in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz == metal::float3 {})))); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:167:187: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_790_ = x_790_ * metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_)); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:167:234: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_790_ = x_790_ * metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_)); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:167:280: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_790_ = x_790_ * metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_)); melia_runner.html:431:29
^ melia_runner.html:431:29
program_source:167:305: error: use of undeclared identifier 'clamped_lod_e165' melia_runner.html:431:29
x_790_ = x_790_ * metal::exp(-(in_extinction_tx.read(metal::min(metal::uint3(metal::int4(x_470_.x, x_470_.y, x_777_, 0).xyz), metal::uint3(in_extinction_tx.get_width(clamped_lod_e165), in_extinction_tx.get_height(clamped_lod_e165), in_extinction_tx.get_depth(clamped_lod_e165)) - 1), clamped_lod_e165).xyz) * metal::abs((x_781_ * x_778_) - x_783_)); melia_runner.html:431:29
^ melia_runner.html:431:29
<empty string> melia_runner.html:431:29
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
|
||
After some experiments with implementing dual source blending, this app runs into another well-known issue: shadowing in WGSL (viz., bug 1961248):
WebGPU compilation info for shader module "Deferred Shader PS [8567AD0E19535E88933BD57961CD56BB]" (1 error(s), 0 warning(s), 0 info)
Shader 'Deferred Shader PS [8567AD0E19535E88933BD57961CD56BB]' parsing error: name `u32` is a reserved keyword
┌─ wgsl:44:3
│
44 │ u32 : f32,
│ ^^^ definition of `u32`
| Reporter | ||
Comment 3•1 year ago
|
||
I'm also getting consistent crashes in surface presentation on macOS unless I set dom.webgpu.allow-present-without-readback to false. 🤔 CC :sotaro, :jimb. I don't have a crash stack yet, but I'm trying to get one.
| Reporter | ||
Comment 4•1 year ago
|
||
Crash stack from macOS for presentation:
Thread 45 Crashed:: CanvasRenderer
0 XUL 0x121aa6ebc mozilla::webgpu::SharedTextureMacIOSurface::ToSurfaceDescriptor() + 496
1 XUL 0x121aba910 mozilla::webgpu::WebGPUParent::PostSharedTexture(std::__1::shared_ptr<mozilla::webgpu::SharedTexture> const&&, mozilla::layers::RemoteTextureId, mozilla::layers::RemoteTextureOwnerId) + 452
2 XUL 0x121ab67e0 mozilla::webgpu::WebGPUParent::SwapChainPresent(unsigned long long, unsigned long long, unsigned long long, mozilla::layers::RemoteTextureId const&, mozilla::layers::RemoteTextureOwnerId const&) + 936
3 XUL 0x121ab6410 wgpu_parent_swap_chain_present + 44
4 XUL 0x1267628e0 wgpu_bindings::server::process_message::h7f2bdc4ad1c6dcbb + 548
5 XUL 0x126762648 wgpu_server_messages + 172
6 XUL 0x121abbf50 mozilla::webgpu::WebGPUParent::RecvMessages(unsigned int, mozilla::ipc::ByteBuf&&, nsTArray<mozilla::ipc::ByteBuf>&&, nsTArray<mozilla::ipc::shared_memory::Handle<(mozilla::ipc::shared_memory::Type)0>>&&) + 584
7 XUL 0x121abd56c mozilla::webgpu::PWebGPUParent::OnMessageReceived(IPC::Message const&) + 744
8 XUL 0x11fa3b564 mozilla::gfx::PCanvasManagerParent::OnMessageReceived(IPC::Message const&) + 692
9 XUL 0x11effa1b4 mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) + 348
10 XUL 0x11eff8354 mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, std::__1::unique_ptr<IPC::Message, mozilla::DefaultDelete<IPC::Message>>) + 512
11 XUL 0x11eff8a18 mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&) + 376
12 XUL 0x11eff94dc mozilla::ipc::MessageChannel::MessageTask::Run() + 216
13 XUL 0x11e51e748 nsThread::ProcessNextEvent(bool, bool*) + 1784
14 XUL 0x11e525238 NS_ProcessNextEvent(nsIThread*, bool) + 100
15 XUL 0x11efff6a4 mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) + 196
16 XUL 0x11ef72cf8 MessageLoop::RunInternal() + 140
17 XUL 0x11ef72bf0 MessageLoop::Run() + 100
18 XUL 0x11e51a388 nsThread::ThreadFunc(void*) + 352
19 libnss3.dylib 0x1077b6c1c _pt_root + 260
20 libsystem_pthread.dylib 0x1a01dbc0c _pthread_start + 136
21 libsystem_pthread.dylib 0x1a01d6b80 thread_start + 8
| Reporter | ||
Updated•1 year ago
|
Comment 5•1 year ago
|
||
Adding to macOS blockers because Naga is generating bad MSL.
Comment 6•1 year ago
|
||
Taking out of macOS blockers, to keep things focused.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 7•6 months ago
|
||
I tested with https://phabricator.services.mozilla.com/D296702, but there is at least one more issue independent of that, which I filed as https://github.com/gfx-rs/wgpu/issues/9510.
Comment 8•3 months ago
|
||
https://github.com/gfx-rs/wgpu/issues/9510 remains outstanding for MacOS, but with a fix for bug 1984765 and dual-source blending enabled, I was able to run this demo on Linux.
Description
•