Commit graph

2286 commits

Author SHA1 Message Date
Unknown W. Brackets
63e623ecb2 Build: Fix some format truncation warnings.
Generally all should be safe already, but better to be sure.
2021-12-11 10:45:27 -08:00
Henrik Rydgård
b85a7e9a46 Name uniform buffers, add more asserts. Used this to track down the bug fixed in the previous commit. 2021-12-10 21:01:01 +01:00
Henrik Rydgård
7b07a1385a
Merge pull request #15220 from unknownbrackets/vulkan-exit
Vulkan: Fix use-after-free on shutdown
2021-12-10 10:37:43 +01:00
Henrik Rydgård
97f3b477ab
Merge pull request #15219 from unknownbrackets/vulkan-2d
Vulkan: Avoid desc set error in tests
2021-12-10 10:37:19 +01:00
Unknown W. Brackets
c2c16032fe Vulkan: Document lifetime for desc set pool. 2021-12-09 23:57:37 -08:00
Unknown W. Brackets
fe7b573a38 Vulkan: Fix use-after-free on shutdown. 2021-12-09 23:52:10 -08:00
Unknown W. Brackets
8d06431ea7 Vulkan: Use new desc sets in Draw and VulkanUtil.
It seems like a bug that destory device objects wasn't clearing descSets.
2021-12-09 19:03:17 -08:00
Unknown W. Brackets
1010d7ac0e Vulkan: Refactor common desc pool handling. 2021-12-09 18:39:55 -08:00
Henrik Rydgård
45308a16c0 Vulkan is strict about scissor rect, so let's clamp centrally.
Better than spreading the logic all over.

Fixes #15207
2021-12-08 22:38:01 +01:00
Unknown W. Brackets
7c7340e338 ThreadManager: Check for exchange failure.
Even if expected stays null, since it's weak assume it can fail.
2021-12-07 18:24:01 -08:00
Henrik Rydgård
a2f9f68565 Vulkan: More scissor dimension checks. See #15207 2021-12-07 21:46:10 +01:00
Henrik Rydgård
0179cb1811 Very minor logging improvement 2021-12-07 21:28:39 +01:00
Henrik Rydgård
466a731ece Detect and specify the max available Vulkan version, up to 1.2. 2021-12-07 21:26:14 +01:00
Unknown W. Brackets
f9a7ad3e3d ThreadManager: Use separate pool for IO blocking.
This prevents starving the compute pool (which may be used very regularly
parallel loops or other tasks) if the IO operations are slow.
2021-12-05 21:01:49 -08:00
Unknown W. Brackets
8b5173350f ThreadManager: Make TaskType a property of a Task. 2021-12-05 21:01:49 -08:00
Unknown W. Brackets
fd245f2863
Common: Correct shm_open() call.
Don't remember what happened here,
this was meant to be shm_open().
2021-12-03 14:30:32 -08:00
Unknown W. Brackets
212669d2bc Vulkan: Cleanup pipeline var shadowing. 2021-12-02 17:57:40 -08:00
Henrik Rydgård
cfe2716d49
Merge pull request #15178 from unknownbrackets/threads-atomic
Tweaks to thread manager enqueue and shutdown
2021-11-30 09:26:13 +01:00
Unknown W. Brackets
12b790bb81 ThreadManager: Protect against teardown hang/leak.
Make sure we lock during canceled checks/updates, and also try to free
tasks queued on threads that didn't end up running.
2021-11-27 08:57:19 -08:00
Unknown W. Brackets
de9a4dcede ThreadManager: Lock notify on global queue add.
Otherwise, it's possible the chosen thread might not wake up, and then it
may wait for another task to be enqueued - potentially causing a hang.
2021-11-27 08:57:19 -08:00
Unknown W. Brackets
d15af6e9d9 ThreadManager: Use atomic task optimistically.
This makes EnqueueTaskOnThread take priority as well.
Gives about 1% improvement in softgpu, reducing overhead a bit.
2021-11-27 08:07:12 -08:00
Unknown W. Brackets
3f3e0ea8cf softjit: Optimize typical alpha/depth test.
Messed with SSE4 then realized there's no point, just use SHR.
2021-11-26 08:21:14 -08:00
Henrik Rydgård
f991f6a789 Remove the old allocator visualizer. Keep the setting but hide it. Other feedback 2021-11-23 08:55:12 +01:00
Henrik Rydgård
2cbadefb29 Fix bugs in deletion. Delete redundant functions. 2021-11-22 19:02:08 +01:00
Henrik Rydgård
a7591d7826 Switch framebuffers to use VMA for allocation as well 2021-11-22 18:54:09 +01:00
Henrik Rydgård
8d5247ddf3 Convert the PushBuffer to use VMA. 2021-11-22 18:54:09 +01:00
Henrik Rydgård
0cbb7ab027 Change the PushBuffer API a bit to not take explicit memory types. 2021-11-22 18:54:09 +01:00
Henrik Rydgård
c2f594cc73 Remove the VulkanDeviceAllocator 2021-11-22 18:54:09 +01:00
Henrik Rydgård
1b1e585a35 More integration, use VMA in VulkanTexture 2021-11-22 18:54:09 +01:00
Henrik Rydgård
8f9ce03a8d Start integrating VMA 2021-11-22 18:54:08 +01:00
Henrik Rydgård
81fba1f4a4 Minor refactor 2021-11-21 22:08:53 +01:00
Henrik Rydgård
29f54befbd Comment improvement, restore accidental deletion 2021-11-21 21:34:05 +01:00
Henrik Rydgård
dda425b068 Vulkan: Add a single background thread for pipeline creation
Add proper waits for compile-done

Don't rely on non-standard struct initialization of classes

Attempt to drain the pipeline compile queue before destroying the PipelineManager.

Vulkan: Bump the cache version for testing
2021-11-21 18:36:00 +01:00
Henrik Rydgård
62f4875e24 VulkanRenderManager: Add deferred pipeline creation (to get it off the CPU thread) 2021-11-21 18:36:00 +01:00
Henrik Rydgård
4f85b8b2ef Threading: Remove a level of indirection from Promise and Mailbox.
Makes using small copyable or POD objects in these more efficient, and if you want
to you can just put a pointer or smart pointer in there, which will
effectively do the same thing as the old setup.
2021-11-20 22:40:10 +01:00
Unknown W. Brackets
e21f2b8fcf
Common: UWP buildfix.
Just use SetThreadDescription() directly, assuming new enough Windows.
2021-11-13 09:40:07 -08:00
Henrik Rydgård
9f1c9b9963 Buildfix 2021-11-13 18:12:09 +01:00
Henrik Rydgård
6e1455fd55 Use the "new" API SetThreadDescription to set thread names on Windows.
Mainly useful in debugging and profiling tools. Using the new function helps
modern debugging/profiling tools like Superluminal which don't support the
old exception method.

(Is there any old tool left that might be a reason we'd want to do both?)
2021-11-13 18:02:36 +01:00
Henrik Rydgård
4161b500ab
Merge pull request #15021 from unknownbrackets/ui-font-atlas
UI: Support a second texture for just fonts
2021-11-09 22:51:09 +01:00
Henrik Rydgård
281ddc2437 Speed up the 4xBRZ upscaler with 16x and the MMPX one with 4x by not doing redundant work 2021-11-07 15:47:05 +01:00
Unknown W. Brackets
60bd25582c Vulkan: Remove wide line handling.
No longer used, since we convert lines to triangles now.
2021-10-31 14:47:21 -07:00
Unknown W. Brackets
2718e81c0e GPU: Expand lines to triangles. 2021-10-31 14:46:46 -07:00
Unknown W. Brackets
1d76e55f84 Vulkan: Disable large points feature.
No longer used.
2021-10-31 13:07:03 -07:00
Unknown W. Brackets
b3a8e013f6 GPU: Expand points into triangles for higher res. 2021-10-31 13:06:06 -07:00
Henrik Rydgård
3245f54dc1 Optimize the rotation a bit (limit to VK/D3D11, mat2 instead of mat4) 2021-10-31 13:44:54 +01:00
Unknown W. Brackets
09daace8b8 GLES: Skip assert if no buffer. 2021-10-25 06:27:45 -07:00
Unknown W. Brackets
d5dac66c7a Path: Avoid adding a double slash from root. 2021-10-20 13:01:16 -07:00
Unknown W. Brackets
8e15f755e6 UI: Add a sysprop for if the device has a keyboard.
Still left some ifdefs because of System_InputBoxGetString(), but
hopefully we can move away from them.  Some devices (like SDL) may only
optionally have a keyboard, so it's a runtime check.
2021-10-19 10:01:52 -07:00
Unknown W. Brackets
49c64e12d1 UI: Add a way to disable tabs in tab strips. 2021-10-19 10:01:52 -07:00
Unknown W. Brackets
eb81d5b30b UI: Support a second texture for just fonts.
Will still allow using fonts between both.
2021-10-19 10:01:17 -07:00