summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
AgeCommit message (Collapse)Author
2023-11-26VideoCommon: move xf state management to its own class, so changes can be ↵iwubcode
detected in places other than VertexShaderManager
2023-11-12Fix accidental fallthrough in BPStructsPokechu22
This caused us to update the indirect texture information in shaders more often than we needed to, which probably doesn't matter in practice since it's only used in ubershaders and copyyscale and stride are generally only updated before EFB/XFB copies, which generally will have other changes afterwards.
2023-11-11Add descriptions for more BP registersPokechu22
2023-11-11Convert BPMEM_LOADTLUT1 to a structPokechu22
2023-11-11Rename bpmem.copyMipMapStrideChannels to bpmem.copyDestStridePokechu22
As far as I can tell, it has nothing to do with the mipmap/half_scale functionality, but does change based on the width of the destination texture (and the destination texture is half the width if half_scale is set). The comment that was there (which dates back to the initial megacommit) seems to not have accounted for the width aspect; it was first used as an actual stride in bbbe898839467c312c31456334540c20fedc7be3 (the first commit that used it at all).
2023-09-02Fifo: Convert MemoryUpdate::Type to enum classDentomologist
2023-03-11HW/VideoInterface: Refactor to class.Admiral H. Curtiss
2023-02-09Add comment about "end of frame"Scott Mansell
2023-02-09Cleanup headersScott Mansell
2023-02-09Lint fixesScott Mansell
2023-02-09Move xfb tracking and IR scaling out of RenderBaseScott Mansell
2023-01-31Renderer still needs to track swaps for savestatesScott Mansell
2023-01-31Wire up frame before/after eventsScott Mansell
2023-01-31Move BoundingBox out of RenderBaseScott Mansell
They were essentially just pass-though methods
2023-01-31TextureCache: Refactor with smart pointersScott Mansell
The whole ownership model was getting a bit of a mess, with a some of special cases to deal with. And I'm planning to make it even more complex in the future. So here is some upfront work to convert it over to reference counted pointers.
2022-12-29VideoCommon: De-globalize GeometryShaderManager class.Admiral H. Curtiss
2022-12-28VideoCommon: De-globalize VertexShaderManager class.Admiral H. Curtiss
2022-12-27VideoCommon: De-globalize PixelShaderManager class.Admiral H. Curtiss
2022-12-11VideoCommon/PixelEngine: Pass Core::System to methods.Admiral H. Curtiss
2022-12-11VideoCommon/PixelEngine: Refactor to class, move to Core::System.Admiral H. Curtiss
2022-12-10VideoCommon/Fifo: Refactor to class, move to Core::System.Admiral H. Curtiss
2022-12-03HW/Memmap: Refactor Memory to class, move to Core::System.Admiral H. Curtiss
2022-11-27CoreTiming: Refactor to class.Admiral H. Curtiss
2022-10-01VideoCommon: Update EFB peek cache on draw done and tokensRobin Kertels
Massively improves performance in Mario Galaxy on Android.
2022-09-26VideoCommon: Add statistics for draw done and token commandsPokechu22
2022-08-29Fifo analyzer: Improve some BP descriptionsPokechu22
Mainly, the improvements are passing in the current command ID so that e.g. stage numbers can be directly included, instead of saying 0/1 or even/odd.
2022-07-15Create dedicated enum for EFB/XFB gamma correctionPokechu22
This also changes the behavior for the invalid gamma value, which was confirmed to behave the same as 2.2. Note that currently, the gamma value is only used for XFB copies, even though hardware testing indicates it also works for EFB copies. This will be changed in a later commit.
2022-07-15Only use intensity formats if both intensity_fmt and auto_conv are setPokechu22
auto_conv is normally always set for EFB copies, but hardware testing indicates that intensity_fmt does nothing if auto_conv is not set.
2022-04-16VideoCommon: Rework scissor handlingPokechu22
This increases accuracy, fixing the white rendering in Major Minor's Majestic March. However, the hardware backends can only have one viewport and scissor rectangle at a time, while sometimes multiple are needed to accurately emulate what is happening. If possible, this will need to be fixed later.
2022-04-16VideoCommon: Create dedicated structs for scissor pos/offsetPokechu22
2021-12-18Refactor OpcodeDecoding and FIFO analyzer to use callbacksPokechu22
2021-11-25Delay singlecore gpu interruptsScott Mansell
Fixes Bomberman Jetters in single core mode. When single core mode pauses the CPU to execute the GPU FIFO it greedily executes the whole thing. Before this commit, Finish and Token interrupts would happen instantly, not even taking into account how long the current FIFO window has taken to execute. The interrupts would be effectively backdated to the start of this execution window. This commit does two things: It pipes the current FIFO window execution time though to the interrupt scheduling and it enforces a minimum delay of 500 cycles before an interrupt will be fired.
2021-11-11VideoCommon: Use the copy filter for EFB copies as well as XFB copiesPokechu22
This fixes the pink screens in EA Sports Active. See https://gist.github.com/Pokechu22/49455f9094ed0ff017da64e3f7aa0404 for details.
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-10BPMem: Abstract TexUnit Addressing into structScott Mansell
The addressing of the texture units is a bit non-obvious. This struct abstracts the complexity away.
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-09-18BPStructs: ensure side effects are sameScott Mansell
Missed this side effect when fixing crash in Mario Kart Wii wifi
2021-09-17BPStructs: Ignore malformed efb copiesScott Mansell
2021-09-15BPStructs: make copy width/height constScott Mansell
2021-09-15BPStructs: fix out-of-range EFB copy clampingScott Mansell
Previous code from #7950 only clamps correctly when the efb copies left and top coordinates are (0, 0) Now we should handle all situations. Spyro: A hero's tail is an example of a game that does an oversized EFB copy with a non-zero origin.
2021-07-11Use separate fmt::formatters for each indirect matrix columnPokechu22
This also fixes a bug where the float version of row 1 actually showed row 0 again.
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-31VideoCommon: Add fallback handling for bounding box when disabled or unsupportedTechjar
The SDK seems to write "default" bounding box values before every draw (1023 0 1023 0 are the only values encountered so far, which happen to be the extents allowed by the BP registers) to reset the registers for comparison in the pixel engine, and presumably to detect whether GX has updated the registers with real values. Handling these writes and returning them on read when bounding box emulation is disabled or unsupported, even without computing real values from rendering, seems to prevent games from corrupting memory or crashing. This obviously does not fix any effects that rely on bounding box emulation, but having the game not clobber its own code/data or just outright crash is a definite improvement.
2021-04-24VideoCommon: Fix scissorOffset, handle negative value correctlyezio1900
VideoCommon: Change the type of BPMemory.scissorOffset to 10bit signed: S32X10Y10 VideoBackends: Fix Software Clipper.PerspectiveDivide function, use BPMemory.scissorOffset instead of hard code 342
2021-04-06Add game quirks for unknown BP/CP/XF commandsPokechu22
2021-03-06Use formatters in GetBPRegInfo; add missing commandsPokechu22
BPMEM_TEV_COLOR_ENV + 6 (0xC6) was missing due to a typo. BPMEM_BP_MASK (0xFE) does not lend itself well to documentation with the current FIFO analyzer implementation (since it requires remembering the values in BP memory) but still shouldn't be treated as unknown. BPMEM_TX_SETMODE0_4 and BPMEM_TX_SETMODE1_4 (0xA4-0xAB) were missing entirely.
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.
2021-03-06Rename BPMEM_EFB_BR to BPMEM_EFB_WHPokechu22
2020-12-16Fix -Wclass-memaccess warningsLéo Lam
We want to clear/memset the padding bytes, not just each member, so using assignment or {} initialization is not an option. To silence the warnings, cast the object pointer to u8* (which is not undefined behavior) to make it explicit to the compiler that we want to fill the object representation.
2020-11-17VideoCommon: Migrate over to fmtLioncash
Migrates off the printf-based formatting where applicable.