Commit Graph

426 Commits

Author SHA1 Message Date
Unknown W. Brackets
b4496f1975 Core: Move config enums to separate file.
These are a bit strewn about and there are constants that aren't
consistently used, which just adds confusion.
2018-06-23 10:59:18 -07:00
Unknown W. Brackets
d1fa9b97a3 GPU: Remove some unused fields. 2018-06-17 11:26:09 -07:00
Henrik Rydgård
6bf6490c2f
Merge pull request #11128 from unknownbrackets/gpu-minor
Minor framebuffer code cleanup
2018-06-06 22:28:35 +02:00
Henrik Rydgård
03175b74ef
Merge pull request #10957 from unknownbrackets/depal-bounds2
GPU: Dirty tex when clearing or rendering to self
2018-06-06 22:22:01 +02:00
Unknown W. Brackets
8f354e5312 GPU: Minor framebuffer code cleanup. 2018-06-06 05:56:30 -07:00
Unknown W. Brackets
2606365ba4 GPU: Use software transform for flat shading.
Except on GLES where it works fine with the default provoking index.

This fixes #10969 so that it works everywhere.
2018-06-06 05:53:50 -07:00
Unknown W. Brackets
dca159c47e GPU: Correct sw flat shading color on Vulkan/D3D.
It was only correct on GLES before.  This only fixes software transform.
2018-06-06 05:53:50 -07:00
Unknown W. Brackets
61fc1cdcfb GPU: Dirty tex when clearing or rendering to self.
This way if we're blitting, we'll re-blit.
2018-06-06 05:52:49 -07:00
Henrik Rydgård
c1d113e0e9 When creating temp framebuffers for download, size them using bufferWidth/Height instead of width/height.
Or maybe we should make sure to only download within the width/height by
adding more clamps at the beginning of ReadFramebufferToMemory but seems
more dangerous.

Plus some minor things.

Should help #11113
2018-06-01 21:16:07 +02:00
Unknown W. Brackets
abbab23814 D3D11: Use a dedicated slot for the depal texture.
Otherwise it affects shader blending.
2018-05-06 08:58:54 -07:00
Unknown W. Brackets
8d07e6d985 GPU: Prevent temp FBOs from overwriting each other.
Sometimes we'd use two temp FBOs in the same draw (e.g. shader blending +
depal.)  This could cause the same temp FBO to get used for two purposes,
causing weird behavior.
2018-05-06 08:57:44 -07:00
Unknown W. Brackets
3eb0450998 Depal: Reapply texture when bounds change.
Since we need each slice of the texture when we use bounds to reduce the
size.  Fixes #10951.
2018-04-22 10:43:46 -07:00
Henrik Rydgård
36fd2711d6 Revert "Remove further remains of hardware skinning."
This reverts commit 40db61a680.
2018-04-10 12:22:41 +02:00
Henrik Rydgård
8953d7ff73 Revert "Comment fixes, reindentation."
This reverts commit 6fa9fcefb2.
2018-04-10 12:14:23 +02:00
Henrik Rydgård
6a90b8fbb4 Revert "Further cleanup after the removal of hardware skinning."
This reverts commit f086a0915f.

Increment the shader cache version. Restore some more.
2018-04-10 11:38:02 +02:00
Henrik Rydgård
69309aa400 Revert "Remove some remains of software skinning"
This reverts commit 2d33d526b8.
2018-04-10 11:21:56 +02:00
Henrik Rydgård
f967e206b8 Remove the last remains of the idea that textures can be efficiently updated instead of recreated. Accidentally fixes #10697 somehow.
Also this is good for terminology, no more confusion with the texture
replacement facility :)
2018-03-25 10:50:37 +02:00
aliaspider
15c4406df7 add missing inclues. 2018-03-22 22:14:19 +01:00
Henrik Rydgård
1bb7be489f Remove some unused tracking of whether lighting is used by a shader 2018-03-17 10:33:50 +01:00
Henrik Rydgård
2d33d526b8 Remove some remains of software skinning 2018-03-16 20:38:05 +01:00
Henrik Rydgård
7a8310ae5e Tiny unification of code. Save the GL shader cache a bit less often. 2018-03-13 13:35:58 +01:00
Henrik Rydgård
f086a0915f Further cleanup after the removal of hardware skinning. 2018-03-05 00:03:47 +01:00
Henrik Rydgård
6fa9fcefb2 Comment fixes, reindentation. 2018-03-05 00:03:47 +01:00
Henrik Rydgård
40db61a680 Remove further remains of hardware skinning. Fixes #10661 2018-03-05 00:03:47 +01:00
Henrik Rydgård
c7dcb7c365 D3D9/D3D11: Fix GPU feature detection. Enforce accurate depth on nVidia as well, they no longer seem to support reverse depth so it's needed as a workaround. Fixes #10655 2018-03-01 09:38:06 +01:00
Henrik Rydgård
64ec46e705 Unify FramebufferDirty()/FramebufferReallyDirty() for the hw backends 2018-02-26 11:58:17 +01:00
Henrik Rydgård
78467d6092 Unify FastRunLoop for the hardware backends. 2018-02-26 11:52:16 +01:00
Henrik Rydgård
6a2f45c2e1 Unify UpdateCmdInfo 2018-02-26 11:48:56 +01:00
Henrik Rydgård
8cef1f0f8d GPU: Unify command table (cmdInfo_) 2018-02-26 11:44:02 +01:00
Henrik Rydgård
a8a34fef9c Virtualize CheckGPUFeatures 2018-02-26 11:35:37 +01:00
Henrik Rydgård
feb4694acc Unify DispatchSubmitPrim as much as possible 2018-02-26 11:33:17 +01:00
Henrik Rydgård
967018b7f8 Unify Execute_LoadClut 2018-02-26 11:32:02 +01:00
Henrik Rydgård
c7f8f4c5ca Unify Execute_Prim 2018-02-26 11:22:27 +01:00
Henrik Rydgård
23980065ba Unify all the DrawEngine::SubmitPrim 2018-02-26 11:07:30 +01:00
Unknown W. Brackets
4b8d8c875d Qt: Remove old texture debug API.
No one's testing it and it's not the best way.  We have a better
implemented API and should use it instead.
2018-02-19 09:09:35 -08:00
Henrik Rydgård
86cfc411a4 Remove the confusing "DisableState" across the codebase 2018-02-08 16:27:36 +01:00
Unknown W. Brackets
22f65500f1 GPU: Fix shader blending recopying.
This at least didn't look horrible like GLEs did, but still looked
odd in Lunar.
2018-01-27 15:10:17 +01:00
Unknown W. Brackets
b566b6cca2 D3D11: Remove potentially misleading rebind func.
This doesn't override the GPUCommon one, it just shares the same name,
which might lead to confusion later.  Better not to use the parent.
2018-01-27 15:10:17 +01:00
Unknown W. Brackets
db0989a9d0 Debugger: Fix texture preview in GLES.
Also, fix issues with the first view of a texture in Vulkan / D3D11.
2018-01-27 15:10:17 +01:00
Henrik Rydgård
f3282dcfda Delete the gl name cache (might resurrect it on the GLQueueRunner side if needed later). Other cleanup and fixes. 2018-01-27 15:10:17 +01:00
Henrik Rydgård
d565e23f4c Stencil copy: Avoid clearing the depth buffer. 2017-12-31 01:06:31 +01:00
Henrik Rydgård
b5e5d72a0a Complete the separation of depth and stencil renderpass flags 2017-12-30 22:52:22 +01:00
Unknown W. Brackets
0151c5e649 GPU: Track stats on uploads.
A lot can lead to slowdown, so it's useful when logging frame drops.
2017-12-28 19:27:45 -08:00
Henrik Rydgård
c1a23658d1
Merge pull request #10456 from unknownbrackets/gpu-flips
Display: Avoid limiting FPS without a clear
2017-12-27 10:14:12 +01:00
Unknown W. Brackets
f9750dd137 Display: Avoid limiting FPS without a clear.
A bit of a dirty heuristic to avoid the slowdown in #8538.
2017-12-26 19:37:40 -08:00
Unknown W. Brackets
d6da758ed3 GPU: Remove duplicate BACKEND constants. 2017-12-26 15:55:24 -08:00
Unknown W. Brackets
0956fa3ff6 GPU: Reduce depth blits when not updated.
If the game initially clears the depth in a buffer, but then never uses
that depth again, don't keep blitting depth.

Improves #8538, by preventing the depth blits in this case.
2017-12-24 11:52:15 -08:00
Henrik Rydgård
dc6a4ea753 Fix annoying name clashes (Status is in X11 headers..) 2017-12-15 16:34:29 +01:00
Unknown W. Brackets
cd2dfd5c9a UI: Show a few more flags in build config. 2017-12-10 09:00:51 -08:00
Henrik Rydgård
b75c8b72c6 Fix another little inconsistency (two uniforms were merged for bad reasons) 2017-12-07 21:39:09 +01:00
Henrik Rydgård
fb74c9dfeb Clean up a small inconsistency 2017-12-07 21:09:09 +01:00
Unknown W. Brackets
0dee041002 D3D11: Change state caches to DenseHashMaps. 2017-12-02 18:55:02 -08:00
Unknown W. Brackets
243304a5e8 Hashmaps: Fix missing maintain calls in non-GLES.
Should only matter if vertex cache is enabled.
2017-12-02 18:27:18 -08:00
Unknown W. Brackets
4731a2918c GPU: Use more typesafe shader IDs.
Since they really are fairly distinct, let's make sure we can't mix them
accidentally.
2017-12-02 09:07:27 -08:00
Henrik Rydgård
734d9c494c Fix bug in Vulkan non-buffered where clears could extend outside the frame, since Vulkan clears do not respect scissors. 2017-12-02 11:05:10 +01:00
Henrik Rydgård
f8b70fe185 Clean up all the FBOs in DestroyAllFBOs. Missing any can have bad consequences after app switching on Android/Vulkan where we recreate stuff. 2017-12-01 12:17:10 +01:00
Unknown W. Brackets
7339c6c0fd Vulkan: Report more info on texture from target. 2017-11-30 15:42:21 -08:00
Henrik Rydgård
ce818263a1 Fix D3D11 push buffer overflow 2017-11-24 17:53:42 +01:00
Henrik Rydgård
e6be86ce74 ARM buildfix 2017-11-22 11:01:42 +01:00
Henrik Rydgård
2c86217552 Cleanup GPU vendor detection a bit, use it to avoid the issue mentioned in #9545 2017-11-21 16:19:28 +01:00
Henrik Rydgård
6a3d41892a Workarounds for issue with "accurate depth". See #9545, #10087 2017-11-21 12:11:05 +01:00
Henrik Rydgård
674d5c7dbb
Merge pull request #10130 from hrydgard/lod-bias-fixes
Mipmaps: Disable slope mode pending a better method. Implementing it entirely as a LOD bias is not the way it works.
2017-11-20 13:49:39 +01:00
Henrik Rydgård
713afdfe49 Refactor: Unify DecodeVerts and move ComputeNumVertsToDecode to Common 2017-11-19 12:39:09 +01:00
Henrik Rydgård
23f7819329 Unify RebindFramebuffer, mostly. 2017-11-15 20:44:25 +01:00
Henrik Rydgård
971995fa3d Move aniso to the sampler cache key. 2017-11-15 19:07:41 +01:00
Henrik Rydgård
313223364c Buildfix, update comments slightly 2017-11-15 14:21:17 +01:00
Henrik Rydgård
65275c29b7 Share UpdateSamplingParams between D3D11 and Vulkan. Support lod bias in Vulkan. 2017-11-15 14:21:17 +01:00
Henrik Rydgård
b958432783 Properly zero samplercache keys before filling them out. 2017-11-15 14:21:17 +01:00
Henrik Rydgård
f564c59248 Mipmaps: Disable LOD bias in slope mode as that's not how it works.
Works around #9772
2017-11-15 14:21:17 +01:00
Henrik Rydgård
d4df0181db More duplicate code removal 2017-11-14 09:20:36 +01:00
Henrik Rydgård
35437e6b62 Kill off more unused duplicate code 2017-11-13 16:50:45 +01:00
Henrik Rydgård
4a09289056 D3D11: Similarly to the last vulkan commit, don't create lots of dupe vertex input layouts 2017-11-13 12:26:52 +01:00
Henrik Rydgård
3e749a94ce Vulkan: Fix bug where we ended up creating duplicate pipelines even if vertices decoded to the same format, if they were created from different formats.
This can cut down the number of pipelines to a third or less in some
games. However, benefit is likely smaller since Vulkan drivers will
deduplicate shaders inside each vkPipelineCache object.

Helps #10106 while not actually implementing any of the suggestions inside.
2017-11-13 11:22:33 +01:00
Henrik Rydgård
04e313ecba Unify Execute_Bezier and Execute_Spline 2017-11-13 10:45:27 +01:00
Unknown W. Brackets
e3b3828b15 TexCache: Check alpha before scaling.
This will be faster when scaling.  We no longer need to wait, since we
only care about full alpha now.
2017-11-12 16:19:28 -08:00
Unknown W. Brackets
9fbcc01afa TexCache: Remove simple 0/1 alpha check.
No practical optimizations have come of this, so it's a waste of time.
Slows down Vulkan too.
2017-11-12 16:17:46 -08:00
Unknown W. Brackets
9cf17d9288 D3D11: Clear input layouts on shader clear.
When we do clear shaders, make sure to also clear input layouts so we
don't have corrupt keys.
2017-11-11 08:11:10 -08:00
Unknown W. Brackets
f93ef92960 D3D11: Avoid clearing shaders on load state.
They don't need to be cleared (unlike FBOs), and clearing them requires
clearing even more things.  Fixes #9637.
2017-11-11 08:09:56 -08:00
Henrik Rydgård
d618b3673b Count readbacks in a frame and show in GPU debug stats. 2017-11-08 11:57:53 +01:00
Henrik Rydgård
ea2fc55217
Merge pull request #10056 from hrydgard/remove-multithreading-2
Remove the old style multithreading
2017-11-06 20:37:06 +01:00
Unknown W. Brackets
cd6249d080 D3D11: Show FBO-as-texture in GE debugger. 2017-11-05 18:41:24 -08:00
Henrik Rydgård
8c69be9bfa Get rid of GPUCommon's "Internal" functions. 2017-11-05 23:21:52 +01:00
Henrik Rydgård
26e52ca5e8 Get rid of a bunch of sync stuff that's no longer needed. 2017-11-05 23:21:49 +01:00
Unknown W. Brackets
78b5565035 GPU: Properly Release() FBOs.
In case we end up wanting to use those reference counts, let's use the
right API.
2017-11-05 12:45:02 -08:00
Henrik Rydgård
5d0bd85a70 Unify a little bit of depal code. 2017-11-05 10:40:21 +01:00
Henrik Rydgård
d670948ad2 Cleanups and fixes around Vulkan stencil upload. thx unknown 2017-11-05 10:14:44 +01:00
Henrik Rydgård
5018e400f2 Remove some code duplication 2017-11-01 14:51:15 +01:00
Henrik Rydgård
330bdb8be8 Add and update some comments. 2017-11-01 08:42:49 +01:00
Henrik Rydgård
65e23bb9f3 Some reorganization. Start implementing framebuffer depal for Vulkan. 2017-10-31 12:34:31 +01:00
Henrik Rydgård
7312576239 More buildfixes, warning fix, memory leak fix 2017-10-26 11:43:22 +02:00
Henrik Rydgård
b886efe8f5 Another minor cleanup (DescribeCodePtr) 2017-10-20 11:06:12 +02:00
Henrik Rydgård
4a30aedc53 Unify and move around code to cleanup some debug accessors 2017-10-18 13:10:05 +02:00
Henrik Rydgård
d53c88456a Unify GetFramebufferList() (trivial) 2017-10-18 12:49:15 +02:00
Henrik Rydgård
898716cc26 Unify DownloadFramebufferForClut 2017-10-18 12:34:01 +02:00
Henrik Rydgård
981c49615c Unify FlushBeforeCopy. Remove old dummy methods from Vulkan framebuffer manager. 2017-10-18 12:26:02 +02:00
Henrik Rydgård
4e3a9bc3e3 Unify some more framebuffer functions. Leave the GL stuff alone for now due to async. 2017-10-18 11:20:58 +02:00
Henrik Rydgård
f2ea0ce472 Unify (well, almost) GetOutputFramebuffer (D3D11/GL) 2017-10-18 10:54:26 +02:00
Henrik Rydgård
214270d192 Unify GetDepthBuffer/GetStencilBuffer in GL/D3D11 2017-10-18 10:54:26 +02:00
Henrik Rydgård
f220c74037 Remove comment, add check. 2017-10-16 16:28:27 +02:00
Henrik Rydgård
9b1ee6fce6 Unify GetFramebuffer in GLES and D3D11.
D3D9 is left behind for now, and Vulkan still needs implementation - got a branch with initial work towards that.
2017-10-11 13:39:34 +02:00
Henrik Rydgård
62972cb891 D3D11: Move to CopyFramebufferToSync where easily possible. 2017-10-11 13:34:31 +02:00
Henrik Rydgård
5bbe0eb69a Move GL readback to a Thin3D abstraction 2017-10-10 14:48:58 +02:00
Unknown W. Brackets
72e0a24724 GPU: Reset shader state on shader reset.
Was ending up with lastFSID being -1, but being used.

Seen in gpu/commands/blend test.
2017-09-20 08:37:54 -07:00
Henrik Rydgård
6a1fa728d8 Remove Globals.h 2017-08-31 17:15:22 +02:00
Henrik Rydgård
2f85e6516e Minor optimizations (use the new hashmap in a few more places) 2017-08-20 19:18:46 +02:00
Henrik Rydgård
10cebb4195 32-bit buildfix 2017-08-20 15:33:53 +02:00
Henrik Rydgård
e0e13e191f Replace the most critical unordered_maps and maps with two new maps: FastHashMap and PrehashMap. 2017-08-20 11:30:19 +02:00
Henrik Rydgård
d60bb27cd9 Merge pull request #9906 from hrydgard/fastrunloop-optimize
GPU FastRunLoop optimizations
2017-08-17 16:25:15 +02:00
Henrik Rydgård
5680332343 Minor cleanups 2017-08-17 15:20:21 +02:00
Henrik Rydgård
2c4e5e2303 Fastpath in fastrunloop when diff=0. Remove need for Execute for UV scale/offset. 2017-08-17 15:20:16 +02:00
Henrik Rydgård
71baecabd6 Make FLAG_FLUSHBEFORE a no-op, move flushes into the execution functions.
It would only be necessary if we needed the previous value, which we
don't do in any of these.
2017-08-17 15:20:10 +02:00
Henrik Rydgård
5e788ffadf Implement vertex caching for Vulkan. 2017-08-17 11:22:45 +02:00
Henrik Rydgård
50d771961b Vulkan: More minor optimization (avoid pipeline cache lookups when possible) 2017-08-15 16:01:50 +02:00
Henrik Rydgård
983bb3bd0f Can't dirty VERTEXSHADER_STATE before the flush in Execute_VertexTypeSkinning, causes obscure bugs when software skinning is enabled 2017-08-15 14:27:54 +02:00
Henrik Rydgård
4e7099bf47 Vulkan: Fix some more state dirtying issues. 2017-08-15 10:51:44 +02:00
Henrik Rydgård
5a65334646 Use dirty-flags more in Vulkan state setting 2017-08-14 15:14:46 +02:00
Unknown W. Brackets
ca40282a10 Dirty on various framebuf state helpers.
Ideally we should cut down on using DisableState(), or restore afterward.
2017-08-14 11:36:07 +02:00
Henrik Rydgard
078e1151f9 Dirty-flag the fragment shader ID. 2017-08-14 11:36:07 +02:00
Unknown W. Brackets
f1cf92988f Dirty things on stencil buffer upload. 2017-08-14 11:36:06 +02:00
Unknown W. Brackets
c84efcfc97 Dirty vertexshader state on hw bezier/spline. 2017-08-14 11:36:06 +02:00
Henrik Rydgard
56cd991833 All: Only recompute the vertex shader ID when dirty 2017-08-14 11:36:06 +02:00
Henrik Rydgard
f01da87ab2 D3D11: Make better use of the dirty flags to avoid state calls 2017-08-14 11:36:03 +02:00
Henrik Rydgard
4e55654522 Add some missing VIEWPORTSCISSOR dirtying. 2017-08-14 11:35:11 +02:00
Henrik Rydgard
1098bf7342 All: Only convert viewportscissor state if dirty 2017-08-14 11:14:26 +02:00
Henrik Rydgard
e439055a32 All: Only convert raster state if dirty 2017-08-14 11:14:26 +02:00
Henrik Rydgard
e2b179d6e2 All: Only convert depth stencil state if dirty 2017-08-14 11:14:26 +02:00
Henrik Rydgard
e4567c694c All: Only convert blend state if "dirty" 2017-08-14 11:14:26 +02:00
Unknown W. Brackets
c724df5f52 D3D11: Fix texture scaling with blank first half.
This would cause some textures to become blank.  Fixes #9813.
2017-07-01 16:10:00 -07:00
Henrik Rydgård
dfdf54813a Port a small simplification to D3D9 2017-06-09 14:53:06 +02:00
Henrik Rydgård
5f6e0feacb D3D11: Fix Star Ocean again (wasn't clearing stencil properly) 2017-06-09 14:50:39 +02:00
Unknown W. Brackets
4a56e6ff83 GE Debugger: Fix recording in softgpu. 2017-06-04 10:38:58 -07:00
Unknown W. Brackets
dca75437c3 GPU: Refactor common frame dumping code. 2017-06-03 15:29:07 -07:00
Henrik Rydgård
14a80968cf Unify transformed arrays 2017-06-03 18:05:21 +02:00
Henrik Rydgård
1abb8792ab Unify ComputeMiniHash 2017-06-03 18:05:18 +02:00
Henrik Rydgård
3032240916 Unify DecodeVertsStep 2017-06-03 18:04:46 +02:00
Henrik Rydgård
240e058b3b Some unification in DrawEngine 2017-06-03 18:03:56 +02:00
Henrik Rydgård
0ac979505c Fixes for D3D11 postprocessing 2017-06-02 17:04:08 +02:00
Henrik Rydgård
6169fa289a Merge pull request #9769 from hrydgard/vulkan-sw-skinning
Implement software skinning for the Vulkan backend.
2017-06-02 12:15:56 +02:00
Henrik Rydgård
665a2c04cb Implement software skinning for the Vulkan backend. Fixes #9753 2017-06-02 11:47:14 +02:00
Unknown W. Brackets
5190ad7aa2 GLES: Copy only depth in BlitFramebufferDepth.
Otherwise we get glitched rendering in some games - see #9740.
2017-06-01 20:57:08 -07:00
Henrik Rydgård
7822e5b57f Merge pull request #9755 from unknownbrackets/mipmaps
GPU: Block mipmap autogen for matching size
2017-06-01 09:04:36 +02:00
Unknown W. Brackets
f1e9180676 Vulkan: Fix Cardboard rendering.
Mostly the Viewport2D flush issue, which may possibly have broken
something else.
2017-05-31 23:26:38 -07:00
Unknown W. Brackets
f66ffb9ffe GPU: Fix negative mip levels with const workaround.
Might've crashed if it hit a negative level before.
2017-05-31 21:42:07 -07:00
Unknown W. Brackets
b6375638f5 GPU: Block mipmap autogen for matching size.
If the mips don't get smaller, we can't autogen - the bias in that case is
used to select a different texture.  Fixes #9731.

This also may improve a minor performance issue on PowerVR in some games.
2017-05-31 21:23:20 -07:00
Henrik Rydgård
2b14c6b531 Delete obsolete function ClearBuffer 2017-05-31 13:38:22 +02:00
Henrik Rydgård
44423f3ba2 Vulkan: Implement BlitFramebuffer 2017-05-30 09:38:09 +02:00
Henrik Rydgård
e8890e3c4a Address a bunch of review comments. 2017-05-30 09:36:17 +02:00
Henrik Rydgård
6bcfe539f7 Use vulkan-style clear-on-bind when switching render targets. Not optimally used yet.
Also removes a bunch of redundant render target binds.
2017-05-30 09:36:17 +02:00
Henrik Rydgård
35aefe4a2a BindBackBufferAsRenderTarget is now replaced with BindFramebufferAsRT(nullptr) 2017-05-30 09:36:17 +02:00
Henrik Rydgård
1b05a54800 Remove the Mipmap setting. One step forward for #8171 2017-05-26 10:21:20 +02:00