Commit graph

65 commits

Author SHA1 Message Date
TellowKrinkle
6ab24e6c17 VideoCommon: Better driver bug handling
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-07-13 21:51:24 -05:00
Dentomologist
f6b9acccfc Common: Refactor PointerWrap 2022-05-25 13:06:41 -07:00
OatmealDome
04ec02c06b ConstantManager: Add logic ops to PixelShaderConstants 2021-11-24 17:52:26 -05:00
Pokechu22
4a9b26de86 VideoCommon: Expose SamplerState to shaders
The benefit to exposing this over the raw BP state is that adjustments Dolphin makes, such as LOD biases from arbitrary mipmap detection, will work properly.
2021-11-17 20:04:34 -08:00
Pokechu22
9ef228503a VideoCommon: Provide raw texdims to shaders 2021-11-17 20:04:34 -08: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
Pokechu22
e1d45e9ba6 UberShaderPixel: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07 16:37:47 -07:00
Pokechu22
c3668e179c Split TevStageIndirect::mid into matrix_index and matrix_id 2021-05-07 16:27:52 -07:00
Pokechu22
70f9fc4e75 Convert BPMemory to BitField and enum class
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-06 19:27:19 -08:00
Lioncash
3d9b2aa005 VideoCommon: Migrate over to fmt
Migrates off the printf-based formatting where applicable.
2020-11-17 21:23:58 -05:00
Lioncash
a9663669dc Common/CommonFuncs: Remove now-unneccessary ArraySize function
Since C++17, non-member std::size() is present in the standard library
which also operates on regular C arrays. Given that, we can just replace
usages of ArraySize with that where applicable.

In many cases, we can just change the actual C array ArraySize() was
called on into a std::array and just use its .size() member function
instead.

In some other cases, we can collapse the loops they were used in, into a
ranged-for loop, eliminating the need for en explicit bounds query.
2019-06-01 10:07:57 -04:00
Techjar
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Stenzek
f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00
Stenzek
340ee8fff8 PixelShaderGen: Implement table-based fog range as in software renderer 2018-02-15 22:19:21 +10:00
Stenzek
260d5b7aa7 BPMemory: Handle fog configuration where both A and C are infinity/NaN
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.
2018-02-01 17:40:39 +10:00
Jonathan Hamilton
ceb1f8c8cb Enable shader_framebuffer_fetch blend path on ubershaders
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
2018-01-05 09:56:46 -08:00
Stenzek
852e30bb8c Ubershaders: Fix 6-bit color truncation not being applied 2017-08-01 00:01:09 +10:00
Stenzek
7d78cf0f6f ShaderGen: Implement pixel ubershaders 2017-07-30 17:43:59 +10:00
Stenzek
00a0a91513 VideoCommon: Move last EFB scale handling to CalculateTargetSize 2017-03-04 16:53:07 +10:00
Stenzek
277829d842 VideoCommon: Eliminate static state in Renderer 2017-03-04 16:39:50 +10:00
Lioncash
8dcb05802b ShaderManagers: Use aggregate initialization for some variables.
These provide the same semantics, however aggregate initialization
doesn't force the structs to be trivially copyable. memset, on the other
hand, does.
2016-12-10 17:33:51 -05:00
Emmanuel Gil Peyrot
c9e6b05ce9 Core: Remove double newlines at the end of *_LOG messages. 2016-11-02 02:09:33 +00:00
Jules Blok
f7987017a0 PixelShaderManager: Use signed integers for the depth range parameters. 2016-08-23 15:54:05 +02:00
degasus
7833ff25df VideoBackends: Merge Initialize and Shutdown functions. 2016-06-26 12:34:59 +02:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
degasus
10e4f7e7bf PixelShaderGen: Move constant multiplication to constant generation.
No need to do this within the shader per pixel if it can be done once.
2016-04-09 12:25:00 +02:00
Lioncash
d9fec92628 VideoCommon: Header cleanup
Also remedies places where the video backends and core rely on things
being indirectly included.
2016-01-17 20:11:45 -05:00
Jules Blok
ef1dfa8bcb VideoBackends: Allow the viewport to use the full depth range. 2015-06-06 03:37:46 +02:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Jules Blok
ef78941042 VideoBackends: Clamp depth to uint24 range. 2015-05-18 23:22:28 +02:00
degasus
35373c5185 TextureCache: load all mipmap levels from custom textures
This drops the "feature" to load level 0 from the custom texture
and all other levels from the native one if the size matches.
But in my opinion, when a custom texture only provide one level,
no more should be used at all.
2015-03-02 00:09:09 +01:00
Lioncash
d10571a86a PixelShaderManager: Remove unnecessary casts.
EFBToScaledXf and EFBScaledYf return a float, so the cast isn't needed here.
2015-02-28 00:04:05 -05:00
Scott Mansell
e88c02dece Ensure that ZSlopes save/restore state correctly.
Had to re-do *ShaderManager so they saved their constant arrays
instead of completly rebuilding them on restore state.
2015-01-23 03:32:31 +13:00
NanoByte011
add59b3bea Fixes Mario Tennis Gimmick Courts and adds support for FastDepthCalc
- Calculate ZSlope every flush but only set PixelShader Constant on Reset Buffer when zfreeze
- Fixed another Pixel Shader bug in D3D that was giving me grief
2015-01-23 03:32:31 +13:00
Scott Mansell
88c7afd315 Make zfreeze use screenspace coordinates independant of IR.
OpenGL requires the y coordinates to be flipped.

Also refactored PixelGen code to remove duplicate code.
2015-01-23 03:32:31 +13:00
NanoByte011
613781c765 Cleanup and refactor of zfreeze port
Based on the feedback from pull request #1767 I have put in most of
degasus's suggestions in here now.

I think we have a real winner here as moving the code to
VertexManagerBase for a function has allowed OGL to utilize zfreeze now
:)

Correct use of the vertex pointer has also corrected most of the issue
found in pull request #1767 that JMC47 stated.  Which also for me now
has Mario Tennis working with no polygon spikes on the characters
anymore!  Shadows are still an issue and probably in the other games
with shadow problems.  Rebel Strike also seems better but random skybox
glitches can show up.
2015-01-23 03:32:31 +13:00
NanoByte011
937844b9e3 Initial port of zfreeze branch (3.5-1729)
Initial port of original zfreeze branch (3.5-1729) by neobrain into
most recent build of Dolphin.

Makes Rogue Squadron 2 very playable at full speed thanks to recent core
speedups made to Dolphin. Works on DirectX Video plugin only for now.

Enjoy!  and Merry Xmas!!
2015-01-23 03:31:54 +13:00
Tillmann Karras
4d1face540 Fix indentation 2015-01-07 21:51:47 +01:00
Tony Wasserka
1d23c2ca8b GPU: Only load the relevant color components upon writes to the tev color registers.
The other two components need not be valid upon write, hence loading them results in glitches.

Fixes issue 6783.
2014-09-21 10:38:22 +02:00
Rohit Nirmal
fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
Shawn Hoffman
4bf031c064 msvc: resolve all warnings in VideoCommon. 2014-08-19 22:33:46 -07:00
degasus
e456a5e64f PixelShader: remove the duplicated ppl constants 2014-06-19 16:33:33 +02:00
degasus
027baad73b VideoCommon: use the Light struct in XF memory 2014-06-19 16:33:29 +02:00
Jasper St. Pierre
08611c3f36 PixelShaderManager: Fizzle out fog changes when disabled here
This lets us remove a use of GetConfig.
2014-05-20 11:15:09 -04:00
magumagu
1357277f40 Video backends: mass-replace "xfregs" with "xfmem". 2014-05-16 18:58:07 -07:00
magumagu
8f5342c442 Video backend: merge global var xfmem into xfregs.
There isn't really any reason to keep them separate.
2014-05-16 18:55:31 -07:00
magumagu
818c89313e Video backends: unify xfregs/xfmem structures.
Removes the duplicate swxfregs global variable/struct from the software
backend in favor of the ones from VideoCommon.
2014-05-16 18:55:30 -07:00
magumagu
fd9c1fa746 VideoBackend: remove unused config vars.
No point to keeping around variables which are always "true".
2014-04-11 14:53:12 -07:00
Tony Wasserka
77a7bab5ae BPMemory: Use the new BitField class in two selected structures. 2014-03-25 23:57:57 +01:00