Commit Graph

655 Commits

Author SHA1 Message Date
Henrik Rydgård
a208afb7b8 OpenGL and D3D11 fixes 2022-09-14 23:35:15 +02:00
Henrik Rydgård
abd58199ce Add way to bind cached textures to a DrawContext 2022-09-14 22:18:35 +02:00
Henrik Rydgård
0ed1f3d461 Switch multiple bools as parameters to DecodeTextureLevel to a flags enum. 2022-09-14 18:40:08 +02:00
Henrik Rydgård
75efcd9dfd
Merge pull request #16000 from unknownbrackets/gedebugger
Cleanup some crashes in GE debugger or with large textures
2022-09-11 19:41:11 +02:00
Henrik Rydgård
694dbe1271 Add ShaderDepalMode enum, use in shader ID. Replaces smoothed bit. 2022-09-11 14:40:01 +02:00
Henrik Rydgård
9bd8b11bf8 Implement shader depal for D3D11. 2022-09-11 13:41:17 +02:00
Unknown W. Brackets
1056301c95 D3D11: Prevent crash on larger textures. 2022-09-10 20:16:05 -07:00
Henrik Rydgård
f3c097680e
Merge pull request #15982 from hrydgard/renderpass-refactor
Vulkan: Refactor renderpass handling
2022-09-08 09:35:55 +02:00
Unknown W. Brackets
e6b4495e22 GPU: Make NotifyConfigChanged() calls consistent.
They're generally centralized in Common.
2022-09-07 23:41:00 -07:00
Henrik Rydgård
e828df9f25 Split each renderpass/framebuffer into multiple "compatibility classes" (RenderPassType). 2022-09-08 00:32:03 +02:00
Unknown W. Brackets
62ed43633c d3d9: Correct decode of 16-bit textures.
Was causing crashes since we assumed this func could handle non-replaced
formats.
2022-09-06 07:44:08 -07:00
Henrik Rydgård
b15c65540e Fix the new logic-op-in-shader on OpenGL and D3D11
Also disable BlueToAlpha for now for Outrun and DiRT 2, it breaks the
water effect somehow. Will come back to it later.
2022-09-04 22:53:05 +02:00
Henrik Rydgård
ec173559f8 Additional cleanup 2022-09-04 00:10:55 +02:00
Henrik Rydgård
87b14fe1c2 Some more renaming and refactoring, extracted from a future PR 2022-09-04 00:10:55 +02:00
Henrik Rydgård
8e39018b95 Channel mask refactor 2022-09-04 00:10:54 +02:00
Henrik Rydgård
c846c2dfa8 Remove confusing resetFramebufferRead flag from secondary framebuffer binding 2022-09-03 14:48:07 +02:00
Henrik Rydgård
8c56abd3dc Remove setting "Disable slower framebuffer effects" 2022-09-03 11:06:43 +02:00
Henrik Rydgård
b84cda2876 Plumb the computed pipeline state into ComputeFragmentShaderID. 2022-09-02 22:16:57 +02:00
Henrik Rydgård
c784c0e94b Some renaming. Store the BlendState/MaskState. 2022-09-02 21:07:29 +02:00
Henrik Rydgård
2bf0c86ac7 Fix image format when dumping textures.
Fixes #15831
2022-09-01 15:04:59 +02:00
Henrik Rydgård
67d6549afd Rename Slow Framebuf effects to Shader Blending (might remove). Reassign readbacks to BlockTransferGPU. 2022-08-31 14:23:33 +02:00
Henrik Rydgård
08eaf7665c Fix race condition in replacement texture loading
The texture could become valid during the load, causing an inconsistent
state within the texture loading. So can only check for valid-ness once.
2022-08-30 12:52:31 +02:00
Henrik Rydgård
6f2966f502 Clean up mip size calculations
Calculating the same thing in multiple places is a recipe for bugs, so
let's not.
2022-08-30 12:05:57 +02:00
Unknown W. Brackets
a8190f3eb4 GPU: Recheck depth/stencil after Spongebob hack.
Since we swap the compare, we should at least recheck it later.
2022-08-28 08:39:05 -07:00
Unknown W. Brackets
18e1efece1 GPU: Add a way to defer dirty rechecks.
These are situations where we have temporary state which will require
recalc again later.
2022-08-28 08:34:48 -07:00
Henrik Rydgård
df92f72ac3 Unify the spongebob depth inverse check 2022-08-28 07:11:00 +02:00
Henrik Rydgård
880ea48e2d Implement the stencil/alpha reverse trick for all backends 2022-08-27 10:25:18 +02:00
Henrik Rydgård
8acae79013 Minor D3D11 refactoring 2022-08-27 10:05:18 +02:00
Henrik Rydgård
b529d26f3a Fix smoothed depal on GLES. Don't enable filtering if not using. 2022-08-24 13:43:41 +02:00
Henrik Rydgård
5d50d02227
Merge pull request #15894 from unknownbrackets/debugger
GE Debugger: Record only one flip if display framebuf not changed, step on vsync
2022-08-24 06:27:31 +02:00
Unknown W. Brackets
c581a83896 GPU: Centralize SetDisplayFramebuffer(). 2022-08-23 19:29:06 -07:00
Henrik Rydgård
5084743bbb Use Draw2D for depal shaders (except the actual blit, for now) 2022-08-23 11:21:40 +02:00
Unknown W. Brackets
86e754fb4a D3D11: Correct viewport offset sign handling. 2022-08-22 21:29:49 -07:00
Henrik Rydgård
b39b74e602 More renaming. Fix shader view for Vulkan 2022-08-22 12:30:51 +02:00
Henrik Rydgård
82a6c42e17 DepalettizeCommon -> TextureShaderCommon. Simplifications. 2022-08-22 12:21:20 +02:00
Unknown W. Brackets
89a499b4d2 GLES: Correct preview of mip levels > 0.
Don't need to force level 0 anymore.  Software can show levels hardware
refuses to load.  This is consistent with other backends.
2022-08-21 16:47:46 -07:00
Unknown W. Brackets
b5a4843c1f GPU: Purify ConvertViewportAndScissor().
This makes it harder to misuse.  See #15856.
2022-08-20 14:21:11 -07:00
Unknown W. Brackets
d61619db47 GPU: Dirty params when converting viewport state.
This flag will be false when we convert next time, so parameters won't get
updated as expected.
2022-08-20 14:03:24 -07:00
Henrik Rydgård
12db0e52d4 Fix deferred-depth for bezier/spline. Move updating of last_frame_depth_render to GPUCommon. 2022-08-20 08:29:33 +02:00
Henrik Rydgård
886679c7ec Remove the color-to-depth mode 2022-08-20 08:29:33 +02:00
Henrik Rydgård
295f5f391e More consistent handling of lack of depth texture support. Small log improvement. 2022-08-20 08:05:53 +02:00
Henrik Rydgård
cbe6a9161a Remove some unused code in FramebufferManagerD3D11.cpp/h 2022-08-16 12:15:40 +02:00
Henrik Rydgård
131098c4d4 Some enum renaming, move RasterChannel to GPU.h. 2022-08-09 19:58:48 +02:00
Henrik Rydgård
9a5893ce6e More cleanup 2022-08-06 18:27:04 +02:00
Henrik Rydgård
4e3c258140 Delete all the duplicate implementations of ApplyTextureFramebuffer 2022-08-06 18:27:03 +02:00
Henrik Rydgård
45def772ee Move the depal cache instance ownership to TextureCacheCommon 2022-08-06 18:27:03 +02:00
Henrik Rydgård
e345a6ba3c Works with D3D11, except the depth texturing case 2022-08-06 18:27:03 +02:00
Henrik Rydgård
2fa9b0d0c7 Simplify 2022-08-06 18:27:03 +02:00
Henrik Rydgård
8d23c5ecfb Fixy fix 2022-08-06 18:27:03 +02:00
Henrik Rydgård
da65af832a D3D11 prep 2022-08-06 18:27:03 +02:00
Henrik Rydgård
08e2d951b4 State handling reordering in D3D11 and D3D9 backends. 2022-08-05 23:07:01 +02:00
Henrik Rydgård
e28b45481b Delete more unused code 2022-08-03 22:47:31 +02:00
Henrik Rydgård
f8e0c09463 Delete unused stuff in all backends 2022-08-03 22:22:52 +02:00
Henrik Rydgård
9d23939e28 Replace D3D11's BlitFramebuffer with the common one 2022-08-03 22:22:51 +02:00
Henrik Rydgård
1ab9293cb3 Convert FramebufferBlit from the GL backend to use thin3d 2022-08-03 22:22:51 +02:00
Henrik Rydgård
64a8a3f7d3 D3D11: Remove more custom drawing 2022-08-03 22:22:51 +02:00
Henrik Rydgård
1d3075566f Move to common (todo: merge with above) 2022-08-03 14:12:55 +02:00
Henrik Rydgård
d55c4a3456 Convert the D3D11 DrawActiveTexture to thin3d 2022-08-03 14:12:55 +02:00
Henrik Rydgård
41e327a66b Cleanup and testfixes 2022-08-03 13:34:59 +02:00
Henrik Rydgård
9bead443c3 Unify stencil buffer upload using Draw. Only OpenGL tested yet (shaders need adaptation). 2022-08-03 13:31:13 +02:00
Henrik Rydgård
19931c003f Clean up blit/copy feature detection. Don't need fast GPU flags for these. 2022-08-02 09:53:46 +02:00
Henrik Rydgård
655cadc281 D3D11 fix 2022-08-01 11:54:42 +02:00
Henrik Rydgård
90a44579bf Implement color-to-depth for Vulkan, start implementing for D3D11 2022-08-01 11:30:36 +02:00
Henrik Rydgård
3331654396 Fix Macross glitches. 2022-08-01 00:19:47 +02:00
Henrik Rydgård
0262fbc70a Implement 3D textures for D3D11 2022-07-31 10:43:48 +02:00
Henrik Rydgård
6a5a232777 Unify the GLES LoadTextureLevel with the D3D ones. 2022-07-30 19:07:21 +02:00
Henrik Rydgård
c6d7423368 Prepare to convert the GLES functions too 2022-07-30 18:37:48 +02:00
Henrik Rydgård
dea979433c Share LoadTextureLevel between the two D3D backends. 2022-07-30 17:00:34 +02:00
Henrik Rydgård
9ed96921e1 Cleanup 2022-07-30 16:51:29 +02:00
Henrik Rydgård
b7940f9402 Part 2 of the above 2022-07-30 16:43:31 +02:00
Henrik Rydgård
61cf3e8ba0 D3D: Part 1 of breaking out the API stuff 2022-07-30 16:38:40 +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
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
1513978019 Use PrepareBuildTexture from DX9 backend 2022-07-30 10:44:28 +02:00
Henrik Rydgård
043989ca8a Use PrepareBuildTexture from D3D11 backend 2022-07-30 10:44:27 +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
4165e146e6 Remove unused parameters to some conversion functions 2022-07-30 08:52:24 +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
Henrik Rydgård
c9a37ec6b9 Remove bool that was always true in state mapping. 2022-07-24 21:04:54 +02:00
Henrik Rydgård
f523341351 Remove unnecessary parameters from MakePixelsTexture 2022-07-24 13:54:09 +02:00
Henrik Rydgård
66ddbe9513 Remove the rather problematic limit on framebuffer copies 2022-05-01 12:49:19 +02:00
Henrik Rydgård
7be86264d0 Move framebufFormat to gstate_c, so we can override it 2022-04-30 18:16:09 +02:00
Henrik Rydgård
32df78a2cc Make the existing ReinterpretFramebuffers/ShaderColorBitmask path work for Split/Second
It took writing and debugging #15500 for me to understand what the issue with the old path was..

Much simpler alternative to #15500, or we could merge both but disable Split/Second
for this one. Needs some benchmarks I guess...
2022-04-25 00:11:09 +02:00
Henrik Rydgård
b1af940d8e Save textures on background tasks when texture dumping is enabled.
Should help #15478, at least a bit.
2022-04-18 00:26:35 +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
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
Unknown W. Brackets
2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
Unknown W. Brackets
0dc7688838 GPU: Cleanup some extra pointers in fb managers.
These weren't being used / weren't final anyway.
2021-11-14 14:13:48 -08:00
Unknown W. Brackets
2718e81c0e GPU: Expand lines to triangles. 2021-10-31 14:46:46 -07:00
Unknown W. Brackets
b3a8e013f6 GPU: Expand points into triangles for higher res. 2021-10-31 13:06:06 -07:00
Unknown W. Brackets
9fc94a3494 GPU: Skip cull for lines and points.
These already always go through software transform, so make sure we handle
them consistently.  We'll eventually convert to triangles.
2021-10-31 10:54:50 -07:00