diff options
| author | 2020-05-15 02:24:42 -0300 | |
|---|---|---|
| committer | 2020-05-21 23:20:43 -0300 | |
| commit | 5d0986a53be495f2a2158968db1bc0974f0dd0d3 (patch) | |
| tree | 76b89957701a3e8cec21211b0090f8517b9338af /src/video_core/renderer_vulkan | |
| parent | Merge pull request #3926 from ogniK5377/keyboard-states (diff) | |
| download | yuzu-5d0986a53be495f2a2158968db1bc0974f0dd0d3.tar.gz yuzu-5d0986a53be495f2a2158968db1bc0974f0dd0d3.tar.xz yuzu-5d0986a53be495f2a2158968db1bc0974f0dd0d3.zip | |
shader/other: Implement BAR.SYNC 0x0
Trivially implement this particular case of BAR. Unless games use OpenCL
or CUDA barriers, we shouldn't hit any other case here.
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 167e20e91..78963901c 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -2181,6 +2181,22 @@ private: | |||
| 2181 | return {OpSubgroupReadInvocationKHR(t_float, value, index), Type::Float}; | 2181 | return {OpSubgroupReadInvocationKHR(t_float, value, index), Type::Float}; |
| 2182 | } | 2182 | } |
| 2183 | 2183 | ||
| 2184 | Expression Barrier(Operation) { | ||
| 2185 | if (!ir.IsDecompiled()) { | ||
| 2186 | LOG_ERROR(Render_Vulkan, "OpBarrier used by shader is not decompiled"); | ||
| 2187 | return {}; | ||
| 2188 | } | ||
| 2189 | |||
| 2190 | const auto scope = spv::Scope::Workgroup; | ||
| 2191 | const auto memory = spv::Scope::Workgroup; | ||
| 2192 | const auto semantics = | ||
| 2193 | spv::MemorySemanticsMask::WorkgroupMemory | spv::MemorySemanticsMask::AcquireRelease; | ||
| 2194 | OpControlBarrier(Constant(t_uint, static_cast<u32>(scope)), | ||
| 2195 | Constant(t_uint, static_cast<u32>(memory)), | ||
| 2196 | Constant(t_uint, static_cast<u32>(semantics))); | ||
| 2197 | return {}; | ||
| 2198 | } | ||
| 2199 | |||
| 2184 | Expression MemoryBarrierGL(Operation) { | 2200 | Expression MemoryBarrierGL(Operation) { |
| 2185 | const auto scope = spv::Scope::Device; | 2201 | const auto scope = spv::Scope::Device; |
| 2186 | const auto semantics = | 2202 | const auto semantics = |
| @@ -2641,6 +2657,7 @@ private: | |||
| 2641 | &SPIRVDecompiler::ThreadId, | 2657 | &SPIRVDecompiler::ThreadId, |
| 2642 | &SPIRVDecompiler::ShuffleIndexed, | 2658 | &SPIRVDecompiler::ShuffleIndexed, |
| 2643 | 2659 | ||
| 2660 | &SPIRVDecompiler::Barrier, | ||
| 2644 | &SPIRVDecompiler::MemoryBarrierGL, | 2661 | &SPIRVDecompiler::MemoryBarrierGL, |
| 2645 | }; | 2662 | }; |
| 2646 | static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount)); | 2663 | static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount)); |