Skip to content

Bug Fix: Added Validation Pass for Rendering Driver Availability#1274

Merged
Arctis-Fireblight merged 1 commit into
Redot-Engine:masterfrom
Selciner-Games:rdriver-validation
Jun 5, 2026
Merged

Bug Fix: Added Validation Pass for Rendering Driver Availability#1274
Arctis-Fireblight merged 1 commit into
Redot-Engine:masterfrom
Selciner-Games:rdriver-validation

Conversation

@TheAenema

@TheAenema TheAenema commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Godot has switched to D3D12 as the default rendering driver in recent versions on the Windows platform, while Redot still defaults to Vulkan. This mismatch causes crashes when loading newer Godot projects in Redot due to the absence of validation for the renderer setting in the project configuration.

This PR implements a minimal validation to prevent the crash and provides users with a clear error message explaining the incompatibility and suggesting a solution.

Summary by CodeRabbit

  • Bug Fixes
    • Engine now validates the selected rendering driver at startup. If an unavailable driver is chosen, a clear error lists supported drivers and advises updating project settings; startup proceeds normally when a valid driver is selected.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2efcbab3-68de-4a9f-9f4b-196fcffbc2b6

📥 Commits

Reviewing files that changed from the base of the PR and between 85993f5 and 15c7502.

📒 Files selected for processing (1)
  • main/main.cpp

Walkthrough

The PR adds validation to verify that a user-selected rendering driver is actually supported by the current engine build. During Main::setup(), after normalizing the driver name, the code checks availability against compile-time backend macros and the dummy driver. If unavailable, it constructs and displays a list of valid options before exiting through the error path.

Changes

Rendering Driver Validation

Layer / File(s) Summary
Rendering driver availability validation
main/main.cpp
Declares rendering_driver_available flag and implements availability check during Main::setup(). Validates the selected driver against build-enabled macros (D3D12_ENABLED, VULKAN_ENABLED, GLES3_ENABLED, dummy), and if unavailable, builds a deduplicated list of supported drivers from display server registrations, prints an error message describing valid options, and transfers to the error cleanup path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

bug

Suggested reviewers

  • Arctis-Fireblight
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding validation for rendering driver availability to prevent crashes from unsupported drivers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
main/main.cpp

In file included from main/main.cpp:39:
main/main.h:41:10: fatal error: 'core/os/thread.h' file not found
41 | #include "core/os/thread.h"
| ^~~~~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/15c75020e8b0d27985f512d4ef5e207fa3ad9ba8-18b7c19417a461e4/tmp/clang_command_.tmp.ec9c6c.txt
++Contents of '/tmp/coderabbit-infer/15c75020e8b0d27985f512d4ef5e207fa3ad9ba8-18b7c19417a461e4/tmp/clang_command_.tmp.ec9c6c.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emi

... [truncated 1079 characters] ...

plugins/clang/install/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/18b7c19417a461e4/file.o" "-x" "c++"
"main/main.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@main/main.cpp`:
- Around line 2603-2617: The availability check fails to mark the Metal backend
available; update the same conditional blocks that set
rendering_driver_available to also handle the "metal" rendering_driver when the
METAL_ENABLED macro is defined. Specifically, add an `#ifdef` METAL_ENABLED block
that checks if rendering_driver == "metal" and sets rendering_driver_available =
true (and mirror the same change in the other similar occurrence around the
later block referenced), ensuring checks reference the rendering_driver variable
and rendering_driver_available flag so valid Metal builds aren't aborted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 464ef6e4-4f3c-4073-935e-732e2a208f5a

📥 Commits

Reviewing files that changed from the base of the PR and between a8f52d2 and 85993f5.

📒 Files selected for processing (1)
  • main/main.cpp

Comment thread main/main.cpp

@AR-DEV-1 AR-DEV-1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TheAenema TheAenema force-pushed the rdriver-validation branch from 85993f5 to 15c7502 Compare June 5, 2026 15:44
@Arctis-Fireblight Arctis-Fireblight merged commit 69c73e8 into Redot-Engine:master Jun 5, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from Open to Done in Engine Overview Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants