Commit graph

313 commits

Author SHA1 Message Date
Henrik Rydgård
f061eadc04 Initial implementation of 3D texturing through equal-size mips (see #6357)
Vulkan-only currently, though all the other backends except ES 2.0
without GL_OES_texture_3d can support it with some work.
2022-07-31 10:43:47 +02:00
Unknown W. Brackets
795b1c04a9 GPU: Small scaling variable cleanup. 2022-07-30 18:18:51 -07:00
Henrik Rydgård
6a5a232777 Unify the GLES LoadTextureLevel with the D3D ones. 2022-07-30 19:07:21 +02:00
Henrik Rydgård
9ed96921e1 Cleanup 2022-07-30 16:51:29 +02:00
Henrik Rydgård
063cd18254 Simplify CPU upscaling code
Use the existing expandTo32bit mode in the texture decoder instead of
the backend-specific switches and stuff.

Just gets rid of a bunch of redundant code and makes further changes
easier.
2022-07-30 15:06:25 +02:00
Henrik Rydgård
b9b3310c21 Remove some indentation 2022-07-30 10:45:03 +02:00
Henrik Rydgård
9f1fdc6c02 Use PrepareBuildTexture from the Vulkan backend too 2022-07-30 10:45:03 +02:00
Henrik Rydgård
d0d53091a8 Change from maxLevel to levelsToLoad, for better readability. Cleanup. 2022-07-30 10:45:02 +02:00
Henrik Rydgård
1e9d85cda1 Define texture loading plan semantics better, pre-port some from Vulkan 2022-07-30 10:44:28 +02:00
Henrik Rydgård
eb6d364a2d Vulkan: One step closer to using PrepareBuildTexture 2022-07-30 10:44:28 +02:00
Henrik Rydgård
c031f3085b Additional cleanup 2022-07-30 10:44:26 +02:00
Henrik Rydgård
679a861204 Make the BuildTexture of DX9 and D3D11 backends more similar 2022-07-30 10:44:01 +02:00
Henrik Rydgård
da9f03e356 Remove indentation, useless code 2022-07-30 10:42:16 +02:00
Henrik Rydgård
f728faffdc Remove fake-mipmap logic from LoadTextureLevel 2022-07-30 10:38:17 +02:00
Henrik Rydgård
8b398bbbb7 Minor code simplification 2022-07-30 10:32:50 +02:00
Henrik Rydgård
6f484d0aee Remove unused useBGRA parameter 2022-07-30 08:52:24 +02:00
Henrik Rydgård
c41b780c8c Remove the ReplacedTextureFormat enum 2022-07-30 08:52:24 +02:00
Henrik Rydgård
ef4a6cf873 Remove support for 16-bit replacement texture formats 2022-07-30 08:52:24 +02:00
Unknown W. Brackets
42d7226413 Vulkan: Correct size for tex mip level readback.
Used by the GE debugger to display the texture levels.
2022-05-01 15:23:57 -07:00
Henrik Rydgård
d30024cc88 Vulkan: Follow sampler best practices with auto max quality. 2022-05-01 10:20:11 +02:00
Henrik Rydgård
ed7dfdc8ad Fix mip level bug in Vulkan texture cache. 2022-04-23 22:51:11 +02:00
Henrik Rydgård
c52a5e9e25 Fix checks for the "fake mipmap" situation.
Fixes #15492
2022-04-22 22:59:20 +02:00
Unknown W. Brackets
34d0acac4e Vulkan: Save textures using a memory copy. 2022-04-17 20:55:39 -07:00
Unknown W. Brackets
39d6dc1740 Vulkan: Allow saving const tex levels.
This might be used for fonts, for example.  They could be replaced, so no
reason not to export.
2022-04-17 20:06:03 -07:00
Henrik Rydgård
dffc1a9196 Add the slow comment to one more place 2022-04-18 00:40:49 +02:00
Henrik Rydgård
c4dfbf4f1a Delete a lot of specialized alpha checking code.
This was now only used to check alpha in CLUTs, and the generic functions will not actually be any slower.
2022-04-15 12:34:50 +02:00
Henrik Rydgård
a5ee1884c1 Address feedback 2022-04-15 01:08:14 +02:00
Henrik Rydgård
3bf9ea8de6 Debug log (remove before merge) 2022-04-15 00:56:25 +02:00
Henrik Rydgård
42cd937de2 Simplification and some cleanup 2022-04-15 00:56:25 +02:00
Henrik Rydgård
9f7e0978a9 AND together colors while decoding, and then check against fullAlphaMask. 2022-04-15 00:56:25 +02:00
Henrik Rydgård
a68ddd0a8d Merge separate NEON functions into the normal functions.
We no longer support non-NEON ARM.

It's nice also to have the NEON and SSE implementations "close" to each
other, easier to port optimizations back and forth etc.
2022-04-12 23:43:21 +02:00
Henrik Rydgård
7cab540fca Short circuit the texture replacement code 2022-03-08 19:56:06 +01:00
Unknown W. Brackets
8418287a87 Vulkan: Avoid crash on double DeviceLost.
This caused Android to crash when switching to OpenGL, because the
destructor would try to deinit again.  There weren't any objects, but
draw_ was no longer valid.
2022-02-06 23:34:44 -08:00
Henrik Rydgård
748b8287a6 Add format string support to Vulkan log-profiler 2021-12-19 22:21:34 +01:00
Henrik Rydgård
80ae4b039c Vulkan: Be more restrictive about texture upscaling on "slow" devices.
Applies the same rules as for software upscaling in this case.

Should fix the stutters seen in #15109
2021-12-16 21:00:49 +01:00
Henrik Rydgård
ff887b0f11 Vulkan: Don't generate mipmaps for huge textures (probably menu backgrounds). Other minor fixes. 2021-12-13 09:13:48 +01:00
Henrik Rydgård
b99a5b6613 Minor fixes 2021-12-12 23:21:28 +01:00
Henrik Rydgård
5adf23280c Turn video upscaling off. 2021-12-12 23:21:28 +01:00
Henrik Rydgård
dc9816ceac Add hardcoded bool toggle for upscaling video, fix log, remove a comment, minor opt 2021-12-12 23:20:57 +01:00
Henrik Rydgård
3833d935f4 Fixes when profiler is disabled.
Typo, validation fix

More fixes

Fix mipgen logging

Disable the logging profiler by default again

Important to use the macro
2021-12-12 12:42:40 +01:00
Henrik Rydgård
9945620504 Switch to macros to easily disable the new profiling. Add missing scope 2021-12-12 12:11:59 +01:00
Henrik Rydgård
55fe21db1e Add a simple GPU profiler to profile individual events, rather than full passes. 2021-12-12 12:11:54 +01:00
Henrik Rydgård
45308a16c0 Vulkan is strict about scissor rect, so let's clamp centrally.
Better than spreading the logic all over.

Fixes #15207
2021-12-08 22:38:01 +01:00
Henrik Rydgård
05429fc34f Vulkan: Correct the max level to generate mipmap calculation 2021-12-07 21:28:58 +01:00
Henrik Rydgård
f991f6a789 Remove the old allocator visualizer. Keep the setting but hide it. Other feedback 2021-11-23 08:55:12 +01:00
Henrik Rydgård
c2f594cc73 Remove the VulkanDeviceAllocator 2021-11-22 18:54:09 +01:00
Henrik Rydgård
1b1e585a35 More integration, use VMA in VulkanTexture 2021-11-22 18:54:09 +01:00
Unknown W. Brackets
8a5f07b860 Vulkan: Don't cache vulkan_ with draw context.
Since we can get the VulkanContext cheaply from the draw context, it's
easier to make sure things stay up to date.
2021-11-14 15:25:28 -08:00
Henrik Rydgård
f58e75e462 Remove unused variable 2021-11-07 16:31:28 +01:00
Henrik Rydgård
43dc54bc4a Comment fix, remove assert 2021-11-07 16:30:47 +01:00