Commit graph

3828 commits

Author SHA1 Message Date
Stenzek
f2d8c8d2a8 D3D12: Fix rare case where command list was executed with open queries 2019-04-01 20:49:24 +10:00
Connor McLaughlin
32e330eb35
Merge pull request #7950 from stenzek/out-of-range-efb-copies
BPStructs: Gracefully handle out-of-range EFB copies
2019-04-01 13:08:11 +10:00
Stenzek
113bd60fe7 Implement D3D12 backend 2019-04-01 11:24:55 +10:00
Stenzek
378b605669 BPStructs: Gracefully handle out-of-range EFB copies
Since the copy X and Y coordinates/sizes are 10-bit, the game can configure a
copy region up to 1024x1024. Hardware tests have found that the number of bytes
written does not depend on the configured stride, instead it is based on the
size registers, writing beyond the length  of a single row. The data written
for the pixels which lie outside the EFB bounds does not wrap around instead
returning different colors based on the pixel format of the EFB.

This suggests it's not based on coordinates, but instead on memory addresses.
The effect of a within-bounds size but out-of-bounds offset
(e.g. offset 320,0, size 640,480) are the same.

As it would be difficult to emulate the exact behavior of out-of-bounds reads,
instead of writing the junk data, we don't write anything to RAM at all for
over-sized copies, and clamp to the EFB borders for over-offset copies.
2019-03-31 22:05:53 +10:00
Stenzek
3c455de799 FramebufferManager: Fix broken EFB peeks in GL with MSAA on 2019-03-30 03:14:29 +10:00
Stenzek
087b11e780 TextureCacheBase: Fix possible crash on shutdown with deferred EFB copies 2019-03-29 20:54:44 +10:00
Connor McLaughlin
f3fadd7302
Merge pull request #7869 from stenzek/d3dcommon
D3D: Move sharable D3D11/D3D12 code to common library
2019-03-29 20:40:06 +10:00
Stenzek
d66d778bae PixelShaderGen: Use subgroup reduction operations for bounding box 2019-03-29 20:06:56 +10:00
Connor McLaughlin
1304e963ad
Merge pull request #7895 from stenzek/framebuffer-corruption
FramebufferManager: Don't discard in ReinterpretPixelData
2019-03-29 20:03:13 +10:00
Connor McLaughlin
154eeae8ae
Merge pull request #7915 from stenzek/bbox-scaled-update
VideoBackends: Scale bounding box rectangle in the pixel shader
2019-03-29 19:59:25 +10:00
Stenzek
3b86c93285 VertexManagerBase: Increase vertex/uniform buffer sizes
ZTP was uploading 10MB+ of uniforms per frame, reducing paralellism by
forcing GPU waits.
2019-03-29 19:52:38 +10:00
Stenzek
2a4bca8b4a VideoBackends: Verify validity before doing full renderer init
Prevents attempting to create invalid MSAA configurations, for example.
2019-03-29 19:52:38 +10:00
Stenzek
e9cfcf4632 ShaderCache: Don't create invalid logic op pipelines
uint_output will never be set unless logic ops are enabled. Also clears
the bits so we're not compiling unused pixel shaders on the other
backends.
2019-03-28 20:35:02 +10:00
Stenzek
5732769a3c ShaderCache: Set correct primitive in dummy ubershader pipelines 2019-03-28 20:35:02 +10:00
Stenzek
7dd9d74eec RenderBase: Add EFBHasAlphaChannel() helper 2019-03-28 20:35:02 +10:00
JMC47
b4b0ebae27
Merge pull request #7934 from stenzek/stretched-efb-peeks
FramebufferManager: Fix EFB peek cache stretching last tile
2019-03-27 10:53:47 -04:00
Stenzek
92fa6c34cd FramebufferManager: Fix EFB pokes being offset by 1 in D3D 2019-03-27 23:28:34 +10:00
Stenzek
c28393d6f9 FramebufferManager: Fix EFB peek cache stretching last tile 2019-03-27 22:12:40 +10:00
spycrab
f7897778ff NetPlayChatUI: Add activate chat hotkey 2019-03-26 18:13:32 +01:00
Stenzek
16294acd2a VideoBackends: Scale bounding box rectangle in the pixel shader 2019-03-25 18:47:58 +10:00
Stenzek
cff60f5ba0 FramebufferManager: Only clear tile array when valid
When looking into the Faron Woods fifolog, I noticed this code was quite
high in the profile (~10%). Clearing 4096 entries from the vector isn't
needed every draw, we only need to do this when the cache was actually
valid in the first place.

Should provide a slight general performance boost.
2019-03-24 15:03:04 +10:00
spycrab
c89139d75d
Merge pull request #7903 from spycrab/imgui_np_chat
Add imgui-based Netplay Chat
2019-03-23 21:11:33 +01:00
spycrab
7cfb626a83 Add imgui-based Netplay Chat 2019-03-23 20:13:24 +01:00
spycrab
8cfbbbe9dc VideoCommon/RenderBase: Disable backculling for ImGui 2019-03-21 13:16:21 +01:00
Stenzek
bf0b52efc6 TextureCacheBase: Fix infinite loop in DoPartialTextureUpdates 2019-03-20 20:05:51 +10:00
Stenzek
8aa0ea10d9 FramebufferManager: Don't discard in ReinterpretPixelData
This was causing the depth buffer to be discarded as well, which
has an effect on mobiles (doesn't get loaded into tile memory).

If we find this is hindering performance (remember, the EFB is
only a 640x528 texture), it may be worth changing the interface to
support discarding only the colour buffer.
2019-03-16 23:45:08 +10:00
JosJuice
c71216419b
Merge pull request #7874 from vadosnaprimer/ffv1_fix
FFV1 fix
2019-03-15 23:17:02 +01:00
Stenzek
cce7ac43d4 FramebufferManager: Fix panic in VertexManager with large EFB depth poke batches 2019-03-12 18:26:07 +10:00
feos
7fd940411b decrease gop size (keyint)
this makes seeking a lot smoother (especially at high resolutions), while only adding less than 1% of filesize with this codec.
2019-03-11 22:17:13 +03:00
feos
005e60fa22 change pixel format from BGRA to BGR0
for this kind of footage carrying alpha information makes no sense, and it additionally complicates things by hugely damaging compatibility of the resulting video. after this change alone the video becomes compatible with VfW/WinAPI and tools that rely on it (avisynth, virtualdub).

fixes https://bugs.dolphin-emu.org/issues/11141 and https://bugs.dolphin-emu.org/issues/10193
2019-03-11 22:17:12 +03:00
Stenzek
a218a794cb FramebufferManager: Implement deferred EFB cache invalidation 2019-03-09 12:24:04 +10:00
Stenzek
6bc4bfd26a FramebufferManager: Implement EFB tile cache
The new tile cache is dynamic in size and can be turned on/off.
2019-03-09 12:23:33 +10:00
Stenzek
65216c9e87 VideoConfig: Add SupportsPartialDepthCopies to backend info
D3D11 doesn't support partial copies of depth buffers via
CopySubResource(), so we need to use a different path for the EFB cache.
2019-03-09 12:19:53 +10:00
spycrab
9ca394bbea VideoCommon/RenderBase: Don't destroy pipelines that are in use 2019-03-07 01:59:46 +01:00
Tillmann Karras
05fa667d03 VideoCommon: add EFB peek/poke stats 2019-03-04 02:49:59 +00:00
Tillmann Karras
24ba3bf2f2 TextureConversionShader: fix XFB decoding shader 2019-03-01 21:54:33 +00:00
Tilka
6be35422e9
Merge pull request #7832 from stenzek/xfb-decoding-regression
TextureCache: Fix GPU decoding of XFB copies
2019-02-28 11:03:25 +00:00
Stenzek
8192c0dd48 TextureConversionShader: Fix XFB decoding shader for D3D
D3D has no mix() equivalent with a bool parameter. Compilers should be
able to optimize the ternary into a select anyway.
2019-02-28 20:43:50 +10:00
Stenzek
db6763019d TextureCache: Fix GPU decoding of XFB copies not falling back to CPU 2019-02-28 20:19:37 +10:00
Stenzek
7f0111b022 TextureCache: Fix EFB2RAM copies at >1xIR sampling out-of-range 2019-02-28 20:11:46 +10:00
Tilka
6ce7f44b8a
Merge pull request #7753 from stenzek/videocommon-all-the-things
Move a significant amount of video backend logic to VideoCommon
2019-02-26 04:21:05 +00:00
JosJuice
ea7b96342b VideoConfig: Don't overwrite aspect_mode with suggested_aspect_mode
Unnecessary since b93b7ec. It was needed before that commit becase
RenderBase.cpp only was checking the value of aspect_mode, not
suggested_aspect_mode.
2019-02-23 16:00:18 +01:00
Stenzek
f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00
Stenzek
933f3ba008 TextureCache: Don't copy out-of-range rectangles when stitching textures
This can cause driver crashes or GPU hangs if we do.
2019-02-17 16:35:43 +10:00
Stenzek
2165523fdc TextureConverterShader: Write EFB2Tex XFB copies with alpha value of 1
This way we don't end up with artifacts of the EFB's alpha values in
frame dumps. XFB copies loaded from RAM also set the alpha to 1, so this
will match.
2019-02-17 16:35:43 +10:00
Stenzek
50bdcb8d9c TextureCache: Bind textures/samplers after loading all textures
Since loading textures can result in rendering, e.g. partial copies, we
don't want to disturb partially-bound GX state.
2019-02-17 16:35:43 +10:00
Tilka
8d59d1bb11
Merge pull request #7798 from ShFil119/impr/empty
Use empty instead of size
2019-02-13 01:59:43 +00:00
Filip Gawin
49fe9f5db1 Use empty instead of size 2019-02-13 00:03:49 +01:00
Anthony
f65b3a998c
Merge pull request #7739 from zackhow/multib
Android: Disable backend multithreading and add option to gfx menu
2019-02-03 12:44:00 -08:00
Tilka
8aaebfa2b3
Merge pull request #7716 from stenzek/stereo
Stereoscopy regression fixes
2019-02-03 19:57:01 +00:00
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