Status Update
Comments
fb...@google.com <fb...@google.com> #2
ka...@chromium.org <ka...@chromium.org> #3
el...@gmail.com <el...@gmail.com> #4
is...@google.com <is...@google.com> #5
[Auto-CCs applied]
[Monorail blocking:
[Monorail components added to Component Tags custom field.]
ja...@gmail.com <ja...@gmail.com> #6
If you are on linux with the vulkan backend atm the only WGPUPresentMode that can be used with configure is Mailbox due to a intel bug by the looks of it. This is a guess on my behalf( I see you have selected FiFo as your presentMode )
This threw me for a loop for a bit as it was reporting the TextureFormat::BGRA8Unorm
was invalid even though it is the only supported format even tho it was the present mode not the textureformat.
If you use this to get the capabilities for the present mode and select the first option( on linux/vulkan there will only be one mode Mailbox ) that should be selected.
wgpu::SurfaceCapabilities capabilities;
surface.GetCapabilities(adapter, &capabilities);
config.presentMode = capabilities.presentModes[0];
Or just hardcode Mailbox for linux/vulkan and FiFo for the rest. I changed the code to test it out on my end (AMD integrated graphics - MESA) and FiFo worked fine.
Intel UhD 630 Bug
as...@gmail.com <as...@gmail.com> #7
Don't think this is due to intel graphics.
I'm seeing the same thing with my nvidia card on linux with vulkan. SurfaceCapabilities only has one PresentMode which is Mailbox. Fifo and Immediate worked with Swapchain and with wayland Mailbox behaves like Immediate now which is weird.
The error message should report presentMode instead of format
Otherwise my migration was successful though. I don't know what copyTexture does. I only changed:
TextureView backBuffer = swapchain.GetCurrentTextureView();
to
SurfaceTexture surfaceTexture;
surface.GetCurrentTexture(&surfaceTexture);
TextureView backBuffer = surfaceTexture.texture.CreateView();
fb...@google.com <fb...@google.com> #8
For info, I'm working on updating the WebGPU cross-platform app with CMake/Emscripten (
I'm currently missing Emscripten support:
ja...@gmail.com <ja...@gmail.com> #9
The limit on the vulkan surface capabilities are apparently due to the intel bug
I agree the message should report present mode error but it never triggered on mine (and cbf to track down why), only texture format was complaining and knowing that BGRA8Unorm
was the only supported colour I knew it was a red herring.
ma...@gmail.com <ma...@gmail.com> #10
Original bug reporter here (I think).
I finally had a chance to look at this more closely and determined the
problem was 100% unrelated to Dawn. I now have the new surface present
system fine on Windows 10 with D3D12, D3D11 and Vulkand backends.
Bye!
Mark
On Fri, May 17, 2024 at 7:33 AM <buganizer-system@google.com> wrote:
cw...@chromium.org <cw...@chromium.org> #11
Thanks for the confirmation. What was the issue one your end? I planned to look at this issue soonish but never got time.
ma...@gmail.com <ma...@gmail.com> #12
Completely and utterly unrelated to dawn and kind of embarrassing...I was
forgetting to set a 'canRender' bool flag when the surface was 'resized' to
have a valid (ie: non-0) size, ie: I'd forgotten to copy this line from the
swapChain code:
Sorry for wasting everyone's time...
Bye,
Mark
I can say I've successfully used the new system more tha
What was the issue one your end?
On Sat, May 18, 2024 at 4:44 AM <buganizer-system@google.com> wrote:
cw...@chromium.org <cw...@chromium.org> #13
The smallest bugs are always very hard to figure out. Maybe someone will find this thread and realize they had the same issue. Closing this, but i'll remember to test more of the surface code on Windows.
Description
Looking around the code a bit, it looks like I now need to configure my surface and use it instead of a swap chain. I tried this and I don't get any errors but it's not working either, the Present never seems to happen and I'm left with an empty white window. I've checked the surface texture status after Surface::GetTexture() and that's OK. Reverting to the swapchain + warning everything works fine.
Here's my new surface configuration code, largely taken from Device.cpp. This is called at startup and each time window size changes.
```
wgpu::SurfaceConfiguration config{};
config.device = m_wgpuDevice;
config.width = size.x; // From Glfw window
config.height = size.y;
config.format = m_wgpuSurface.GetPreferredFormat(m_wgpuDevice.GetAdapter());
config.usage = wgpu::TextureUsage::RenderAttachment;
config.presentMode = wgpu::PresentMode::Fifo;
config.viewFormatCount = 0;
config.viewFormats = nullptr;
config.alphaMode = wgpu::CompositeAlphaMode::Opaque;
m_wgpuSurface.Configure(&config);
```
Here's my new present code:
```
wgpu::SurfaceTexture surfaceTexture{};
m_wgpuSurface.GetCurrentTexture(&surfaceTexture);
if (surfaceTexture.status != wgpu::SurfaceGetCurrentTextureStatus::Success) {
SGD_LOG << "GetCurrentTexture failed";
return;
}
copyTexture(m_wgpuDevice, wgpuTexture, surfaceTexture.texture);
m_wgpuSurface.Present();
```