Commit Graph

68 Commits

Author SHA1 Message Date
Stenzek f7a0cae7f4 HiresTextures: Do not load compressed textures with unaligned dimensions
D3D11 cannot handle block compressed textures where the first mip level
is not a multiple of the block size. The simple fix for texture pack
authors: leave these textures uncompressed. You can still use a .dds
container.
2018-05-22 16:15:18 +10:00
Emmanuel Gil Peyrot 6d0143647e VideoCommon: Remove a workaround mutex used for SOIL 2018-05-20 13:44:41 +02:00
Emmanuel Gil Peyrot 17e65a7167 VideoCommon: Replace SOIL with libpng for hires textures 2018-05-20 13:44:38 +02:00
spycrab 40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
Lioncash 74aff4d9ef
HiresTexture: Correct texture hashes
Fixes a regression introduced in 2da8d98b2f
2018-04-03 12:42:05 -04:00
Lioncash 2da8d98b2f
HiresTextures: Use std::minmax or std::minmax_element where applicable in GenBaseName()
Minimizes repetition.

std::minmax_element can be used for the 256 * 2 case, as it's only performing byte comparisons
and thus, there will always be an element smaller than 0xffff, so it doesn't need to be included
in the set of compared values.
2018-03-27 15:39:05 -04:00
Lioncash d5a1edba09
HiresTextures: Remove unnecessary pointer casts in GenBaseName()
swap16 has an overload that accepts a u8*, performing the same behavior
in a well-defined manner.
2018-03-27 15:19:02 -04:00
degasus a5a0599145 CustomTexture: Drop old texture format. 2018-01-20 17:08:47 +01:00
degasus 0b466249e0 CustomTextures: Drop format convertion. 2018-01-20 16:39:04 +01:00
JosJuice 226b65bd38 Clean up variable naming in HiresTextures::Update 2018-01-10 17:53:51 +01:00
JosJuice c25fffc9a0 Treat custom textures with "_arb" suffix as having arbitrary mipmaps
This is adapted from Bighead's code that was posted at
https://forums.dolphin-emu.org/Thread-dolphin-custom-texture-mipmaps?pid=460867#pid460867

In master, custom textures are never treated as having arbitrary mipmaps,
so we need either a change like this or a change that makes us apply the
arbitrary mipmap heuristic even when a custom texture is used.
2018-01-10 17:51:45 +01:00
Léo Lam 67ba326ff6 VideoCommon: Fix -Wformat warnings 2017-12-02 21:48:01 +01: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
Shawn Hoffman c5fa470ad8 replace DoFileSearch with optimized version 2017-06-23 17:25:53 -07:00
shuffle2 e63c337830 Merge pull request #5305 from iwubcode/abstract_texture
Abstract Texture
2017-06-18 12:57:05 -07:00
JosJuice f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
iwubcode e4896d39bd Video Backends: Move and rename HostTextureFormat to AbstractTextureFormat 2017-06-13 00:41:56 -05:00
MerryMage f5f45855f0 GameConfigLoader: Add GFX Game INI translations 2017-06-03 18:13:02 +01:00
Stenzek 20cbef8e9f HiresTextures: Move the maximum mip level check from DDS to main loader
This way that the mip count check occurs on .png and uncombined DDS
textures as well.
2017-04-29 13:46:43 +10:00
Stenzek 8761c8244d HiresTextures: Load full mipmap chain from DDS files
This removes the need for multiple texture files to store the mipmap
chain for a texture. As many mipmaps will be loaded as are present in
the DDS file, and any remaining mipmaps will fall back to the old
behavior.
2017-04-29 13:46:43 +10:00
Stenzek bc8a96d713 HiresTextures: Support parsing DDS files directly
This leaves DDS textures using DXT1/3/5 compressed in-memory, which can
be passed directly to the backend.
2017-04-29 00:14:23 +10:00
Lioncash f7a2f6ad01 FileSearch: Namespace functions under the Common namespace 2017-04-07 01:02:14 -04:00
JosJuice ced1614cac Unify the way of setting game ID, title ID, revision
The existing code from ConfigManager, ES and MIOS is merged
into a new set of functions called SetRunningGameMetadata.
2017-03-09 15:34:14 +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
JosJuice 1081497cad DiscIO/SConfig: Rename GetUniqueID to GetGameID
We call this "game ID" everywhere else, and it's not
actually completely unique.
2016-10-29 15:24:02 +02:00
Lioncash e01c143379 Common: namespace MemoryUtil 2016-08-07 13:03:07 -04:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
degasus 1544e4049d CustomTextures: Fix loading of the last mipmaps.
Non-square textures still have mipmaps down to 1x1.
2016-03-02 23:25:04 +01: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
JosJuice 03091ce180 HiresTextures: Refactor getting directory 2016-01-06 19:35:16 +01:00
JosJuice a2b45a4b82 HiresTextures: Also look for directories with 3-character IDs
People who make texture packs usually release them using a specific ID
(for instance SX4E01). Users who have a different version of the game
(like the PAL version SX4P01) then need to rename the custom texture
folder to match. This is a lot simpler than renaming every texture file,
as was required with the old texture format, but it's still something
that users can forget to do. To make that unnecessary, this change makes
it possible to use three-character region-free IDs for custom texture
folders, similarly to how game INIs can use three-character IDs. Once
most people have updated to Dolphin versions that include this change,
those who make texture packs will be able to name them with
three-character IDs, removing the need for users to rename anything.
2016-01-06 14:33:36 +01:00
Lioncash e082ebad1a HiresTextures: Remove the need to explicitly free SOIL allocated data 2015-12-29 08:40:17 -05:00
Lioncash 1d01fbd217 HiresTextures: Make Load return a unique_ptr 2015-12-29 08:40:15 -05:00
Lioncash 6a9e4511b5 HiresTextures: Remove unnecessary header includes 2015-12-29 08:40:07 -05:00
waddlesplash 5643fe5d1f FileSearch: Don't use RegExs, just do string comparisons.
Nothing used the RegEx feature of FileSearch, and GCC < 4.9
doesn't support C++11 RegEx properly, so get rid of it.
2015-09-27 13:25:51 -04:00
Lioncash 19459e827f Partially revert "General: Toss out PRI macro usage" 2015-09-11 09:49:00 -04:00
Lioncash 8fdb013d54 General: Toss out PRI macro usage
Now that VS supports more printf specifiers, these aren't necessary
2015-09-05 16:02:35 -04:00
Bartosz Telesiński a52aaf22ba VideoCommon: Allow more Ram for HiresTexture if system memory is over 4GB 2015-08-19 23:13:09 +02:00
Lioncash 4c79aa8216 HiresTextures: Remove unused variable 2015-06-19 17:31:04 -04:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
comex 830a4e4f8f Undo accidental screwup of some HiresTextures code from project-moration.
This is why I should wait for people to review, even if I get annoyed
that nobody seems to care. :duncecap:
2015-06-04 02:52:41 -04:00
comex a3b3f0522b Merge pull request #1556 from comex/project-moration
Rudimentary version of Wii IPC determinism.  Ported from my old udpnet branch.
2015-06-02 18:38:19 -04:00
degasus c69cc91f00 HiresTexture: Fix prefetching with broken textures 2015-05-29 07:31:11 +02:00
comex a225426510 Rewrite FileSearch and improve ScanDirectoryTree.
- FileSearch is now just one function, and it converts the original glob
  into a regex on all platforms rather than relying on native Windows
  pattern matching on there and a complete hack elsewhere.  It now
  supports recursion out of the box rather than manually expanding
  into a full list of directories in multiple call sites.

  - This adds a GCC >= 4.9 dependency due to older versions having
  outright broken <regex>.  MSVC is fine with it.

- ScanDirectoryTree returns the parent entry rather than filling parts
  of it in via reference.  The count is now stored in the entry like it
  was for subdirectories.

- .glsl file search is now done with DoFileSearch.

- IOCTLV_READ_DIR now uses ScanDirectoryTree directly and sorts the
  results after replacements for better determinism.
2015-05-28 19:14:42 -04:00
Markus Wick a6412fb41e Merge pull request #2162 from degasus/prefetch_tex
CustomTexture: prefetch all available textures
2015-05-26 13:30:26 +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
degasus 562b9d4a9f VideoCommon: Abort texture prefetching on low RAM
There is no nice way to correctly "detect" the "used" memory, so we just say
we're fine to use 50% of the physical memory for custom textures.

This will fix out-of-memory crashes, but we still might run into swapping issues.
2015-05-16 15:39:36 +02:00
degasus 242f7d964d CustomTexture: prefetch all available textures 2015-05-16 15:12:07 +02:00
degasus 7cf4dd63e4 CustomTexture: fix texture format 2015-01-21 23:33:42 +01:00