Commit graph

4248 commits

Author SHA1 Message Date
iwubcode
1f2f505373 VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc 2021-08-30 13:47:48 -05:00
Tillmann Karras
f9d2d42a4c VideoCommon: report games that set bits in XFMEM_CLIPDISABLE
The SDK only exposes the lowest bit. The Nintendo Channel intro is currently
broken because we don't implement this (see issue 12562).
2021-08-15 04:41:49 +01:00
JosJuice
c79757618d
Merge pull request #9993 from Techjar/late-vi-output
VI: Implement post-scanout XFB output
2021-08-07 12:41:59 +02:00
Techjar
797d0b7b1b VI: Implement post-scanout XFB output
This adds about a frame of latency, and since most games don't change
VI registers during scanout, we can get away with outputting the XFB at
the start of scanout. WWE Crush Hour is the (only currently known)
exception, which has flickering problems when doing it this way.

This adds a path to perform the output at the end of scanout, and gates
it behind an option which defaults to using the latency-reducing
pre-scanout path.
2021-08-03 23:37:50 -04:00
Léo Lam
c9c5f7a89c
Merge pull request #9928 from Pokechu22/shadow-the-hedgehog-eyelids-NaN
Convert NaN to 1 when generating texture coordinates
2021-08-04 03:08:34 +02:00
Léo Lam
35bf5e3839
Merge pull request #9962 from OatmealDome/macos-vulkan-default
VideoBackendBase: Prefer Vulkan over OGL on macOS Mojave and newer
2021-08-02 03:39:12 +02:00
Pokechu22
f46fe77264 GeometryShaderGen: Rename ApiType to api_type 2021-08-01 15:17:21 -07:00
Pokechu22
3b752c4d5d UberShaderPixel: Rename ApiType to api_type 2021-08-01 15:09:20 -07:00
Pokechu22
b6d2938731 Recompile shaders when 'Enable API Validation Layers' is toggled 2021-07-28 21:35:36 -07:00
Pokechu22
eb81968fe6 Convert ShaderHostConfig to BitField 2021-07-28 21:35:36 -07:00
Pokechu22
1640fa9096 Remove note about anisotropic filtering requiring edge LOD
This was added because YAGCD's info on MAXANISO (near TX_SETMODE0 in Section 5.11.1) claims it's the case, but Extrems says it does work.  I haven't tested anything myself, and dolphin still does not actually implement anisotropic filtering based on this field.
2021-07-27 19:33:31 -07:00
OatmealDome
46e331d000 VideoBackendBase: Prefer Vulkan over OGL on macOS Mojave and newer 2021-07-25 19:21:06 -04:00
Pokechu22
3a4d8379bf Convert NaN to 1 when generating texture coordinates
This fixes eyelids in Shadow the Hedgehog during cutscenes (https://bugs.dolphin-emu.org/issues/11458)
2021-07-24 22:20:35 -07:00
Pokechu22
19332575aa WrapMode=3 behaves the same as Clamp 2021-07-20 19:23:23 -07:00
JosJuice
92fc4f1eca PixelShaderGen: Fix OpenGL ES bounding box compilation error 2021-07-20 11:39:32 +02:00
Techjar
5e0520b6e0 VideoCommon: Expand vector comparisons instead of overloading any()
For whatever stupid reason, Mali drivers do not allow overloading
built-in functions.
2021-07-20 05:24:47 -04:00
Tillmann Karras
c948d7f436 PostProcessing: fix link error when switching shaders
Switching to a post-processing shader with different configuration options will
change the UBO, so we need to recompile the vertex shader as well.
2021-07-18 04:08:48 +01:00
Connor McLaughlin
9b17805be9
Merge pull request #9881 from blaahaj/postprocessing-fix
PostProcessing: Fix OpenGL UBO linking with configuration options
2021-07-14 13:14:17 +10:00
Markus Wick
edc4396603
Merge pull request #9888 from JosJuice/jitarm64-logicalimm-everywhere
JitArm64: Stop using hand-encoded logical immediates
2021-07-12 23:03:31 +02:00
JosJuice
8af5095ff4 JitArm64: Stop using hand-encoded logical immediates 2021-07-12 22:25:49 +02:00
CrystalGamma
beb6ec0569 VideoCommon: fix generic build
On x86/ARM Common/Assert.h is included by way of
VideoCommon/VertexLoader{X64,ARM64}.h, on other platforms it is missing.
2021-07-12 04:30:43 +02:00
Pokechu22
b880be0aa5 Use separate fmt::formatters for each indirect matrix column
This also fixes a bug where the float version of row 1 actually showed row 0 again.
2021-07-11 15:01:42 -07:00
Pokechu22
f467c02d1a Ignore the top bit of the indirect texture matrix scale
This fixes the Zora eye coloration in Twilight Princess.
2021-07-11 15:01:37 -07:00
Tilka
20a8e9c872
Merge pull request #9876 from Pokechu22/skyward-sword-map
Fix indirect textures when format is not ITF_8
2021-07-11 22:59:23 +01:00
JosJuice
9e80db123f JitArm64: Encode logical immediates at compile-time where possible
Manually encoding and decoding logical immediates is error-prone.
Using ORRI2R and friends lets us avoid doing the work manually,
but in exchange, there is a runtime performance penalty. It's
probably rather small, but still, it would be nice if we could
let the compiler do the work at compile-time. And that's exactly
what this commit does, so now I have no excuse for trying to
manually write logical immediates anymore.
2021-07-10 20:43:59 +02:00
Pokechu22
a379456f38 Fix indentation for alphabump 2021-07-08 15:48:14 -07:00
Pokechu22
2feced2e33 Fix indirect textures when format is not ITF_8 2021-07-08 15:48:14 -07:00
blåhaj
debeb09dee PostProcessing: Fix OpenGL UBO linking with configuration options 2021-07-07 21:28:22 +02:00
Léo Lam
56fdde5d74
Merge pull request #9595 from Dentomologist/fix_vertex_loader_test_warnings
VertexLoaderTest: Fix memset assignment warning
2021-07-06 11:50:23 +02:00
Mai M
ffdc8538a1
Merge pull request #9862 from delroth/spdx-tags
Use SPDX for Dolphin licensing info
2021-07-06 01:02:57 -04:00
JMC47
6cc195e02f
Merge pull request #9640 from v1993/patch-1
Allow post-processing shaders to query reciprocal of window resolution
2021-07-05 16:30:54 -04:00
Pierre Bourdon
e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Léo Lam
a632a6a404
Merge pull request #9833 from Pokechu22/ubershaders-tevcoord
UberShaderPixel: always set tevcoord, even if the stage has no texture
2021-06-24 01:05:17 +02:00
Léo Lam
b66e88e4b9
Merge pull request #9837 from AdmiralCurtiss/mysterious-voodoo-performance-fix
VideoCommon/Fifo: Move SConfig::GetInstance() outside the GPU loop.
2021-06-24 00:41:43 +02:00
JMC47
95ecb73b11
Merge pull request #9826 from Techjar/fix-tmem-mips
VideoCommon/TextureInfo: Fix mipmap loading from tmem
2021-06-23 18:21:55 -04:00
Admiral H. Curtiss
1183fb3d2d VideoCommon/Fifo: Move SConfig::GetInstance() outside the GPU loop. 2021-06-23 23:52:26 +02:00
Pokechu22
2f1726e3f3 UberShaderPixel: always set tevcoord, even if the stage has no texture
This fixes NES game graphics when UberShaders are in use.
2021-06-21 13:01:25 -07:00
Techjar
2d59dcb95d VideoCommon/TextureInfo: Fix mipmap loading from tmem
Even address needs to be offset to the first mipmap entry.
2021-06-20 16:49:39 -04:00
iwubcode
df53a5f880 VideoCommon: enhance hi res texture support by having exact matches be picked before wildcard matches. Additionally, add the ability to ignore the texture hash portion of the texture name when loading a hi res texture 2021-06-19 21:15:38 -05:00
iwubcode
8fb0f91331 VideoCommon: split the texture hash from the base name when generating the texture name 2021-06-19 21:15:38 -05:00
Techjar
3da0976a81 VideoCommon: Define scalar any() and all() functions in GLSL
This fixes bounding box shaders failing to compile under Vulkan, due to
differences between GLSL and HLSL in the return value of vector
comparisons and what types these functions accept. I included all() for
the sake of completeness.
2021-06-13 04:50:35 -04:00
JMC47
0c6e00ce0c
Merge pull request #9801 from Techjar/bbox-rounding-hack
VideoCommon: Only include centered pixels in bounding box
2021-06-11 00:41:11 -04:00
Techjar
b267f54259 VideoCommon: Only include centered pixels in bounding box
At higher resolutions, our bounding box dimensions end up being
slightly larger than original hardware in some cases. This is not
necessarily wrong, it's just an artifact of rendering at a higher
resolution, due to bringing out detail that wouldn't have appeared on
original hardware. It causes a texel to fall partially on what would
have been a single pixel at native resolution, resulting in the
coordinates getting bumped up to the next valid value. In many cases,
these slightly larger bounding boxes are perfectly fine, as games don't
hard-code expected dimensions. It is problematic in Paper Mario TTYD
though, for a somewhat complicated reason.

Paper Mario TTYD frequently uses EFB copies to pre-render a bunch of
animation frames for a character sprite (especially in Chapter 2), so
that it can then render 100 or more of them without bringing the
GameCube to its knees. Based on my observation, the game seems to set
aside a region of memory to store these EFB copies. This region is
obviously fairly small, as the GameCube only has 24MB of RAM. There are
2 rooms in Chapter 2 where you fight a horde of as many as 100 Jabbies,
which are also rendered using EFB copies, so in this room the game ends
up making 130(!) EFB copies just for Puni and Jabbi sprites. This seems
to nearly fill the region of memory it set aside for them.
Unfortunately, our slightly larger bounding boxes at higher resolutions
results in overflowing this memory, causing very strange behavior. Some
EFB copies partially overlap game state, resulting in reading it as a
garbage RGB5A3 texture that constantly changes. Others apparently
somehow trigger a corner case in our persistent buffer mapping, causing
them to partially overwrite earlier EFB copies.

What this change does is only include the screen coordinates that align
with the equivalent native resolution pixel centers, which generally
results in the bounding boxes being more in line with original
hardware. It isn't perfect, but it's enough to fix Paper Mario TTYD's
Jabbi rooms by avoiding the buffer overflow. Notably, it is more
accurate at odd resolutions than at even resolutions. Native resolution
is completely unaffected by this change, as should be the case. This
change may also have a small positive impact on shader performance at
higher resolutions, as there will be less atomic operations performed.
2021-06-10 21:49:52 -04:00
Pokechu22
1500a0119b Eliminate TVtxDesc.GetLegacyHex 2021-06-09 20:50:50 -07:00
Pokechu22
820d9ffbfa Remove PixelShaderGen hasindstage 2021-06-09 20:50:49 -07:00
Pokechu22
c583cac568 Hack to hide debug cubes in Super Mario Sunshine
... while not breaking other games.
2021-06-09 20:50:49 -07:00
Connor McLaughlin
c729852d72
Merge pull request #9782 from Techjar/bbox-ogl-upsidedown-fix
VideoCommon: Perform OpenGL bounding box inversion in pixel shader
2021-06-08 13:24:03 +10:00
Léo Lam
5e371bb4be
Merge pull request #9792 from sepalani/lint
Lint: End of namespace
2021-06-07 12:16:08 +02:00
Sepalani
ce8004c9c1 Lint: End of namespace 2021-06-07 12:55:52 +04:00
Techjar
4866002c9b VideoCommon: Perform OpenGL bounding box inversion in pixel shader
Running the min/max operation on the upside down, quad-rounded pixel
coordinates before inverting them to the standard upper-left origin
produces wrong results. Therefore, we need to do the inversion before
rounding to pixel quads.
2021-06-06 20:55:06 -04:00