This commit is contained in:
Arctis-Fireblight
2025-08-27 23:18:33 -05:00
177 changed files with 1631 additions and 967 deletions

View File

@@ -42,6 +42,24 @@
#include "d3d12_godot_nir_bridge.h"
#include "rendering_context_driver_d3d12.h"
GODOT_GCC_WARNING_PUSH
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
GODOT_GCC_WARNING_IGNORE("-Wlogical-not-parentheses")
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
GODOT_GCC_WARNING_IGNORE("-Wshadow")
GODOT_GCC_WARNING_IGNORE("-Wswitch")
GODOT_CLANG_WARNING_PUSH
GODOT_CLANG_WARNING_IGNORE("-Wimplicit-fallthrough")
GODOT_CLANG_WARNING_IGNORE("-Wlogical-not-parentheses")
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
GODOT_MSVC_WARNING_PUSH
GODOT_MSVC_WARNING_IGNORE(4200) // "nonstandard extension used: zero-sized array in struct/union".
GODOT_MSVC_WARNING_IGNORE(4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant".
#include <nir_spirv.h>
#include <nir_to_dxil.h>
#include <spirv_to_dxil.h>
@@ -49,6 +67,10 @@ extern "C" {
#include <dxil_spirv_nir.h>
}
GODOT_GCC_WARNING_POP
GODOT_CLANG_WARNING_POP
GODOT_MSVC_WARNING_POP
#if !defined(_MSC_VER)
#include <guiddef.h>
@@ -3696,7 +3718,7 @@ void RenderingDeviceDriverD3D12::_command_bind_uniform_set(CommandBufferID p_cmd
if (unlikely(frame_heap_walkers.resources->get_free_handles() < num_resource_descs)) {
if (!frames[frame_idx].desc_heaps_exhausted_reported.resources) {
frames[frame_idx].desc_heaps_exhausted_reported.resources = true;
ERR_FAIL_MSG("Cannot bind uniform set because there's no enough room in current frame's RESOURCES descriptor heap.\n"
ERR_FAIL_MSG("Cannot bind uniform set because there's not enough room in the current frame's RESOURCES descriptor heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_resource_descriptors_per_frame project setting.");
} else {
return;
@@ -3751,7 +3773,7 @@ void RenderingDeviceDriverD3D12::_command_bind_uniform_set(CommandBufferID p_cmd
if (unlikely(frame_heap_walkers.samplers->get_free_handles() < num_sampler_descs)) {
if (!frames[frame_idx].desc_heaps_exhausted_reported.samplers) {
frames[frame_idx].desc_heaps_exhausted_reported.samplers = true;
ERR_FAIL_MSG("Cannot bind uniform set because there's no enough room in current frame's SAMPLERS descriptors heap.\n"
ERR_FAIL_MSG("Cannot bind uniform set because there's not enough room in the current frame's SAMPLERS descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame project setting.");
} else {
return;
@@ -3826,7 +3848,7 @@ void RenderingDeviceDriverD3D12::command_clear_buffer(CommandBufferID p_cmd_buff
if (!frames[frame_idx].desc_heaps_exhausted_reported.resources) {
frames[frame_idx].desc_heaps_exhausted_reported.resources = true;
ERR_FAIL_MSG(
"Cannot clear buffer because there's no enough room in current frame's RESOURCE descriptors heap.\n"
"Cannot clear buffer because there's not enough room in the current frame's RESOURCE descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_resource_descriptors_per_frame project setting.");
} else {
return;
@@ -3836,7 +3858,7 @@ void RenderingDeviceDriverD3D12::command_clear_buffer(CommandBufferID p_cmd_buff
if (!frames[frame_idx].desc_heaps_exhausted_reported.aux) {
frames[frame_idx].desc_heaps_exhausted_reported.aux = true;
ERR_FAIL_MSG(
"Cannot clear buffer because there's no enough room in current frame's AUX descriptors heap.\n"
"Cannot clear buffer because there's not enough room in the current frame's AUX descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting.");
} else {
return;
@@ -3981,7 +4003,7 @@ void RenderingDeviceDriverD3D12::command_clear_color_texture(CommandBufferID p_c
if (!frames[frame_idx].desc_heaps_exhausted_reported.rtv) {
frames[frame_idx].desc_heaps_exhausted_reported.rtv = true;
ERR_FAIL_MSG(
"Cannot clear texture because there's no enough room in current frame's RENDER TARGET descriptors heap.\n"
"Cannot clear texture because there's not enough room in the current frame's RENDER TARGET descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting.");
} else {
return;
@@ -4016,7 +4038,7 @@ void RenderingDeviceDriverD3D12::command_clear_color_texture(CommandBufferID p_c
if (!frames[frame_idx].desc_heaps_exhausted_reported.resources) {
frames[frame_idx].desc_heaps_exhausted_reported.resources = true;
ERR_FAIL_MSG(
"Cannot clear texture because there's no enough room in current frame's RESOURCE descriptors heap.\n"
"Cannot clear texture because there's not enough room in the current frame's RESOURCE descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_resource_descriptors_per_frame project setting.");
} else {
return;
@@ -4026,7 +4048,7 @@ void RenderingDeviceDriverD3D12::command_clear_color_texture(CommandBufferID p_c
if (!frames[frame_idx].desc_heaps_exhausted_reported.aux) {
frames[frame_idx].desc_heaps_exhausted_reported.aux = true;
ERR_FAIL_MSG(
"Cannot clear texture because there's no enough room in current frame's AUX descriptors heap.\n"
"Cannot clear texture because there's not enough room in the current frame's AUX descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting.");
} else {
return;
@@ -4520,7 +4542,7 @@ void RenderingDeviceDriverD3D12::command_next_render_subpass(CommandBufferID p_c
if (frames[frame_idx].desc_heap_walkers.rtv.is_at_eof()) {
if (!frames[frame_idx].desc_heaps_exhausted_reported.rtv) {
frames[frame_idx].desc_heaps_exhausted_reported.rtv = true;
ERR_FAIL_MSG("Cannot begin subpass because there's no enough room in current frame's RENDER TARGET descriptors heap.\n"
ERR_FAIL_MSG("Cannot begin subpass because there's not enough room in the current frame's RENDER TARGET descriptors heap.\n"
"Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting.");
} else {
return;