Commit Graph

3996 Commits

Author SHA1 Message Date
JosJuice bf57abc0d5 Fix Windows CMake build errors
Lambda expressions with uncaptured constants were leading to errors,
and there were also some warnings about deprecated functions
(QFontMetrics::width and inet_ntoa).
2020-05-03 14:10:24 +02:00
degasus fc0df37d94 Fix windows build system. 2020-04-29 12:56:52 +02:00
Pierre Bourdon b7db359081
XFMemory: SETPOSMTXINFO should be SETPOSTMTXINFO
It actually maps to postMtxInfo, not posMtxInfo (which isn't a thing).
This is especially confusing because there *are* position matrices (as
opposed to post-transform matrices).
2020-04-29 05:26:02 +02:00
Léo Lam 0fe4985f8d
Merge pull request #8689 from howard0su/cleanup_sign
Remove warnings of -Wsign-compare
2020-04-28 13:36:21 +02:00
Jun Su f3d7b82f83 Cleanup warnings of -Wswitch
Add default branch to the switch-case.
2020-04-28 13:16:30 +02:00
Sintendo 523954e03a Analytics: Report correct quirk for mismatched xf/bp colors
Looks like a copy-paste error. The quirk for mismatched xf/bp texgens
was used twice.
2020-04-24 02:22:51 +02:00
JMC47 d845b31579
Merge pull request #8717 from stenzek/mismatched-xf-bp
VertexManagerBase: Skip drawing objects with mismatched xf/bp stages
2020-04-21 10:07:36 -04:00
JMC47 935b12d785
Merge pull request #8730 from JosJuice/frame-advance-duplicate-frame
Core: Skip duplicate frames when using frame advance
2020-04-16 18:29:16 -04:00
JMC47 c0ae9cbc45
Merge pull request #8584 from jordan-woyak/widescreen-heuristic-fix
VideoCommon: Tweak widescreen heuristic.
2020-04-13 05:57:19 -04:00
JosJuice 812ad4257c Core: Skip duplicate frames when using frame advance
It used to be the case that frame advance skipped duplicate frames
(i.e. it would take 30 frame advances to get through one second
of emulated time in a 30 fps game), but this broke in 9c5c3c0.
Skipping duplicate frames making TASing less annoying.
2020-04-09 11:39:29 +02:00
JosJuice 1a42355f96 Core: Clarify Callback_VideoCopiedToXFB and FrameUpdate 2020-04-09 00:21:04 +02:00
Stenzek ff7180cac4 Analytics: Add quirk for mismatched xf/bp texgens/colors 2020-04-02 12:52:16 +10:00
Stenzek a9c1dcf656 VertexManagerBase: Skip drawing objects with mismatched xf/bp stages
Hardware tests have shown that if the number of texgens/channels do not
match, you get garbage rendering. Presumably because the output
registers from the XF stage are fed into the incorrect input registers
for TEV/BP.

Currently, this causes Dolphin to crash/generate invalid shaders with an
assertion failure in the hardware backends. Instead, we log an error.

Perhaps in the future we should just spit out all texgens/colors anyway
from both stages, and let cross-stage optimization take care of DCE'ing
it away. But doing so would require changing the UIDs and invalidating
everyone's shader caches.
2020-04-02 12:51:41 +10:00
Jun Su 81f8099cc6 Remove warnings of -Wsign-compare
Cast the variable to the coresponding type.
2020-03-25 07:57:14 +08:00
Jun Su da223a2271 Cleanup warnings of -Wunused-lambda-capture
Remove unused lambda captures.
2020-03-24 20:14:10 +08:00
iwubcode bba92019dc VideoCommon: Allow texture folders to be determined by a <gameid>.txt file 2020-03-15 12:34:04 -05:00
Stenzek a545344268 VideoBackends: Make it possible for PrepareWindow to change the surface
Again, needed for MoltenVK.
2020-03-11 23:10:30 +10:00
Jordan Woyak 7cbb9822c1 VideoCommon: Remove widescreen heuristic debug logs. 2020-02-09 13:22:27 -06:00
Jordan Woyak 10223da6a8 VideoCommon: Tweak widescreen heuristic and clean up some related Renderer logic. 2020-02-09 13:22:25 -06:00
Lioncash abd2897377 VideoCommon: Amend formatting code to handle the upgrade to fmt
It seems that the newer version of fmt gets tripped up by bitfields
within structs. However, we can just specify the intended type where
necessary to get around this.
2020-02-04 14:55:20 -05:00
Techjar 3a3dc28d54 VertexLoaderX64: Don't use PDEP on AMD Zen 2020-01-26 22:12:00 -05:00
Tilka 2edcb29706
Merge pull request #8582 from jordan-woyak/osd-disabled-fix
VideoCommon/OSD: Process OSD messages even when they are disabled.
2020-01-25 21:11:37 +00:00
Tilka b0e040431a
Merge pull request #8581 from jordan-woyak/ciface-ar-aware
InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio.
2020-01-25 20:28:01 +00:00
Connor McLaughlin e3a7922e12
Merge pull request #8336 from Ebola16/PS
Add Dolphin version and current video backend to shader compilation logs
2020-01-25 11:52:14 +10:00
Jordan Woyak c08671c4ce VideoCommon/OSD: Process OSD messages even when they are disabled. 2020-01-24 11:00:58 -06:00
Jordan Woyak b92f6480a0 InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio. 2020-01-24 09:20:41 -06:00
Ryan Meredith e5f6d9320f Add Dolphin version and current video backend to shader compilation logs 2020-01-24 03:29:38 -05:00
Lioncash 687f1f0330 VideoCommon/TextureConversionShader: Make use of fmt where applicable
Now that we've converted the shader generation over to ShaderCode, we
can now make use of the fmt-capable WriteFmt function.
2020-01-23 14:19:40 -05:00
Lioncash aa77dff3a2 VideoCommon/TextureConversionShader: Convert over to using ShaderCode
Migrates the shader generator off the use of a global array, eliminating
the use of some global state. This also allows us to move the shader
generation over to using fmt in a subsequent change.
2020-01-23 14:19:36 -05:00
Stenzek 11ba623f26 Add an option to present/skip presenting duplicate frames
Currently, we do not display every second frame in 25fps/30fps games
which run to vsync. This improves performance as there's less rendering
for the GPU to perform, but when combined with vsync, could cause frame
pacing issues.

This commit adds an option to force every frame generated by the console
to be displayed to the host, which may improve pacing for these games.
2020-01-14 10:57:35 +10: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
Stenzek d744c5a148 Compile fixes for Windows-on-ARM64 2019-12-28 19:20:41 +10:00
Stenzek 6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
Stenzek 6a0067fd26 FrameDump: Set first_frame if movie frame number <= 1
The frame number is incremented before the first frame is swapped out.

Fixes ffmpeg creating invalid video files on output if the emulator only
runs for a single frame, e.g. FifoCI.
2019-12-22 11:54:34 +10:00
Anthony bac8c060b5
Merge pull request #8508 from lioncash/fmt-tex
VideoCommon/TextureConverterShaderGen: Convert over to fmt
2019-12-07 18:41:14 -08:00
Anthony 9ef50a1d4b
Merge pull request #8509 from lioncash/shader-str
VideoCommon/FramebufferShaderGen: Minor clean up
2019-12-07 18:40:56 -08:00
Anthony 19ea546a0a
Merge pull request #8511 from lioncash/if-constexpr
VideoCommon/OpcodeDecoding: Make use of if constexpr
2019-12-07 18:40:15 -08:00
Anthony fdb78b64e1
Merge pull request #8513 from lioncash/bounding-box
VideoCommon/BoundingBox: Make interface for querying bounding box data
2019-12-07 18:40:02 -08:00
Lioncash 2c9ec6cb8a VideoCommon/BoundingBox: Move PixelShaderManager::SetBoundingBoxActive() calls into Enable()/Disable()
Now that we have an actual interface to manage things, we can stop
duplicating the calls to to the pixel shader manager and remove the
need to remember to actually do so when disabling or enabling the
bounding box.
2019-12-05 11:57:58 -05:00
Lioncash 9bd533ebe4 VideoCommon/BoundingBox: Make interface for querying bounding box data
Rather than expose the bounding box members directly, we can instead
provide an interface for code to use. This makes it nicer to transition
from global data, as the interface function names are already in
place.
2019-12-05 11:48:42 -05:00
Lioncash 10f7674651 VideoCommon/IndexGenerator: Eliminate static state
Now that we've extracted all of the stateless functions that can be
hidden, it's time to make the index generator a regular class with
active data members.

This can just be a member that sits within the vertex manager base
class. By deglobalizing the state of the index generator we also get rid
of the wonky dual-initializing that was going on within the OpenGL
backend.

Since the renderer is always initialized before the vertex manager, we
now only call Init() once throughout the execution lifecycle.
2019-12-05 10:49:32 -05:00
Lioncash 159947ab68 VideoCommon/IndexGenerator: Make use of if constexpr
We can use if constexpr with the template functions that pass in a
non-type template parameter, allowing the removal of branches that
aren't taken at compile time.

Compilers will generally do this by default, however, we now give a
gentle prodding to the compiler if this would otherwise not be the case.
2019-12-05 10:49:32 -05:00
Lioncash fb3fda775f VideoCommon/IndexGenerator: Move stateless functions into anonymous namespace
These don't rely on any of the static members within the IndexGenerator
class, so we can make all of these functions fully internal to the
translation unit.
2019-12-05 10:49:29 -05:00
Lioncash 69f2ca2230 VideoCommon/IndexGenerator: Make use of anonymous namespace
More things will be moved into this in subsequent changes. While we're
at it, we can also make use of std::array.
2019-12-05 09:36:41 -05:00
Lioncash 1f46a6a64b VideoCommon/OpcodeDecoding: Make use of if constexpr
We can make use of if constexpr in several scenarios here to allow
compilers to exise the relevant code paths out.

Technically a decent compiler would do this already, but now we can give
compilers a little more nudging here in the event that isn't the case.
2019-12-05 09:13:06 -05:00
Lioncash 99353c3baa VideoCommon/OpcodeDecoding: Remove unused headers
Nothing provided by these headers are used, so we can remove them.
2019-12-05 09:13:06 -05:00
Lioncash 6339a5ea8e VideoCommon/OpcodeDecoding: Resolve implicit signedness conversion
cmd2 is a u32, so any bitwise arithmetic on it with a type of the same
size or smaller will result in a u32 value. This is also implicitly
converted to an unsigned type in the if statement as well, given that
size_t * int -> size_t.

This is just more explicit about the operations occurring and also
likely silences a sign conversion warning.
2019-12-05 09:13:06 -05:00
Lioncash 4710b82f43 VideoCommon/OpcodeDecoding: Remove use of goto in Run()
With the use of a lambda and a change in switch fallthrough, we can
completely eliminate the use of goto within Run().
2019-12-05 09:13:06 -05:00
Lioncash f74503cce0 VideoCommon/OpcodeDecoding: Make use of anonymous namespace
Provides a region for all internal utilities.
2019-12-05 09:13:06 -05:00
Lioncash 6b4e340995 VideoCommon/OpcodeDecoding: Amend comment formatting
Amends a documentation comment that acquired some wonky formatting
during the introduction of clang-format a few years ago.
2019-12-05 09:13:06 -05:00