Commit Graph

3761 Commits

Author SHA1 Message Date
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
Lubos
cb6448ff2d Merge branch 'master' into feature_openxr_6dof 2022-08-02 21:01:05 +02:00
Lubos
4814bed7df OpenXR - HUD support added 2022-08-02 20:58:16 +02:00
Henrik Rydgård
770cb49f94 GLES: FramebufferBlit: Don't blit if the target is the current framebuffer. 2022-08-02 14:57:20 +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
Lubos
2103874c0f OpenXR - Estimate world unit scale 2022-08-01 19:28:50 +02:00
Lubos
4a3f809588 OpenXR - Head orientation in some games fixed 2022-08-01 17:47:24 +02:00
Henrik Rydgård
73fc9fb520 OpenGL fix 2022-08-01 11:57:22 +02:00
Lubos
e6b14cb473 OpenXR - 6DoF head movement support added 2022-07-31 20:05:08 +02:00
Lubos
8117f05395 OpenXR - Renderer support for axis mirror added 2022-07-31 19:08:47 +02:00
Lubos
d129870d44 Merge branch 'master' into feature_openxr_6dof 2022-07-31 16:37:54 +02:00
Henrik Rydgård
c158414858 Give the mip bias its own uniform flag. 2022-07-31 10:43:48 +02:00
Henrik Rydgård
fecf9127a0 Implement 3D texturing in the OpenGL backend too. Assorted fixes. 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
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
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
167b837ed3 Break out the preparation part of BuildTexture from GLES 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
ae6763766e Get the GLES BuildTexture slightly closer 2022-07-30 10:44:02 +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
Lubos
60d8a102f9 OpenXR - Switching between 2D/VR fixed 2022-07-29 10:19:11 +02:00
Lubos
d29b9011db OpenXR - VR settings added, better UI detection 2022-07-27 19:47:11 +02:00
Lubos
9b8a9d3b32 Merge branch 'feature_openxr_quest' into feature_openxr_6dof 2022-07-26 18:00:40 +02:00
Lubos
5c95fd244f OpenXR - Automatically switch between fullscreen/VR 2022-07-26 17:20:46 +02:00
Lubos
0c208d192b OpenXR - Basic look around implementation 2022-07-25 18:47:54 +02:00
Henrik Rydgård
f523341351 Remove unnecessary parameters from MakePixelsTexture 2022-07-24 13:54:09 +02:00
Henrik Rydgård
9ffb248e59
Merge pull request #15646 from unknownbrackets/report-vertex
Reporting: Log when vertex count truncated
2022-07-04 23:23:36 +02:00
Unknown W. Brackets
efacbddaef Reporting: Log when vertex count truncated. 2022-07-04 13:22:17 -07:00
Unknown W. Brackets
feddff8299 GLES: Fix sw transform flip in skip buffer mode.
Was causing some things to be drawn in the wrong places and upside down.
2022-06-05 11:31:07 -07: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
c52a5e9e25 Fix checks for the "fake mipmap" situation.
Fixes #15492
2022-04-22 22:59:20 +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
Henrik Rydgård
f1cd1d535b Add a hidden setting to turn off the shader cache, for shader compile performance work 2021-11-21 21:25:56 +01: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
Henrik Rydgård
b88d676f78 Remove the vertex cache from the OpenGL backend.
It was disabled for a very long time, and now that we've re-enabled it, it
mostly causes problems.

Not feeling like debugging it on weird hardware, I think it's better
to focus energy on other optimizations.
2021-11-06 00:45:43 +01: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
Henrik Rydgård
8a718a8202
Merge pull request #15072 from unknownbrackets/guardband
Implement depth culling in software transform
2021-10-31 17:29:41 +01:00
Henrik Rydgård
3bf6b140c7 Don't forget to check for bufferedRendering before enabling screen rotation in the shader. 2021-10-31 13:35:13 +01:00
Unknown W. Brackets
5128480d74 GPU: Implement cull behavior in sw transform. 2021-10-30 21:04:16 -07:00
Unknown W. Brackets
e688bb2cdf GPU: Correct software transform projection.
Now reading the new fog value.
2021-10-30 18:23:58 -07:00
Unknown W. Brackets
4ec75de0e7 GPU: Add fog separately for swtransform verts.
At this point, still being processed wrong, this just changes the
attribute structure.
2021-10-30 18:22:54 -07:00
Unknown W. Brackets
b87451de92 GPU: Restore rotation handling in sw transform. 2021-10-30 18:22:53 -07:00
Unknown W. Brackets
159eab5141 GPU: Set projection matrix per backend.
There's a bit of variance, so this keeps the central code clean.
2021-10-30 18:20:36 -07:00
Unknown W. Brackets
f35c7d04bd GPU: Update viewport params before sw transform. 2021-10-30 18:19:16 -07:00
Unknown W. Brackets
3730460bc5 GPU: Move swtransform flippedY to params. 2021-10-30 18:17:22 -07:00
Henrik Rydgård
edc4e69c3d
Merge pull request #15025 from unknownbrackets/texreplace-pop
Allow delayed loading of texture replacements
2021-10-25 23:31:30 +02:00
Unknown W. Brackets
5557950a4b GPU: Allow range cull on Mali/etc.
Previously had been disabled when cullDistance/clipDistance were
unsupported, but it's still helpful without those.  See #15049.
2021-10-23 08:43:14 -07:00
Unknown W. Brackets
83b7b33cfd Replacement: Centralize lookup logic.
And make sure we don't change our minds about using a replacement during a
draw.
2021-10-21 17:05:38 -07:00
Unknown W. Brackets
2356280a9c Replacement: Add structure for delayed loading. 2021-10-21 17:05:38 -07:00
Unknown W. Brackets
d804d35dcb GPU: Enable new guardband culling again. 2021-10-21 15:29:51 -07:00
Unknown W. Brackets
c72d045170 Compat: Ignore DisableRangeCulling with clip/cull.
As long as we support these things and the NAN issue isn't there, we
should be able to safely enable regardless.
2021-10-21 13:23:13 -07:00
Henrik Rydgård
16bf5197e4
Merge pull request #14833 from unknownbrackets/guardband
Handle guardband clip/cull better for hardware backends
2021-10-19 12:00:01 +02:00
Unknown W. Brackets
3e9d1e0b00 GLES: Re-enable vertex cache.
Was accidentally left disabled during GL threading effort.
2021-10-12 20:41:18 -07:00
Unknown W. Brackets
33598f2e75 GPU: Support clip and cull distances separately.
Older GL devices, and it seems Apple devices, may not support cull.
2021-10-12 20:34:44 -07:00
Unknown W. Brackets
5e6f54033e GPU: Split clip and cull caps.
GL_ARB_cull_distance is needed, sometimes available on older GL.
2021-10-12 20:34:43 -07:00
Unknown W. Brackets
7d00b6ca90 GLES: Enable/disable clip distance 0. 2021-10-12 20:34:42 -07:00
Unknown W. Brackets
046a5c548b GLES: Check clip/cull distance support.
Pretty limited on GLES3+.  Also D3D11.
Seems like doing it on D3D9 might be a bit tricky.
2021-10-12 20:34:42 -07:00
Unknown W. Brackets
24011c3754 GPU: Correct depth handling for guardband.
This culls based on pre-viewport Z and avoids culling based on the clip
range at negative Z.
2021-10-12 20:34:41 -07:00
Henrik Rydgård
9ca97dfa8e Handle vertex shader generation failures better.
Suspect that this is happening with the HW tesselation crash in KOF '96.

Should help #14774
2021-08-29 21:50:43 +02:00
Henrik Rydgård
4c9b5ada0f Address feedback 2021-07-09 21:09:44 +02:00
Henrik Rydgård
4e8ffae024 Implement basic depth texturing for OpenGL, requires depth clamp for now.
Need to figure out what to do about other Z mappings.

Helps #6411 for OpenGL on desktop primarily, and certain other games affected by #13256
are likely working too like the fog in Harry Potter.
2021-07-09 21:09:44 +02:00
Henrik Rydgård
df6abe83a3 Support depth clamping in OpenGL where available.
Should make support for depth texturing quite easy.

Unfortunately, this extension does not exist on OpenGL ES. There we'll
have to use ugly tricks with gl_FragDepth if we want this.
2021-07-09 21:09:44 +02:00
Henrik Rydgård
81f0c3a8e4 Address feedback (except the mailbox refcount) 2021-06-13 10:16:53 +02:00
Henrik Rydgård
3be5c7bd9a Make the minimum items per thread explicit. Found some bugs, optional arguments are evil. 2021-06-12 21:21:28 +02:00
Henrik Rydgård
73871b9b7e Implement new thread manager, port stuff to it. 2021-06-12 13:03:53 +02:00
Henrik Rydgård
025bcb1673 Introduce Path, start using it all over the place.
Still lots left to convert!

Convert GetSysDirectory to return Path.

More buildfixing

Remove unnecessary Path( constructors
2021-05-13 10:39:16 +02:00
Unknown W. Brackets
de46b0998a GPU: Correctly initialize HW tessellation support.
Oops, shouldn't call a virtual in a constructor.
2021-05-08 09:10:23 -07:00
Unknown W. Brackets
8a8328c431 Common: Move ColorConv to a more appropriate place. 2021-05-01 11:20:05 -07:00
Unknown W. Brackets
5119d79082 Build: Remove IOS define. 2021-03-02 21:04:03 -08:00
Unknown W. Brackets
82a7a26409 GPU: Look up replaced filtering options. 2021-02-27 17:17:21 -08:00
Unknown W. Brackets
557bf0d963 TexCache: Check for videos rendered as slices.
In a few places, we were checking only the start address of the video.
2021-02-20 20:59:04 -08:00
Unknown W. Brackets
ae474f5f18 GPU: Correct some field shadowing. 2021-02-15 12:00:29 -08:00
Unknown W. Brackets
e85a8b0f5b Global: Cleanup class init order warnings. 2021-02-15 11:59:45 -08:00
Unknown W. Brackets
f32f89dd90 Global: Remove some unused variables. 2021-02-15 11:59:45 -08:00
Henrik Rydgård
252160b5e2 GL: Call CreateDeviceObjects *after* updating render_.
Also remove a redundant call to fetch render_ in the constructor, it's
already passed in.
2021-02-09 09:53:03 +01:00
Unknown W. Brackets
9857e8d1b1 GPU: Respect stencil write mask for 5551 buffers.
If the mask is 0x7F on 5551, that's equivalent to allowing the clear
entirely.  See #13391.
2021-01-24 15:54:13 -08:00
Unknown W. Brackets
a73c15babc GPU: Correct shader gen with weights as floats.
For now, this supports the option.  We should probably just move to
everything being floats, but we already prefer software skinning.

Fixes #13903.
2021-01-10 08:52:28 -08:00
Henrik Rydgård
16f629df3e Split the DepthRangeHack compat setting into itself and DisableRangeCulling
Most of our uses of DepthRangeHack was just to get DisableRangeCulling anyway -
and we don't want that on when not needed.

Also disables range culling for Splinter Cell Essentials (see #13035)

We really need to understand range culling better. This is a "ship hack" for 1.11.
2020-12-26 19:56:49 +01:00
Henrik Rydgård
7de7680416 Apple driver bug workaround. See issue #13451 2020-12-16 14:39:08 +01:00
Henrik Rydgård
559ccd9f33 Minor cleanups 2020-12-14 20:06:06 +01:00
Henrik Rydgård
32c9728c0c Some cleanups in GL feature and shader language detection.
Gets rid of many wrong or bad checks for IsCoreContext.
2020-12-14 19:46:11 +01:00
Henrik Rydgård
3b54063955 Fix regression in Dream Club Portable. Fixes, for OpenGL, #6497 2020-12-13 18:27:37 +01:00
Henrik Rydgård
f3ebd6553d Turn off vertex range culling in bezier/spline calls.
When we do lower res tess than the real PSP, we cant trust the game to not cause range culling to kick in.

Fixes #11692
2020-12-13 16:04:16 +01:00
Henrik Rydgård
9818c8aabd Better debug names for BlitFramebuffer operations. 2020-11-28 13:45:26 +01:00
Henrik Rydgård
3c2733d8eb Adreno/OpenGL: Limit shader depal to 6xx series GPUs. Should help #13668.
Also make a function static.
2020-11-22 18:00:07 +01:00
Henrik Rydgård
38684762c8 Fix Star Ocean stencil issue with OpenGL. Fixes #13746 2020-11-11 23:23:31 +01:00
Henrik Rydgård
e14437cb3f OpenGL: Assorted shader-depal bugfixes and regression fixes.
Fixes #13517
2020-11-11 23:09:48 +01:00
Henrik Rydgård
5eea7435d0 Minor cleanup in GL backend, fixes #13647
Was a stray old texture in boundTextures_ in thin3d. Now makes sure to
invalidate them, and also make it possible to look up bound framebuffer
textures when checking for valid tex parameters.
2020-11-10 00:13:44 +01:00
Henrik Rydgård
2384b7a17d Remove support for NV_shader_framebuffer_fetch extension, very old and rare.
Minor refactor.
2020-11-09 13:31:39 +01:00
Henrik Rydgård
6310af25fa Get shader color write masking going on all backends. 2020-11-08 23:45:47 +01:00
Henrik Rydgård
3e06eaccfb Fix some comments 2020-11-08 14:57:35 +01:00
Henrik Rydgård
793e89d2e3 Fix some comments, rename a function. 2020-11-08 14:34:04 +01:00
Henrik Rydgård
391b8155c5 More work on detangling the concepts and making things make more sense. 2020-11-08 13:14:23 +01:00
Henrik Rydgård
3d289594f9 ShaderBlend and FramebufferRead are separate concepts. Reflect that in naming.
The former has forms that don't need to read the framebuffer.

This exposes that some logic is wrong...
2020-11-08 12:54:05 +01:00
Henrik Rydgård
f2e315b9a6 More shadergen work
Buildfix
2020-11-08 11:32:53 +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
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
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
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
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
Henrik Rydgård
32eb882bc6 Clarify some logic, improve framebuffer names 2020-11-02 10:02:49 +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
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
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
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
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
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
8b2aeade15 Fix checks for fragment test cache in GLES fragment shader generator 2020-10-28 23:51:22 +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
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
56ddd597c1 Fix more tiny differences. The fragment shader generators now match! 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
391d2ea73d Rename vk uniforms to match the other backends 2020-10-21 21:13:08 +02:00
Henrik Rydgård
495fd9a13c Fix OpenGL crash introduced in #13536 2020-10-11 22:34:37 +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
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
821817e6d4 Move the profiler to Common 2020-10-04 11:42:16 +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
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
dcd33a4692 Remove redundant bind on GL texture build. Improve dirtying of texture state. 2020-09-21 08:56:58 +02:00
Henrik Rydgård
eaca9d1b59 Remove dirtying of TEXTURE_PARAMS from ForgetLastTexture, not its responsibility. 2020-09-21 08:56:58 +02:00
Henrik Rydgård
b6efc65c94 Set the texture dirty flags when binding a new framebuffer. 2020-09-21 08:56:58 +02:00
Henrik Rydgård
3093b9c7bf Share GPUS stats formatting code between the backends (easier to add new stats) 2020-09-20 22:09:25 +02:00
Henrik Rydgård
707e9cf7ac Remove some unnecessary function parameters, improve some comments. 2020-09-20 20:44:18 +02:00
Henrik Rydgård
277f0e4ec6 Fix bug in GLES texture filter setup 2020-09-17 20:53:02 +02:00
Henrik Rydgård
d6d72db0a9 Unify BlitFramebufferDepth. 2020-09-17 20:53:02 +02:00
Henrik Rydgård
d0f7b1e30f Make the implementations of CopyFramebufferDepth more similar.
Also avoid matching framebuffers with bad z for copies.
2020-09-17 20:52:45 +02:00
Henrik Rydgård
181ddd842a Unify some GPU_SUPPORT* bits 2020-09-17 20:52:32 +02:00
Henrik Rydgård
1b3413945b Some header include cleanup 2020-09-16 09:20:41 +02:00
Henrik Rydgård
a222b2017e Switch to a returned value and rename these functions. 2020-09-14 00:04:39 +02:00
Henrik Rydgård
5190f85c8e Unify/centralize SetFramebufferSamplingParams. Some include cleanup. 2020-09-14 00:04:39 +02:00
Henrik Rydgård
d8263d50f4 Make the signature of all the SetFramebufferSamplingParams the same 2020-09-14 00:04:39 +02:00
Henrik Rydgård
9ea295093b TextureCacheGLES: Also share the same sampler calculation for GLES. 2020-09-14 00:04:39 +02:00
Henrik Rydgård
b81e0669e6 TextureCacheDX9: Use the already centralized sampler setup code from D3D11/Vulkan. 2020-09-14 00:04:39 +02:00
Henrik Rydgård
a4c071261b TextureCacheCommon::UpdateSamplingParams no longer takes a TexCacheEntry 2020-09-13 16:40:37 +02:00
Henrik Rydgård
5d5e5fe6ff Remove some outdated debugging code (SetDebugTexture) 2020-09-13 12:18:38 +02:00
Henrik Rydgård
3dff9781fc Fix GetCurrentTextureDebug 2020-09-13 09:33:06 +02:00
Henrik Rydgård
f6db1c2b01 Show how many times we evaluate framebuffers per frame in debug statistics. 2020-09-12 15:37:03 +02:00
Henrik Rydgård
41eee6a1a4 Decouple framebuffers from texcache entries entirely. 2020-09-12 14:25:50 +02:00
Unknown W. Brackets
cbeeb8fdf1 GPU: Allow culling in through mode.
It works per tests and is used in Soul Caliber.  Fixes #13400.
2020-09-08 15:52:01 -07:00
Henrik Rydgård
cb3ed8f4a1
Merge pull request #13343 from unknownbrackets/xxhash
Switch to XXH3
2020-08-28 12:20:26 +02:00
Unknown W. Brackets
e32524c544 GPU: Remove ReliableHash aliases.
Let's just use XXH32/XXH64 directly in texture replacements, clearer
anyway.
2020-08-28 01:15:22 -07:00
Unknown W. Brackets
7f812a5d9a GPU: Hash CLUT using XXH3 with replacements off.
It's faster, but if texture replacements are enabled, we want the hash to
stay the same.
2020-08-27 20:46:39 -07:00
Unknown W. Brackets
15c25be42b GPU: Switch vertex/lookup hashes to XXH3.
This is faster pretty much everywhere.
2020-08-27 20:37:49 -07:00
Unknown W. Brackets
f44717c4f5 TexCache: Force recreate texture on detach.
We could have multiple detaches, and we delete the texture on attach, so
we really must make sure we recreate.

Fixes #13320.
2020-08-23 21:29:53 -07:00
Unknown W. Brackets
3b11b09621 Debugger: Check for no texture before debug bind.
This means a framebuffer texture that is somehow not attached, but better
to avoid the crash.
2020-08-23 08:24:46 -07:00
Unknown W. Brackets
3055deeba6 GPU: Fix some case warnings.
Better to avoid the warnings.
2020-08-19 21:18:44 -07:00
Henrik Rydgård
5313fc5b36 More work on GL state leaks. Some things really need a redesign. 2020-08-18 09:18:24 +02:00
Henrik Rydgård
ccc0331279 Move timeutil to Common. (Experiment to see how much work it is to move these). 2020-08-15 20:53:08 +02:00
Henrik Rydgård
c41f875df4 Remove base/logging.h in a whole lot more places. 2020-08-15 19:09:00 +02:00
Henrik Rydgård
b43698a13d Remove most instances of base/logging.h from Common, Core, GPU, more 2020-08-15 19:08:44 +02:00
Unknown W. Brackets
b8342fb8ec SaveState: Rename ChunkFile files to Serialize.
Makes more sense and less weird than ChunkFileDoMap, etc.
2020-08-10 08:04:05 +00:00
Unknown W. Brackets
1dc5ee424b SaveState: Split out Do types to reduce headers. 2020-08-10 08:03:44 +00:00
Henrik Rydgård
e6dfb55d3d Optimize value conversion in (unused) depth readback.
This also exposes factors we can feed into shaders to do the conversion
on the GPU.
2020-08-09 10:47:01 +02:00
Henrik Rydgård
58ef0c8e80 Texture from framebuffer: Logging improvements 2020-08-04 14:45:14 +02:00
Henrik Rydgård
d57edfbdac Rename FramebufferCommon.cpp/h to FramebufferManagerCommon.cpp/h for consistency 2020-08-03 23:17:22 +02:00
Henrik Rydgård
c5e0b799d9 Remove category from _assert_msg_ functions. We don't filter these by category anyway.
Fixes the inconsistency where we _assert_ didn't take a category but
_assert_msg_ did.
2020-07-19 20:33:25 +02:00
Henrik Rydgård
bb6219e402
Merge pull request #12921 from unknownbrackets/postshader
Use less FBOs for chained post-processing shaders
2020-07-13 18:52:53 +02:00
Henrik Rydgård
6009bf7b74
Merge pull request #12952 from unknownbrackets/vulkan-safesize
Vulkan: Match safe size behavior on all backends
2020-07-13 15:59:09 +02:00
Henrik Rydgård
4537b807c6
Merge pull request #12969 from unknownbrackets/vertex-cache
Fix and improve the GLES vertex cache
2020-07-13 14:38:06 +02:00
Unknown W. Brackets
cdb7e2fc1e GPU: Add sampler1 for postshader orig source. 2020-06-12 12:35:37 -07:00
Unknown W. Brackets
9ef521d945 GPU: Avoid immediate postshader FBO recreate.
Before, we created things at the wrong size, then recreated at the right.
Now we just start at the correct size once.
2020-06-12 12:35:35 -07:00
Henrik Rydgård
737688a22a Annotate calls to RebindFramebuffer with their cause. 2020-06-02 09:51:38 +02:00
Unknown W. Brackets
56f4335915 GLES: Delay buffer use in vertex cache.
This creates the buffer on frame 2, starts using it on frame 3.
2020-05-24 14:47:41 -07:00
Unknown W. Brackets
c051e9ec2c GLES: Fix disabled vertex cache code. 2020-05-24 14:05:54 -07:00
Henrik Rydgård
370678c498 Do a similar thing for D3D (let the backend handle the dirtying). 2020-05-24 20:57:59 +02:00
Henrik Rydgård
bebf649705 OpenGL/Vulkan: Rework the contract around dynamic state. Removes some ugly dirtying from the GL render manager. 2020-05-24 20:27:58 +02:00
Unknown W. Brackets
ea1f0a1195 Vulkan: Match safe size behavior on all backends.
Before, we would not mark a safe size for some Vulkan clears where depth
was not cleared, deviating from other backends.  We also never detected
that on PowerVR.  This makes things more consistent.
2020-05-23 00:25:39 -07:00
Henrik Rydgård
fabe987c8f Add a name tag for all render steps (GL/Vulkan). Helps with debugging and should be cheap enough (a single pointer per "step"). 2020-05-21 11:24:05 +02:00
Unknown W. Brackets
4ef4325fdb GPU: Avoid unnecessary clear on stencil upload.
In this common case, we've typically just bound the buffer to upload a
texture to it.  No need to start a new render pass.

This dodges #12927 but doesn't really fix the underlying issue.
2020-05-18 21:36:06 -07:00
Unknown W. Brackets
a36239473d GLES: Add dependency tracking for render passes.
Let's try to invalidate when it's possible.  We move the invalidate to the
end of the render when detected.
2020-05-17 11:06:39 -07:00
Unknown W. Brackets
32a7e7345e GPU: Centralize framebuffer download.
And try not to use a potentially-null nvfb.  Primarily this can happen on
Direct3D backends.
2020-05-17 10:59:33 -07:00
Unknown W. Brackets
d88099e701 GLES: Specify buffer type just to be safe.
Probably doesn't matter, but maybe some drivers take it as a hint?
2020-05-16 23:48:56 -07:00
Unknown W. Brackets
22e46b51c2 GPU: Centralize DestroyAllFBOs().
This cleans up the postshader update code.
2020-05-13 18:15:04 -07:00
Unknown W. Brackets
2faab0e082 GPU: Use postshader for direct VRAM draws again.
Also centralize the pixel texture code while at it.
2020-05-13 18:10:09 -07:00
Unknown W. Brackets
762b656ea2 GPU: Use a texture directly for MakePixelTexture.
This makes it easier to do things with it.
2020-05-13 18:10:09 -07:00
Unknown W. Brackets
fa6544b737 GPU: Cleanup leftover postshader stuff. 2020-05-13 18:10:09 -07:00
Unknown W. Brackets
cb94487a16 GPU: Move post shader handling to new class.
Currently, Vulkan is not working properly and direct (RAM -> output) is
not hooked up.  But in general, it works.
2020-05-13 18:10:06 -07:00
Unknown W. Brackets
d39b0bdca2 GPU: Split FramebufferCommon into two classes.
Only some things moved over so far.

FramebufferCommon does too much, we want to share it with softgpu without
all the buffer management stuff.
2020-05-13 18:07:22 -07:00
Unknown W. Brackets
ef43ec5f33 GPU: Split up software transform into phases. 2020-05-08 23:09:24 -07:00
Unknown W. Brackets
b413a58945 GLES: Add safety handling for offset depal.
Just in case...
2020-05-07 23:30:17 -07:00
Unknown W. Brackets
48980d8786 GLES: Simplify the framebuf offset detection.
It's clearly not been understood well as changes were made, so let's dump
a bunch of comments on it.
2020-05-07 23:12:14 -07:00
Henrik Rydgård
c6cd45e933
Merge pull request #12813 from unknownbrackets/gles-state
GLES: Update shader uniforms after apply state
2020-04-12 15:21:23 +02:00
Unknown W. Brackets
b57ba89b45 GLES: Update shader uniforms after apply state.
We may set shaderblend, projmatrix, or depthrange dirty in
ApplyDrawState().  These need to update shader uniforms to apply
correctly, but we were checking beforehand.
2020-04-11 17:40:39 -07:00
Unknown W. Brackets
a5ede2bed3 GLES: Re-enable non-float depal shader path.
Was accidentally always detected as unsupported.
2020-04-07 22:49:07 -07:00
Unknown W. Brackets
ac60e2ecd4 GPU: Track HW tess at start of frame too.
This also makes it so we don't force the setting off when you change
backends, and just ignore it if unsupported.
2020-04-04 11:52:32 -07:00
Unknown W. Brackets
30ede8240c GPU: Move hw transform decision to draw engine. 2020-04-04 11:14:32 -07:00
Unknown W. Brackets
c42fb72419 GPU: Update uniforms w/ consistent render mode too. 2020-04-04 11:03:07 -07:00
Unknown W. Brackets
ad98609819 GPU: Use consistent buffered rendering state.
The setting can be changed in Qt and Windows between frames, so let's
track the current setting in most places.  This is everywhere fbman is
easily accessible.
2020-04-04 10:51:47 -07:00
Unknown W. Brackets
4a0109d273 GPU: Treat negative light exp same as 0.
Based on #12507 and some tests, seems like negative exponents are also
fixed to a 1.0f result.
2020-03-22 22:28:05 -07:00
Unknown W. Brackets
051a84e9bd GPU: Restart when changing inflight frames setting.
We need to keep the push and pull in step, so changing at runtime is
messy.
2020-03-02 19:21:15 -08:00