summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/renderer/command/command_buffer.cpp2
-rw-r--r--src/audio_core/renderer/command/mix/depop_prepare.cpp2
-rw-r--r--src/audio_core/renderer/effect/effect_info_base.h8
-rw-r--r--src/common/threadsafe_queue.h2
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/service.cpp7
-rw-r--r--src/core/loader/elf.cpp263
-rw-r--r--src/core/loader/elf.h36
-rw-r--r--src/core/loader/loader.cpp11
-rw-r--r--src/core/loader/loader.h1
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_util.cpp1
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp369
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.h3
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp2
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp234
-rw-r--r--src/yuzu/applets/qt_profile_select.cpp1
-rw-r--r--src/yuzu/loading_screen.cpp4
-rw-r--r--src/yuzu/main.cpp30
-rw-r--r--src/yuzu/main.h2
22 files changed, 382 insertions, 604 deletions
diff --git a/src/audio_core/renderer/command/command_buffer.cpp b/src/audio_core/renderer/command/command_buffer.cpp
index 40074cf14..2ef879ee1 100644
--- a/src/audio_core/renderer/command/command_buffer.cpp
+++ b/src/audio_core/renderer/command/command_buffer.cpp
@@ -339,7 +339,7 @@ void CommandBuffer::GenerateDepopPrepareCommand(const s32 node_id, const VoiceSt
339 cmd.previous_samples = memory_pool->Translate(CpuAddr(voice_state.previous_samples.data()), 339 cmd.previous_samples = memory_pool->Translate(CpuAddr(voice_state.previous_samples.data()),
340 MaxMixBuffers * sizeof(s32)); 340 MaxMixBuffers * sizeof(s32));
341 cmd.buffer_count = buffer_count; 341 cmd.buffer_count = buffer_count;
342 cmd.depop_buffer = memory_pool->Translate(CpuAddr(buffer.data()), buffer_count * sizeof(s32)); 342 cmd.depop_buffer = memory_pool->Translate(CpuAddr(buffer.data()), buffer.size_bytes());
343 343
344 GenerateEnd<DepopPrepareCommand>(cmd); 344 GenerateEnd<DepopPrepareCommand>(cmd);
345} 345}
diff --git a/src/audio_core/renderer/command/mix/depop_prepare.cpp b/src/audio_core/renderer/command/mix/depop_prepare.cpp
index 2ee076ef6..69bb78ccc 100644
--- a/src/audio_core/renderer/command/mix/depop_prepare.cpp
+++ b/src/audio_core/renderer/command/mix/depop_prepare.cpp
@@ -19,7 +19,7 @@ void DepopPrepareCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor
19 19
20void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) { 20void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) {
21 auto samples{reinterpret_cast<s32*>(previous_samples)}; 21 auto samples{reinterpret_cast<s32*>(previous_samples)};
22 auto buffer{std::span(reinterpret_cast<s32*>(depop_buffer), buffer_count)}; 22 auto buffer{reinterpret_cast<s32*>(depop_buffer)};
23 23
24 for (u32 i = 0; i < buffer_count; i++) { 24 for (u32 i = 0; i < buffer_count; i++) {
25 if (samples[i]) { 25 if (samples[i]) {
diff --git a/src/audio_core/renderer/effect/effect_info_base.h b/src/audio_core/renderer/effect/effect_info_base.h
index 43d0589cc..8c9583878 100644
--- a/src/audio_core/renderer/effect/effect_info_base.h
+++ b/src/audio_core/renderer/effect/effect_info_base.h
@@ -419,13 +419,13 @@ protected:
419 /// Workbuffers assigned to this effect 419 /// Workbuffers assigned to this effect
420 std::array<AddressInfo, 2> workbuffers{AddressInfo(CpuAddr(0), 0), AddressInfo(CpuAddr(0), 0)}; 420 std::array<AddressInfo, 2> workbuffers{AddressInfo(CpuAddr(0), 0), AddressInfo(CpuAddr(0), 0)};
421 /// Aux/Capture buffer info for reading 421 /// Aux/Capture buffer info for reading
422 CpuAddr send_buffer_info; 422 CpuAddr send_buffer_info{};
423 /// Aux/Capture buffer for reading 423 /// Aux/Capture buffer for reading
424 CpuAddr send_buffer; 424 CpuAddr send_buffer{};
425 /// Aux/Capture buffer info for writing 425 /// Aux/Capture buffer info for writing
426 CpuAddr return_buffer_info; 426 CpuAddr return_buffer_info{};
427 /// Aux/Capture buffer for writing 427 /// Aux/Capture buffer for writing
428 CpuAddr return_buffer; 428 CpuAddr return_buffer{};
429 /// Parameters of this effect 429 /// Parameters of this effect
430 std::array<u8, sizeof(InParameterVersion2)> parameter{}; 430 std::array<u8, sizeof(InParameterVersion2)> parameter{};
431 /// State of this effect used by the AudioRenderer across calls 431 /// State of this effect used by the AudioRenderer across calls
diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h
index f7ae9d8c2..053798e79 100644
--- a/src/common/threadsafe_queue.h
+++ b/src/common/threadsafe_queue.h
@@ -39,7 +39,7 @@ public:
39 template <typename Arg> 39 template <typename Arg>
40 void Push(Arg&& t) { 40 void Push(Arg&& t) {
41 // create the element, add it to the queue 41 // create the element, add it to the queue
42 write_ptr->current = std::forward<Arg>(t); 42 write_ptr->current = std::move(t);
43 // set the next pointer to a new element ptr 43 // set the next pointer to a new element ptr
44 // then advance the write pointer 44 // then advance the write pointer
45 ElementPtr* new_ptr = new ElementPtr(); 45 ElementPtr* new_ptr = new ElementPtr();
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 40b1ea4a2..9dbe5bdca 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -727,8 +727,6 @@ add_library(core STATIC
727 internal_network/sockets.h 727 internal_network/sockets.h
728 loader/deconstructed_rom_directory.cpp 728 loader/deconstructed_rom_directory.cpp
729 loader/deconstructed_rom_directory.h 729 loader/deconstructed_rom_directory.h
730 loader/elf.cpp
731 loader/elf.h
732 loader/kip.cpp 730 loader/kip.cpp
733 loader/kip.h 731 loader/kip.h
734 loader/loader.cpp 732 loader/loader.cpp
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index c64291e7f..dadaf897f 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -194,13 +194,16 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session,
194 Kernel::HLERequestContext& ctx) { 194 Kernel::HLERequestContext& ctx) {
195 const auto guard = LockService(); 195 const auto guard = LockService();
196 196
197 Result result = ResultSuccess;
198
197 switch (ctx.GetCommandType()) { 199 switch (ctx.GetCommandType()) {
198 case IPC::CommandType::Close: 200 case IPC::CommandType::Close:
199 case IPC::CommandType::TIPC_Close: { 201 case IPC::CommandType::TIPC_Close: {
200 session.Close(); 202 session.Close();
201 IPC::ResponseBuilder rb{ctx, 2}; 203 IPC::ResponseBuilder rb{ctx, 2};
202 rb.Push(ResultSuccess); 204 rb.Push(ResultSuccess);
203 return IPC::ERR_REMOTE_PROCESS_DEAD; 205 result = IPC::ERR_REMOTE_PROCESS_DEAD;
206 break;
204 } 207 }
205 case IPC::CommandType::ControlWithContext: 208 case IPC::CommandType::ControlWithContext:
206 case IPC::CommandType::Control: { 209 case IPC::CommandType::Control: {
@@ -227,7 +230,7 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session,
227 ctx.WriteToOutgoingCommandBuffer(ctx.GetThread()); 230 ctx.WriteToOutgoingCommandBuffer(ctx.GetThread());
228 } 231 }
229 232
230 return ResultSuccess; 233 return result;
231} 234}
232 235
233/// Initialize Services 236/// Initialize Services
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
deleted file mode 100644
index dfb10c34f..000000000
--- a/src/core/loader/elf.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
1// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
2// SPDX-FileCopyrightText: 2014 Citra Emulator Project
3// SPDX-License-Identifier: GPL-2.0-or-later
4
5#include <cstring>
6#include <memory>
7#include "common/common_funcs.h"
8#include "common/common_types.h"
9#include "common/elf.h"
10#include "common/logging/log.h"
11#include "core/hle/kernel/code_set.h"
12#include "core/hle/kernel/k_page_table.h"
13#include "core/hle/kernel/k_process.h"
14#include "core/loader/elf.h"
15#include "core/memory.h"
16
17using namespace Common::ELF;
18
19////////////////////////////////////////////////////////////////////////////////////////////////////
20// ElfReader class
21
22typedef int SectionID;
23
24class ElfReader {
25private:
26 char* base;
27 u32* base32;
28
29 Elf32_Ehdr* header;
30 Elf32_Phdr* segments;
31 Elf32_Shdr* sections;
32
33 u32* sectionAddrs;
34 bool relocate;
35 VAddr entryPoint;
36
37public:
38 explicit ElfReader(void* ptr);
39
40 u32 Read32(int off) const {
41 return base32[off >> 2];
42 }
43
44 // Quick accessors
45 u16 GetType() const {
46 return header->e_type;
47 }
48 u16 GetMachine() const {
49 return header->e_machine;
50 }
51 VAddr GetEntryPoint() const {
52 return entryPoint;
53 }
54 u32 GetFlags() const {
55 return (u32)(header->e_flags);
56 }
57 Kernel::CodeSet LoadInto(VAddr vaddr);
58
59 int GetNumSegments() const {
60 return (int)(header->e_phnum);
61 }
62 int GetNumSections() const {
63 return (int)(header->e_shnum);
64 }
65 const u8* GetPtr(int offset) const {
66 return (u8*)base + offset;
67 }
68 const char* GetSectionName(int section) const;
69 const u8* GetSectionDataPtr(int section) const {
70 if (section < 0 || section >= header->e_shnum)
71 return nullptr;
72 if (sections[section].sh_type != ElfShtNobits)
73 return GetPtr(sections[section].sh_offset);
74 else
75 return nullptr;
76 }
77 bool IsCodeSection(int section) const {
78 return sections[section].sh_type == ElfShtProgBits;
79 }
80 const u8* GetSegmentPtr(int segment) {
81 return GetPtr(segments[segment].p_offset);
82 }
83 u32 GetSectionAddr(SectionID section) const {
84 return sectionAddrs[section];
85 }
86 unsigned int GetSectionSize(SectionID section) const {
87 return sections[section].sh_size;
88 }
89 SectionID GetSectionByName(const char* name, int firstSection = 0) const; //-1 for not found
90
91 bool DidRelocate() const {
92 return relocate;
93 }
94};
95
96ElfReader::ElfReader(void* ptr) {
97 base = (char*)ptr;
98 base32 = (u32*)ptr;
99 header = (Elf32_Ehdr*)ptr;
100
101 segments = (Elf32_Phdr*)(base + header->e_phoff);
102 sections = (Elf32_Shdr*)(base + header->e_shoff);
103
104 entryPoint = header->e_entry;
105}
106
107const char* ElfReader::GetSectionName(int section) const {
108 if (sections[section].sh_type == ElfShtNull)
109 return nullptr;
110
111 int name_offset = sections[section].sh_name;
112 const char* ptr = reinterpret_cast<const char*>(GetSectionDataPtr(header->e_shstrndx));
113
114 if (ptr)
115 return ptr + name_offset;
116
117 return nullptr;
118}
119
120Kernel::CodeSet ElfReader::LoadInto(VAddr vaddr) {
121 LOG_DEBUG(Loader, "String section: {}", header->e_shstrndx);
122
123 // Should we relocate?
124 relocate = (header->e_type != ElfTypeExec);
125
126 if (relocate) {
127 LOG_DEBUG(Loader, "Relocatable module");
128 entryPoint += vaddr;
129 } else {
130 LOG_DEBUG(Loader, "Prerelocated executable");
131 }
132 LOG_DEBUG(Loader, "{} segments:", header->e_phnum);
133
134 // First pass : Get the bits into RAM
135 const VAddr base_addr = relocate ? vaddr : 0;
136
137 u64 total_image_size = 0;
138 for (unsigned int i = 0; i < header->e_phnum; ++i) {
139 const Elf32_Phdr* p = &segments[i];
140 if (p->p_type == ElfPtLoad) {
141 total_image_size += (p->p_memsz + 0xFFF) & ~0xFFF;
142 }
143 }
144
145 Kernel::PhysicalMemory program_image(total_image_size);
146 std::size_t current_image_position = 0;
147
148 Kernel::CodeSet codeset;
149
150 for (unsigned int i = 0; i < header->e_phnum; ++i) {
151 const Elf32_Phdr* p = &segments[i];
152 LOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type,
153 p->p_vaddr, p->p_filesz, p->p_memsz);
154
155 if (p->p_type == ElfPtLoad) {
156 Kernel::CodeSet::Segment* codeset_segment;
157 u32 permission_flags = p->p_flags & (ElfPfRead | ElfPfWrite | ElfPfExec);
158 if (permission_flags == (ElfPfRead | ElfPfExec)) {
159 codeset_segment = &codeset.CodeSegment();
160 } else if (permission_flags == (ElfPfRead)) {
161 codeset_segment = &codeset.RODataSegment();
162 } else if (permission_flags == (ElfPfRead | ElfPfWrite)) {
163 codeset_segment = &codeset.DataSegment();
164 } else {
165 LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i,
166 p->p_flags);
167 continue;
168 }
169
170 if (codeset_segment->size != 0) {
171 LOG_ERROR(Loader,
172 "ELF has more than one segment of the same type. Skipping extra "
173 "segment (id {})",
174 i);
175 continue;
176 }
177
178 const VAddr segment_addr = base_addr + p->p_vaddr;
179 const u32 aligned_size = (p->p_memsz + 0xFFF) & ~0xFFF;
180
181 codeset_segment->offset = current_image_position;
182 codeset_segment->addr = segment_addr;
183 codeset_segment->size = aligned_size;
184
185 std::memcpy(program_image.data() + current_image_position, GetSegmentPtr(i),
186 p->p_filesz);
187 current_image_position += aligned_size;
188 }
189 }
190
191 codeset.entrypoint = base_addr + header->e_entry;
192 codeset.memory = std::move(program_image);
193
194 LOG_DEBUG(Loader, "Done loading.");
195
196 return codeset;
197}
198
199SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const {
200 for (int i = firstSection; i < header->e_shnum; i++) {
201 const char* secname = GetSectionName(i);
202
203 if (secname != nullptr && strcmp(name, secname) == 0)
204 return i;
205 }
206 return -1;
207}
208
209////////////////////////////////////////////////////////////////////////////////////////////////////
210// Loader namespace
211
212namespace Loader {
213
214AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {}
215
216FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& elf_file) {
217 static constexpr u16 ELF_MACHINE_ARM{0x28};
218
219 u32 magic = 0;
220 if (4 != elf_file->ReadObject(&magic)) {
221 return FileType::Error;
222 }
223
224 u16 machine = 0;
225 if (2 != elf_file->ReadObject(&machine, 18)) {
226 return FileType::Error;
227 }
228
229 if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) {
230 return FileType::ELF;
231 }
232
233 return FileType::Error;
234}
235
236AppLoader_ELF::LoadResult AppLoader_ELF::Load(Kernel::KProcess& process,
237 [[maybe_unused]] Core::System& system) {
238 if (is_loaded) {
239 return {ResultStatus::ErrorAlreadyLoaded, {}};
240 }
241
242 std::vector<u8> buffer = file->ReadAllBytes();
243 if (buffer.size() != file->GetSize()) {
244 return {ResultStatus::ErrorIncorrectELFFileSize, {}};
245 }
246
247 const VAddr base_address = process.PageTable().GetCodeRegionStart();
248 ElfReader elf_reader(&buffer[0]);
249 Kernel::CodeSet codeset = elf_reader.LoadInto(base_address);
250 const VAddr entry_point = codeset.entrypoint;
251
252 // Setup the process code layout
253 if (process.LoadFromMetadata(FileSys::ProgramMetadata::GetDefault(), buffer.size()).IsError()) {
254 return {ResultStatus::ErrorNotInitialized, {}};
255 }
256
257 process.LoadModule(std::move(codeset), entry_point);
258
259 is_loaded = true;
260 return {ResultStatus::Success, LoadParameters{48, Core::Memory::DEFAULT_STACK_SIZE}};
261}
262
263} // namespace Loader
diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h
deleted file mode 100644
index acd33dc3d..000000000
--- a/src/core/loader/elf.h
+++ /dev/null
@@ -1,36 +0,0 @@
1// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
2// SPDX-FileCopyrightText: 2014 Citra Emulator Project
3// SPDX-License-Identifier: GPL-2.0-or-later
4
5#pragma once
6
7#include "core/loader/loader.h"
8
9namespace Core {
10class System;
11}
12
13namespace Loader {
14
15/// Loads an ELF/AXF file
16class AppLoader_ELF final : public AppLoader {
17public:
18 explicit AppLoader_ELF(FileSys::VirtualFile file);
19
20 /**
21 * Identifies whether or not the given file is an ELF file.
22 *
23 * @param elf_file The file to identify.
24 *
25 * @return FileType::ELF, or FileType::Error if the file is not an ELF file.
26 */
27 static FileType IdentifyType(const FileSys::VirtualFile& elf_file);
28
29 FileType GetFileType() const override {
30 return IdentifyType(file);
31 }
32
33 LoadResult Load(Kernel::KProcess& process, Core::System& system) override;
34};
35
36} // namespace Loader
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 994ee891f..104d16efa 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -12,7 +12,6 @@
12#include "core/core.h" 12#include "core/core.h"
13#include "core/hle/kernel/k_process.h" 13#include "core/hle/kernel/k_process.h"
14#include "core/loader/deconstructed_rom_directory.h" 14#include "core/loader/deconstructed_rom_directory.h"
15#include "core/loader/elf.h"
16#include "core/loader/kip.h" 15#include "core/loader/kip.h"
17#include "core/loader/nax.h" 16#include "core/loader/nax.h"
18#include "core/loader/nca.h" 17#include "core/loader/nca.h"
@@ -39,8 +38,6 @@ std::optional<FileType> IdentifyFileLoader(FileSys::VirtualFile file) {
39FileType IdentifyFile(FileSys::VirtualFile file) { 38FileType IdentifyFile(FileSys::VirtualFile file) {
40 if (const auto romdir_type = IdentifyFileLoader<AppLoader_DeconstructedRomDirectory>(file)) { 39 if (const auto romdir_type = IdentifyFileLoader<AppLoader_DeconstructedRomDirectory>(file)) {
41 return *romdir_type; 40 return *romdir_type;
42 } else if (const auto elf_type = IdentifyFileLoader<AppLoader_ELF>(file)) {
43 return *elf_type;
44 } else if (const auto nso_type = IdentifyFileLoader<AppLoader_NSO>(file)) { 41 } else if (const auto nso_type = IdentifyFileLoader<AppLoader_NSO>(file)) {
45 return *nso_type; 42 return *nso_type;
46 } else if (const auto nro_type = IdentifyFileLoader<AppLoader_NRO>(file)) { 43 } else if (const auto nro_type = IdentifyFileLoader<AppLoader_NRO>(file)) {
@@ -69,8 +66,6 @@ FileType GuessFromFilename(const std::string& name) {
69 const std::string extension = 66 const std::string extension =
70 Common::ToLower(std::string(Common::FS::GetExtensionFromFilename(name))); 67 Common::ToLower(std::string(Common::FS::GetExtensionFromFilename(name)));
71 68
72 if (extension == "elf")
73 return FileType::ELF;
74 if (extension == "nro") 69 if (extension == "nro")
75 return FileType::NRO; 70 return FileType::NRO;
76 if (extension == "nso") 71 if (extension == "nso")
@@ -89,8 +84,6 @@ FileType GuessFromFilename(const std::string& name) {
89 84
90std::string GetFileTypeString(FileType type) { 85std::string GetFileTypeString(FileType type) {
91 switch (type) { 86 switch (type) {
92 case FileType::ELF:
93 return "ELF";
94 case FileType::NRO: 87 case FileType::NRO:
95 return "NRO"; 88 return "NRO";
96 case FileType::NSO: 89 case FileType::NSO:
@@ -208,10 +201,6 @@ static std::unique_ptr<AppLoader> GetFileLoader(Core::System& system, FileSys::V
208 FileType type, u64 program_id, 201 FileType type, u64 program_id,
209 std::size_t program_index) { 202 std::size_t program_index) {
210 switch (type) { 203 switch (type) {
211 // Standard ELF file format.
212 case FileType::ELF:
213 return std::make_unique<AppLoader_ELF>(std::move(file));
214
215 // NX NSO file format. 204 // NX NSO file format.
216 case FileType::NSO: 205 case FileType::NSO:
217 return std::make_unique<AppLoader_NSO>(std::move(file)); 206 return std::make_unique<AppLoader_NSO>(std::move(file));
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 7bf4faaf1..7b43f70ed 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -34,7 +34,6 @@ namespace Loader {
34enum class FileType { 34enum class FileType {
35 Error, 35 Error,
36 Unknown, 36 Unknown,
37 ELF,
38 NSO, 37 NSO,
39 NRO, 38 NRO,
40 NCA, 39 NCA,
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 07d4b7cf0..1ad56d9e7 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -299,7 +299,7 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
299 state.has_loaded = true; 299 state.has_loaded = true;
300 lock.unlock(); 300 lock.unlock();
301 301
302 workers->WaitForRequests(); 302 workers->WaitForRequests(stop_loading);
303 if (!use_asynchronous_shaders) { 303 if (!use_asynchronous_shaders) {
304 workers.reset(); 304 workers.reset();
305 } 305 }
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp
index f83ad0a5b..a0d9d10ef 100644
--- a/src/video_core/renderer_opengl/gl_shader_util.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_util.cpp
@@ -17,6 +17,7 @@ static OGLProgram LinkSeparableProgram(GLuint shader) {
17 glProgramParameteri(program.handle, GL_PROGRAM_SEPARABLE, GL_TRUE); 17 glProgramParameteri(program.handle, GL_PROGRAM_SEPARABLE, GL_TRUE);
18 glAttachShader(program.handle, shader); 18 glAttachShader(program.handle, shader);
19 glLinkProgram(program.handle); 19 glLinkProgram(program.handle);
20 glDetachShader(program.handle, shader);
20 if (!Settings::values.renderer_debug) { 21 if (!Settings::values.renderer_debug) {
21 return program; 22 return program;
22 } 23 }
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 689164a6a..7d1431b6d 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -317,195 +317,204 @@ VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const Device& device,
317 } 317 }
318} 318}
319 319
320VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size) { 320VkFormat VertexFormat(const Device& device, Maxwell::VertexAttribute::Type type,
321 switch (type) { 321 Maxwell::VertexAttribute::Size size) {
322 case Maxwell::VertexAttribute::Type::UnsignedNorm: 322 const VkFormat format{([&]() {
323 switch (size) { 323 switch (type) {
324 case Maxwell::VertexAttribute::Size::Size_8: 324 case Maxwell::VertexAttribute::Type::UnsignedNorm:
325 return VK_FORMAT_R8_UNORM; 325 switch (size) {
326 case Maxwell::VertexAttribute::Size::Size_8_8: 326 case Maxwell::VertexAttribute::Size::Size_8:
327 return VK_FORMAT_R8G8_UNORM; 327 return VK_FORMAT_R8_UNORM;
328 case Maxwell::VertexAttribute::Size::Size_8_8_8: 328 case Maxwell::VertexAttribute::Size::Size_8_8:
329 return VK_FORMAT_R8G8B8_UNORM; 329 return VK_FORMAT_R8G8_UNORM;
330 case Maxwell::VertexAttribute::Size::Size_8_8_8_8: 330 case Maxwell::VertexAttribute::Size::Size_8_8_8:
331 return VK_FORMAT_R8G8B8A8_UNORM; 331 return VK_FORMAT_R8G8B8_UNORM;
332 case Maxwell::VertexAttribute::Size::Size_16: 332 case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
333 return VK_FORMAT_R16_UNORM; 333 return VK_FORMAT_R8G8B8A8_UNORM;
334 case Maxwell::VertexAttribute::Size::Size_16_16: 334 case Maxwell::VertexAttribute::Size::Size_16:
335 return VK_FORMAT_R16G16_UNORM; 335 return VK_FORMAT_R16_UNORM;
336 case Maxwell::VertexAttribute::Size::Size_16_16_16: 336 case Maxwell::VertexAttribute::Size::Size_16_16:
337 return VK_FORMAT_R16G16B16_UNORM; 337 return VK_FORMAT_R16G16_UNORM;
338 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 338 case Maxwell::VertexAttribute::Size::Size_16_16_16:
339 return VK_FORMAT_R16G16B16A16_UNORM; 339 return VK_FORMAT_R16G16B16_UNORM;
340 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 340 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
341 return VK_FORMAT_A2B10G10R10_UNORM_PACK32; 341 return VK_FORMAT_R16G16B16A16_UNORM;
342 default: 342 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
343 return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
344 default:
345 break;
346 }
343 break; 347 break;
344 } 348 case Maxwell::VertexAttribute::Type::SignedNorm:
345 break; 349 switch (size) {
346 case Maxwell::VertexAttribute::Type::SignedNorm: 350 case Maxwell::VertexAttribute::Size::Size_8:
347 switch (size) { 351 return VK_FORMAT_R8_SNORM;
348 case Maxwell::VertexAttribute::Size::Size_8: 352 case Maxwell::VertexAttribute::Size::Size_8_8:
349 return VK_FORMAT_R8_SNORM; 353 return VK_FORMAT_R8G8_SNORM;
350 case Maxwell::VertexAttribute::Size::Size_8_8: 354 case Maxwell::VertexAttribute::Size::Size_8_8_8:
351 return VK_FORMAT_R8G8_SNORM; 355 return VK_FORMAT_R8G8B8_SNORM;
352 case Maxwell::VertexAttribute::Size::Size_8_8_8: 356 case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
353 return VK_FORMAT_R8G8B8_SNORM; 357 return VK_FORMAT_R8G8B8A8_SNORM;
354 case Maxwell::VertexAttribute::Size::Size_8_8_8_8: 358 case Maxwell::VertexAttribute::Size::Size_16:
355 return VK_FORMAT_R8G8B8A8_SNORM; 359 return VK_FORMAT_R16_SNORM;
356 case Maxwell::VertexAttribute::Size::Size_16: 360 case Maxwell::VertexAttribute::Size::Size_16_16:
357 return VK_FORMAT_R16_SNORM; 361 return VK_FORMAT_R16G16_SNORM;
358 case Maxwell::VertexAttribute::Size::Size_16_16: 362 case Maxwell::VertexAttribute::Size::Size_16_16_16:
359 return VK_FORMAT_R16G16_SNORM; 363 return VK_FORMAT_R16G16B16_SNORM;
360 case Maxwell::VertexAttribute::Size::Size_16_16_16: 364 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
361 return VK_FORMAT_R16G16B16_SNORM; 365 return VK_FORMAT_R16G16B16A16_SNORM;
362 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 366 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
363 return VK_FORMAT_R16G16B16A16_SNORM; 367 return VK_FORMAT_A2B10G10R10_SNORM_PACK32;
364 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 368 default:
365 return VK_FORMAT_A2B10G10R10_SNORM_PACK32; 369 break;
366 default: 370 }
367 break; 371 break;
368 } 372 case Maxwell::VertexAttribute::Type::UnsignedScaled:
369 break; 373 switch (size) {
370 case Maxwell::VertexAttribute::Type::UnsignedScaled: 374 case Maxwell::VertexAttribute::Size::Size_8:
371 switch (size) { 375 return VK_FORMAT_R8_USCALED;
372 case Maxwell::VertexAttribute::Size::Size_8: 376 case Maxwell::VertexAttribute::Size::Size_8_8:
373 return VK_FORMAT_R8_USCALED; 377 return VK_FORMAT_R8G8_USCALED;
374 case Maxwell::VertexAttribute::Size::Size_8_8: 378 case Maxwell::VertexAttribute::Size::Size_8_8_8:
375 return VK_FORMAT_R8G8_USCALED; 379 return VK_FORMAT_R8G8B8_USCALED;
376 case Maxwell::VertexAttribute::Size::Size_8_8_8: 380 case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
377 return VK_FORMAT_R8G8B8_USCALED; 381 return VK_FORMAT_R8G8B8A8_USCALED;
378 case Maxwell::VertexAttribute::Size::Size_8_8_8_8: 382 case Maxwell::VertexAttribute::Size::Size_16:
379 return VK_FORMAT_R8G8B8A8_USCALED; 383 return VK_FORMAT_R16_USCALED;
380 case Maxwell::VertexAttribute::Size::Size_16: 384 case Maxwell::VertexAttribute::Size::Size_16_16:
381 return VK_FORMAT_R16_USCALED; 385 return VK_FORMAT_R16G16_USCALED;
382 case Maxwell::VertexAttribute::Size::Size_16_16: 386 case Maxwell::VertexAttribute::Size::Size_16_16_16:
383 return VK_FORMAT_R16G16_USCALED; 387 return VK_FORMAT_R16G16B16_USCALED;
384 case Maxwell::VertexAttribute::Size::Size_16_16_16: 388 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
385 return VK_FORMAT_R16G16B16_USCALED; 389 return VK_FORMAT_R16G16B16A16_USCALED;
386 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 390 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
387 return VK_FORMAT_R16G16B16A16_USCALED; 391 return VK_FORMAT_A2B10G10R10_USCALED_PACK32;
388 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 392 default:
389 return VK_FORMAT_A2B10G10R10_USCALED_PACK32; 393 break;
390 default: 394 }
391 break; 395 break;
392 } 396 case Maxwell::VertexAttribute::Type::SignedScaled:
393 break; 397 switch (size) {
394 case Maxwell::VertexAttribute::Type::SignedScaled: 398 case Maxwell::VertexAttribute::Size::Size_8:
395 switch (size) { 399 return VK_FORMAT_R8_SSCALED;
396 case Maxwell::VertexAttribute::Size::Size_8: 400 case Maxwell::VertexAttribute::Size::Size_8_8:
397 return VK_FORMAT_R8_SSCALED; 401 return VK_FORMAT_R8G8_SSCALED;
398 case Maxwell::VertexAttribute::Size::Size_8_8: 402 case Maxwell::VertexAttribute::Size::Size_8_8_8:
399 return VK_FORMAT_R8G8_SSCALED; 403 return VK_FORMAT_R8G8B8_SSCALED;
400 case Maxwell::VertexAttribute::Size::Size_8_8_8: 404 case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
401 return VK_FORMAT_R8G8B8_SSCALED; 405 return VK_FORMAT_R8G8B8A8_SSCALED;
402 case Maxwell::VertexAttribute::Size::Size_8_8_8_8: 406 case Maxwell::VertexAttribute::Size::Size_16:
403 return VK_FORMAT_R8G8B8A8_SSCALED; 407 return VK_FORMAT_R16_SSCALED;
404 case Maxwell::VertexAttribute::Size::Size_16: 408 case Maxwell::VertexAttribute::Size::Size_16_16:
405 return VK_FORMAT_R16_SSCALED; 409 return VK_FORMAT_R16G16_SSCALED;
406 case Maxwell::VertexAttribute::Size::Size_16_16: 410 case Maxwell::VertexAttribute::Size::Size_16_16_16:
407 return VK_FORMAT_R16G16_SSCALED; 411 return VK_FORMAT_R16G16B16_SSCALED;
408 case Maxwell::VertexAttribute::Size::Size_16_16_16: 412 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
409 return VK_FORMAT_R16G16B16_SSCALED; 413 return VK_FORMAT_R16G16B16A16_SSCALED;
410 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 414 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
411 return VK_FORMAT_R16G16B16A16_SSCALED; 415 return VK_FORMAT_A2B10G10R10_SSCALED_PACK32;
412 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 416 default:
413 return VK_FORMAT_A2B10G10R10_SSCALED_PACK32; 417 break;
414 default: 418 }
415 break; 419 break;
416 } 420 case Maxwell::VertexAttribute::Type::UnsignedInt:
417 break; 421 switch (size) {
418 case Maxwell::VertexAttribute::Type::UnsignedInt: 422 case Maxwell::VertexAttribute::Size::Size_8:
419 switch (size) { 423 return VK_FORMAT_R8_UINT;
420 case Maxwell::VertexAttribute::Size::Size_8: 424 case Maxwell::VertexAttribute::Size::Size_8_8:
421 return VK_FORMAT_R8_UINT; 425 return VK_FORMAT_R8G8_UINT;
422 case Maxwell::VertexAttribute::Size::Size_8_8: 426 case Maxwell::VertexAttribute::Size::Size_8_8_8:
423 return VK_FORMAT_R8G8_UINT; 427 return VK_FORMAT_R8G8B8_UINT;
424 case Maxwell::VertexAttribute::Size::Size_8_8_8: 428 case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
425 return VK_FORMAT_R8G8B8_UINT; 429 return VK_FORMAT_R8G8B8A8_UINT;
426 case Maxwell::VertexAttribute::Size::Size_8_8_8_8: 430 case Maxwell::VertexAttribute::Size::Size_16:
427 return VK_FORMAT_R8G8B8A8_UINT; 431 return VK_FORMAT_R16_UINT;
428 case Maxwell::VertexAttribute::Size::Size_16: 432 case Maxwell::VertexAttribute::Size::Size_16_16:
429 return VK_FORMAT_R16_UINT; 433 return VK_FORMAT_R16G16_UINT;
430 case Maxwell::VertexAttribute::Size::Size_16_16: 434 case Maxwell::VertexAttribute::Size::Size_16_16_16:
431 return VK_FORMAT_R16G16_UINT; 435 return VK_FORMAT_R16G16B16_UINT;
432 case Maxwell::VertexAttribute::Size::Size_16_16_16: 436 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
433 return VK_FORMAT_R16G16B16_UINT; 437 return VK_FORMAT_R16G16B16A16_UINT;
434 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 438 case Maxwell::VertexAttribute::Size::Size_32:
435 return VK_FORMAT_R16G16B16A16_UINT; 439 return VK_FORMAT_R32_UINT;
436 case Maxwell::VertexAttribute::Size::Size_32: 440 case Maxwell::VertexAttribute::Size::Size_32_32:
437 return VK_FORMAT_R32_UINT; 441 return VK_FORMAT_R32G32_UINT;
438 case Maxwell::VertexAttribute::Size::Size_32_32: 442 case Maxwell::VertexAttribute::Size::Size_32_32_32:
439 return VK_FORMAT_R32G32_UINT; 443 return VK_FORMAT_R32G32B32_UINT;
440 case Maxwell::VertexAttribute::Size::Size_32_32_32: 444 case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
441 return VK_FORMAT_R32G32B32_UINT; 445 return VK_FORMAT_R32G32B32A32_UINT;
442 case Maxwell::VertexAttribute::Size::Size_32_32_32_32: 446 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
443 return VK_FORMAT_R32G32B32A32_UINT; 447 return VK_FORMAT_A2B10G10R10_UINT_PACK32;
444 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 448 default:
445 return VK_FORMAT_A2B10G10R10_UINT_PACK32; 449 break;
446 default: 450 }
447 break; 451 break;
448 } 452 case Maxwell::VertexAttribute::Type::SignedInt:
449 break; 453 switch (size) {
450 case Maxwell::VertexAttribute::Type::SignedInt: 454 case Maxwell::VertexAttribute::Size::Size_8:
451 switch (size) { 455 return VK_FORMAT_R8_SINT;
452 case Maxwell::VertexAttribute::Size::Size_8: 456 case Maxwell::VertexAttribute::Size::Size_8_8:
453 return VK_FORMAT_R8_SINT; 457 return VK_FORMAT_R8G8_SINT;
454 case Maxwell::VertexAttribute::Size::Size_8_8: 458 case Maxwell::VertexAttribute::Size::Size_8_8_8:
455 return VK_FORMAT_R8G8_SINT; 459 return VK_FORMAT_R8G8B8_SINT;
456 case Maxwell::VertexAttribute::Size::Size_8_8_8: 460 case Maxwell::VertexAttribute::Size::Size_8_8_8_8:
457 return VK_FORMAT_R8G8B8_SINT; 461 return VK_FORMAT_R8G8B8A8_SINT;
458 case Maxwell::VertexAttribute::Size::Size_8_8_8_8: 462 case Maxwell::VertexAttribute::Size::Size_16:
459 return VK_FORMAT_R8G8B8A8_SINT; 463 return VK_FORMAT_R16_SINT;
460 case Maxwell::VertexAttribute::Size::Size_16: 464 case Maxwell::VertexAttribute::Size::Size_16_16:
461 return VK_FORMAT_R16_SINT; 465 return VK_FORMAT_R16G16_SINT;
462 case Maxwell::VertexAttribute::Size::Size_16_16: 466 case Maxwell::VertexAttribute::Size::Size_16_16_16:
463 return VK_FORMAT_R16G16_SINT; 467 return VK_FORMAT_R16G16B16_SINT;
464 case Maxwell::VertexAttribute::Size::Size_16_16_16: 468 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
465 return VK_FORMAT_R16G16B16_SINT; 469 return VK_FORMAT_R16G16B16A16_SINT;
466 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 470 case Maxwell::VertexAttribute::Size::Size_32:
467 return VK_FORMAT_R16G16B16A16_SINT; 471 return VK_FORMAT_R32_SINT;
468 case Maxwell::VertexAttribute::Size::Size_32: 472 case Maxwell::VertexAttribute::Size::Size_32_32:
469 return VK_FORMAT_R32_SINT; 473 return VK_FORMAT_R32G32_SINT;
470 case Maxwell::VertexAttribute::Size::Size_32_32: 474 case Maxwell::VertexAttribute::Size::Size_32_32_32:
471 return VK_FORMAT_R32G32_SINT; 475 return VK_FORMAT_R32G32B32_SINT;
472 case Maxwell::VertexAttribute::Size::Size_32_32_32: 476 case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
473 return VK_FORMAT_R32G32B32_SINT; 477 return VK_FORMAT_R32G32B32A32_SINT;
474 case Maxwell::VertexAttribute::Size::Size_32_32_32_32: 478 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
475 return VK_FORMAT_R32G32B32A32_SINT; 479 return VK_FORMAT_A2B10G10R10_SINT_PACK32;
476 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 480 default:
477 return VK_FORMAT_A2B10G10R10_SINT_PACK32; 481 break;
478 default: 482 }
479 break; 483 break;
480 } 484 case Maxwell::VertexAttribute::Type::Float:
481 break; 485 switch (size) {
482 case Maxwell::VertexAttribute::Type::Float: 486 case Maxwell::VertexAttribute::Size::Size_16:
483 switch (size) { 487 return VK_FORMAT_R16_SFLOAT;
484 case Maxwell::VertexAttribute::Size::Size_16: 488 case Maxwell::VertexAttribute::Size::Size_16_16:
485 return VK_FORMAT_R16_SFLOAT; 489 return VK_FORMAT_R16G16_SFLOAT;
486 case Maxwell::VertexAttribute::Size::Size_16_16: 490 case Maxwell::VertexAttribute::Size::Size_16_16_16:
487 return VK_FORMAT_R16G16_SFLOAT; 491 return VK_FORMAT_R16G16B16_SFLOAT;
488 case Maxwell::VertexAttribute::Size::Size_16_16_16: 492 case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
489 return VK_FORMAT_R16G16B16_SFLOAT; 493 return VK_FORMAT_R16G16B16A16_SFLOAT;
490 case Maxwell::VertexAttribute::Size::Size_16_16_16_16: 494 case Maxwell::VertexAttribute::Size::Size_32:
491 return VK_FORMAT_R16G16B16A16_SFLOAT; 495 return VK_FORMAT_R32_SFLOAT;
492 case Maxwell::VertexAttribute::Size::Size_32: 496 case Maxwell::VertexAttribute::Size::Size_32_32:
493 return VK_FORMAT_R32_SFLOAT; 497 return VK_FORMAT_R32G32_SFLOAT;
494 case Maxwell::VertexAttribute::Size::Size_32_32: 498 case Maxwell::VertexAttribute::Size::Size_32_32_32:
495 return VK_FORMAT_R32G32_SFLOAT; 499 return VK_FORMAT_R32G32B32_SFLOAT;
496 case Maxwell::VertexAttribute::Size::Size_32_32_32: 500 case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
497 return VK_FORMAT_R32G32B32_SFLOAT; 501 return VK_FORMAT_R32G32B32A32_SFLOAT;
498 case Maxwell::VertexAttribute::Size::Size_32_32_32_32: 502 case Maxwell::VertexAttribute::Size::Size_11_11_10:
499 return VK_FORMAT_R32G32B32A32_SFLOAT; 503 return VK_FORMAT_B10G11R11_UFLOAT_PACK32;
500 case Maxwell::VertexAttribute::Size::Size_11_11_10: 504 default:
501 return VK_FORMAT_B10G11R11_UFLOAT_PACK32; 505 break;
502 default: 506 }
503 break; 507 break;
504 } 508 }
505 break; 509 return VK_FORMAT_UNDEFINED;
510 })()};
511
512 if (format == VK_FORMAT_UNDEFINED) {
513 UNIMPLEMENTED_MSG("Unimplemented vertex format of type={} and size={}", type, size);
506 } 514 }
507 UNIMPLEMENTED_MSG("Unimplemented vertex format of type={} and size={}", type, size); 515
508 return {}; 516 return device.GetSupportedFormat(format, VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT,
517 FormatType::Buffer);
509} 518}
510 519
511VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison) { 520VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison) {
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.h b/src/video_core/renderer_vulkan/maxwell_to_vk.h
index 9edd6af6a..356d46292 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.h
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.h
@@ -48,7 +48,8 @@ VkShaderStageFlagBits ShaderStage(Shader::Stage stage);
48 48
49VkPrimitiveTopology PrimitiveTopology(const Device& device, Maxwell::PrimitiveTopology topology); 49VkPrimitiveTopology PrimitiveTopology(const Device& device, Maxwell::PrimitiveTopology topology);
50 50
51VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size); 51VkFormat VertexFormat(const Device& device, Maxwell::VertexAttribute::Type type,
52 Maxwell::VertexAttribute::Size size);
52 53
53VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison); 54VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison);
54 55
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index 682f05335..5aca8f038 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -559,7 +559,7 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
559 vertex_attributes.push_back({ 559 vertex_attributes.push_back({
560 .location = static_cast<u32>(index), 560 .location = static_cast<u32>(index),
561 .binding = attribute.buffer, 561 .binding = attribute.buffer,
562 .format = MaxwellToVK::VertexFormat(attribute.Type(), attribute.Size()), 562 .format = MaxwellToVK::VertexFormat(device, attribute.Type(), attribute.Size()),
563 .offset = attribute.offset, 563 .offset = attribute.offset,
564 }); 564 });
565 } 565 }
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 09e035799..43cc94fab 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -452,7 +452,7 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading
452 state.has_loaded = true; 452 state.has_loaded = true;
453 lock.unlock(); 453 lock.unlock();
454 454
455 workers.WaitForRequests(); 455 workers.WaitForRequests(stop_loading);
456 456
457 if (state.statistics) { 457 if (state.statistics) {
458 state.statistics->Report(); 458 state.statistics->Report();
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 10f9fe7fe..16e46d3e5 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -939,7 +939,7 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs)
939 .pNext = nullptr, 939 .pNext = nullptr,
940 .location = static_cast<u32>(index), 940 .location = static_cast<u32>(index),
941 .binding = binding, 941 .binding = binding,
942 .format = MaxwellToVK::VertexFormat(attribute.type, attribute.size), 942 .format = MaxwellToVK::VertexFormat(device, attribute.type, attribute.size),
943 .offset = attribute.offset, 943 .offset = attribute.offset,
944 }); 944 });
945 } 945 }
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 743ac09f6..ddecfca13 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -50,6 +50,21 @@ constexpr std::array R4G4_UNORM_PACK8{
50 VK_FORMAT_UNDEFINED, 50 VK_FORMAT_UNDEFINED,
51}; 51};
52 52
53constexpr std::array R16G16B16_SFLOAT{
54 VK_FORMAT_R16G16B16A16_SFLOAT,
55 VK_FORMAT_UNDEFINED,
56};
57
58constexpr std::array R16G16B16_SSCALED{
59 VK_FORMAT_R16G16B16A16_SSCALED,
60 VK_FORMAT_UNDEFINED,
61};
62
63constexpr std::array R8G8B8_SSCALED{
64 VK_FORMAT_R8G8B8A8_SSCALED,
65 VK_FORMAT_UNDEFINED,
66};
67
53} // namespace Alternatives 68} // namespace Alternatives
54 69
55enum class NvidiaArchitecture { 70enum class NvidiaArchitecture {
@@ -102,6 +117,12 @@ constexpr const VkFormat* GetFormatAlternatives(VkFormat format) {
102 return Alternatives::B5G6R5_UNORM_PACK16.data(); 117 return Alternatives::B5G6R5_UNORM_PACK16.data();
103 case VK_FORMAT_R4G4_UNORM_PACK8: 118 case VK_FORMAT_R4G4_UNORM_PACK8:
104 return Alternatives::R4G4_UNORM_PACK8.data(); 119 return Alternatives::R4G4_UNORM_PACK8.data();
120 case VK_FORMAT_R16G16B16_SFLOAT:
121 return Alternatives::R16G16B16_SFLOAT.data();
122 case VK_FORMAT_R16G16B16_SSCALED:
123 return Alternatives::R16G16B16_SSCALED.data();
124 case VK_FORMAT_R8G8B8_SSCALED:
125 return Alternatives::R8G8B8_SSCALED.data();
105 default: 126 default:
106 return nullptr; 127 return nullptr;
107 } 128 }
@@ -122,109 +143,142 @@ VkFormatFeatureFlags GetFormatFeatures(VkFormatProperties properties, FormatType
122 143
123std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(vk::PhysicalDevice physical) { 144std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(vk::PhysicalDevice physical) {
124 static constexpr std::array formats{ 145 static constexpr std::array formats{
125 VK_FORMAT_A8B8G8R8_UNORM_PACK32, 146 VK_FORMAT_A1R5G5B5_UNORM_PACK16,
126 VK_FORMAT_A8B8G8R8_UINT_PACK32, 147 VK_FORMAT_A2B10G10R10_SINT_PACK32,
127 VK_FORMAT_A8B8G8R8_SNORM_PACK32, 148 VK_FORMAT_A2B10G10R10_SNORM_PACK32,
149 VK_FORMAT_A2B10G10R10_SSCALED_PACK32,
150 VK_FORMAT_A2B10G10R10_UINT_PACK32,
151 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
152 VK_FORMAT_A2B10G10R10_USCALED_PACK32,
128 VK_FORMAT_A8B8G8R8_SINT_PACK32, 153 VK_FORMAT_A8B8G8R8_SINT_PACK32,
154 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
129 VK_FORMAT_A8B8G8R8_SRGB_PACK32, 155 VK_FORMAT_A8B8G8R8_SRGB_PACK32,
130 VK_FORMAT_R5G6B5_UNORM_PACK16, 156 VK_FORMAT_A8B8G8R8_UINT_PACK32,
131 VK_FORMAT_B5G6R5_UNORM_PACK16, 157 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
132 VK_FORMAT_R5G5B5A1_UNORM_PACK16, 158 VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
159 VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
160 VK_FORMAT_ASTC_10x5_SRGB_BLOCK,
161 VK_FORMAT_ASTC_10x5_UNORM_BLOCK,
162 VK_FORMAT_ASTC_10x6_SRGB_BLOCK,
163 VK_FORMAT_ASTC_10x6_UNORM_BLOCK,
164 VK_FORMAT_ASTC_10x8_SRGB_BLOCK,
165 VK_FORMAT_ASTC_10x8_UNORM_BLOCK,
166 VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
167 VK_FORMAT_ASTC_12x10_UNORM_BLOCK,
168 VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
169 VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
170 VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
171 VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
172 VK_FORMAT_ASTC_5x4_SRGB_BLOCK,
173 VK_FORMAT_ASTC_5x4_UNORM_BLOCK,
174 VK_FORMAT_ASTC_5x5_SRGB_BLOCK,
175 VK_FORMAT_ASTC_5x5_UNORM_BLOCK,
176 VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
177 VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
178 VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
179 VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
180 VK_FORMAT_ASTC_8x5_SRGB_BLOCK,
181 VK_FORMAT_ASTC_8x5_UNORM_BLOCK,
182 VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
183 VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
184 VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
185 VK_FORMAT_ASTC_8x8_UNORM_BLOCK,
186 VK_FORMAT_B10G11R11_UFLOAT_PACK32,
187 VK_FORMAT_B4G4R4A4_UNORM_PACK16,
133 VK_FORMAT_B5G5R5A1_UNORM_PACK16, 188 VK_FORMAT_B5G5R5A1_UNORM_PACK16,
134 VK_FORMAT_A2B10G10R10_UNORM_PACK32, 189 VK_FORMAT_B5G6R5_UNORM_PACK16,
135 VK_FORMAT_A2B10G10R10_UINT_PACK32, 190 VK_FORMAT_B8G8R8A8_SRGB,
136 VK_FORMAT_A1R5G5B5_UNORM_PACK16, 191 VK_FORMAT_B8G8R8A8_UNORM,
137 VK_FORMAT_R32G32B32A32_SFLOAT, 192 VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
138 VK_FORMAT_R32G32B32A32_SINT, 193 VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
139 VK_FORMAT_R32G32B32A32_UINT, 194 VK_FORMAT_BC2_SRGB_BLOCK,
140 VK_FORMAT_R32G32_SFLOAT, 195 VK_FORMAT_BC2_UNORM_BLOCK,
141 VK_FORMAT_R32G32_SINT, 196 VK_FORMAT_BC3_SRGB_BLOCK,
142 VK_FORMAT_R32G32_UINT, 197 VK_FORMAT_BC3_UNORM_BLOCK,
198 VK_FORMAT_BC4_SNORM_BLOCK,
199 VK_FORMAT_BC4_UNORM_BLOCK,
200 VK_FORMAT_BC5_SNORM_BLOCK,
201 VK_FORMAT_BC5_UNORM_BLOCK,
202 VK_FORMAT_BC6H_SFLOAT_BLOCK,
203 VK_FORMAT_BC6H_UFLOAT_BLOCK,
204 VK_FORMAT_BC7_SRGB_BLOCK,
205 VK_FORMAT_BC7_UNORM_BLOCK,
206 VK_FORMAT_D16_UNORM,
207 VK_FORMAT_D16_UNORM_S8_UINT,
208 VK_FORMAT_D24_UNORM_S8_UINT,
209 VK_FORMAT_D32_SFLOAT,
210 VK_FORMAT_D32_SFLOAT_S8_UINT,
211 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
212 VK_FORMAT_R16G16B16A16_SFLOAT,
143 VK_FORMAT_R16G16B16A16_SINT, 213 VK_FORMAT_R16G16B16A16_SINT,
144 VK_FORMAT_R16G16B16A16_UINT,
145 VK_FORMAT_R16G16B16A16_SNORM, 214 VK_FORMAT_R16G16B16A16_SNORM,
215 VK_FORMAT_R16G16B16A16_SSCALED,
216 VK_FORMAT_R16G16B16A16_UINT,
146 VK_FORMAT_R16G16B16A16_UNORM, 217 VK_FORMAT_R16G16B16A16_UNORM,
147 VK_FORMAT_R16G16_UNORM, 218 VK_FORMAT_R16G16B16A16_USCALED,
148 VK_FORMAT_R16G16_SNORM, 219 VK_FORMAT_R16G16B16_SFLOAT,
220 VK_FORMAT_R16G16B16_SINT,
221 VK_FORMAT_R16G16B16_SNORM,
222 VK_FORMAT_R16G16B16_SSCALED,
223 VK_FORMAT_R16G16B16_UINT,
224 VK_FORMAT_R16G16B16_UNORM,
225 VK_FORMAT_R16G16B16_USCALED,
149 VK_FORMAT_R16G16_SFLOAT, 226 VK_FORMAT_R16G16_SFLOAT,
150 VK_FORMAT_R16G16_UINT,
151 VK_FORMAT_R16G16_SINT, 227 VK_FORMAT_R16G16_SINT,
152 VK_FORMAT_R16_UNORM, 228 VK_FORMAT_R16G16_SNORM,
229 VK_FORMAT_R16G16_SSCALED,
230 VK_FORMAT_R16G16_UINT,
231 VK_FORMAT_R16G16_UNORM,
232 VK_FORMAT_R16G16_USCALED,
233 VK_FORMAT_R16_SFLOAT,
234 VK_FORMAT_R16_SINT,
153 VK_FORMAT_R16_SNORM, 235 VK_FORMAT_R16_SNORM,
236 VK_FORMAT_R16_SSCALED,
154 VK_FORMAT_R16_UINT, 237 VK_FORMAT_R16_UINT,
238 VK_FORMAT_R16_UNORM,
239 VK_FORMAT_R16_USCALED,
240 VK_FORMAT_R32G32B32A32_SFLOAT,
241 VK_FORMAT_R32G32B32A32_SINT,
242 VK_FORMAT_R32G32B32A32_UINT,
243 VK_FORMAT_R32G32B32_SFLOAT,
244 VK_FORMAT_R32G32B32_SINT,
245 VK_FORMAT_R32G32B32_UINT,
246 VK_FORMAT_R32G32_SFLOAT,
247 VK_FORMAT_R32G32_SINT,
248 VK_FORMAT_R32G32_UINT,
249 VK_FORMAT_R32_SFLOAT,
250 VK_FORMAT_R32_SINT,
251 VK_FORMAT_R32_UINT,
252 VK_FORMAT_R4G4B4A4_UNORM_PACK16,
253 VK_FORMAT_R4G4_UNORM_PACK8,
254 VK_FORMAT_R5G5B5A1_UNORM_PACK16,
255 VK_FORMAT_R5G6B5_UNORM_PACK16,
256 VK_FORMAT_R8G8B8A8_SINT,
257 VK_FORMAT_R8G8B8A8_SNORM,
155 VK_FORMAT_R8G8B8A8_SRGB, 258 VK_FORMAT_R8G8B8A8_SRGB,
156 VK_FORMAT_R8G8_UNORM, 259 VK_FORMAT_R8G8B8A8_SSCALED,
157 VK_FORMAT_R8G8_SNORM, 260 VK_FORMAT_R8G8B8A8_UINT,
261 VK_FORMAT_R8G8B8A8_UNORM,
262 VK_FORMAT_R8G8B8A8_USCALED,
263 VK_FORMAT_R8G8B8_SINT,
264 VK_FORMAT_R8G8B8_SNORM,
265 VK_FORMAT_R8G8B8_SSCALED,
266 VK_FORMAT_R8G8B8_UINT,
267 VK_FORMAT_R8G8B8_UNORM,
268 VK_FORMAT_R8G8B8_USCALED,
158 VK_FORMAT_R8G8_SINT, 269 VK_FORMAT_R8G8_SINT,
270 VK_FORMAT_R8G8_SNORM,
271 VK_FORMAT_R8G8_SSCALED,
159 VK_FORMAT_R8G8_UINT, 272 VK_FORMAT_R8G8_UINT,
160 VK_FORMAT_R8_UNORM, 273 VK_FORMAT_R8G8_UNORM,
161 VK_FORMAT_R8_SNORM, 274 VK_FORMAT_R8G8_USCALED,
162 VK_FORMAT_R8_SINT, 275 VK_FORMAT_R8_SINT,
276 VK_FORMAT_R8_SNORM,
277 VK_FORMAT_R8_SSCALED,
163 VK_FORMAT_R8_UINT, 278 VK_FORMAT_R8_UINT,
164 VK_FORMAT_B10G11R11_UFLOAT_PACK32, 279 VK_FORMAT_R8_UNORM,
165 VK_FORMAT_R32_SFLOAT, 280 VK_FORMAT_R8_USCALED,
166 VK_FORMAT_R32_UINT,
167 VK_FORMAT_R32_SINT,
168 VK_FORMAT_R16_SFLOAT,
169 VK_FORMAT_R16G16B16A16_SFLOAT,
170 VK_FORMAT_B8G8R8A8_UNORM,
171 VK_FORMAT_B8G8R8A8_SRGB,
172 VK_FORMAT_R4G4_UNORM_PACK8,
173 VK_FORMAT_R4G4B4A4_UNORM_PACK16,
174 VK_FORMAT_B4G4R4A4_UNORM_PACK16,
175 VK_FORMAT_D32_SFLOAT,
176 VK_FORMAT_D16_UNORM,
177 VK_FORMAT_S8_UINT, 281 VK_FORMAT_S8_UINT,
178 VK_FORMAT_D16_UNORM_S8_UINT,
179 VK_FORMAT_D24_UNORM_S8_UINT,
180 VK_FORMAT_D32_SFLOAT_S8_UINT,
181 VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
182 VK_FORMAT_BC2_UNORM_BLOCK,
183 VK_FORMAT_BC3_UNORM_BLOCK,
184 VK_FORMAT_BC4_UNORM_BLOCK,
185 VK_FORMAT_BC4_SNORM_BLOCK,
186 VK_FORMAT_BC5_UNORM_BLOCK,
187 VK_FORMAT_BC5_SNORM_BLOCK,
188 VK_FORMAT_BC7_UNORM_BLOCK,
189 VK_FORMAT_BC6H_UFLOAT_BLOCK,
190 VK_FORMAT_BC6H_SFLOAT_BLOCK,
191 VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
192 VK_FORMAT_BC2_SRGB_BLOCK,
193 VK_FORMAT_BC3_SRGB_BLOCK,
194 VK_FORMAT_BC7_SRGB_BLOCK,
195 VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
196 VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
197 VK_FORMAT_ASTC_5x4_UNORM_BLOCK,
198 VK_FORMAT_ASTC_5x4_SRGB_BLOCK,
199 VK_FORMAT_ASTC_5x5_UNORM_BLOCK,
200 VK_FORMAT_ASTC_5x5_SRGB_BLOCK,
201 VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
202 VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
203 VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
204 VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
205 VK_FORMAT_ASTC_8x5_UNORM_BLOCK,
206 VK_FORMAT_ASTC_8x5_SRGB_BLOCK,
207 VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
208 VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
209 VK_FORMAT_ASTC_8x8_UNORM_BLOCK,
210 VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
211 VK_FORMAT_ASTC_10x5_UNORM_BLOCK,
212 VK_FORMAT_ASTC_10x5_SRGB_BLOCK,
213 VK_FORMAT_ASTC_10x6_UNORM_BLOCK,
214 VK_FORMAT_ASTC_10x6_SRGB_BLOCK,
215 VK_FORMAT_ASTC_10x8_UNORM_BLOCK,
216 VK_FORMAT_ASTC_10x8_SRGB_BLOCK,
217 VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
218 VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
219 VK_FORMAT_ASTC_12x10_UNORM_BLOCK,
220 VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
221 VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
222 VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
223 VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
224 VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
225 VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
226 VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
227 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
228 }; 282 };
229 std::unordered_map<VkFormat, VkFormatProperties> format_properties; 283 std::unordered_map<VkFormat, VkFormatProperties> format_properties;
230 for (const auto format : formats) { 284 for (const auto format : formats) {
@@ -739,9 +793,9 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags
739 if (!IsFormatSupported(alternative, wanted_usage, format_type)) { 793 if (!IsFormatSupported(alternative, wanted_usage, format_type)) {
740 continue; 794 continue;
741 } 795 }
742 LOG_WARNING(Render_Vulkan, 796 LOG_DEBUG(Render_Vulkan,
743 "Emulating format={} with alternative format={} with usage={} and type={}", 797 "Emulating format={} with alternative format={} with usage={} and type={}",
744 wanted_format, alternative, wanted_usage, format_type); 798 wanted_format, alternative, wanted_usage, format_type);
745 return alternative; 799 return alternative;
746 } 800 }
747 801
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp
index 826c6c224..c8bcfb223 100644
--- a/src/yuzu/applets/qt_profile_select.cpp
+++ b/src/yuzu/applets/qt_profile_select.cpp
@@ -100,6 +100,7 @@ QtProfileSelectionDialog::QtProfileSelectionDialog(Core::HID::HIDCore& hid_core,
100 } 100 }
101 QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); 101 QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier);
102 QCoreApplication::postEvent(tree_view, event); 102 QCoreApplication::postEvent(tree_view, event);
103 SelectUser(tree_view->currentIndex());
103 }); 104 });
104 105
105 const auto& profiles = profile_manager->GetAllUsers(); 106 const auto& profiles = profile_manager->GetAllUsers();
diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp
index e273744fd..e263a07a7 100644
--- a/src/yuzu/loading_screen.cpp
+++ b/src/yuzu/loading_screen.cpp
@@ -147,6 +147,10 @@ void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size
147 ui->progress_bar->setMaximum(static_cast<int>(total)); 147 ui->progress_bar->setMaximum(static_cast<int>(total));
148 previous_total = total; 148 previous_total = total;
149 } 149 }
150 // Reset the progress bar ranges if compilation is done
151 if (stage == VideoCore::LoadCallbackStage::Complete) {
152 ui->progress_bar->setRange(0, 0);
153 }
150 154
151 QString estimate; 155 QString estimate;
152 // If theres a drastic slowdown in the rate, then display an estimate 156 // If theres a drastic slowdown in the rate, then display an estimate
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e8a57f4b4..dc7b343d9 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1076,12 +1076,26 @@ void GMainWindow::InitializeHotkeys() {
1076 [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); 1076 [] { Settings::values.audio_muted = !Settings::values.audio_muted; });
1077 connect_shortcut(QStringLiteral("Audio Volume Down"), [] { 1077 connect_shortcut(QStringLiteral("Audio Volume Down"), [] {
1078 const auto current_volume = static_cast<int>(Settings::values.volume.GetValue()); 1078 const auto current_volume = static_cast<int>(Settings::values.volume.GetValue());
1079 const auto new_volume = std::max(current_volume - 5, 0); 1079 int step = 5;
1080 if (current_volume <= 30) {
1081 step = 2;
1082 }
1083 if (current_volume <= 6) {
1084 step = 1;
1085 }
1086 const auto new_volume = std::max(current_volume - step, 0);
1080 Settings::values.volume.SetValue(static_cast<u8>(new_volume)); 1087 Settings::values.volume.SetValue(static_cast<u8>(new_volume));
1081 }); 1088 });
1082 connect_shortcut(QStringLiteral("Audio Volume Up"), [] { 1089 connect_shortcut(QStringLiteral("Audio Volume Up"), [] {
1083 const auto current_volume = static_cast<int>(Settings::values.volume.GetValue()); 1090 const auto current_volume = static_cast<int>(Settings::values.volume.GetValue());
1084 const auto new_volume = std::min(current_volume + 5, 100); 1091 int step = 5;
1092 if (current_volume < 30) {
1093 step = 2;
1094 }
1095 if (current_volume < 6) {
1096 step = 1;
1097 }
1098 const auto new_volume = std::min(current_volume + step, 100);
1085 Settings::values.volume.SetValue(static_cast<u8>(new_volume)); 1099 Settings::values.volume.SetValue(static_cast<u8>(new_volume));
1086 }); 1100 });
1087 connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] { 1101 connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] {
@@ -1574,17 +1588,18 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
1574 return true; 1588 return true;
1575} 1589}
1576 1590
1577void GMainWindow::SelectAndSetCurrentUser() { 1591bool GMainWindow::SelectAndSetCurrentUser() {
1578 QtProfileSelectionDialog dialog(system->HIDCore(), this); 1592 QtProfileSelectionDialog dialog(system->HIDCore(), this);
1579 dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | 1593 dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
1580 Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); 1594 Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
1581 dialog.setWindowModality(Qt::WindowModal); 1595 dialog.setWindowModality(Qt::WindowModal);
1582 1596
1583 if (dialog.exec() == QDialog::Rejected) { 1597 if (dialog.exec() == QDialog::Rejected) {
1584 return; 1598 return false;
1585 } 1599 }
1586 1600
1587 Settings::values.current_user = dialog.GetIndex(); 1601 Settings::values.current_user = dialog.GetIndex();
1602 return true;
1588} 1603}
1589 1604
1590void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index, 1605void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index,
@@ -1618,11 +1633,14 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
1618 Settings::LogSettings(); 1633 Settings::LogSettings();
1619 1634
1620 if (UISettings::values.select_user_on_boot) { 1635 if (UISettings::values.select_user_on_boot) {
1621 SelectAndSetCurrentUser(); 1636 if (SelectAndSetCurrentUser() == false) {
1637 return;
1638 }
1622 } 1639 }
1623 1640
1624 if (!LoadROM(filename, program_id, program_index)) 1641 if (!LoadROM(filename, program_id, program_index)) {
1625 return; 1642 return;
1643 }
1626 1644
1627 system->SetShuttingDown(false); 1645 system->SetShuttingDown(false);
1628 1646
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 23b67a14e..e13b38b24 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -218,7 +218,7 @@ private:
218 void SetDiscordEnabled(bool state); 218 void SetDiscordEnabled(bool state);
219 void LoadAmiibo(const QString& filename); 219 void LoadAmiibo(const QString& filename);
220 220
221 void SelectAndSetCurrentUser(); 221 bool SelectAndSetCurrentUser();
222 222
223 /** 223 /**
224 * Stores the filename in the recently loaded files list. 224 * Stores the filename in the recently loaded files list.