summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexManagerBase.cpp
AgeCommit message (Collapse)Author
2022-07-13Merge pull request #10777 from tellowkrinkle/EFBFlushJMC47
VideoCommon: Remember to flush command buffers after multiple EFB copies
2022-07-06VideoCommon: Remember to flush command buffers after multiple EFB copiesTellowKrinkle
2022-06-27VideoCommon: trigger mod calls in TextureCacheBase (efb/xfb calls), ↵iwubcode
VertexManagerBase (draw calls), and VertexShaderManager (projection calls)
2022-05-25Common: Refactor PointerWrapDentomologist
2022-04-22VideoCommon: Handle emboss texgen with only a single normalPokechu22
Fixes a large number of effects in Rogue Squadron 2 and 3.
2022-04-22VertexLoader: Convert count register to remaining registerPokechu22
This more accurately represents what's going on, and also ends at 0 instead of 1, making some indexing operations easier. This also changes it so that position_matrix_index_cache actually starts from index 0 instead of index 1.
2022-04-22Convert vertex loader position cache to std::arrayPokechu22
2021-12-18Convert OpcodeDecoder::Opcode and OpcodeDecoder::Primitive to enum classPokechu22
2021-11-17Eliminate SamplerCommonPokechu22
2021-10-12Extend TMEM cache implementationScott Mansell
Now works with games that deliberately avoid invalidating TMEM because they know textures are too large to fit: * Sonic Riders * Metal Arms: Glitch in the System * Godzilla: Destroy All Monsters Melee * NHL Slapshot * Tak and the Power of Juju * Night at the Museum: Battle of the Smithsonian * 428: Fūsa Sareta Shibuya de
2021-10-04VideoCommon: Abstract bounding boxTechjar
This moves much of the duplicated bounding box code into VideoCommon, leaving only the specific buffer implementations in each backend.
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
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-03-06Convert XFMemory to BitField and enum classPokechu22
Additionally a new ClipDisable union has been added (though it is not currently used by Dolphin).
2021-01-27rename Core/Analytics to Core/DolphinAnalyticsShawn Hoffman
2020-11-17VideoCommon: Migrate over to fmtLioncash
Migrates off the printf-based formatting where applicable.
2020-05-25VideoCommon/ShaderGenCommon: Make template functions regular functionsLioncash
These are only ever used with ShaderCode instances and nothing else. Given that, we can convert these helper functions to expect that type of object as an argument and remove the need for templates, improving compiler throughput a marginal amount, as the template instantiation process doesn't need to be performed. We can also move the definitions of these functions into the cpp file, which allows us to remove a few inclusions from the ShaderGenCommon header. This uncovered a few instances of indirect inclusions being relied upon in other source files. One other benefit is this allows changes to be made to the definitions of the functions without needing to recompile all translation units that make use of these functions, making change testing a little quicker. Moving the definitions into the cpp file also allows us to completely hide DefineOutputMember() from external view, given it's only ever used inside of GenerateVSOutputMembers().
2020-04-24Analytics: Report correct quirk for mismatched xf/bp colorsSintendo
Looks like a copy-paste error. The quirk for mismatched xf/bp texgens was used twice.
2020-04-21Merge pull request #8717 from stenzek/mismatched-xf-bpJMC47
VertexManagerBase: Skip drawing objects with mismatched xf/bp stages
2020-04-02Analytics: Add quirk for mismatched xf/bp texgens/colorsStenzek
2020-04-02VertexManagerBase: Skip drawing objects with mismatched xf/bp stagesStenzek
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-02-09VideoCommon: Tweak widescreen heuristic and clean up some related Renderer ↵Jordan Woyak
logic.
2019-12-29Use std::istringstream or std::ostringstream instead of std::stringstream ↵David Korth
where possible. This removes std::iostream from the inheritance chain, which reduces overhead slightly.
2019-12-07Merge pull request #8513 from lioncash/bounding-boxAnthony
VideoCommon/BoundingBox: Make interface for querying bounding box data
2019-12-05VideoCommon/BoundingBox: Make interface for querying bounding box dataLioncash
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-05VideoCommon/IndexGenerator: Eliminate static stateLioncash
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-07-24TextureCache: Support saving cache entries, including EFB copiesStenzek
2019-07-24VideoBackendBase: Do save state logic on the GPU threadStenzek
2019-07-10VideoCommon/Statistics: Rename stats global to g_statsLioncash
Makes the global variable follow our convention of prefixing g_ on global variables to make it obvious in surrounding code that it's not a local variable.
2019-07-10VideoCommon/Statistics: Normalize statistic variable namesLioncash
Normalizes all variables related to statistics so that they follow our coding style. These are relatively low traffic areas, so this modification isn't too noisy.
2019-06-20VideoCommon/Statistics: Use std::array for projection valuesLioncash
Makes the members within the interface much nicer to look at, and also makes copying them over much nicer too.
2019-03-09FramebufferManager: Implement deferred EFB cache invalidationStenzek
2019-02-19Move most backend functionality to VideoCommonStenzek
2019-02-17TextureCache: Bind textures/samplers after loading all texturesStenzek
Since loading textures can result in rendering, e.g. partial copies, we don't want to disturb partially-bound GX state.
2018-12-04Use main buffers for utility drawsStenzek
2018-03-26Implement "Skip" ubershader modeStenzek
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-10VideoConfig: Collapse ubershader configuration fields to a single valueStenzek
2018-03-10Renderer: Remove now-redundant Set{Rasterization,Depth,Blending}StateStenzek
2018-03-10Move shader caches to VideoCommonStenzek
2018-01-17VideoCommon: Apply custom texture scale for arbitrary mipmaps.Markus Wick
We want to get the same mipmap level. And if the IR and the custom texture upscaling fits, we don't need to modify the LOD bias.
2017-11-19VideoCommon: Resolve -Wmissing-brace warningsLioncash
Resolves around 5 -Wmissing-brace warnings on macOS.
2017-11-03Fix incorrect handling of auto IRJosJuice
Some lines of code in Dolphin just plainly grabbed the value of g_ActiveConfig.iEFBScale, which resulted in Auto being treated as 0x rather than the actual automatically selected scale.
2017-10-27Fixed fog, lava, water in Mario Galaxy (and possibly other games) in higher ↵Tommaso Checchi
IRs by detecting & fixing the mipmaps that aren't just used for downscaling, but are handmade to create a gradient.
2017-09-11VideoBackends: Move SamplerState to commonStenzek
2017-09-11Renderer: Move cull mode to a rasterization state objectStenzek
Also moves logic for primitive handling to VideoCommon.
2017-07-30XFMemory: Convert several registers to bitfieldsStenzek
2017-07-30BPMemory: Convert a number of unions to BitFieldsScott Mansell
2017-07-10Implement minimal emulation of TMEM cachingmimimi085181
This is a remake of https://github.com/dolphin-emu/dolphin/pull/3749 Full credit goes to phire. Old message: "If none of the texture registers have changed and TMEM hasn't been invalidated or changed in other ways, we can blindly reuse the old texture cache entries without rehashing. Not only does this fix the bloom effect in Spyro: A Hero's Tail (The game abused texture cache) but it will also provide speedups for other games which use the same texture over multiple draw calls, especially when safe texture cache is in use." Changed the pr per phire's instructions to only return the current texture(s) if none of the texture registers were changed. If any texture register was changed, fall back to the default hashing and rebuilding textures from memory.
2017-04-05VideoCommon: rework anamorphic widescreen heuristicMichael Maltese
Some widescreen hacks (see below) properly force anamorphic output, but don't make the last projection in a frame 16:9, so Dolphin doesn't display it correctly. This changes the heuristic code to assume a frame is anamorphic based on the total number of vertex flushes in 4:3 and 16:9 projections that frame. It also adds a bit of "aspect ratio inertia" by making it harder to switch aspect ratios, which takes care of aspect ratio flickering that some games / widescreen hacks would be susceptible with the new logic. I've tested this on SSX Tricky's native anamorphic support, Tom Clancy's Splinter Cell (it stayed in 4:3 the whole time), and on the following widescreen hacks for which the heuristic doesn't currently work: Paper Mario: The Thousand-Year Door (Gecko widescreen code from Nintendont) C202F310 00000003 3DC08042 3DE03FD8 91EEF6D8 4E800020 60000000 00000000 04199598 4E800020 C200F500 00000004 3DE08082 3DC0402B 61CE12A2 91CFA1BC 60000000 387D015C 60000000 00000000 C200F508 00000004 3DE08082 3DC04063 61CEE8D3 91CFA1BC 60000000 7FC3F378 60000000 00000000 The Simpsons: Hit & Run (AR widescreen code from the wiki) 04004600 C002A604 04004604 C09F0014 04004608 FC002040 0400460C 4082000C 04004610 C002A608 04004614 EC630032 04004618 48220508 04041A5C 38600001 04224344 C002A60C 04224B1C 4BDDFAE4 044786B0 3FAAAAAB 04479F28 3FA33333
2017-02-08OpcodeDecoding: Convert #defines into enum constantsLioncash
Gets several constants out of global scope.
2017-01-23RenderBase: Forward declare EFBAccessTypeLioncash