Commit Graph

3778 Commits

Author SHA1 Message Date
Jordan Woyak 69b617ce76 WiimoteEmu: Remove redundant Matrix library and use the one in Common. 2019-02-03 12:02:02 -06:00
Jordan Woyak b9a00a40a9 Common: Move Matrix classes out of MathUtil into their own files and make their interface more friendly. 2019-02-03 11:35:31 -06:00
Stenzek b01df8670f Renderer: Fix throttle-disable (TAB) hotkey when vsync is enabled 2019-01-27 12:31:12 +10:00
zackhow 8a1eb34c38 Android: Default backendMultithreading to false on android 2019-01-25 19:22:07 -05:00
Stenzek 78588ce79d ShaderCache: Use imgui for shader compilation dialog 2019-01-25 11:15:57 +10:00
Stenzek e4b205c769 Decouple XFB scanout from presentation 2019-01-25 11:15:57 +10:00
Stenzek f1e7fb505b Renderer: Scale all imgui fonts by the backbuffer scale 2019-01-25 11:15:57 +10:00
Stenzek c9c0b85056 VideoBackends: Store a backbuffer 'scale'
This is a scaling factor, used for hi-dpi configurations.
2019-01-25 11:15:57 +10:00
Stenzek 36ce47635b RenderWidget: Hook up to ImGui 2019-01-25 11:15:57 +10:00
Stenzek 63dd91628d Remove old RasterFont classes 2019-01-25 11:15:57 +10:00
Stenzek 600d1fc0bc Renderer: Use imgui for drawing debug text and OSD 2019-01-25 11:15:57 +10:00
Stenzek d1868d9475 RenderBase: Implement imgui rendering 2019-01-25 11:10:49 +10:00
Stenzek 396b7c2978 OGL: Invalidate tracked state when calling ResetAPIState()
Due to the current design, any of the GL state can be mutated after
calling this function, so we can't assume that the tracked state will
match if we call SetPipeline() after ResetAPIState().
2019-01-25 11:10:49 +10:00
Stenzek 1d61041985 ShaderGen: Don't use interface blocks on Vulkan without GS
Doing so causes the Adreno driver to choke and spew errors about
too many output locations/components, when clearly we're under
the limit.
2019-01-24 17:02:17 +10:00
Stenzek 68cb24172b ShaderGen: Omit some unused varyings when possible
Removes the clipPos varying unless slow-depth is used, and the
clipDistance varyings if geometry shaders are not used.
2019-01-23 18:34:22 +10:00
Stenzek 1070192165 TextureCache: Fix a possible crash when partial updating palette textures 2019-01-19 23:38:02 +10:00
Stenzek 84bcbef944 TextureCache: Don't partial copy to non-existant texture layers 2019-01-19 23:38:00 +10:00
Stenzek ade255a5ff TextureCache: Fix broken XFB stitching with stereoscopy is enabled 2019-01-19 23:23:21 +10:00
Connor McLaughlin 5962316068
Merge pull request #7643 from weihuoya/texture-overlap
Texture: fx overlap src position
2019-01-16 08:49:36 +10:00
Connor McLaughlin 0da5929226
Merge pull request #7626 from weihuoya/vulkan-oom
Always clean cache on render swap
2019-01-08 21:57:25 +10:00
weihuoya 66a7db3850 Always flush on swap 2019-01-08 18:28:59 +08:00
JosJuice a8e5f2b922
Merge pull request #7230 from ligfx/remove_clamp_draw_size
RenderBase: don't clamp draw size to window
2019-01-03 18:26:41 +01:00
weihuoya 184b2edc30 fx texture overlap 2018-12-25 21:24:25 +08:00
Stenzek 7afd5cc2fb Use main buffers for utility draws 2018-12-04 17:37:25 +10:00
Stenzek 2644e920cc Renderer: Add backbuffer format to base class 2018-12-04 17:36:08 +10:00
Stenzek 1adcd47dcb Renderer: Add a base Initialize() method to match Shutdown() 2018-12-04 17:36:08 +10:00
Stenzek 38479dd783 RenderBase: Force a pipeline flush when drawing the XFB to the host
Since we use the common pipelines here and draw vertices if a batch is
currently being built by the vertex loader, we end up trampling over its
pointer, as we share the buffer with the loader, and it has not been
unmapped yet. Force a pipeline flush to avoid this.
2018-12-04 17:36:08 +10:00
Connor McLaughlin 6388992f62
Merge pull request #7039 from stenzek/moltenvk
Vulkan: macOS support via MoltenVK
2018-11-30 21:55:30 +10:00
Stenzek 502c4c0e87 TextureCache: Recompute overlapping XFB copy hashes after copying to RAM 2018-11-13 12:48:27 +10:00
Pierre Bourdon 541c5ee996
Merge pull request #7550 from JosJuice/widescreen-hack-suggested-ratio
Fix the widescreen hack for Wii games with 4:3 forced in game INI
2018-11-09 04:28:31 +01:00
Stenzek 78056686fd TextureCache: Fix leaking TCacheEntry instances 2018-11-08 11:52:17 +10:00
JosJuice a42432cae4 RenderBase: Set m_aspect_wide on start
It doesn't feel great to let the value from a previous emulation session
linger around considering that the GC aspect ratio heuristic can use
the previous value of m_aspect_wide when calculating m_aspect_wide.
2018-11-07 19:01:45 +01:00
JosJuice b93b7ec419 Fix the widescreen hack for Wii games with 4:3 forced in game INI 2018-11-07 19:00:24 +01:00
Stenzek 0c0d66809d PixelShaderGen: Split bbox into seperate variables
The Metal shader compiler fails to compile the atomic instructions
when operating on individual components of a vector. Spltting it
into four variables shouldn't make any difference for other
platforms, as they are accessed independently.
2018-11-07 05:41:09 -08:00
Stenzek 673f1963a0 Vulkan: Support macOS via MoltenVK
The path to the MoltenVK library can be specified by the
LIBMOLTENVK_PATH environment variable, otherwise it assumes it is
located in the application bundle's Contents/MacOS directory.
2018-11-07 05:41:09 -08:00
Stenzek 487ea5ab36 VideoBackend: Add a virtual PrepareWindow function
Executes backend-specific commands on the main thread.
2018-11-07 05:12:20 -08:00
Stenzek 8e2c063d62 TextureCache: Implement deferred/batched EFB copies 2018-11-07 16:25:01 +10:00
Pierre Bourdon f1413dbbf6
Merge pull request #7501 from Techjar/class-memaccess-cleanup
VideoCommon: Clean up class-memaccess warnings
2018-10-28 23:59:51 +01:00
Pierre Bourdon 83c3370c2a RenderBase: send performance sample at every end of frame
Not the best integration point, but couldn't think of something better.
This implementation has the benefit to be super simple.
2018-10-27 17:39:54 +02:00
Stenzek eb284b5d66 VideoBackends: Pass window system info from host on creation 2018-10-20 21:11:34 +10:00
Stenzek 1d827a5223 Renderer: Pull dimensions from GLInterface/Swapchain 2018-10-20 21:11:34 +10:00
Stenzek a3961750a7 Drop Host_GetRenderSurface and pass display to backend 2018-10-20 21:11:34 +10:00
Stenzek 74b82bab3b GLInterface: Drop Haiku support 2018-10-20 21:11:33 +10:00
Tillmann Karras 97cc9894e4 Update to Visual Studio's default Windows SDK 2018-10-20 00:53:08 +01:00
Techjar 8560eecd49 VideoCommon: Clean up class-memaccess warnings 2018-10-14 23:05:47 -04:00
Tilka b5d855caf7
Merge pull request #7496 from stenzek/null-shader-cache
ShaderCache: Don't create or load shader cache with Null backend
2018-10-14 12:30:32 +01:00
Tilka 660fb3fca0
Merge pull request #7412 from AdmiralCurtiss/xfb-stitch-in-order
Stitch together overlapping XFB regions in order of XFB copy creation.
2018-10-14 12:00:41 +01:00
Stenzek c2fab7f016 ShaderCache: Don't create or load shader cache with Null backend 2018-10-14 20:03:57 +10:00
Mat M ecd4897d43
Merge pull request #7437 from stenzek/graphics-options-race
Fix race condition caused by opening graphics options while running
2018-10-12 10:29:28 -04:00
Tilka 5b8e1e61e8
Merge pull request #7470 from Tilka/fifoplayer
FifoPlayer: reduce XF_REGS_SIZE to what we know
2018-10-09 08:56:48 +01:00
Tillmann Karras 56fdcf5f00 VideoCommon: remove unnecessary floor()
floatindex is clamped to the range [0, 9]. For non-negative numbers
floor() is equivalent to trunc(). Truncation happens implicitly when
converting to uint, so the floor() is unnecessary.
2018-10-09 00:31:43 +01:00
Tillmann Karras 9c7136453d FifoPlayer: reduce XF_REGS_SIZE to what we know
This avoids out-of-bounds warnings when replaying FIFO captures.

The value of XF_REGS_SIZE is written into the DFF header and we only
read the min of XF_REGS_SIZE and the header value, so this change is
backward compatible and doesn't break forward compatibility for old
Dolphin versions either.
2018-10-08 06:54:32 +01:00
Tillmann Karras c53cd09b00 BPStructs: don't warn about busclock/perf regs 2018-10-07 16:08:18 +01:00
Pierre Bourdon 58b0a284a8
Merge pull request #7408 from AdmiralCurtiss/twin-snakes-cutscene-flicker-fix
Do not consider XFB copies for invalidating textures when loading a new texture.
2018-10-01 22:24:31 +02:00
Stenzek eb33d7af64 Core: Call InitBackendInfo before loading config 2018-09-28 21:44:41 +10:00
Stenzek 93923e2b29 Don't fill backend info when core is running
The current approach results in the UI thread creating a graphics device
whilst the core is running, leading to races on function pointers, and
potentially crashing.
2018-09-28 21:43:22 +10:00
Stenzek a877d5f6dc Remove unused Host_ShowVideoConfig 2018-09-28 14:05:53 +10:00
Léo Lam c49eb2d249
Merge pull request #7398 from Techjar/emu-speed-skip-vsync
VideoCommon: Skip vsync if configured emulation speed is not 100%
2018-09-16 15:19:45 +02:00
Admiral H. Curtiss f2fa63783b Do not consider XFB copies for invalidating textures when loading a new texture.
This fixes severe image flickering in some cutscenes of Twin Snakes. The game appears to sometimes load a previously made XFB copy as a texture before it is actually rendered to the screen, which we took as an invitation to invalidate the XFB copy.
2018-09-15 13:56:45 +02:00
Admiral H. Curtiss 3e95d3c477 Stitch together overlapping XFB regions in order of XFB copy creation. 2018-09-14 19:41:27 +02:00
Admiral H. Curtiss d97bc0d359 Correctly adjust the rendered XFB region at non-native internal resolutions when XFB was loaded from console RAM.
If, for whatever reason, the XFB has to be loaded from console memory, it's possible that the texture is returned at native resolution instead of EFB-scaled resolution. In this case, our xfb_rect.right adjustment must also happen at native resolution instead of scaled resolution.
2018-09-13 19:39:49 +02:00
Techjar e9046f8eec VideoCommon: Skip vsync if configured emulation speed is not 100%
It doesn't make much sense to try to vsync at weird framerates, and
vsync actually causes the speed setting to not work as expected.
2018-09-05 05:40:22 -04:00
Pierre Bourdon 95c2a92f26
Revert "ShaderGen: Drop broken fragment shader index workaround for Vulkan" 2018-09-01 05:32:56 +02:00
Stenzek 3ad7812b53 ShaderGen: Drop broken fragment shader index workaround for Vulkan
AMD appears to have since fixed this in their driver, and it makes
shadergen ever so slightly less messy.
2018-08-28 23:39:47 +10:00
Pierre Bourdon 6a22f1b3e0
Merge pull request #7253 from booto/fifo_reg
CP: some bits in some of the HI registers cannot be set
2018-08-27 14:56:12 +02:00
Stenzek bae1168fe9 PixelShaderGen: Ensure all components of ocol1 are initialized
This was causing a warning in the shader compiler, as the rgb components
were not initialized. Which shouldn't be an issue, as the rgb is not
used in the blend equation, only the alpha. However, the lack of
initialization causes crashes in Intel's D3D shader compiler, so we'll
play nice and initialize all the channels.
2018-08-24 23:53:00 +10:00
Techjar 5512eadd08 VideoCommon/HiresTextures: Change wildcard to a Windows-compatible character 2018-08-21 15:54:25 -04:00
Stenzek dae161e138 FramebufferManager: Use D24S8 on Adreno when using Vulkan
D32F clears are broken on Adreno, which resulted in smeared geometry
across the screen.
2018-07-19 23:30:25 +10:00
Stenzek 3323265d91 FramebufferManager: Dynamic selection of EFB depth format 2018-07-19 21:47:42 +10:00
Stenzek b30342d38f VideoBackends: Support D24S8 abstract texture format 2018-07-19 21:47:42 +10:00
Markus Wick f5e8af7b6c
Merge pull request #7276 from stenzek/disable-shared-context-nouveau
DriverDetails: Disable shared context shader compilation on nouveau
2018-07-19 09:15:27 +02:00
Stenzek 602fe0f457 DriverDetails: Disable shared context shader compilation on nouveau
Our usage of glFinish() can cause driver crashes and/or lockups.

Please note that this disables the background shader compilation (i.e.
all shaders will be compiled on boot). There is no way around this.
2018-07-17 13:34:18 +10:00
Michael M 857138a0ba AVIDump: use dump_path rather than deprecated AVFormatContext::filename
AVFormatContext::filename was deprecated in lavf 58.7.100 in favor
of AVFormatContext::url. Instead of adding version-checking logic,
just use the passed-in dump path instead.
2018-07-14 12:46:04 -07:00
Michael M e45698aaa0 AVIDump: av_register_all is deprecated/unneeded since 58.9.100 2018-07-14 12:46:00 -07:00
booto e2e43b4896 CP: some bits in some of the HI registers cannot be set
The mask is slightly different for Wii and GCN so we need to work it out at runtime.
2018-07-12 20:15:27 -04:00
Michael M 2a30e64974 RenderBase: don't clamp draw size to window
It distorts the aspect ratio when cropping, rather than actually cropping.
2018-07-07 13:32:10 -07:00
Lioncash 34c3a65de6
VideoCommon/TextureCacheBase: Resolve a -Wmissing-braces warning in GetRAMCopyFilterCoefficients() 2018-07-06 19:56:35 -04:00
Techjar 80b05b6f0d Make arbitrary mipmap detection toggle invalidate the texture cache
We want this setting to invalidate the cache because it may affect the appearance of textures in the rendered scene, therefore one would expect changing it while the game is running to have the expected effect immediately.
2018-07-03 18:44:11 -04:00
Jonathan Hamilton b54803a074 Remove unused sRGB conversion functions
Now the arbitrary mipmap reference downsampling is just done in linear space,
these are no longer used.
2018-07-02 09:53:54 -07:00
Jonathan Hamilton ac05d1a593 Do all arbitrary mipmap detection in integer space
This no longer converts from sRGB to linear for the reference mip
downsample - even if the original mipmap creation tool used an sRGB
colorspace (which isn't really guaranteed, and may even change per
game), this is a "fast" heuristic that's only an estimate anyway.

The average diff is also now stored in a u64, avoiding floating point
calculations in the per-pixel hot loop.

This should speed up the detection significantly, hopefully fixing
jank when loading in new textures.
2018-07-02 09:52:15 -07:00
Techjar 25bfee2233 VideoCommon: Fix auto IR being very overzealous 2018-06-25 00:48:57 -04:00
Markus Wick 0459a1a9e6
Merge pull request #6875 from JonnyH/WIP/mipmap-heuristic-tweaks
Make arbitrary mipmap detection a config option
2018-06-21 10:19:47 +02:00
Markus Wick bf50348d9f
Merge pull request #6539 from degasus/async
VideoCommon: Flush the GPU pipeline on async requests.
2018-06-21 10:16:54 +02:00
Lioncash de9c5fd375 ConfigManager: Convert GPUDeterminismMode into an enum class
Makes the values strongly-typed and gets more identifiers out of the
global namespace.

We are forced to use anything that is not "None" to mean none, because
X11 is garbage in that it has:

\#define None 0L

Because clearly no one else will ever want to use that identifier for
anything in their own code (and is why you should prefix literally
any and all preprocessor macros you expose to library users in public
headers).
2018-06-15 14:45:30 -04:00
Lioncash 3f210836ad Compiler: Rename __forceinline define to DOLPHIN_FORCE_INLINE
This is much better as prefixed double underscores are reserved for the
implementation when it comes to identifiers. Another reason its better,
is that, on Windows, where __forceinline is a compiler built-in, with
the previous define, header inclusion software that detects unnecessary
includes will erroneously flag usages of Compiler.h as unnecessary
(despite being necessary on other platforms). So we define a macro
that's used by Windows and other platforms to ensure this doesn't
happen.
2018-06-09 12:20:25 -04:00
Lioncash 03414e8e84 Common: Add header for compiler-specifics
Instead of globbing things under an ambiguous Common.h header, move
compiler-specifics over to Compiler.h. This gives us a dedicated home
for anything related to compilers that we want to make functional across
all compilers that we support.

This moves us a little closer to eliminating Common.h entirely.
2018-06-09 12:10:05 -04:00
master0fdisaster 7a90ea2752 Add OSD message for Volume Hotkeys
This pr adds an OnScreenDisplay message when you use the Volume hotkeys.
Just to have visual feedback.
2018-06-06 17:11:43 +02:00
Markus Wick 3860219899 VideoCommon: Flush the GPU pipeline on async requests. 2018-06-06 09:22:01 +02:00
Anthony 36ff2a20d5
Merge pull request #6954 from degasus/coherent
OGL/Streambuffer: Use coherent mapping by default.
2018-06-05 12:06:17 -07:00
Lioncash 72feeb4d18 BPMemory: Silence a -Wmissing-braces warning
Fairly trivial to resolve, we just initialize the std::array with two
sets of braces (one set to create the array, the other to start and end the
aggregate data that we'll end up returning)
2018-05-28 14:52:59 -04:00
Markus Wick cddc2d52c2
Merge pull request #6965 from stenzek/d3d-feature-level-10
D3D: Don't emit uint outputs when logic op is unsupported
2018-05-28 09:52:07 +02:00
degasus 3307946e2a VertexLoaderArm: Fix 565 color format.
Copy & paste error for enforcing A=255.
It was copied from the 888X format, which stores the output data in another register.
2018-05-27 11:27:15 +02:00
Stenzek 57976c947b ShaderGen: Don't emit integer outputs when logic op is unsupported
This may have been causing issues for D3D10 hardware, where logic op was
not supported.
2018-05-26 00:09:29 +10:00
Stenzek 9a5c2119e5 ShaderCache: Remove unused UID bits before inserting into shader map 2018-05-26 00:09:10 +10:00
Stenzek 640bfb8135 VideoConfig: Add a field for indicating logic op support in the backend 2018-05-26 00:07:20 +10:00
degasus fdfd8b19d6 OGL/Streambuffer: Use coherent mapping by default.
Coherent mappings have a lower overhead and less GL codes.
So enables coherent mapping by default for all drivers.
Both Qualcomm and ARM performs very bad with explicit flushing, so this change helps them as well.

AFAIK there was one GPU generation which was slower on coherent mapping: nvidia tesla
So Geforce 200 and 300 series should be tested with this PR before merging.
As this was last tested many years ago, this issue might have been fixed as well.
Those GPUs are close to 10 years old and not supported any more by nvidia.
2018-05-24 00:00:02 +02:00
Stenzek f7a0cae7f4 HiresTextures: Do not load compressed textures with unaligned dimensions
D3D11 cannot handle block compressed textures where the first mip level
is not a multiple of the block size. The simple fix for texture pack
authors: leave these textures uncompressed. You can still use a .dds
container.
2018-05-22 16:15:18 +10:00
Stenzek f74dbc794c EFB2RAM: Apply copy filter as a float coefficient after sampling
Using 8-bit integer math here lead to precision loss for depth copies,
which broke various effects in games, e.g. lens flare in MK:DD.

It's unlikely the console implements this as a floating-point multiply
(fixed-point perhaps), but since we have the float round trip in our
EFB2RAM shaders anyway, it's not going to make things any worse. If we
do rewrite our shaders to use integer math completely, then it might be
worth switching this conversion back to integers.

However, the range of the values (format) should be known, or we should
expand all values out to 24-bits first.
2018-05-22 12:24:08 +10:00
Lioncash c4d27cc8ec PostProcessing: Make GetShader() return by constant reference
We don't need to create copies of the shader string when they can be
avoided.
2018-05-21 12:07:51 -04:00
Lioncash 9d1b6cdea4 PostProcessing: Make member functions const qualified where applicable
These functions don't modify internal class state
2018-05-21 11:59:08 -04:00