Closed farcaller closed 1 year ago
Wow 😯 Very interesting, if you change the power mode to low what happens?
# Performance
#
# Set WGPU rendering performance
# High: Adapter that has the highest performance. This is often a discrete GPU.
# Low: Adapter that uses the least possible power. This is often an integrated GPU.
#
performance = "High"
Setting it to low makes no difference.
i see, will try to reproduce locally, what's your system report (Windows Version and graphic drivers)?
that's on windows 22H2 with nvidia studio drivers 536.99 (but I tried on game ready 537.13 and there's no difference).
The display is set to not have HDR enabled, FWIW
(I'm still confused as to which part of windows graphics API allows to override that switch)
I am having the same issue. Even if the HDR setting is set to off as soon as I open Rio it configures the monitor to HDR and only way to disable it to turn off Rio.
@dvtkrlbs are you also using windows?
Yeah a macbook and a windows desktop @raphamorim . Can do additional debugging if you have some ideas. Will look at the wgpu crate to see if there is anything about HDR mentioned there. There is also extensive logs for wgpu so there might be something useful there. Will post a full debug log in a moment.
Cool! that would be awesome @dvtkrlbs . I am still stuck in some work with font ligature and split panel support.
I would suggest start by bumping wgpu to 0.17.0 and giving it a try
here is a full debug log for the rio 0.0.18 will do the version bump now
still the same on wgpu 0.17.0 here is the logs for that it seems to compiling and initializing fine
Using WGPU_BACKEND=vulkan still results in the same thing (it defaults to opengl insstead of directx for some reason)
Running with WGPU_BACKEND=dx12 panics with the following message
---------------------------
Rio: Runtime Error
---------------------------
panicked at 'Error in Surface::configure: Validation Error
Caused by:
Invalid surface
', C:\Users\dvtkrlbs\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.17.0\src\backend\direct.rs:771:18
Press Ctrl-C to Copy
---------------------------
OK
---------------------------
Forcing the internal gpu using the Low performance setting seems to fix the issue here is the log for the vulkan backend set on one thing that might be happening is wgpu setting the color depth to 10bpc on dedicated gpu instead of 8bpc which in some cases forces HDR.
I found the culprit for the issue the forced HDR comes from the selected TextureFormat on my machine filtered_formats here returns [Bgra8UnormSrgb, Bgra8Unorm, Rgba16Float]
. I than queries the surface capability formats (ub tgus case same as the filtered_formats) and selects the first one. However since the filtrered_formats is not empty it selects the last one from that array which is an Rgba16Float which probably causes the driver to set HDR. I think for now we can just filter out Rgba16Float (I did that locally and it works) in the future maybe HDR can be set as an option or even better maybe we can query the system settings and only allow Rgba16Float if the user already enables HDR. @raphamorim. Creating a PR now for the filter.
Interestingly enough when I put the performance mode to low it still picks Rgba16Float but in this case the HDR does not get turned on.
I talked to a friend of mine who dealt with gpu a lot he said
Oh hmm... well its a little poorly defined in webgpu itself
Only recently the working copy got predefinedColorSpace setting for CanvasConfiguration
Hopefully we get it on next wgpu release, it lets you define output format of either sRGB or DCI-P3
Before PredefinedColorSpace lands on wgpu though I wouldnt use anything else than the *Srgb formats for your canvas
Otherwise the colors you get out is "who knows
Use Rgba8UnormSrgb or Bgra8UnormSrgb as your surface format
the color space is undefined
For most 8 bit formats thats practically Srgb but its a wild west when it comes to float textures
Great input on it @dvtkrlbs! I've left just one small comment in PR.
Oh hmm... well its a little poorly defined in webgpu itself Only recently the working copy got predefinedColorSpace setting for CanvasConfiguration Hopefully we get it on next wgpu release, it lets you define output format of either sRGB or DCI-P3 Before PredefinedColorSpace lands on wgpu though I wouldnt use anything else than the *Srgb formats for your canvas Otherwise the colors you get out is "who knows Use Rgba8UnormSrgb or Bgra8UnormSrgb as your surface format the color space is undefined For most 8 bit formats thats practically Srgb but its a wild west when it comes to float textures
Honestly I imagined was something like that because I often use Rgba16Float with metal.
@farcaller could you check if the PR fix for it you as well?
@raphamorim sorry for getting back to this so late but yes, I checked it and it works as intended; thanks so much!
Somewhat hilarious, but when I start rio, windows automatically forces me into HDR mode with no way to turn it off. I know rio can render a whole lot of colors but maybe going full on HDR is a bit excessive (and also burns my eyes 😞).
This is rio 0.0.18. I'm honestly not sure where to even start debugging this, I don't see anything relevant in wgpu.