Add Direct3D 12 RenderingDevice implementation
This commit is contained in:
@ -1732,15 +1732,27 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
|
||||
{
|
||||
String driver_hints = "";
|
||||
String driver_hints_with_d3d12 = "";
|
||||
|
||||
{
|
||||
Vector<String> driver_hints_arr;
|
||||
#ifdef VULKAN_ENABLED
|
||||
driver_hints = "vulkan";
|
||||
driver_hints_arr.push_back("vulkan");
|
||||
#endif
|
||||
driver_hints = String(",").join(driver_hints_arr);
|
||||
|
||||
#ifdef D3D12_ENABLED
|
||||
driver_hints_arr.push_back("d3d12");
|
||||
#endif
|
||||
driver_hints_with_d3d12 = String(",").join(driver_hints_arr);
|
||||
}
|
||||
|
||||
String default_driver = driver_hints.get_slice(",", 0);
|
||||
String default_driver_with_d3d12 = driver_hints_with_d3d12.get_slice(",", 0);
|
||||
|
||||
// For now everything defaults to vulkan when available. This can change in future updates.
|
||||
GLOBAL_DEF_RST_NOVAL("rendering/rendering_device/driver", default_driver);
|
||||
GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.windows", PROPERTY_HINT_ENUM, driver_hints), default_driver);
|
||||
GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.windows", PROPERTY_HINT_ENUM, driver_hints_with_d3d12), default_driver_with_d3d12);
|
||||
GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.linuxbsd", PROPERTY_HINT_ENUM, driver_hints), default_driver);
|
||||
GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.android", PROPERTY_HINT_ENUM, driver_hints), default_driver);
|
||||
GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.ios", PROPERTY_HINT_ENUM, driver_hints), default_driver);
|
||||
@ -1798,7 +1810,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
}
|
||||
|
||||
// Start with RenderingDevice-based backends. Should be included if any RD driver present.
|
||||
#ifdef VULKAN_ENABLED
|
||||
#if defined(VULKAN_ENABLED) || defined(D3D12_ENABLED)
|
||||
renderer_hints = "forward_plus,mobile";
|
||||
default_renderer_mobile = "mobile";
|
||||
#endif
|
||||
@ -1878,11 +1890,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
// Now validate whether the selected driver matches with the renderer.
|
||||
bool valid_combination = false;
|
||||
Vector<String> available_drivers;
|
||||
#ifdef VULKAN_ENABLED
|
||||
if (rendering_method == "forward_plus" || rendering_method == "mobile") {
|
||||
#ifdef VULKAN_ENABLED
|
||||
available_drivers.push_back("vulkan");
|
||||
}
|
||||
#endif
|
||||
#ifdef D3D12_ENABLED
|
||||
available_drivers.push_back("d3d12");
|
||||
#endif
|
||||
}
|
||||
#ifdef GLES3_ENABLED
|
||||
if (rendering_method == "gl_compatibility") {
|
||||
available_drivers.push_back("opengl3");
|
||||
|
||||
Reference in New Issue
Block a user