Commit graph

139 commits

Author SHA1 Message Date
emufan4568 efc2db4088 rasterizer_cache: Separate into common directory 2022-08-21 01:16:42 +03:00
zhang wei afa7f4996f
fx bgr write back on gles (#5924) 2022-01-24 14:14:12 +05:30
James Rowe fda121c25c Use immutable storage when available 2021-10-02 16:38:15 +05:30
BreadFish64 54b8af1444 video_core: implement GLES depth/stencil downloads
video_core: disable depth/stencil texture download on OpenGL ES

Disable deptch stencil shader in texture_downloader_es for now

enable_depth_stencil

DepthStencil

remove GL_DEBUG_OUTPUT_SYNCHRONOUS
2021-10-02 14:19:27 +05:30
bunnei 5a31aa175d android: video_core: gl_rasterizer_cache: Make cache access thread safe. 2021-09-29 22:51:12 +05:30
bunnei 853acce6c5 android: renderer_opengl: Optimize GetTexImageOES and fix bugs. 2021-07-24 23:37:01 +05:30
bunnei 855d19a468 android: gl_rasterizer_cache: Skip costly shutdown procedure. 2021-07-24 23:37:00 +05:30
SachinVin 4439423313 (jroweboy)gl_rasterizer_cache.cpp: Check Framebuffer Status 2021-07-24 23:36:58 +05:30
Marshall Mohror e6c479f497
Merge pull request #5710 from BreadFish64/bonk_textures
gl_rasterizer_cache: Remove all fully invalid surfaces from the cache
2021-02-11 19:06:03 -06:00
BreadFish64 ff56fdf37d fix recycling custom textures 2021-02-08 15:53:06 -06:00
BreadFish64 a131f9eb74 gl_rasterizer_cache: don't place null textures in the recycler 2021-02-03 13:29:03 -06:00
BreadFish64 85e9ba897d gl_rasterizer_cache: Recycle host textures
Allocating new textures has fairly high driver overhead.
We can avoid some of this by reusing the textures from destroyed surfaces since the game will probably create more textures with the same dimensions and format.
2021-02-02 20:46:25 -06:00
BreadFish64 935e88a580 gl_rasterizer_cache: Remove all fully invalid surfaces from the cache
Some games (e.g. Pilotwings Resort) create many surfaces that are invalidated quickly but were never removed.
This occasionally lead to large lag spikes due to high lookup times and other data structure management overhead.
2021-02-02 20:43:41 -06:00
FearlessTobi 20139141f7 video_core: Remove unnecessary enum class casting in logging messages
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more.

Reduces the line noise in our code a bit.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-28 16:50:23 +01:00
Mat M 51dfc46d3f
gl_rasterizer_cache: Trivial minor cleanups (#5295)
* gl_rasterizer_cache: Mark file-scope functions as static where applicable

Prevents -Wmissing-declaration warnings from occurring and also makes
these functions internally linked.

* gl_rasterizer_cache: Remove unused local std::string variable

Despite being unused, compilers are unable to completely remove any code
gen related to the construction and destruction of this variable, since
the destructor of std::string is non-trivial.

Thus, we can remove it to reduce a minor amount of unnecessary code
generation

* gl_rasterizer_cache: Mark hash implementation as noexcept

This shouldn't throw.

* gl_rasterizer_cache: Remove unused variable in ClearAll()

* gl_rasterizer_cache: Make use of const on references explicit

While declared as auto&, these actually behave as const auto& variables,
due to the constness of the container being iterated. We can make this
explicit for readability sake.

* gl_rasterizer_cache: Resolve truncation warnings

The size is forwarded to a std::memset call, which takes a std::size_t
as its size parameter, so we can just make this change to silence the
warnings.

* gl_rasterizer_cache: Resolve variable shadowing warnings

Prevents a -Wshadow warning from occurring.
2020-05-18 09:19:54 -05:00
Lioncash 38c8fecb81 gl_rasterizer_cache: Make use of if constexpr in MortonCopyTile()
A trivial change that allows compilers to more rigorously optimize out
code blocks that will never be executed in some scenarios.
2020-05-04 23:08:53 -04:00
Lioncash 59a614a70f gl_rasterizer_cache: Remove unnecessary reference parameter in LoadCustomTexture()
This is only ever used in a self-referential manner, so we can make use
of the texture info member directly.
2020-05-01 05:42:35 -04:00
Lioncash e342f36e02 gl_rasterizer_cache: Flatten LoadCustomTexture()
Makes the control flow much nicer to follow, as we don't store to a
local before returning anymore.
2020-05-01 05:33:47 -04:00
Hamish Milne 828f88d20a Merge branch 'master' into feature/savestates-2 2020-04-12 11:24:06 +01:00
Marshall Mohror d37b0476ad
video_core/renderer_opengl/gl_rasterizer_cache: Create Format Reinterpretation Framework (#5170)
* video_core/renderer_opengl/gl_rasterizer_cache: Create Format Reinterpretation Framework

Adds RGBA4 -> RGB5A1 reinterpretation commonly used by virtual console
If no matching surface can be found, ValidateSurface checks for a surface in the cache which is reinterpretable to the requested format.
If that fails, the cache is checked for any surface with a matching bit-width. If one is found, the region is flushed.
If not, the region is checked against dirty_regions to see if it was created entirely on the GPU.
If not, then the surface is flushed.

Co-Authored-By: James Rowe <jroweboy@users.noreply.github.com>
Co-Authored-By: Ben <b3n30@users.noreply.github.com>

temporary change to avoid merge conflicts with video dumping

* re-add D24S8->RGBA8 res_scale hack

* adress review comments

* fix dirty region check

* check for surfaces with invalid pixel format, and break logic into separate functions
2020-04-07 09:12:32 -05:00
Marshall Mohror f14e973a27
Texture Filtering v2 (#5166)
* video_core/renderer_opengl: Move SurfaceParams into its own file

Some of its enums are needed outside of the rasterizer cache
and trying to use it caused circular dependencies.

* video_core/renderer_opengl: Overhaul the texture filter framework

This should make it less intrusive.
Now texture filtering doesn't have any mutable global state.
The texture filters now always upscale to the internal rendering resolution.
This simplifies the logic in UploadGLTexture and it simply takes the role of BlitTextures at the end of the function.
This also prevent extra blitting required when uploading to a framebuffer surface with a mismatched size.

* video_core/renderer_opengl: Use generated mipmaps for filtered textures

The filtered guest mipmaps often looked terrible.

* core/settings: Remove texture filter factor

* sdl/config: Remove texture filter factor

* qt/config: Remove texture filter factor
2020-04-02 22:42:50 -05:00
Khangaroo d26564d020
Don't dump textures that aren't a power of 2 (#5152)
* don't dump textures that aren't a power of 2

* early return

* include bitset

* revert change to comment block

* explain change
2020-04-01 23:59:24 -05:00
Hamish Milne 7049af744f Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-03-28 12:33:21 +00:00
Marshall Mohror 5dbf334ef1
Revert "Use immutable storage when available (#5053)" (#5151)
This reverts commit 407fd15515.
2020-03-26 19:01:18 -05:00
James Rowe 407fd15515
Use immutable storage when available (#5053)
Going to merge this because I plan to use it.
2020-03-26 12:53:55 -05:00
Marshall Mohror a7d3489dc9
video_core: add texture filtering (#5017)
video_core: add texture filtering
2020-03-16 09:42:05 -05:00
Hamish Milne da3ab3d56e Merge branch 'master' into feature/savestates-2 2020-03-07 21:23:08 +00:00
James Rowe 55c75b5e3e Add ClearAll to rasterizer cache for fully wiping the cache on save/load 2020-02-13 17:42:11 +08:00
Khangaroo df99d98240 specify size of buffer and use openglstate in getteximageoes 2019-11-09 12:58:17 -07:00
khang06 a458155f99 texture dump hotkey (ctrl+d)
address more comments
2019-11-09 12:56:30 -07:00
Khangaroo 5450d4980d crash hotfix (no clang-format because on phone)
hotfix 2: check if the texture is custom before dumping

hotfix 4: fix custom texture conflict detection
2019-11-09 12:56:28 -07:00
Khangaroo ae4aaf2fc1 nested folder support + refuse to load incompatibly sized textures + general cleanups 2019-11-09 12:56:27 -07:00
Khangaroo 8a98310a16 address more comments, fix dumping textures that already got dumped 2019-11-09 12:56:27 -07:00
Khangaroo c2a32e942b address more comments 2019-11-09 12:56:27 -07:00
Khangaroo 650fe6447d generate mipmaps (for now) 2019-11-09 12:56:27 -07:00
Khangaroo f09489475a fix texture dumping on opengl es, create load folder if none exists if custom textures is enabled 2019-11-09 12:56:27 -07:00
Khangaroo 254f8a4643 fix inverted texture dump error message path 2019-11-09 12:56:27 -07:00
Khangaroo 8b881ac1fc fix preload textures being enabled when it shouldn't
address more comments
2019-11-09 12:56:25 -07:00
Khangaroo 391e552927 qimageinterface fixes, remove old lodepng, address more comments 2019-11-09 12:56:24 -07:00
Khangaroo b81c15941e add image interface, remove lodepng from video_core/core, address more comments, fix comments
remove unnecessary conversion
2019-11-09 12:56:21 -07:00
Khangaroo 5940361b81 new-line that clang-format didn't fix
address some comments
2019-11-09 12:56:17 -07:00
Khangaroo 59b475a4b9 implement custom texture preload 2019-11-09 12:56:17 -07:00
Khangaroo 657a129b60 handle upscaling and offsets (fixes oot3d) 2019-11-09 12:54:43 -07:00
Khangaroo 6d90c42a79 fix crashes, add custom texture cache, load textures from load directory 2019-11-09 12:54:40 -07:00
Khangaroo f866b2a917 texture replacement (also messy) 2019-11-09 12:53:16 -07:00
khang06 deff865ac9 initial sloppy texture dumping implementation (opengl only) 2019-11-09 12:53:16 -07:00
weihuoya 899e3eb003 minor fix for opengles 2019-07-28 21:18:38 +08:00
BreadFish64 aaf496dec7 video_core: change "left + width" to "right" in CanSubRect
the constructed rectangle from GetSubRect already has the right info
2019-06-04 17:03:31 -05:00
Weiyi Wang 0ec45f694c
Merge pull request #3910 from wwylele/mipmap
gl_rasterizer: implement mipmap by forwarding PICA mipmap configuration
2019-04-17 14:10:42 -04:00
Weiyi Wang e3b6bf93bc gl_rasterizer_cache: validate surface in mipmap/cubemap if the children is not validated yet 2019-04-15 09:07:36 -04:00