diff options
Diffstat (limited to '')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt | 34 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 9 |
2 files changed, 30 insertions, 13 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt index ea8eb073a..18bc34b9f 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt @@ -5,6 +5,9 @@ package org.yuzu.yuzu_emu.fragments import android.app.Dialog import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.DialogFragment @@ -21,22 +24,40 @@ import org.yuzu.yuzu_emu.model.TaskViewModel class IndeterminateProgressDialogFragment : DialogFragment() { private val taskViewModel: TaskViewModel by activityViewModels() + private lateinit var binding: DialogProgressBarBinding + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { val titleId = requireArguments().getInt(TITLE) - val progressBinding = DialogProgressBarBinding.inflate(layoutInflater) - progressBinding.progressBar.isIndeterminate = true + binding = DialogProgressBarBinding.inflate(layoutInflater) + binding.progressBar.isIndeterminate = true val dialog = MaterialAlertDialogBuilder(requireContext()) .setTitle(titleId) - .setView(progressBinding.root) + .setView(binding.root) .create() dialog.setCanceledOnTouchOutside(false) + if (!taskViewModel.isRunning.value) { + taskViewModel.runTask() + } + return dialog + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) viewLifecycleOwner.lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.CREATED) { taskViewModel.isComplete.collect { if (it) { - dialog.dismiss() + dismiss() when (val result = taskViewModel.result.value) { is String -> Toast.makeText(requireContext(), result, Toast.LENGTH_LONG) .show() @@ -51,11 +72,6 @@ class IndeterminateProgressDialogFragment : DialogFragment() { } } } - - if (!taskViewModel.isRunning.value) { - taskViewModel.runTask() - } - return dialog } companion object { diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 4f83a88e1..a1ec1a100 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -294,10 +294,11 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device texture_cache{texture_cache_}, shader_notify{shader_notify_}, use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()}, use_vulkan_pipeline_cache{Settings::values.use_vulkan_driver_pipeline_cache.GetValue()}, - workers(device.GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY - ? 1 - : (std::max(std::thread::hardware_concurrency(), 2U) - 1), - "VkPipelineBuilder"), +#ifdef ANDROID + workers(1, "VkPipelineBuilder"), +#else + workers(std::max(std::thread::hardware_concurrency(), 2U) - 1, "VkPipelineBuilder"), +#endif serialization_thread(1, "VkPipelineSerialization") { const auto& float_control{device.FloatControlProperties()}; const VkDriverId driver_id{device.GetDriverID()}; |