Commit Graph

592 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks a9bb56c5ee project: Optimize to use single fullscreen tri instead 2023-03-28 12:40:42 +02:00
Michael Fabian 'Xaymar' Dirks 775e27caff gs-helper: Only include debug markers if profiling is enabled 2023-03-28 12:40:42 +02:00
Michael Fabian 'Xaymar' Dirks 49f1cbc15e project: Improve performance profiling support
Adds a new CMake option "ENABLE_PROFILING" which enables all CPU and GPU performance profiling available in StreamFX for tracking what's actually causing things to be slow.
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 071760b867 ffmpeg-encoder/nvenc: Invert "no-scenecut" option for "Adaptive I-Frames"
Our "Adaptive I-Frames" is the inverse of the expected parameter to "no-scenecut" in FFmpegs NVENC.

Related #191
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 0966b61f76 ffmpeg-encoder/nvenc: Test for "h264_nvenc" in for "Adaptive B-Frames"
Fixes the bug where "Adaptive B-Frames" would not be applied in the way it was expected to be applied.

Related: #191
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks fb024cad73 gfx-blur-dual-filtering: Implement asynchronous rendering
Asynchronous rendering allows the GPU to perform work while the CPU performs other work, and is significantly faster than lockstep immediate rendering. By reusing existing render targets we can see a performance improvement of up to 500%, while still doing the same things.
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 9b13d64551 filter-blur: Add debug markers for performance tracking 2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 6e8135dc98 gfx-blur-*: Add debug markers for performance tracking 2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 4947d46aa1 gs-mipmapper: Update API usage, remove broken options and optimize
The new libOBS API allows us to directly access the underlying API instead of having to mess around in memory. By using it we can avoid crashing in case the compiler for it is different, or in case the actual back end structure changes.

Additionally the mostly unimplemented and unused options have also been removed, which streamlines the use of this class even further and reduces both shader and code complexity.

Finally by optimizing the use of the internal render target we can achieve a speed up of up to 3000% over the old way, allowing for many more mipmapped filters.
2023-03-28 12:40:40 +02:00
Michael Fabian 'Xaymar' Dirks 47a22ce462 gs-vertexbuffer: Initialize memory to 0 2023-03-28 12:40:40 +02:00
Michael Fabian 'Xaymar' Dirks 8b0cc92d10 ui: Fix incorrect namespace for Qt symbol
Q_INIT_RESOURCE and Q_CLEANUP_RESOURCE can't be called from within a namespace and instead have to be in outside of the namespace, so by moving them into small inline functions we can fulfill this restriction.

Related: #192 #155
2023-03-28 12:40:40 +02:00
Michael Fabian 'Xaymar' Dirks a553b39a6d gfx-shader: Actually fix the thing 93207d was supposed to fix 2023-03-28 12:40:40 +02:00
Michael Fabian 'Xaymar' Dirks c2c5afd763 gfx-shader: Actually write alpha channel to render target 2023-03-28 12:40:39 +02:00
Michael Fabian 'Xaymar' Dirks bb21d940bf project: Fix virtual overrides not using the correct type 2023-03-28 12:40:39 +02:00
Michael Fabian 'Xaymar' Dirks a5518388ec util-profiler: Specify type for template 2023-03-28 12:40:38 +02:00
Michael Fabian 'Xaymar' Dirks 544b67d55e util-profiler: Fix typo with in reparent() 2023-03-28 12:40:38 +02:00
Michael Fabian 'Xaymar' Dirks ad4d00e0ea util-event: Fix unknown type 2023-03-28 12:40:37 +02:00
Michael Fabian 'Xaymar' Dirks a19e8d1e00 gfx-shader: Add default path for file selection 2023-03-28 12:40:37 +02:00
Michael Fabian 'Xaymar' Dirks 7a929d6af4 locale: Add missing and remove unused strings 2020-04-23 09:14:31 +02:00
Michael Fabian 'Xaymar' Dirks 5291b193e2 gfx-shader: Fix rendering at unexpected sizes and fix performance
Fixes rendering at unexpected sizes by first rendering to a render target and then rendering the contents of that render target to the frame buffer instead. This also prevent rendering twice or more, which might cause severe FPS impact.
2020-04-23 08:10:01 +02:00
Michael Fabian 'Xaymar' Dirks f58ce9f421 project: Implement a brand new UI with fancy windows
Implements support for various new UI features that weren't possible up until now, such as an 'About StreamFX' window with a thank you to everyone that supported the project up until now.
2020-04-23 01:09:02 +02:00
Michael Fabian 'Xaymar' Dirks d0941895ad project: Refactor into namespace streamfx 2020-04-23 00:50:39 +02:00
Michael Fabian 'Xaymar' Dirks 2ab8949ba5 cmake: Place Windows exclusive functionality into own file 2020-04-22 23:32:22 +02:00
Michael Fabian 'Xaymar' Dirks 9ddc9051c7 configuration: Add global configuration handler 2020-04-22 23:15:32 +02:00
Michael Fabian 'Xaymar' Dirks 6cbfee4579 obs-tools: Add OBS data deleter 2020-04-22 23:15:32 +02:00
Michael Fabian 'Xaymar' Dirks ce74d2f7cd common: Undefine the unsafe 'strtoll' define from libobs 2020-04-22 23:11:30 +02:00
Michael Fabian 'Xaymar' Dirks 04ac0a640f filter-nv-face-tracking: Improve performance with asynchronous tracking
Through converting the code to a threaded asynchronous approach, the libOBS video renderer no longer has to wait on our tracking code to run, and we can enjoy a little bit of extra calculation time before we actually have to do anything.

However due to the remaining synchronization with the Direct3D11/OpenGL context, it is not entirely safe to spend a full frame tracking as libOBS will then start skipped/dropping frames. Even though the priority of the stream is now increased, this still means that we can't just sit around and have to quickly finish all work.

Related #150
2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks 4d8ff417e7 nvidia-cuda: Improve usage of CUDA resources and functions
Load additional functions from CUDA and add new enumerations to support them:
* cuDevicePrimaryCtxSetFlags allows us to sched scheduling mode for the GPU.
* cuCtxgetStreamPriorityRange allows us to check which priority levels are supported.
* cuStreamCreateWithPriority allows us to create streams with non-default priority.

The scheduler mode is now set to yield so that other threads can do work when we hit an eventual stalling problem. Streams can also now be created with higher priority and different flags, if necessary. In most cases this should allow CUDA resources to execute even while the GPU is under heavy load.
2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks 97e1846156 obs-tools: Add deleter for obs_weak_source_t 2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks e4b4dc23e8 gs-helper: Define extra debug colors 2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks 05d69e3c59 util-threadpool: Fix rare double-execute bug 2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks 984a1132bf ffmpeg-encoder: Implement additional support checks 2020-04-17 11:13:10 +02:00
Michael Fabian 'Xaymar' Dirks a9c881130e ffmpeg-encoder/nvenc: Fix Look Ahead setting
Also now disables Adaptive I & B as they do nothing without Look-Ahead set to non-zero.

Fixes #159
2020-04-17 11:13:10 +02:00
Michael Fabian 'Xaymar' Dirks c03fc933bb ffmpeg-encoder/d3d11: Set highest eviction priority for buffers
This should ideally prevent textures from being removed from the GPU while the encoder is actively using them.
2020-04-11 15:23:07 +02:00
Michael Fabian 'Xaymar' Dirks 908d1f0a20 project: Modernize code to proper C++ 2020-04-09 00:17:25 +02:00
Michael Fabian 'Xaymar' Dirks 05399bd183 filter-dynamic-mask: Add missing include
Fixes #134
2020-04-06 15:39:12 +02:00
Michael Fabian 'Xaymar' Dirks 6a9921c9ce project: Fix include ordering and reapply formatting 2020-04-06 15:39:12 +02:00
Michael Fabian 'Xaymar' Dirks cd5acd42f4 obs-source-factory: Add settings migration code
Previously sources had to manually implement migration code, which resulted in unresolvable regression issues due to the lack of version and commit tagging. With the new migration code, all sources automatically have this version and commit tagging at all times, and as such can now have a temporary regression fixed without the user needing to change any values manually.
2020-04-05 07:28:10 +02:00
Michael Fabian 'Xaymar' Dirks a138f95126 cmake: Fix clang support in native OBS Studio build 2020-04-05 06:50:21 +02:00
Michael Fabian 'Xaymar' Dirks 9e9e9cbcd5 ffmpeg-encoder/prores: Improve pixel format override logic 2020-04-04 19:34:58 +02:00
Michael Fabian 'Xaymar' Dirks 87163f5f70 ffmpeg-encoder: Use correct key when getting pixel formats 2020-04-04 19:34:58 +02:00
Michael Fabian 'Xaymar' Dirks 9ca190c96a gfx-shader: Don't use modified_properties to reload shaders
As OBS Studio locks some mutexes in a different order depending on what actions are being done, using modified_properties for GPU work causes things to freeze in place. Instead have users manually click the refresh button when they changed files in order to prevent this freeze from happening.

Fixes: #118
2020-04-03 18:54:56 +02:00
Michael Fabian 'Xaymar' Dirks cc9d3486b2 project: Fix Linux support by fixing errors and warnings
With this, GCC 8 and above should now be able to compile the project both in obs-studio and as a standalone install. Some features are currently still not fully supported and require extra work, but the majority of things are supported and work out of the box. Exact feature parity can be looked up here on the wiki: https://github.com/Xaymar/obs-StreamFX/wiki/Platform-Feature-Parity

Related: #119 #98 #30
2020-04-02 20:37:45 +02:00
Michael Fabian 'Xaymar' Dirks 3ad2424b22 ffmpeg-encoder: Throw std::runtime_error instead of std::exception 2020-04-02 17:05:02 +02:00
Michael Fabian 'Xaymar' Dirks 59fa1d36d7 common: Common header include for improved platform support
This header includes all common data between headers used in the plugin. This should improve cross-platform compiling support whenever possible, as all platform-dependent common includes and defines can be done here.
2020-04-02 17:02:01 +02:00
Michael Fabian 'Xaymar' Dirks 451d31546f gs-effect-*: Replace strnlen_s with strnlen 2020-04-02 16:21:42 +02:00
Michael Fabian 'Xaymar' Dirks 89b99402c0 util-threadpool: Add missing includes 2020-04-01 14:32:54 +02:00
Michael Fabian 'Xaymar' Dirks 30aaea8449 filter-nv-face-tracking: Possibly fix for rare 0x0 bug 2020-04-01 01:41:18 +02:00
Michael Fabian 'Xaymar' Dirks cf6e867ba5 source-shader: Fix size and parameters 2020-04-01 00:09:21 +02:00
Michael Fabian 'Xaymar' Dirks 3dcf4e5dd6 filter-shader: Fix detected sizes 2020-03-31 22:42:18 +02:00