summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Tev.cpp
AgeCommit message (Collapse)Author
2024-09-24Sw/Tev: drop unused macroTillmann Karras
2022-12-29Merge pull request #11389 from Pokechu22/sw-no-alpha-1-hackJMC47
Software: Remove alpha=1 blending special-case
2022-12-28Software: Remove alpha=1 blending special-casePokechu22
This was added in #10394 for both the hardware and software backends to work around an issue with Mario Kart Wii, Fortune Street, and Baten Kaitos. However, it seems like the software renderer handles blending well enough that we don't need this (and in any case, it's easy to change blending in the software renderer). Some experimentation with #11387 (not pushed) showed that the software renderer's logic would also produce correct results on the hardware backends with this hack removed, but would require fbfetch (currently); if a better solution is found the hack can also be removed from the hardware backends.
2022-12-27VideoCommon: De-globalize PixelShaderManager class.Admiral H. Curtiss
2022-09-26Software: Remove dedicated texture/frame dumping infrastructurePokechu22
Texture dumping can already be done using VideoCommon's system (and in fact the same setting already enabled *both* of these). Dumping objects/TEV stages/texture fetches doesn't currently have an equivalent, but could be added to the FIFO player instead.
2022-08-29BPMemory: Make TevKSel more clearPokechu22
It stores both the konst selection value for alpha and color channels (for two tev stages per ksel), and half of a swap table row (there are 4 total swap tables, which can be used for swizzling the rasterized color and the texture color, and indices selecting which tables to use are stored per tev stage in the alpha combiner). Since these are indexed very differently, the old code was hard to follow.
2022-08-29SW/Tev: Replace Tev::SetRegColor with Tev::SetKonstColorsPokechu22
2022-08-29SW/Tev: Use std::clamp for Clamp255 and Clamp1024Pokechu22
2022-08-29SW/Tev: Remove Tev::InitPokechu22
2022-08-29SW/Tev: Use EnumMap for scale/bias tablesPokechu22
2022-08-29SW/Tev: Use EnumMap for RegPokechu22
2022-08-29SW/Tev: Use TevColorRef/TevAlphaRef instead of raw s16 pointersPokechu22
2022-07-13VideoCommon: Better driver bug handlingTellowKrinkle
Adds a pass to process driver deficiencies between UID caching and use, allowing a full view of the whole pipeline, since some bugs/workarounds involve interactions between blend modes and the pixel shader
2022-04-08Software: Remove config to disable ZComploc and ZFreezePokechu22
These aren't particularly useful, and make the code a bit more confusing. If for some reason someone wants to test what happens when these functions are disabled, it's easier to just edit the code that implements them. They aren't exposed in the UI, so one would need to restart Dolphin to do it anyways.
2022-02-08Treat alpha as 0 if alpha is 1 for blendingPokechu22
This removes the white box in fortune street again, without causing Mario Kart Wii to regress.
2022-02-08Use the same logic for lerp bias for color and alphaPokechu22
It doesn't make sense for alpha to add the bias ONLY when dividing by 2, while color doesn't apply the bias for divide by 2 only; hardware testing indicates that alpha should have the bias. This fixes the menus in Mario Kart Wii (https://bugs.dolphin-emu.org/issues/11909) but reintroduces the white rectangle in Fortune Street. This reverts commit 5aaa5141ed76acc3fffc70561a6b6e7fe3b9b470 (and several other matching changes elsewhere).
2021-10-13Silence the -Wswitch warnings in TevFletcher Porter
The compiler was loudly announcing each and every branch Tev was not checking in a switch statement, but Tev has learned it's lesson and will produce that warning no more.
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-08Fix indirect textures when format is not ITF_8Pokechu22
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-05-28VideoCommon: Move bounding box pixel quads rounding to shaderTechjar
This avoids rounding values that the game writes to the bounding box registers, especially the default values.
2021-05-07Software: Fix OOB tex coord indicesPokechu22
Previously we set the texture coordinate to zero, now we set the texture coordinate *index* to zero. This fixes the ripple effect of the Mario painting in Luigi's Mansion.
2021-05-07Split TevStageIndirect::mid into matrix_index and matrix_idPokechu22
2021-03-06Convert BPMemory to BitField and enum classPokechu22
Additional changes: - For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare. (Shift has also been renamed to scale) - In TexMode0, min_filter has been split into min_mip and min_filter. - In TexImage1, image_type is now cache_manually_managed. - The unused bit in GenMode is now exposed. - LPSize's lineaspect is now named adjust_for_aspect_ratio.
2020-12-02General: Convert PanicAlerts over to fmt equivalentLioncash
Converts lingering panic alert calls over to the fmt-capable ones.
2020-03-25Remove warnings of -Wsign-compareJun Su
Cast the variable to the coresponding type.
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-07-16VideoCommon: Remove unused MathUtil.h include from VideoCommon.hLioncash
This header doesn't actually make use of MathUtil.h within itself, so this can be removed. Many other source files used VideoCommon.h as an indirect include to include MathUtil.h, so these includes can also be adjusted. While we're at it, we can also migrate valid inclusions of VideoCommon.h into cpp files where it can feasibly be done to minimize propagating it via other headers.
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-05-04Replace MathUtil::Clamp with std::clampLéo Lam
2018-10-09VideoCommon: remove unnecessary floor()Tillmann Karras
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-05VideoSoftware: make use of Clamp()Tillmann Karras
2018-04-12Reformat all the things!spycrab
2018-03-14Assert: Uppercase assertion macrosLioncash
Macros should be all upper-cased. This is also kind of a wart that's been sticking out for quite a while now (we avoid prefixing underscores).
2018-02-01BPMemory: Handle fog configuration where both A and C are infinity/NaNStenzek
The console appears to behave against standard IEEE754 specification here, in particular around how NaNs are handled. NaNs appear to have no effect on the result, and are treated the same as positive or negative infinity, based on the sign bit. However, when the result would be NaN (inf - inf, or (-inf) - (-inf)), this results in a completely fogged color, or unfogged color respectively. We handle this by returning a constant zero for the A varaible, and positive or negative infinity for C depending on the sign bits of the A and C registers. This ensures that no NaN value is passed to the GPU in the first place, and that the result of the fog calculation cannot be NaN.
2017-09-03Software/Tev: const correctnessLioncash
2017-07-30BPMemory: Convert a number of unions to BitFieldsScott Mansell
2016-09-02VideoSoftware: Fix unsigned overflow bug in fogScott Mansell
Was causing fog errors on the left half of the screen. Only appeared to affect visual studio builds, GCC did the correct thing.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-03-06VideoSW: Drop SetTevReg for colors.degasus
2016-01-18Merge pull request #3523 from lioncash/videoPierre Bourdon
VideoCommon: Header cleanup
2016-01-17VideoCommon: Header cleanupLioncash
Also remedies places where the video backends and core rely on things being indirectly included.
2016-01-15PixelShaderGen: Use bitwise AND for wrapping indirect texture coordinatesStenzek
(x % y) is not defined in GLSL when sign(x) != sign(y). This also has the added benefit of behaving the same as sampler wrapping modes, in regards to negative inputs.
2016-01-06VideoSW: Use more VideoCommondegasus
Now we require lots of empty functions, but this removes by far more duplicated code.
2015-09-30Tev: Don't savestate Zero16Lioncash
It's an array of zeroes. There's no need.
2015-09-30ChunkFile: Provide additional helpers for C-style arraysLioncash
Gets rid of magic numbers in cases where the array size is known at compile time. This is also useful for future entries that are stack allocated arrays as these functions prevent incorrect sizes being provided.
2015-09-17VideoSW: Drop SW bbox codedegasus
The hardware backends don't use this shared code any more, and it's not needed for video sw either. So this was just dead code.
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras