summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
AgeCommit message (Collapse)Author
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.
2020-03-25Remove warnings of -Wsign-compareJun Su
Cast the variable to the coresponding type.
2020-02-04VideoCommon: Amend formatting code to handle the upgrade to fmtLioncash
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.
2019-12-07Merge pull request #8511 from lioncash/if-constexprAnthony
VideoCommon/OpcodeDecoding: Make use of if constexpr
2019-12-05VideoCommon/BoundingBox: Move PixelShaderManager::SetBoundingBoxActive() ↵Lioncash
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-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/OpcodeDecoding: Move g_bRecordFifoData into namespaceLioncash
Keeps the global localized with the code that it's primarily related to. Now it's obvious from a glance what the global variable is affecting.
2019-11-23VideoCommon: Make use of fmt outside of shader generatorsLioncash
Migrates most of VideoCommon over to using fmt, with the exception being the shader generator code. The shader generators are quite large and have more corner cases to deal with in terms of conversion (shaders have braces in them, so we need to make sure to escape them). Because of the large amount of code that would need to be converted, the conversion of VideoCommon will be in two parts: - This change (which converts over the general case string formatting), - A follow up change that will specifically deal with converting over the shader generators.
2019-07-24VideoBackendBase: Do save state logic on the GPU threadStenzek
2019-04-21Replace EFBRectangle/TargetRectangle with MathUtil::RectangleStenzek
2019-04-21TextureCache: Simplify XFB reconstructionStenzek
This also better handles in-memory interlaced XFB data placed by the CPU by considering the stride from the VI.
2019-03-31BPStructs: Gracefully handle out-of-range EFB copiesStenzek
Since the copy X and Y coordinates/sizes are 10-bit, the game can configure a copy region up to 1024x1024. Hardware tests have found that the number of bytes written does not depend on the configured stride, instead it is based on the size registers, writing beyond the length of a single row. The data written for the pixels which lie outside the EFB bounds does not wrap around instead returning different colors based on the pixel format of the EFB. This suggests it's not based on coordinates, but instead on memory addresses. The effect of a within-bounds size but out-of-bounds offset (e.g. offset 320,0, size 640,480) are the same. As it would be difficult to emulate the exact behavior of out-of-bounds reads, instead of writing the junk data, we don't write anything to RAM at all for over-sized copies, and clamp to the EFB borders for over-offset copies.
2019-03-09FramebufferManager: Implement deferred EFB cache invalidationStenzek
2018-11-07TextureCache: Implement deferred/batched EFB copiesStenzek
2018-10-07BPStructs: don't warn about busclock/perf regsTillmann Karras
2018-04-29Implement EFB copy filter and gamma in hardware backendsStenzek
Also makes y_scale a dynamic parameter for EFB copies, as it doesn't make sense to keep it as part of the uid, otherwise we're generating redundant shaders.
2018-04-29VideoSoftware: Implement xfb copy filter (Deflickering/Brightness)Scott Mansell
2018-04-12Reformat all the things!spycrab
2018-03-27BPStructs: Remove an unnecessary pointer cast in GetBPRegInfoLioncash
swap32 has an overload that accepts a u8*, performing the same behavior in a well-defined manner.
2018-02-20BPFunctions: Move GX viewport conversion to VideoCommonStenzek
2018-01-06VideoCommon: Apply the yscale as upscaling of the XFB.Markus Wick
2018-01-05Enable shader_framebuffer_fetch blend path on ubershadersJonathan Hamilton
Tested on a linux Intel Skylake integrated graphics with blend_func_extended force-disabled, as it's the only platform I have that doesn't crash with ubershaders and supports fb_fetch
2017-12-21BPStructs: Use static cast for XFB/EFB copiesiwubcode
2017-12-21Texture Cache Base: Move PAL vertical scaling to be baked into the texture ↵iwubcode
size. This saves on a number of multiplications and fixes an issue where we were multiplying the y-scaling factor by the srcRectangle's height + 1 which was causing a crash in some GC titles
2017-12-02VideoCommon: Fix -Wformat warningsLéo Lam
2017-11-17Video Backends: Remove the right of the xfb region for games where theiwubcode
VI stride does not match the VI width
2017-11-17HybridXFB: Fix lint errorsiwubcode
2017-11-17VideoCommon: Output gamma now comes from the xfb copyiwubcode
2017-11-17Add 'immediate xfb' which reduces xfb latency at the cost of graphical errorsiwubcode
2017-11-17Video Backends: Implement vertical scaling for xfb copies. This fixes theiwubcode
display of PAL games that run in 50hz mode.
2017-11-17FifoPlayer: Generate fake VideoInterface updatesiwubcode
2017-11-17Add support for hybrid XFBiwubcode
2017-09-03RenderBase: Drop SetColorMask and SetLogicOpModeStenzek
These are now incorporated into the blend state for all backends.
2017-08-01Ubershaders: Fix 6-bit color truncation not being appliedStenzek
2017-07-30ShaderGen: Implement pixel ubershadersStenzek
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-18VideoCommon: Drop SetDitherMode()Stenzek
It was a no-op on all backends apart from GL anyhow.
2017-03-10Merge pull request #4935 from Armada651/depth-range-fixMarkus Wick
VideoBackends: Set the maximum range when the depth range is oversized.
2017-03-04VideoCommon: Eliminate static state in RendererStenzek
2017-02-26VideoBackends: Use vertex shader depth range if ztexture is used.Jules Blok
2017-01-23RenderBase: Forward declare EFBAccessTypeLioncash
2017-01-06OGL: Use VideoCommon blend state for framebuffer configuration.degasus
2016-12-26TextureCache: Extract BP enum check to VideoCommon.degasus
We have TOO many video backends.
2016-12-09TextureCacheBase: Eliminate static stateLioncash
2016-10-08Remove Frameskipanthony