Open GameBeastProductions opened 1 year ago
I know the option I gave it must be valid because I see this in the output as well:
OpenGL API 4.6 (Core Profile) Mesa 23.1.5 - Compatibility
So it has set the rendering method to gl_compatibility
.
Note that there's a note in the documentation about the engine modifying or stripping args here
Note that there's a note in the documentation about the engine modifying or stripping args here
When I run the game with -- --rendering-method gl_compatibility
, I see that the argument appears in OS.get_cmdline_user_args()
but the rendering method is not applied correctly.
The reason I want to determine this is that my game now supports either method, but I need to know which is enabled so I can substitute some graphical effects.
The reason I want to determine this is that my game now supports either method, but I need to know which is enabled so I can substitute some graphical effects.
We should expose a method to get the current rendering method and driver without relying on CLI arguments. This will also account for fallbacks once these are implemented. We had that in 3.x, but it's missing in 4.x for some reason.
There's already a RenderingDriver enum exposed in the OS singleton, but no methods in the engine use it (not even in C++).
As a workaround, you can read the result of RenderingServer.get_video_adapter_api_version()
and infer whether it's Vulkan or OpenGL based on the reported version number. If the version number is 3.0.0
or greater (to account for GLES 3.0 in mobile), it's OpenGL, otherwise, it's Vulkan. This will break once Vulkan reaches version 3.0.0, but I don't see that happening until a decade or so :slightly_smiling_face:
Godot version
v4.1.1.stable.official [bd6af8e0e]
System information
Godot v4.1.1.stable - Manjaro Linux - Vulkan (Mobile) - integrated AMD Radeon Vega 10 Graphics (RADV RAVEN) - AMD Ryzen 7 3700U
Issue description
I am trying to determine if the rendering method has been overridden on the command line, like this:
I am printing the result of
OS.get_cmdline_args()
, so the expected behaviour when I run the game is that the printed array contains something like this:However, when just this argument is set, I get an empty array. I've tried using
OS.get_cmdline_user_args()
and running the game from the editor with the argument set ineditor/run/main_run_args
, but these give the same result.If this is intentional, I can't find mention of it in the docs. Other CLI arguments might also be affected by this.
Steps to reproduce
func _ready(): print(OS.get_cmdline_args())