D3D12: Fix shader model check, initialization error handling
This commit is contained in:
@ -5839,7 +5839,7 @@ Error RenderingDeviceDriverD3D12::_check_capabilities() {
|
|||||||
|
|
||||||
#define D3D_SHADER_MODEL_TO_STRING(m_sm) vformat("%d.%d", (m_sm >> 4), (m_sm & 0xf))
|
#define D3D_SHADER_MODEL_TO_STRING(m_sm) vformat("%d.%d", (m_sm >> 4), (m_sm & 0xf))
|
||||||
|
|
||||||
ERR_FAIL_COND_V_MSG(!shader_capabilities.shader_model, ERR_UNAVAILABLE,
|
ERR_FAIL_COND_V_MSG(shader_capabilities.shader_model < SMS_TO_CHECK[ARRAY_SIZE(SMS_TO_CHECK) - 1], ERR_UNAVAILABLE,
|
||||||
vformat("No support for any of the suitable shader models (%s-%s) has been found.", D3D_SHADER_MODEL_TO_STRING(SMS_TO_CHECK[ARRAY_SIZE(SMS_TO_CHECK) - 1]), D3D_SHADER_MODEL_TO_STRING(SMS_TO_CHECK[0])));
|
vformat("No support for any of the suitable shader models (%s-%s) has been found.", D3D_SHADER_MODEL_TO_STRING(SMS_TO_CHECK[ARRAY_SIZE(SMS_TO_CHECK) - 1]), D3D_SHADER_MODEL_TO_STRING(SMS_TO_CHECK[0])));
|
||||||
|
|
||||||
print_verbose("- Shader:");
|
print_verbose("- Shader:");
|
||||||
@ -6058,6 +6058,8 @@ Error RenderingDeviceDriverD3D12::_initialize_command_signatures() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Error RenderingDeviceDriverD3D12::initialize(uint32_t p_device_index, uint32_t p_frame_count) {
|
Error RenderingDeviceDriverD3D12::initialize(uint32_t p_device_index, uint32_t p_frame_count) {
|
||||||
|
glsl_type_singleton_init_or_ref();
|
||||||
|
|
||||||
context_device = context_driver->device_get(p_device_index);
|
context_device = context_driver->device_get(p_device_index);
|
||||||
adapter = context_driver->create_adapter(p_device_index);
|
adapter = context_driver->create_adapter(p_device_index);
|
||||||
ERR_FAIL_NULL_V(adapter, ERR_CANT_CREATE);
|
ERR_FAIL_NULL_V(adapter, ERR_CANT_CREATE);
|
||||||
@ -6087,7 +6089,5 @@ Error RenderingDeviceDriverD3D12::initialize(uint32_t p_device_index, uint32_t p
|
|||||||
err = _initialize_command_signatures();
|
err = _initialize_command_signatures();
|
||||||
ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
|
ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
|
||||||
|
|
||||||
glsl_type_singleton_init_or_ref();
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6688,7 +6688,6 @@ Error RenderingDevice::initialize(RenderingContextDriver *p_context, DisplayServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
frame = 0;
|
frame = 0;
|
||||||
frames.resize(frame_count);
|
|
||||||
max_timestamp_query_elements = GLOBAL_GET("debug/settings/profiler/max_timestamp_query_elements");
|
max_timestamp_query_elements = GLOBAL_GET("debug/settings/profiler/max_timestamp_query_elements");
|
||||||
|
|
||||||
device = context->device_get(device_index);
|
device = context->device_get(device_index);
|
||||||
@ -6757,6 +6756,8 @@ Error RenderingDevice::initialize(RenderingContextDriver *p_context, DisplayServ
|
|||||||
// Use the processor count as the max amount of transfer workers that can be created.
|
// Use the processor count as the max amount of transfer workers that can be created.
|
||||||
transfer_worker_pool_max_size = OS::get_singleton()->get_processor_count();
|
transfer_worker_pool_max_size = OS::get_singleton()->get_processor_count();
|
||||||
|
|
||||||
|
frames.resize(frame_count);
|
||||||
|
|
||||||
// Create data for all the frames.
|
// Create data for all the frames.
|
||||||
for (uint32_t i = 0; i < frames.size(); i++) {
|
for (uint32_t i = 0; i < frames.size(); i++) {
|
||||||
frames[i].index = 0;
|
frames[i].index = 0;
|
||||||
|
|||||||
@ -1575,7 +1575,9 @@ void RenderingDeviceGraph::initialize(RDD *p_driver, RenderingContextDriver::Dev
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderingDeviceGraph::finalize() {
|
void RenderingDeviceGraph::finalize() {
|
||||||
_wait_for_secondary_command_buffer_tasks();
|
if (!frames.is_empty()) {
|
||||||
|
_wait_for_secondary_command_buffer_tasks();
|
||||||
|
}
|
||||||
|
|
||||||
for (Frame &f : frames) {
|
for (Frame &f : frames) {
|
||||||
for (SecondaryCommandBuffer &secondary : f.secondary_command_buffers) {
|
for (SecondaryCommandBuffer &secondary : f.secondary_command_buffers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user