godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.58k stars 21.1k forks source link

[DX12] RenderingDeviceDriverD3D12 does not correctly check minimum supported shader model #98207

Open lrahmann opened 1 week ago

lrahmann commented 1 week ago

Tested versions

Still present in current master.

System information

Windows DirectX

Issue description

The loop implemented in rendering_device_driver_d3d12.cpp:6394

shader_model.HighestShaderModel = SMS_TO_CHECK[i];
            res = device->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &shader_model, sizeof(shader_model));
            if (SUCCEEDED(res)) {

does not match the official documentation in https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_shader_model

basically as long as an DirectX 12 capable device is present it will always accept even if the highest supported shader model is 5.1. Sadly there are a lot of older Nvidia and Intel GPUs out there where this is the case exactly and instead of printing an error messages in these cases the engine will simply crash later on.

Steps to reproduce

Run Godot with --rendering-driver d3d12 with an old GPU installed (e.g. Intel HD 4000/ Nvidia GTX 620)

Minimal reproduction project (MRP)

None needed

Calinou commented 1 week ago

cc @DarioSamo