Commit Graph

65 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 4acbfedd40 gfx-shader-param: Support for input, slider, enum and more 2019-12-25 10:09:56 +01:00
Michael Fabian 'Xaymar' Dirks 777556f4f6 gfx-shader-param: Vastly improve parameter functionality
Allow for overriding type and size of an element, opening the path for `int#[]`, `float#[]`, `int#x#`, `float#x#`, `bool#x#`, `vector<type, #>` and `matrix<type, #, #>`. Also allows for specifying the exact type of texture instead of hoping the user gets it right, as well as samplers.

Parameters are also now created if they are invisible, which means that the properties() function must not be called, but they must still be used like any other. This is due to a problem with default values not being applied all the time, and sometimes just vanishing.

The code also now throws exceptions with reasonable text, which should be caught by the gfx::shader implementation and refuse a load of the effect. No other state should be modified at that point, so care must be taken that up until the moment the complete initialization is done no other state is modified.
2019-12-24 22:02:37 +01:00
Michael Fabian 'Xaymar' Dirks eab3ae4fbc gfx-shader-param: Add support for order and overall name/desc 2019-12-24 08:38:01 +01:00
Michael Fabian 'Xaymar' Dirks 9696f836e0 gfx-shader: Fix startup and select crash if file is missing 2019-12-24 08:37:37 +01:00
Michael Fabian 'Xaymar' Dirks 4c5a7018a3 gfx-shader: Add file watching and dynamic UI updates
Thanks to the workaround in obs::tools, gfx::shader::shader now supports dynamically rebuilding the properties with new properties without crashing OBS Studio. This effectively allows you to have an up to date view of the current parameters for the shader technique.

Additionally with file watching, live development of shaders is possible at very little cost. Currently only file times and size is looked at every 333ms, but in the future it is possible to also watch for file renames and more.
2019-12-22 06:14:26 +01:00
Michael Fabian 'Xaymar' Dirks bd6b4f2d2a gfx-shader-param-basic: Add support for defaults function 2019-12-22 06:07:54 +01:00
Michael Fabian 'Xaymar' Dirks 672c6d39af gfx-shader-param: Split setting defaults from properties 2019-12-22 06:07:37 +01:00
Michael Fabian 'Xaymar' Dirks 9ef60cc2f9 gfx-shader: Add support for validating file differences
Removes the stutter when re-opening the properties dialog which was caused by recompiling the same exact shader every time this happened. Also paves the way for simple file watching.
2019-12-21 18:23:26 +01:00
Michael Fabian 'Xaymar' Dirks 7e5cbe18cf project: Apply clang-format 2019-12-21 17:05:53 +01:00
Michael Fabian 'Xaymar' Dirks d13778b017 gfx-shader: Fix some crash/problematic locations 2019-12-18 07:49:56 +01:00
Michael Fabian 'Xaymar' Dirks 24edee795a gfx-shader-param: FIXME Don't create parameters for invisible 2019-12-18 07:49:43 +01:00
Michael Fabian 'Xaymar' Dirks de473f0c2e gfx-shader-param-basic: Fix incorrect float properties 2019-12-18 07:49:19 +01:00
Michael Fabian 'Xaymar' Dirks f1b9a1a712 gfx-shader: Initial code 2019-12-18 06:39:07 +01:00
Michael Fabian 'Xaymar' Dirks 0a761b97a2 gfx-shader-param*: Initial code 2019-12-18 06:39:07 +01:00
Michael Fabian 'Xaymar' Dirks 0ad896e905 gfx-shader: Rename from gfx-effect-source 2019-12-15 09:09:11 +01:00