diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/core/hle/result.h | 28 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.cpp | 15 |
3 files changed, 45 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e66dc1df..63dd9febf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -32,6 +32,7 @@ if (MSVC) | |||
| 32 | # /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates | 32 | # /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates |
| 33 | # /Zc:inline - Let codegen omit inline functions in object files | 33 | # /Zc:inline - Let codegen omit inline functions in object files |
| 34 | # /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null | 34 | # /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null |
| 35 | # /GT - Supports fiber safety for data allocated using static thread-local storage | ||
| 35 | add_compile_options( | 36 | add_compile_options( |
| 36 | /MP | 37 | /MP |
| 37 | /Zi | 38 | /Zi |
| @@ -44,6 +45,7 @@ if (MSVC) | |||
| 44 | /Zc:externConstexpr | 45 | /Zc:externConstexpr |
| 45 | /Zc:inline | 46 | /Zc:inline |
| 46 | /Zc:throwingNew | 47 | /Zc:throwingNew |
| 48 | /GT | ||
| 47 | 49 | ||
| 48 | # External headers diagnostics | 50 | # External headers diagnostics |
| 49 | /experimental:external # Enables the external headers options. This option isn't required in Visual Studio 2019 version 16.10 and later | 51 | /experimental:external # Enables the external headers options. This option isn't required in Visual Studio 2019 version 16.10 and later |
| @@ -69,6 +71,10 @@ if (MSVC) | |||
| 69 | /we5038 # data member 'member1' will be initialized after data member 'member2' | 71 | /we5038 # data member 'member1' will be initialized after data member 'member2' |
| 70 | ) | 72 | ) |
| 71 | 73 | ||
| 74 | if (ARCHITECTURE_x86_64) | ||
| 75 | add_compile_options(/QIntel-jcc-erratum) | ||
| 76 | endif() | ||
| 77 | |||
| 72 | # /GS- - No stack buffer overflow checks | 78 | # /GS- - No stack buffer overflow checks |
| 73 | add_compile_options("$<$<CONFIG:Release>:/GS->") | 79 | add_compile_options("$<$<CONFIG:Release>:/GS->") |
| 74 | 80 | ||
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index a755008d5..2c6b24848 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -206,7 +206,7 @@ public: | |||
| 206 | return result; | 206 | return result; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | ResultVal(const ResultVal& o) : result_code(o.result_code) { | 209 | ResultVal(const ResultVal& o) noexcept : result_code(o.result_code) { |
| 210 | if (!o.empty()) { | 210 | if (!o.empty()) { |
| 211 | new (&object) T(o.object); | 211 | new (&object) T(o.object); |
| 212 | } | 212 | } |
| @@ -224,7 +224,7 @@ public: | |||
| 224 | } | 224 | } |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | ResultVal& operator=(const ResultVal& o) { | 227 | ResultVal& operator=(const ResultVal& o) noexcept { |
| 228 | if (this == &o) { | 228 | if (this == &o) { |
| 229 | return *this; | 229 | return *this; |
| 230 | } | 230 | } |
| @@ -244,6 +244,26 @@ public: | |||
| 244 | return *this; | 244 | return *this; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | ResultVal& operator=(ResultVal&& o) noexcept { | ||
| 248 | if (this == &o) { | ||
| 249 | return *this; | ||
| 250 | } | ||
| 251 | if (!empty()) { | ||
| 252 | if (!o.empty()) { | ||
| 253 | object = std::move(o.object); | ||
| 254 | } else { | ||
| 255 | object.~T(); | ||
| 256 | } | ||
| 257 | } else { | ||
| 258 | if (!o.empty()) { | ||
| 259 | new (&object) T(std::move(o.object)); | ||
| 260 | } | ||
| 261 | } | ||
| 262 | result_code = o.result_code; | ||
| 263 | |||
| 264 | return *this; | ||
| 265 | } | ||
| 266 | |||
| 247 | /** | 267 | /** |
| 248 | * Replaces the current result with a new constructed result value in-place. The code must not | 268 | * Replaces the current result with a new constructed result value in-place. The code must not |
| 249 | * be an error code. | 269 | * be an error code. |
| @@ -329,8 +349,8 @@ template <typename T, typename... Args> | |||
| 329 | * copy or move constructing. | 349 | * copy or move constructing. |
| 330 | */ | 350 | */ |
| 331 | template <typename Arg> | 351 | template <typename Arg> |
| 332 | [[nodiscard]] ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { | 352 | [[nodiscard]] ResultVal<std::remove_cvref_t<Arg>> MakeResult(Arg&& arg) { |
| 333 | return ResultVal<std::remove_reference_t<Arg>>::WithCode(ResultSuccess, std::forward<Arg>(arg)); | 353 | return ResultVal<std::remove_cvref_t<Arg>>::WithCode(ResultSuccess, std::forward<Arg>(arg)); |
| 334 | } | 354 | } |
| 335 | 355 | ||
| 336 | /** | 356 | /** |
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 1e1d1d020..0764ea6e0 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -181,6 +181,21 @@ Device::Device() { | |||
| 181 | LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); | 181 | LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); |
| 182 | shader_backend = Settings::ShaderBackend::GLSL; | 182 | shader_backend = Settings::ShaderBackend::GLSL; |
| 183 | } | 183 | } |
| 184 | |||
| 185 | if (shader_backend == Settings::ShaderBackend::GLSL && is_nvidia && | ||
| 186 | !Settings::values.renderer_debug) { | ||
| 187 | const std::string_view driver_version = version.substr(13); | ||
| 188 | const int version_major = | ||
| 189 | std::atoi(driver_version.substr(0, driver_version.find(".")).data()); | ||
| 190 | |||
| 191 | if (version_major >= 495) { | ||
| 192 | LOG_WARNING(Render_OpenGL, "NVIDIA drivers 495 and later causes significant problems " | ||
| 193 | "with yuzu. Forcing GLASM as a mitigation."); | ||
| 194 | shader_backend = Settings::ShaderBackend::GLASM; | ||
| 195 | use_assembly_shaders = true; | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 184 | // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation. | 199 | // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation. |
| 185 | use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && | 200 | use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && |
| 186 | !(is_amd || (is_intel && !is_linux)); | 201 | !(is_amd || (is_intel && !is_linux)); |