Commit Graph

30 Commits

Author SHA1 Message Date
Lioncash 3d9b2aa005 VideoCommon: Migrate over to fmt
Migrates off the printf-based formatting where applicable.
2020-11-17 21:23:58 -05:00
Lioncash 86f8768268 VideoCommon/ShaderGenCommon: Make template functions regular functions
These are only ever used with ShaderCode instances and nothing else.
Given that, we can convert these helper functions to expect that type of
object as an argument and remove the need for templates, improving
compiler throughput a marginal amount, as the template instantiation
process doesn't need to be performed.

We can also move the definitions of these functions into the cpp file,
which allows us to remove a few inclusions from the ShaderGenCommon
header. This uncovered a few instances of indirect inclusions being
relied upon in other source files.

One other benefit is this allows changes to be made to the definitions
of the functions without needing to recompile all translation units that
make use of these functions, making change testing a little quicker.

Moving the definitions into the cpp file also allows us to completely
hide DefineOutputMember() from external view, given it's only ever used
inside of GenerateVSOutputMembers().
2020-05-25 21:12:29 -04:00
David Korth c2dd2e8a2e Use std::istringstream or std::ostringstream instead of std::stringstream where possible.
This removes std::iostream from the inheritance chain, which reduces
overhead slightly.
2019-12-29 23:45:02 -05:00
Lioncash 6fbbc2683e VideoCommon: Make use of fmt outside of shader generators
Migrates most of VideoCommon over to using fmt, with the exception being
the shader generator code. The shader generators are quite large and
have more corner cases to deal with in terms of conversion (shaders have
braces in them, so we need to make sure to escape them).

Because of the large amount of code that would need to be converted, the
conversion of VideoCommon will be in two parts:

- This change (which converts over the general case string formatting),
- A follow up change that will specifically deal with converting over
  the shader generators.
2019-11-23 16:00:45 -05:00
Stenzek 33a6d265e5 PostProcessing: Use interface blocks for shaders 2019-10-02 12:59:50 +10:00
Stenzek c98a5f7dfd Renderer: Draw ImGui interface to both eyes 2019-10-02 12:19:47 +10:00
Stenzek b44a0980eb PostProcessing: Use correct layer in quad-buffered modes
Previously, only the left eye was being used.
2019-10-02 11:52:54 +10:00
Stenzek e88c269d02 PostProcessing: Don't use GS expansion shader for quad buffering w/ OpenGL
OpenGL doesn't render to a 2-layer backbuffer like D3D/Vulkan for quad-buffered
stereo, instead drawing twice with the eye selected by glDrawBuffer()
(see OGL::Renderer::RenderXFBToScreen).
2019-10-02 11:33:25 +10:00
JosJuice a2a1e04fc9 StringUtil: Use std::string_view more 2019-07-23 14:49:12 +02:00
Lioncash 2b9389202e VideoCommon: Remove unused MathUtil.h include from VideoCommon.h
This header doesn't actually make use of MathUtil.h within itself, so
this can be removed. Many other source files used VideoCommon.h as an
indirect include to include MathUtil.h, so these includes can also be
adjusted.

While we're at it, we can also migrate valid inclusions of VideoCommon.h
into cpp files where it can feasibly be done to minimize propagating it
via other headers.
2019-07-16 20:54:34 -04:00
iwubcode c513bb5309 VideoCommon: Implement passive stereoscopic 3D 2019-05-04 22:58:00 -05:00
Filip Gawin c110ffcdaa Remove redundant initialization 2019-04-30 01:22:24 +02:00
Stenzek f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00
Filip Gawin 49fe9f5db1 Use empty instead of size 2019-02-13 00:03:49 +01:00
Lioncash f9c20571ab PostProcessing: Default constructor and destructor of PostProcessingShaderConfiguration
Also ensure that all members of the class are initialized on
construction as well. Previously the bool indicating if options are
dirty wouldn't be initialized, which could be read uninitialized if an
instance was constructed and then IsDirty() is called.
2018-05-21 11:54:56 -04:00
Lioncash 5337e58284 VideoConfig: Make StereoMode an enum class
Makes for more strongly-typed identifiers (and doesn't pollute
surrounding namespaces)
2017-11-18 23:19:53 -05:00
Shawn Hoffman c5fa470ad8 replace DoFileSearch with optimized version 2017-06-23 17:25:53 -07:00
Stenzek 27ae5b8d34 VideoConfigDiag: Move post-processing shader list to post processor
The backends don't use this list at all, and since more than one
backend supports post-processing now, it's duplicate code.
2017-04-25 14:27:05 +10:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Lioncash d9fec92628 VideoCommon: Header cleanup
Also remedies places where the video backends and core rely on things
being indirectly included.
2016-01-17 20:11:45 -05:00
Lioncash ac26f8e79f Pass strings by const reference where possible 2015-05-28 20:54:55 -04:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Lioncash e07679114b Use emplace_* functions where in-place construction is preferable 2015-02-04 11:39:08 -05:00
Jules Blok 5c4ee2f71e PostProcessing: Move default pixel shader to PostProcessingShaderConfiguration.
Reduces code complexity and fixes a bug where the shader is not properly invalidated.
2015-01-25 23:08:49 +01:00
Jules Blok 262c3b19ec PostProcessing: Add support for user-supplied anaglyph shaders.
There are lots of different anaglyph glasses out there and there may be even more creative uses for stereoscopic post-processing shaders.
2015-01-25 22:07:03 +01:00
Ryan Houdek d348bfea46 Fix the Post Processing shader configuration dialog.
On locales that don't use period as a separator this would break us.
For vector values in a configuration, we use comma as a separator which causes the configuration to balloon to massive sizes due to never saving them
correctly. Loading would then break since it would load a million configuration options.
Fixes issue #7569.
2015-01-20 16:40:46 -06:00
Pierre Bourdon bf93920c05 Revert "Catch broken configurations inside of the Post Processing shaders." 2014-08-25 14:33:41 +02:00
Ryan Houdek 2d624780c0 Catch broken configurations inside of the Post Processing shaders.
This catches most instances of configuration failures that can happen in a post processing shader.
Gives a user a helpful error message that lets them know what they have failed to set up correctly
2014-08-17 23:59:21 -05:00
Ryan Houdek 6bdc32c54a Add the VideoCommon PostProcessing class.
This class loads all the common PP shader configuration options and passes those options through to a inherited class that OpenGL or D3D will have.
Makes it so all the common code for PP shaders is in VideoCommon instead of duplicating the code across each backend.
2014-08-13 01:05:10 -05:00