Commit Graph
21 Commits
Author SHA1 Message Date
yzct12345andGitHub 0ba521e634 threadsafe_queue: Fix deadlock
This fixes a lost wakeup in SPSCQueue. If the reader is in just the right position, the writer's notification will be lost and this will be a problem if the writer then does something to wait on the reader.

This was discovered to affect my upcoming stacktrace PR. I don't think any performance decrease will be noticeable because an uncontended mutex is smart enough to skip the syscall. This PR might also resolve some rare deadlocks but I don't know of any examples.
2021-08-13 19:22:51 +00:00
yzct12345andGitHub 81ed54d13e logging: Display backtrace on crash
This implements backtraces so we don't have to tell users how to use gdb anymore.

This prints a backtrace after abort or segfault is detected. It also fixes the log getting cut off with the last line containing only a bracket. This change lets us know what caused a crash not just what happened the few seconds before it.

I only know how to add support for Linux with GCC. Also this doesn't work outside of C/C++ such as in dynarmic or certain parts of graphics drivers. The good thing is that it'll try and just crash again but the stack frames are still there so the core dump will work just like before.
2021-08-13 18:58:35 +00:00
yzct12345andGitHub 001675dced logging: Simplify and make thread-safe
This simplifies the logging system.

This also fixes some lost messages on startup.

The simplification is simple. I removed unused functions and moved most things in the .h to the .cpp. I replaced the unnecessary linked list with its contents laid out as three member variables. Anything that went through the linked list now directly accesses the backends. Generic functions are replaced with those for each specific use case and there aren't many. This change increases coupling but we gain back more KISS and encapsulation.

With those changes it was easy to make it thread-safe. I just removed the mutex and turned a boolean atomic. I was planning to use this thread-safety in my next PR about stacktraces. It was actually async-signal-safety at first but I ended up using a different approach. Anyway getting rid of the linked list is important for that because have the list of backends constantly changing complicates things.
2021-08-13 18:39:45 +00:00
yzct12345andGitHub 430255caf8 decoders: Templates allow memcpy optimizations 2021-08-12 04:45:25 +00:00
yzct12345andGitHub c4eafcc861 texture_cache: Address ameerj's review 2021-08-08 11:02:51 +00:00
yzct12345andGitHub 5f97f74a9a memory: Address lioncash's review 2021-08-07 03:03:21 +00:00
yzct12345andGitHub 70cc4c0f46 memory: Dedup Read and Write and fix logging bugs 2021-08-07 01:32:06 +00:00
yzct12345andGitHub e80323b8b0 texture_cache: Address ameerj's review 2021-08-07 01:27:47 +00:00
yzct12345andGitHub e611f522c2 memory: Clean up CopyBlock too 2021-08-05 21:09:08 +00:00
yzct12345andGitHub 02e98f6c93 texture_cache: Don't change copyright year 2021-08-05 20:52:12 +00:00
yzct12345andGitHub 5566f3dbc0 texture_cache: Address ameerj's review 2021-08-05 20:46:24 +00:00
yzct12345andGitHub 4edfa6ad8f memory: Address lioncash's review 2021-08-05 20:29:43 +00:00
yzct12345andGitHub 6df9611059 memory: Clean up code 2021-08-05 20:11:14 +00:00
yzct12345andGitHub 7e846be376 assert: Verify formatting 2021-08-05 17:46:22 +00:00
yzct12345andGitHub 346149dcf9 assert: Avoid empty macros 2021-08-05 17:21:56 +00:00
yzct12345andGitHub f9563c8f24 texture_cache: Split templates out 2021-08-05 13:52:30 +00:00
2868d4ba84 nvdec: Implement VA-API hardware video acceleration (#6713)
* nvdec: VA-API

* Verify formatting

* Forgot a semicolon for Windows

* Clarify comment about AV_PIX_FMT_NV12

* Fix assert log spam from missing negation

* vic: Remove forgotten debug code

* Address lioncash's review

* Mention VA-API is Intel/AMD

* Address v1993's review

* Hopefully fix CMakeLists style this time

* vic: Improve cache locality

* vic: Fix off-by-one error

* codec: Async

* codec: Forgot the GetValue()

* nvdec: Address ameerj's review

* codec: Fallback to CPU without VA-API support

* cmake: Address lat9nq's review

* cmake: Make VA-API optional

* vaapi: Multiple GPU

* Apply suggestions from code review

Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>

* nvdec: Address ameerj's review

* codec: Use anonymous instead of static

* nvdec: Remove enum and fix memory leak

* nvdec: Address ameerj's review

* codec: Remove preparation for threading

Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>
2021-08-03 23:43:11 -04:00
yzct12345andGitHub f56d0db5bd decoders: Optimize swizzle copy performance (#6790)
This makes UnswizzleTexture up to two times faster. It is the main bottleneck in NVDEC video decoding.
2021-08-02 11:18:58 -04:00
03a7131563 Update src/video_core/renderer_vulkan/vk_texture_cache.cpp
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2021-07-18 22:23:32 +00:00
b727b6784f Update src/video_core/renderer_vulkan/vk_texture_cache.cpp
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2021-07-18 22:23:12 +00:00
yzct12345andGitHub 9e7f41cec6 Ignore wrong blit format 2021-07-18 21:56:06 +00:00