summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-11-20 10:41:27 +0100
committerLioncash <mathew1800@gmail.com>2020-11-20 10:41:29 +0100
commit3fcc98e11adc1cafc4644483a81b29e55e90d11a (patch)
tree1d918c8a7d8ac715b00a53a7c2c4f165a3c30ad7 /src/video_core
parentasync_shaders: std::move data within QueueVulkanShader() (diff)
downloadyuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.tar
yuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.tar.gz
yuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.tar.bz2
yuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.tar.lz
yuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.tar.xz
yuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.tar.zst
yuzu-3fcc98e11adc1cafc4644483a81b29e55e90d11a.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/shader/async_shaders.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp
index c106b2a20..c6bd75b7c 100644
--- a/src/video_core/shader/async_shaders.cpp
+++ b/src/video_core/shader/async_shaders.cpp
@@ -116,11 +116,10 @@ std::vector<AsyncShaders::Result> AsyncShaders::GetCompletedWork() {
void AsyncShaders::QueueOpenGLShader(const OpenGL::Device& device,
Tegra::Engines::ShaderType shader_type, u64 uid,
std::vector<u64> code, std::vector<u64> code_b,
- u32 main_offset,
- VideoCommon::Shader::CompilerSettings compiler_settings,
- const VideoCommon::Shader::Registry& registry,
- VAddr cpu_addr) {
- WorkerParams params{
+ u32 main_offset, CompilerSettings compiler_settings,
+ const Registry& registry, VAddr cpu_addr) {
+ std::unique_lock lock(queue_mutex);
+ pending_queue.push({
.backend = device.UseAssemblyShaders() ? Backend::GLASM : Backend::OpenGL,
.device = &device,
.shader_type = shader_type,
@@ -131,9 +130,7 @@ void AsyncShaders::QueueOpenGLShader(const OpenGL::Device& device,
.compiler_settings = compiler_settings,
.registry = registry,
.cpu_address = cpu_addr,
- };
- std::unique_lock lock(queue_mutex);
- pending_queue.push(std::move(params));
+ });
cv.notify_one();
}
@@ -145,7 +142,8 @@ void AsyncShaders::QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache,
std::vector<VkDescriptorSetLayoutBinding> bindings,
Vulkan::SPIRVProgram program,
Vulkan::GraphicsPipelineCacheKey key) {
- WorkerParams params{
+ std::unique_lock lock(queue_mutex);
+ pending_queue.push({
.backend = Backend::Vulkan,
.pp_cache = pp_cache,
.vk_device = &device,
@@ -156,10 +154,7 @@ void AsyncShaders::QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache,
.bindings = std::move(bindings),
.program = std::move(program),
.key = key,
- };
-
- std::unique_lock lock(queue_mutex);
- pending_queue.push(std::move(params));
+ });
cv.notify_one();
}