Henrik Rydgård
2aa9ee97f4
Simplify shader blend logic in FragmentShaderGenerator.cpp
2020-11-08 12:54:05 +01:00
Henrik Rydgård
d81522af11
Address feedback.
2020-11-08 11:32:55 +01:00
Henrik Rydgård
9105249901
Add compat flag for reinterpret shader, also disable on platforms that can't support it yet
2020-11-08 11:32:55 +01:00
Henrik Rydgård
4e16fcaf1a
Fix reinterpret shader for D3D11
2020-11-08 11:32:55 +01:00
Henrik Rydgård
28f8578408
Cleanup reinterpret shader resources in FramebufferManagerCommon::DeviceLost().
2020-11-08 11:32:55 +01:00
Henrik Rydgård
96c36d5c10
More work on reinterpret. Get Vulkan running
2020-11-08 11:32:55 +01:00
Henrik Rydgård
981d0a2abe
Reinterpret the data when binding a framebuffer with a different 16-bit format.
...
Car reflections in Outrun are better (see #11358 ) but have some
blue/yellow color garbage that will need a different fix.
2020-11-08 11:32:55 +01:00
Henrik Rydgård
1ccc8c129c
Reinterpret code runs, no idea if it works
2020-11-08 11:32:55 +01:00
Henrik Rydgård
f2e315b9a6
More shadergen work
...
Buildfix
2020-11-08 11:32:53 +01:00
Henrik Rydgård
19b4febbbf
More reinterpret shader gen and test work.
...
More work on reinterpret
Buildsystem fixes
2020-11-08 10:41:20 +01:00
Henrik Rydgård
614540aa6e
Merge pull request #13634 from hrydgard/device-lost-improvements
...
Device lost improvements, unify BindFramebufferAsColorTexture
2020-11-07 19:47:35 +01:00
Henrik Rydgård
106fc70a75
Forgot a line in caa960ee8e
2020-11-07 11:25:05 +01:00
Henrik Rydgård
c23ed09a32
Unify FramebufferManager::BindFramebufferAsColorTexture
2020-11-07 11:10:54 +01:00
Henrik Rydgård
a24f4e3e70
Start unifying BindFramebufferAsColorTexture
2020-11-07 11:03:53 +01:00
Henrik Rydgård
d9ee06a60d
Reorganize the DeviceLost code a little. FramebufferManagerCommon now sees it.
2020-11-07 10:51:54 +01:00
Henrik Rydgård
e37468700d
Remove some accidentally added lines
2020-11-07 00:57:26 +01:00
Henrik Rydgård
caa960ee8e
GLSL ES compilers can be very picky about uint/int. Fixes #13628 - for real this time hopefully
2020-11-07 00:32:00 +01:00
Henrik Rydgård
381ca11561
Fix bugs caused by 44ec286ba4
2020-11-06 21:50:16 +01:00
Henrik Rydgård
7a690f177e
Move shader language feature detection to the draw context.
2020-11-06 09:11:57 +01:00
Henrik Rydgård
44ec286ba4
Framebuffer: Keep the render scale factor around, no need to recompute it.
2020-11-06 09:11:57 +01:00
Henrik Rydgård
225734c0b3
Partially revert "Remove remnants of an old, no longer applicable readback optimization"
...
This reverts commit 7b2236778b
.
Fixes #13628
2020-11-06 09:09:18 +01:00
Henrik Rydgård
3c5a05acb3
Buildfix
2020-11-05 18:25:14 +01:00
Henrik Rydgård
84037f448e
Remove colorDepth property of framebuffers. They're all 8888.
2020-11-05 14:51:46 +01:00
Henrik Rydgård
7b2236778b
Remove remnants of an old, no longer applicable readback optimization
2020-11-05 14:38:20 +01:00
Henrik Rydgård
127cf41480
Fix bug in framebuffer naming
2020-11-05 08:51:29 +01:00
Henrik Rydgård
d39badc8c1
Inline "OptimizeDownloadRange" to make the code more readable
2020-11-05 08:50:16 +01:00
Henrik Rydgård
6db943e831
Merge the two ShaderStage enums
2020-11-05 08:34:35 +01:00
Henrik Rydgård
207b76da6e
Show an error on screen if a shader fails to compile.
...
Part of #1 investigation of #13541
2020-11-05 08:27:13 +01:00
Henrik Rydgård
03e8eac6ef
Merge the two ShaderLanguage enums.
2020-11-04 09:40:11 +01:00
Henrik Rydgård
733a152c54
Move ShaderWriter to Common/GPU, along with some stuff from ShaderCommon.h.
2020-11-04 09:18:35 +01:00
Henrik Rydgård
88e772cdf7
GLSL ES: Extensions must go first. Fixes #13620
2020-11-03 19:53:02 +01:00
Henrik Rydgård
3e6d121016
Partially revert "Clarify some logic, improve framebuffer names"
...
I screwed up a couple things.
Fixes #13619
This reverts commit 32eb882bc6
.
2020-11-03 11:39:12 +01:00
Unknown W. Brackets
f3415f4f9c
GPU: Correct shader blend equations.
...
This was wrong when ported to HLSL, and then ported back everywhere.
2020-11-02 21:56:43 -08:00
Henrik Rydgård
21830d4984
Bugfix last commit
2020-11-02 16:22:20 +01:00
Henrik Rydgård
ce4ee010ac
Apparently only MSVC can handle the ambiguity.
2020-11-02 11:45:47 +01:00
Henrik Rydgård
97e8d5b93b
Buildfix the rest of the platforms
2020-11-02 10:37:11 +01:00
Henrik Rydgård
0292d1719d
GEDebugger: Use utf-8 internally.
2020-11-02 10:02:52 +01:00
Henrik Rydgård
39b5eb5b3d
ShaderWriter, a replacement for the sprintf WRITE macro.
2020-11-02 10:02:52 +01:00
Henrik Rydgård
291742535b
Safety, comments
2020-11-02 10:02:52 +01:00
Henrik Rydgård
32eb882bc6
Clarify some logic, improve framebuffer names
2020-11-02 10:02:49 +01:00
Henrik Rydgård
085900adb5
Fix vertex shader generator bug. Got caught by the new test
2020-11-02 09:03:08 +01:00
Henrik Rydgård
f4ea3ccf22
Move the generic vertex shader generator into GPU/Common and rename it.
2020-11-01 19:58:54 +01:00
Henrik Rydgård
be837912e1
Delete the HLSL shader generator, switch to the newly generic one.
2020-11-01 19:58:54 +01:00
Henrik Rydgård
30b1aafcde
Another hlsl compatibility fix
2020-11-01 19:58:54 +01:00
Henrik Rydgård
17778131bd
Share the uniform buffer declarations between D3D11 and VK.
2020-11-01 19:58:53 +01:00
Henrik Rydgård
f1dbd25de9
Fix remaining differences between generated shaders
2020-11-01 19:58:53 +01:00
Henrik Rydgård
642f2004d3
Start working on getting tess to match
2020-11-01 19:58:53 +01:00
Henrik Rydgård
ba7c2e856b
Fix through mode differences
2020-11-01 19:58:50 +01:00
Henrik Rydgård
9b3662460c
Make the lighting code match
2020-11-01 19:58:50 +01:00
Henrik Rydgård
8efb40180e
Make the hardware skinning code match
2020-11-01 19:58:50 +01:00
Henrik Rydgård
b6992e428b
More HLSL work. Some vertex shaders are starting to pass.
2020-11-01 19:58:50 +01:00
Henrik Rydgård
fbb7f72eec
Vertex shader merge work
2020-11-01 19:58:45 +01:00
Henrik Rydgård
105a6ce920
Oops, seems I screwed those #version statements up worse.
2020-11-01 19:53:08 +01:00
Henrik Rydgård
4053c3d1ec
Fix #version statement for GLES 2.0 vertex shaders
2020-11-01 19:42:33 +01:00
Henrik Rydgård
2e9f42a75f
Fix #version statement in GLES 2 fragment shaders
2020-11-01 18:06:56 +01:00
Henrik Rydgård
0938d495d9
Remove a redundant bit from vertex shader IDs.
...
(complicates automated testing of shader generation)
Should have no noticeable effects.
2020-11-01 11:48:55 +01:00
Henrik Rydgård
fb785f5f0d
Fix an old inconsistency between D3D9 and D3D11 projection matrices.
2020-11-01 11:35:46 +01:00
Henrik Rydgård
d32fc34b2b
Remove inPrefix. HLSL shaders gets slightly longer but probably no biggie.
...
The extra variable should be optimized out anyway.
Tried doing it with the preprocessor, couldn't get it to work.
2020-10-31 23:22:06 +01:00
Henrik Rydgård
042f799573
Fix silly issue in vertex shader gen
2020-10-31 22:59:38 +01:00
Henrik Rydgård
0b1b36921e
Move the now-renamed fragment shader generator to GPU/Common.
2020-10-31 19:03:14 +01:00
Henrik Rydgård
2f1bbd314e
Fragment shader gen: Remove unnecessary allocations
2020-10-31 18:32:43 +01:00
Henrik Rydgård
7a63b5e69e
Cleanup
2020-10-31 18:32:43 +01:00
Henrik Rydgård
3d0630c04a
Remove the HLSL fragment shader generator. The GLSL one can now do its job.
2020-10-31 18:32:43 +01:00
Henrik Rydgård
c311eeaf7d
Switch D3D9 too to the glsl shader generator
2020-10-31 18:32:43 +01:00
Henrik Rydgård
cf1a5e2c67
Switch D3D11 over to use the GLSL fragment shader generator
2020-10-31 18:32:43 +01:00
Henrik Rydgård
8d70fd269e
Minor D3D9 fixes
2020-10-31 18:32:43 +01:00
Henrik Rydgård
b7d674411e
Test parsing of generated OpenGL shaders too (by using glslang).
2020-10-31 18:32:43 +01:00
Henrik Rydgård
44c57d87f4
Get D3D9 fragment shader generation to parity
2020-10-31 18:32:43 +01:00
Henrik Rydgård
a2ed609e90
HLSL fix
2020-10-31 18:32:43 +01:00
Henrik Rydgård
c2a6090c3f
More D3D9 fixes.
2020-10-31 18:32:43 +01:00
Henrik Rydgård
af4d6e7642
Set up the test for D3D9, start fixing stuff.
2020-10-31 18:32:43 +01:00
Henrik Rydgård
b070ed45e9
Evolve the HLSL and GLSL fragment shader generators even closer together.
2020-10-31 18:32:42 +01:00
Henrik Rydgård
b4a76a9f09
Change fragment shader output to work the same in GLSL and HLSL.
2020-10-31 18:32:42 +01:00
Henrik Rydgård
d833b5985d
Make discard work the same way in the HLSL shader generator.
2020-10-31 18:32:42 +01:00
Henrik Rydgård
984a4d2641
Start adding HLSL support to the GLSL shader generator.
2020-10-31 18:32:42 +01:00
Henrik Rydgård
200c25bcc9
wip
2020-10-31 18:32:42 +01:00
Henrik Rydgård
92d73e3b03
HLSL: Use #define to switch to glsl-like vector types.
2020-10-31 18:32:42 +01:00
Henrik Rydgård
5ee9cfef0d
Remove support for D3D11_level_9 (previously only really used for Windows Phone, probably).
...
Can always fall back to D3D9, which is not going away anytime soon and
still needs to be there. One less HLSL variant to care about.
2020-10-29 00:52:19 +01:00
Henrik Rydgård
8b2aeade15
Fix checks for fragment test cache in GLES fragment shader generator
2020-10-28 23:51:22 +01:00
Henrik Rydgård
71706724e1
Somehow forgot to delete VertexShaderGeneratorVulkan.cpp
2020-10-26 09:59:16 +01:00
Henrik Rydgård
148d3b72e5
Use splat3(x) liberally (converts to vec3(x) on GLES, vec3(x,x,x) on D3D)
...
Prep for merging the HLSL and GLSL generators.
2020-10-25 08:34:35 +01:00
Henrik Rydgård
2977c56a12
Complete the vertex shader merge, deleting the Vulkan-specific vertex shader generator.
2020-10-25 08:34:35 +01:00
Henrik Rydgård
fb2ac3a67e
Additional fixes
2020-10-25 08:34:35 +01:00
Henrik Rydgård
69c8912b93
More tess fixes
2020-10-25 08:34:35 +01:00
Henrik Rydgård
6055350a2c
Initial work on fixing tess
2020-10-25 08:34:35 +01:00
Henrik Rydgård
7532116b69
Fix additional minor differences
2020-10-25 08:34:35 +01:00
Henrik Rydgård
a8f4a4d749
Fix more vertex shader differences
2020-10-25 08:34:35 +01:00
Henrik Rydgård
057fd9f8a3
Bridge more vertex shader differences
2020-10-25 08:34:35 +01:00
Henrik Rydgård
22b26ffc09
Time for the vertex shaders. Set up a test, start eliminating differences.
2020-10-25 08:34:35 +01:00
Henrik Rydgård
254c316b10
Merge pull request #13570 from hrydgard/gl-allow-wrap-framebuffers
...
GL: Allow texture wrapping on framebuffers
2020-10-23 22:41:10 +02:00
Henrik Rydgård
020fb55a65
Completes the merge, deleting the Vulkan-specific fragment shader generator.
2020-10-23 10:03:44 +02:00
Henrik Rydgård
56ddd597c1
Fix more tiny differences. The fragment shader generators now match!
2020-10-23 10:03:44 +02:00
Henrik Rydgård
fe8691fba7
Fix additional differences
2020-10-23 10:03:44 +02:00
Henrik Rydgård
aea4635d60
Fix minute differences between the shader generators found by the new tester
2020-10-23 10:03:44 +02:00
Henrik Rydgård
ef18938aa0
Hack up a test comparing Vulkan fragment haders generated by the GL GLSL generator to the ones generated by the Vulkan generator.
2020-10-23 10:03:44 +02:00
Henrik Rydgård
9e245d6835
OpenGL: Share the shader version detection.
...
Use a version integer instead of a string
2020-10-23 10:03:44 +02:00
Henrik Rydgård
c45515866b
Cleanup
...
Clean up GLSL language setup further
2020-10-23 10:03:44 +02:00
Henrik Rydgård
2917b0e9e6
GLES: Read compat params first, emit code later.
2020-10-23 10:03:44 +02:00
Henrik Rydgård
e30de2f6a5
More splat3
2020-10-23 10:03:44 +02:00
Henrik Rydgård
43ce4e7493
Remove an unmotivated ifdef. Additional cleanup
2020-10-22 00:10:21 +02:00
Henrik Rydgård
2c0a3c2e23
Prepare for more GLSL testing
2020-10-21 23:39:34 +02:00
Henrik Rydgård
3d36049b65
Rename shader generator functions, a bit of moving around and adding an errorString param.
2020-10-21 23:20:25 +02:00
Henrik Rydgård
c6f51bbc1e
Add brute force shader generator tester. Tests D3D11 and Vulkan shaders.
...
Found a potential error with tesselation without normals already.
2020-10-21 23:20:15 +02:00
Henrik Rydgård
712f56fb7d
Vulkan: remove array indexing for light parameters to match the other backends
2020-10-21 23:20:11 +02:00
Henrik Rydgård
391d2ea73d
Rename vk uniforms to match the other backends
2020-10-21 21:13:08 +02:00
Henrik Rydgård
92e1dce2db
Error handling fixes
2020-10-18 20:26:19 +02:00
Henrik Rydgård
e80a526015
D3D11: Implement depth texturing. Fixes, for D3D11, #6411 .
2020-10-18 20:14:25 +02:00
Henrik Rydgård
6cc8c2ebc1
Merge pull request #13328 from hrydgard/libretro-fixes
...
Fix libretro with Vulkan
2020-10-14 22:08:11 +02:00
Henrik Rydgård
b8e8325888
Fix text issue in God Eater Burst. Forgot that games can allocate texture in volatile memory too.
...
We considered any texture from kernel memory "reliable", which is wrong
since games can allocate out of the upper half of kernel RAM, which is
called "volatile" memory.
Fixes issue #13511
2020-10-14 00:09:08 +02:00
aliaspider
1aff9b3e2b
Vulkan: fix stack overflow.
2020-10-13 06:05:30 +01:00
Henrik Rydgård
332bb7feeb
VK: Whenever safely possible, shrink the render area.
...
We just set the render area to the union of the scissor rects used in a pass.
Might help some games on some mobile hardware, a little bit.
Possibly #13464 ?
2020-10-11 23:23:25 +02:00
Henrik Rydgård
495fd9a13c
Fix OpenGL crash introduced in #13536
2020-10-11 22:34:37 +02:00
Henrik Rydgård
ced83b4785
Libretro/VK: Add a README for debugging, so I don't forget. Minor cleanups.
2020-10-11 19:06:09 +02:00
Henrik Rydgård
afb35c3be3
Fix GPU profile display on notched screens
2020-10-11 19:04:35 +02:00
Henrik Rydgård
5ece3de8ba
Track and accumulate pipeline flags for render passes.
...
(Information that will later let us make some interesting optimizations)
2020-10-11 12:22:25 +02:00
Henrik Rydgård
940611fe65
Remove the USE_GENERAL_LAYOUT_FOR* debug defines.
2020-10-11 11:06:54 +02:00
Henrik Rydgård
dc0f7ca8ee
VK: Copy depth buffer if we can't blit. Some GPUs can't blit to depth.
...
Fixes some recent issues with Intel GPUs on Vulkan.
2020-10-11 10:57:35 +02:00
Henrik Rydgård
b28baed7d3
Create a safer variant of BlockTransferAllowCreateFB, enable for FF Type 0
...
Performance improvement by avoiding unnecessary readbacks.
New one is called IntraVRAMBlockTransferAllowCreateFB.
This one only allows intra-VRAM block transfers to happen on-GPU, such as the one this
game uses for bloom. Good chances to avoid missing stuff that actually requires
real readback, if there's any.
2020-10-10 23:59:51 +02:00
shenweip
a66cb1237d
Warning fixes.
2020-10-10 19:18:46 +02:00
Henrik Rydgård
93e327ab78
Vulkan: Automatically generate mipmaps for replacement textures.
2020-10-05 22:36:55 +02:00
Henrik Rydgård
886a8b1ac6
Remove Timer.cpp/h. Move various collections into Common/Data/Collections.
2020-10-05 21:05:23 +02:00
Henrik Rydgård
4310e35714
Windows: Remove the native project.
2020-10-05 06:56:10 +02:00
Henrik Rydgård
0e3a84b4a8
Move most GPU things to Common.
...
It works after the move, on Windows and Android at least.
Deletes the D3DX9 shader compiler loader, which was not used.
2020-10-04 23:39:02 +02:00
Henrik Rydgård
4f43cff5ca
Move fileutil, net, image loaders, ui to Common. ( #13506 )
...
* Move and rename file_util/fd_util to Common/File/FileUtil and DirListing
Let's also move net while we're at it.
Move the ZIM/PNG loaders over to Common.
Move the UI framework into Common
iOS buildfix
* Buildfix
* Buildfixes
* Apple buildfix
* This typo again..
* UWP buildfix
* Fix build of PPSSPPQt, such as it is (it's not in good condition...)
* Guess what? Another buildfix.
2020-10-04 20:48:47 +02:00
Henrik Rydgård
f01ba6dc84
Move NativeApp.h to Common/System, split into NativeApp.h and System.h
...
Buildfix
2020-10-04 11:42:16 +02:00
Henrik Rydgård
b7edf75437
Move Display.cpp/h to Common.
2020-10-04 11:42:16 +02:00
Henrik Rydgård
821817e6d4
Move the profiler to Common
2020-10-04 11:42:16 +02:00
Henrik Rydgård
989e353482
Common.h shouldn't include Log.h.
...
Buildfixes
More buildfixes. Move JSON code to common.
2020-10-04 11:42:14 +02:00
Henrik Rydgård
9e41fafd0d
Move math and some file and data conversion files out from native to Common.
...
Buildfixing
Move some file util files
Buildfix
Move KeyMap.cpp/h to Core where they belong better.
libretro buildfix attempt
Move ini_file
More buildfixes
2020-10-04 09:12:46 +02:00
Henrik Rydgård
ff8148dd92
Move native/util, native/data and native/i18 to Common/Data.
...
Also move colorutil.cpp/h
linking build fix experiment
Delete a bunch of unused CMakeLists.txt files
CMakeLists.txt linking fix
Don't include NativeApp.h from any headers.
Android.mk buildfix
Half of the UWP fix
Buildfix
Minor project file cleanup
Buildfixes
Guess what? More buildfixes!
2020-10-04 07:28:29 +02:00
Henrik Rydgård
3162f30158
Merge base/basictypes.h into Common/Common.h (mostly).
2020-09-29 15:51:51 +02:00
Henrik Rydgård
ed88761ecc
Merge ext/native/stringutil.cpp/h into Common/StringUtils.cpp/h.
2020-09-29 15:51:51 +02:00
Henrik Rydgård
536d881626
Very minor optimization (divisions by constants are faster unsigned)
2020-09-29 00:36:29 +02:00
Henrik Rydgård
6fb0e92de3
Fix issue with duplicate texture dumps.
...
Fixes #13487 .
2020-09-29 00:30:08 +02:00
barbudreadmon
a8dd3ef553
fix #13471
2020-09-27 16:38:24 +02:00
Henrik Rydgård
054acf768c
Don't cache time in a variable.
...
A little weirdness in the code that has stuck around for a long, long
time. It's really not necessary and mostly just confusing.
2020-09-24 23:52:43 +02:00
Henrik Rydgård
4cfafb4605
Some GPU code cleanup. Disable some unnecessary reporting.
2020-09-24 23:01:23 +02:00
Henrik Rydgård
2a2a4a21d9
More cleanup
2020-09-24 10:03:07 +02:00
Henrik Rydgård
deedc7a1fe
Cleanup
2020-09-24 09:49:28 +02:00
Henrik Rydgård
d8ddef150f
IndexGenerator::AddStrip: Avoid the fallback by writing a few extra indices if necessary.
...
Actually a decent boost.
2020-09-24 09:36:39 +02:00
Henrik Rydgård
be54050521
Also optimize IndexGenerator::AddStrip for ARM NEON.
2020-09-24 09:24:03 +02:00
Henrik Rydgård
df9a5cc0f2
Buildfix
2020-09-24 02:09:39 +02:00
Henrik Rydgård
1a2597a513
SSE-optimize IndexGenerator::AddStrip. Shaves about half a percent from GoW.
2020-09-24 02:03:15 +02:00
Henrik Rydgård
a9fef066b5
Reduce string allocations in Vulkan memory allocator
2020-09-24 00:32:52 +02:00
Henrik Rydgård
b8ab04f53d
Remove some reporting that's normally just the result of garbage-as-display-list-execution.
2020-09-22 21:57:51 +02:00
Henrik Rydgård
5ac6a9b3fd
Fix slowdowns due to careless use of auto
2020-09-22 21:24:16 +02:00
Henrik Rydgård
3e3a40da8c
Mark the PPGe font texture as reliable to avoid hashing it.
2020-09-22 21:13:30 +02:00
Henrik Rydgård
4ccde48485
Merge pull request #12924 from iota97/user-chain
...
Postprocessing: User chain support
2020-09-22 09:20:51 +02:00
Henrik Rydgård
a0251eae27
Merge pull request #13456 from hrydgard/tex-fixes-3
...
More code cleanup in texture cache
2020-09-21 11:17:06 +02:00
Henrik Rydgård
8192f5174c
Quick fix for #13459
2020-09-21 10:31:14 +02:00