PRIME offload with 30 bit display not working properly

Dear all,
I have a Dell XPS 15 7390, that has an Intel graphics + NVIDIA GeForce GTX 1650. It also has a 30 bit display. It runs Gentoo Linux, kernel 5.13.13 and the NVIDIA drivers, version 470.63.01.
I have prime configured and working, but even though it works properly when I have the display set to 24 bit, it doesn’t work properly with 30 bit. It doesn’t crash, but I believe it doesn’t notice that the display is configured in 30 bit, so the colors are just wrong.
I made a screenshot, the left image is glxgears running with the integrated graphics, the right one with the NVIDIA card. It is not the only application where I see this problem, but I believe it is good to test.


So, my question is, can I configure the NVIDIA driver to render with 30 bit color depth? Or is it something that needs to be fixed in the driver?


I did more tests with driver version 470.74, and I can see it happening only with 30 bit color display. With 24 bit the rendering of glxgears is correct. I tested it with other opengl applications (openscad, freecad, meshlab) and they all show wrong colors with 30 bit using optimus.