Commit Graph

56 Commits

Author SHA1 Message Date
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 004dfd1586 Replace uses of cassert with Common/Assert.h 2021-04-02 10:18:18 -07:00
Lioncash 3d9b2aa005 VideoCommon: Migrate over to fmt
Migrates off the printf-based formatting where applicable.
2020-11-17 21:23:58 -05:00
Léo Lam ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
Stenzek dbaba0062a TextureDecoder: Move XFB decoding to Common
This was previously missing for generic (which is used on ARM).
2019-04-21 12:41:15 +10:00
iwubcode 8d1cbeb25e Hybrid XFB: Fix lint errors 2017-11-17 22:11:34 -06:00
iwubcode 53684701fa HybridXFB: Fix lint errors 2017-11-17 22:11:31 -06:00
iwubcode 79387dddb2 Add support for hybrid XFB 2017-11-17 19:47:56 -06:00
N.E.C c3a57bbad5 Video: Clearly separate Texture and EFB Copy formats
Improve bookkeeping around formats. Hopefully make code less confusing.

- Rename TlutFormat -> TLUTFormat to follow conventions.
- Use enum classes to prevent using a Texture format where an EFB Copy format
  is expected or vice-versa.
- Use common EFBCopyFormat names regardless of depth and YUV configurations.
2017-08-03 18:35:29 -07:00
Markus Wick 7b19475911 Merge pull request #4548 from stenzek/gcc-sse
Support SSSE3 texture decoders and CRC32 hashing on non-native builds (gcc)
2017-03-13 14:28:01 +01:00
Lioncash 552c0d8404 Common: Move byte swapping utilities into their own header
This moves all the byte swapping utilities into a header named Swap.h.

A dedicated header is much more preferable here due to the size of the
code itself. In general usage throughout the codebase, CommonFuncs.h was
generally only included for these functions anyway. These being in their
own header avoids dumping the lesser used utilities into scope. As well
as providing a localized area for more utilities related to byte
swapping in the future (should they be needed). This also makes it nicer
to identify which files depend on the byte swapping utilities in
particular.

Since this is a completely new header, moving the code uncovered a few
indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 17:18:18 -05:00
Stenzek b74029ec57 TextureDecoder: Use target attributes on SSSE3 decoders 2017-01-24 20:04:55 +10:00
hthh 88d52b4d69 TextureDecoder: Deduplicate some utility code 2017-01-15 20:23:26 +11:00
hthh 5d4e4aa561 TextureDecoder: Fix off-by-one errors in CMPR 2017-01-14 10:52:35 +11:00
Stenzek 2f223e24dc TextureDecoder: Seperate each format into its own function 2017-01-10 20:41:00 +10:00
Stenzek 344f2e57f6 VideoCommon: Use avg(color1, color2) for color3 in CMPR textures 2016-12-19 20:17:44 +10:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +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
Lioncash 50a7390622 TextureDecoder_x64: Remove unnecessary commented out header 2015-09-29 11:04:00 -04:00
Lioncash 80c7e3ebc0 TextureDecoder_x64: Remove clang warning suppression
This was an issue two years ago on clang 3.3
2015-09-29 11:00:59 -04:00
Lioncash 8ce04f9a65 General: Replace GC_ALIGN macros with alignas
Standard supported alignment -> out with compiler-specific.
2015-09-06 12:53:51 -04: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
Tillmann Karras f298f00e1b Clean up the intrinsics #ifdef mess 2015-02-24 01:02:36 +01:00
degasus 615ae9f106 TexCache: remove PC_TexFormat
We only support rgba32 for a while now, so there is no need to have everything in common configureable.
2015-01-18 19:47:48 +01:00
Jasper St. Pierre 44b879dac2 Destroy OpenMP 2014-11-06 18:38:24 -08:00
Rohit Nirmal 46057db37d Fix build failing when disabling precompiled headers. 2014-09-19 18:17:51 -04:00
Rohit Nirmal fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
comex 917c6d324a Remove unused functions in TextureDecoder. 2014-09-06 13:32:54 -04:00
Rohit Nirmal debe3999b5 Remove more dead and redundant code. 2014-09-05 23:22:48 -05:00
Jasper St. Pierre 76b4dbdf28 TextureDecoder: Clean up the code style
For a long time, we've had ugly and inconsistent function names here as
helpers, names like "decodebytesRGB5A3rgba" which are absolutely
incomprehensible to understand. Fix this by introducing a new consistent
naming scheme, where the above function now becomes "DecodeBytes_RGB5A3".
2014-09-04 18:36:57 -07:00
Jasper St. Pierre ea1245d191 TextureDecoder: Pass the TLUT address straight into the texture decoder
This removes the requirement for the TextureDecoder to have access to
global texture memory.
2014-09-04 18:36:57 -07:00
Jasper St. Pierre fcd4ecc942 TextureDecoder: Add an enum for the TLUT formats
Quick code cleanup. The enum names and values come from libogc.
2014-09-04 18:36:56 -07:00
Jasper St. Pierre f975307016 TextureDecoder: Add some statics to some of our helper functions
I know these are already inline, but this makes it more clear that
they're helper functions to be used in this file only.
2014-09-04 18:36:56 -07:00
Jasper St. Pierre a8e591dc73 VideoCommon: Remove support for decoding to ARGB textures
The D3D / OGL backends only ever used RGBA textures, and the Software
backend uses its own custom code for sampling. The ARGB path seems to
just be dead code.

Since ARGB and RGBA formats are similar, I don't think this will make
the code more difficult to read or unable to be used as
reference. Somebody who wants to use this code to output ARGB can simply
modify the MakeRGBA function to put the shift at the other end.
2014-09-04 18:36:56 -07:00
Jasper St. Pierre 9438a30384 VideoCommon: Start putting common texture decoding code in TextureDecoder_Common
This pulls all the duplicate code from TextureDecoder_Generic /
TextureDecoder_x64 out and puts it in a common file. Out custom font
used for debugging the texture cache is also pulled out and put in a
common "sfont.inc" file. At some point we should also combine this font
with the other six binary fonts we ship.
2014-09-04 18:36:53 -07:00
Jasper St. Pierre bfb2c04ace TextureDecoder: Remove unused function
GetPC_TexFormat was never used. It was added in commit d02426a, with the
only user being commented out code. The commented out code was later
removed in 9893122, but the implementation stayed.
2014-09-04 17:32:06 -07:00
Jasper St. Pierre 6682a2fadd TextureDecoder: Fix a RGBA/BGRA copy/paste typo
We were decoding to BGRA32 textures in our RGBA32 texture decoder. Since
this is the same for the BGRA32 decoder implementation, this is most
likely a copy/paste typo, rather than the texture actually being
bit-swapped. Fix this.

I'm not sure of any games that use the C14X2 texture format, so I'm not
sure this fixes any games, but it does make the code cleaner for when we
clean it up in the future, and merge some of these similar loops.
2014-09-04 17:30:53 -07:00
Lioncash 4af8d9d248 VideoCommon: Clean up brace placements 2014-08-30 18:06:45 -04:00
Tillmann Karras 4063694d20 VideoCommon: fix ifdef expression 2014-07-15 04:15:49 +02:00
Tillmann Karras dbc30c6c76 VideoCommon: make version check easier to read 2014-07-14 03:05:56 +02:00
Tillmann Karras 0be03252cc VideoCommon: fix clang version check
That was... er... a typo!
2014-07-14 02:59:31 +02:00
Tillmann Karras b6f3ae23bc VideoCommon: version-check clang for workaround
The bug was fixed in clang 3.4.
2014-07-14 02:12:48 +02:00
Tillmann Karras 0ccee6c87b Fix warnings unearthed by #579 2014-07-13 02:16:51 +02:00
degasus 81ed17be53 avoid the extern keyword in .cpp files 2014-07-11 16:10:20 +02:00
degasus 6d3f249dcc mark all local variables as static 2014-07-11 16:10:20 +02:00
degasus 22e1aa5bb4 mark all local functions as static 2014-07-11 16:07:23 +02:00
Paul Olszewski 5d793881b0 Fix the capitalization of "GameCube" throughout the project. 2014-06-08 11:24:49 +09:00
Lioncash 49b0eef393 Remove the min/max functions in CommonFuncs.
The algorithm header has the same functions.
2014-05-29 21:44:41 -04:00
Matthew Parlane 31cfc73a09 Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
2014-03-11 00:35:07 +13:00