Commit Graph

156 Commits

Author SHA1 Message Date
Léo Lam 6763a3fce1 Config: Add support for enums
This makes it possible to use enums as the config type.
Default values are now clearer and there's no need for casts
when calling Config::Get/Set anymore.

In order to add support for enums, the common code was updated to
handle enums by using the underlying type when loading/saving settings.

A copy constructor is also provided for conversions from
`ConfigInfo<Enum>` to `ConfigInfo<underlying_type<Enum>>`
so that enum settings can still easily work with code that doesn't care
about the actual enum values (like Graphics{Choice,Radio} in DolphinQt2
which only treat the setting as an integer).
2018-05-12 18:10:26 +02:00
Stenzek 9e798eec94 Implement EFB copy filter and gamma in hardware backends
Also makes y_scale a dynamic parameter for EFB copies, as it doesn't
make sense to keep it as part of the uid, otherwise we're generating
redundant shaders.
2018-04-29 19:05:20 +10:00
JosJuice 91732e2baf Remove support for projection hacks
This isn't really useful for anything anymore as far as I know.
2018-04-01 21:41:18 +02:00
Stenzek 2f1a7cbee1 Implement "Skip" ubershader mode
Skip ubershader mode works the same as hybrid ubershaders in that the
shaders are compiled asynchronously. However, instead of using the
ubershader to draw the object, it skips it entirely until the
specialized shader is made available.

This mode will likely result in broken effects where a game creates an
EFB copy, and does not redraw it every frame. Therefore, it is not a
recommended option, however, it may result in better performance on
low-end systems.
2018-03-26 01:57:41 +10:00
Stenzek 517a977444 ShaderCache: Fix several issues in background shader compiling
- In D3D, shaders could be compiled on the main thread, blocking
startup.
- Reduced the latency between a pipeline being requested and used in all
backends in hybrid ubershader mode, when no shader stages were present.
- Fixed a case where async compilation could cause the same UID to be
appended multiple times to the UID cache.
- Fix incorrect number of threads being used when immediately compile
shaders was enabled.
2018-03-15 01:50:47 +10:00
Stenzek e31cc1f679 ShaderCache: Implement background shader compilation
This enables shaders to be compiled while the game is starting, instead
of blocking startup. If a shader is needed before it is compiled,
emulation will block.
2018-03-10 16:11:19 +10:00
Stenzek 9fa24700b6 VideoConfig: Collapse ubershader configuration fields to a single value 2018-03-10 15:56:45 +10:00
Stenzek f9c829c7f7 OGL: Re-implement async shader compiling 2018-03-10 15:56:34 +10:00
Stenzek dec0c3bce8 Move shader caches to VideoCommon 2018-03-10 15:56:30 +10:00
Stenzek 93fb0e1e1c TextureCache: Add an option to disable EFB copies to VRAM
The option is named DisableCopyToVRAM under the Hacks section in
GFX.ini. It is intentionally not exposed to the GUI, as users should not
need to use it under normal circumstances. The main use is debugging
issues in the EFB-to-RAM shaders.
2018-02-11 15:48:46 +10:00
degasus 0b466249e0 CustomTextures: Drop format convertion. 2018-01-20 16:39:04 +01:00
Vlad Firoiu 330881ae80 Allow users to specify the encoder used for framedumping. 2018-01-03 13:23:10 +01:00
JosJuice 4973ae9952 Rename GFX_HACK_COPY_EFB_ENABLED to GFX_HACK_COPY_EFB_SCALED
Not sure why it was named like this... It doesn't affect whether
the copy happens or not, only what resolution it uses.
2017-12-18 21:55:02 +01:00
Stenzek 39559f6358 VideoConfig: Remove bSupportsInternalResolutionFrameDumps
Field is unused as of Hybrid XFB.
2017-11-21 17:19:43 +10: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
Lioncash 10697bcbe3 VideoConfig: Make AspectMode an enum class
Makes for more strongly-typed identifiers (and doesn't pollute
surrounding namespaces)
2017-11-18 23:17:56 -05:00
iwubcode 7f0834c919 Add 'immediate xfb' which reduces xfb latency at the cost of graphical errors 2017-11-17 22:11:30 -06:00
iwubcode 65cd085f9b Add new GUI option to skip XFBToRam and remove old XFB options 2017-11-17 22:11:28 -06:00
iwubcode 198d3b69b4 Add ability to dump xfb copies to texture for debugging purposes 2017-11-17 22:11:28 -06:00
Lioncash 8e654528fc VideoConfig: Add const specifier to IsVSync() member function
This member function doesn't alter VideoConfig's state.
2017-11-10 22:23:15 -05:00
Stenzek edb5f855c2 VideoConfig: Prevent race condition on g_Config when refreshing
There was a race condition between the video thread and the host thread,
if corrections need to be made by VerifyValidity(). Briefly, the config
will contain invalid values. Instead, pause emulation first, which will
flush the video thread, update the config and correct it, then resume
emulation, after which the video thread will detect the config has
changed and act accordingly.
2017-10-10 23:56:33 +10:00
Leo Lam c91211b6ce Merge pull request #5867 from leoetlino/widescreen
GameINI: Replace Wii.Widescreen with AspectRatio
2017-08-11 18:23:54 +08:00
JosJuice f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02:00
Léo Lam e58ba76f07 Don't force the aspect ratio in GameINIs
Instead, add a SuggestedAspectRatio option which tells Dolphin which
aspect ratio to use when the aspect ratio option is set to Auto.
2017-08-05 14:27:16 +08:00
Stenzek fe65b26d53 Merge pull request #5834 from stenzek/bc7
Support loading BC7 (BPTC) textures from DDS files
2017-08-01 12:39:19 +10:00
Stenzek 63305e9173 HiresTextures: Support loading BC7 (BPTC) from DDS files 2017-08-01 11:59:38 +10:00
Stenzek d62dcd397d VideoConfig: Drop force vertex/pixel ubershader settings
This was mainly included for debugging, but could end up being confusing
for users, as well as polluting the GL program cache with a mix of uber
and specialized shaders if the option was changed.
2017-07-31 23:21:38 +10:00
Stenzek e968c191ff Ubershaders: Support per-pixel lighting 2017-07-30 17:43:59 +10:00
Stenzek c8f31656cb VideoBackends: Support a different number of threads for precompiling
At runtime, we only really want a single shader compiler thread.
However, for initial boots, we can use a higher number to speed things
up.
2017-07-30 17:43:59 +10:00
Stenzek 901bf9c257 VideoConfig: Add config options for ubershaders 2017-07-30 17:43:59 +10:00
Stenzek 3ea9d86faa ShaderGen: Pass host config to shader generation functions
Also moves the host config checks to common.
2017-07-20 17:54:33 +10:00
Stenzek d01b0bf60f VideoCommon: Move shader cache filename generation to common 2017-07-20 17:46:59 +10:00
Stenzek d1381f5021 VideoConfig: Add host config union
Contains all host state that can affect shadergen.
2017-07-20 17:46:59 +10:00
Stenzek 82c27182a8 ShaderGen: Remove host state from shader uids 2017-07-20 17:46:59 +10:00
MerryMage f8a99ca192 VertexShaderManager: Rename projection hack variables 2017-06-15 16:38:10 +01:00
MerryMage a0b41c83e7 VideoConfig: Remove bRunning
Value was set but not used.
2017-06-11 15:06:12 +01:00
Léo Lam 774587cbd1 VideoConfig: Remove useless header includes 2017-06-10 20:25:27 +02:00
Léo Lam 0e85c47237 VideoConfig: Remove manual panic alert setting load
This code hadn't been touched since 2010. Nowadays, the panic alert
setting is loaded by ConfigManager and applied in UICommon.
VideoConfig has no business messing with it.
2017-06-10 20:24:18 +02:00
MerryMage f5f45855f0 GameConfigLoader: Add GFX Game INI translations 2017-06-03 18:13:02 +01:00
Stenzek bc8a96d713 HiresTextures: Support parsing DDS files directly
This leaves DDS textures using DXT1/3/5 compressed in-memory, which can
be passed directly to the backend.
2017-04-29 00:14:23 +10:00
iwubcode a9d08a31a6 Add configurable toggle that rounds vertices to the nearest pixel when
w=1.  This fixes some games at higher IRs.
2017-04-04 09:52:18 -05:00
Stenzek 82fd984f3e VideoBackends: Add configuration field for GPU texture decoding 2017-04-01 12:32:05 +10:00
Michael Maltese 134317e07f videoconfig: add BBoxPreferStencilImplementation
@JMC47 requested this to be able to do performance comparisons.
2017-03-15 17:41:33 -07:00
Stenzek 2cd240af0d VideoBackends: Move max texture size to VideoConfig
This stops the virtual method call from within the Renderer constructor.

The initialization here for GL had to be moved to VideoBackend, as the
Renderer constructor will not have been executed before the value is
required.
2017-03-10 00:04:13 +10:00
Vlad Firoiu 096f58b172 Save new framedump options. 2017-03-08 01:38:40 -08:00
Vlad Firoiu f82e3de763 Dump to arbitrary URLs. 2017-02-27 23:45:34 -08:00
Vlad Firoiu 21e66e60e3 Configable dump codec. 2017-02-27 23:45:12 -08:00
Vlad Firoiu 86a8382376 Arbitrary dump formats. 2017-02-27 23:44:29 -08:00
Anthony ed6a46a193 Merge pull request #4958 from RisingFog/avidump_bitrate
Add configurable video dump bitrate to INI
2017-02-27 10:15:19 -08:00
Chris Burgener bfb17d5a9e Add configurable video dump bitrate to INI 2017-02-25 23:58:21 -05:00