vk: Do not access async scheduler if not explicitly initialized
This commit is contained in:
@@ -505,16 +505,17 @@ void VKGSRender::load_texture_env()
|
||||
}
|
||||
}
|
||||
|
||||
if (g_cfg.video.vk.asynchronous_texture_streaming)
|
||||
if (backend_config.supports_asynchronous_compute)
|
||||
{
|
||||
// We have to do this here, because we have to assume the CB will be dumped
|
||||
auto& async_task_scheduler = g_fxo->get<vk::AsyncTaskScheduler>();
|
||||
auto async_task_scheduler = g_fxo->try_get<vk::AsyncTaskScheduler>();
|
||||
|
||||
if (async_task_scheduler.is_recording() &&
|
||||
!async_task_scheduler.is_host_mode())
|
||||
if (async_task_scheduler &&
|
||||
async_task_scheduler->is_recording() &&
|
||||
!async_task_scheduler->is_host_mode())
|
||||
{
|
||||
// Sync any async scheduler tasks
|
||||
if (auto ev = async_task_scheduler.get_primary_sync_label())
|
||||
if (auto ev = async_task_scheduler->get_primary_sync_label())
|
||||
{
|
||||
ev->gpu_wait(*m_current_command_buffer, m_async_compute_dependency_info);
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ namespace vk
|
||||
static const vk::command_buffer& prepare_for_transfer(const vk::command_buffer& primary_cb, vk::image* dst_image, rsx::flags32_t& flags)
|
||||
{
|
||||
AsyncTaskScheduler* async_scheduler = (flags & image_upload_options::upload_contents_async)
|
||||
? std::addressof(g_fxo->get<AsyncTaskScheduler>())
|
||||
? g_fxo->try_get<AsyncTaskScheduler>()
|
||||
: nullptr;
|
||||
|
||||
if (async_scheduler && (dst_image->aspect() & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)))
|
||||
|
||||
@@ -1115,7 +1115,7 @@ namespace vk
|
||||
const bool upload_async = rsx::get_current_renderer()->get_backend_config().supports_asynchronous_compute;
|
||||
rsx::flags32_t create_flags = 0;
|
||||
|
||||
if (upload_async && g_fxo->get<AsyncTaskScheduler>().is_host_mode())
|
||||
if (upload_async && ensure(g_fxo->try_get<AsyncTaskScheduler>())->is_host_mode())
|
||||
{
|
||||
create_flags |= texture_create_flags::do_not_reuse;
|
||||
if (m_device->get_graphics_queue() != m_device->get_transfer_queue())
|
||||
|
||||
Reference in New Issue
Block a user