Commit Graph

8335 Commits

Author SHA1 Message Date
Henrik Rydgård
e969f9cf8b
Merge pull request #16502 from unknownbrackets/softgpu-opt
A few more softgpu optimizations for alpha blend/test
2022-12-05 09:35:36 +01:00
Henrik Rydgård
e44e9b651f
Merge pull request #16503 from unknownbrackets/softgpu-halfpos
softgpu: Fix double rectangle drawing at halfpixel
2022-12-05 09:34:33 +01:00
Unknown W. Brackets
77e510bd90 GPU: Use accurate depth for depth range hack.
This should be easier to ensure stays well tested.
2022-12-04 19:27:23 -08:00
Unknown W. Brackets
07c276c32d softgpu: Fix double rectangle drawing at halfpixel.
There seems to be some odd behavior with the X start pos, but at least the
end pos should not be drawn twice when using 0.5 - 0.5.
2022-12-04 17:47:57 -08:00
Unknown W. Brackets
d6750993d7 softgpu: Force alpha test when it could skip blend.
Blending is slow, and often games do effects like smoke, sun, etc. that
has a lot of zero alpha in them.  Many games do this with alpha testing
off, which is cheap compared to blending.
2022-12-04 16:36:45 -08:00
Unknown W. Brackets
2c90dafe64 softgpu: Force alpha test off in more scenarios.
Since we're already checking the CLUT, we can tell if it doesn't contain
zero alpha, in which case a != 0 test will never fail.  This is actually
pretty common, even when texture alpha is not always FF.
2022-12-04 16:30:12 -08:00
Lubos
d0e6f480a9 Merge branch 'master' into config_openxr_update 2022-12-04 18:04:08 +01:00
Henrik Rydgård
5de3a7c252
Merge pull request #16500 from unknownbrackets/warnings
Fixes to recently introduced warnings and a couple older ones
2022-12-04 17:40:30 +01:00
Unknown W. Brackets
3342d5ecb3 softgpu: Remove an unused case. 2022-12-04 08:17:05 -08:00
Unknown W. Brackets
8c378c4557 GPU: Avoid an override warning. 2022-12-04 07:57:45 -08:00
Henrik Rydgård
a8939f456a Remove dead code, validation fix in GE debugger
See #16490
2022-12-04 00:49:48 +01:00
Unknown W. Brackets
59431de823
Merge pull request #16494 from hrydgard/force-lower-res-for-effects-off
Force "Lower resolution for effects" off in Ratchet & Clank and a few other games
2022-12-03 15:25:57 -08:00
Henrik Rydgård
7e97ce1760
Merge pull request #16495 from unknownbrackets/vulkan-shutdown
Cleanup shader module lifetime handling for Vulkan
2022-12-04 00:16:58 +01:00
Unknown W. Brackets
78ed8d45a7 Vulkan: Defer deletion of shader module promises. 2022-12-03 14:53:10 -08:00
Unknown W. Brackets
53eedf06e3 Vulkan: Track pipeline desc using a refcount.
Not very safe to not allow deletes, and don't want to force Draw objects
on the deleter (this is referenced by them.)
2022-12-03 14:52:06 -08:00
Henrik Rydgård
8567416be6 Force "Lower resolution for effects" off in Ratchet & Clank and a few other games
It breaks or just makes things look terrible in these games, so no
reason to allow it.

An alternative for this would be to remove the option entirely, and only
use it though the ForceLowerResolutionForEffectsOn flag instead.
2022-12-03 23:35:54 +01:00
Henrik Rydgård
c310d1471e
Merge pull request #16493 from unknownbrackets/softgpu-opt
softgpu: Check CLUT alpha to optimize out blend/alpha test
2022-12-03 22:55:53 +01:00
Unknown W. Brackets
00e76b11b6 softgpu: Optimize > non-zero alpha tests as well.
These are fairly common, especially in 3D games.
2022-12-03 12:55:38 -08:00
Unknown W. Brackets
eb19e24399 softgpu: Skip non-zero alpha test if impossible. 2022-12-03 12:54:53 -08:00
Unknown W. Brackets
adc94b1950 softgpu: Use CLUT to optimize out blending more.
This actually happens relatively often.
2022-12-03 12:44:02 -08:00
Unknown W. Brackets
0aba5ff3c1 TexCache: Correct alpha mask checks for SSE2.
Should have been shifts by byte (4/8), but let's just switch to shuffles
anyway.  These were always shifting in zeros and failing.
2022-12-03 12:38:01 -08:00
Unknown W. Brackets
38eb0a7a82 softgpu: Check for queued compile.
Rarely, we could have queued compiling the same one, which would crash on
a double insert.
2022-12-03 12:15:58 -08:00
Henrik Rydgård
6acbd1f9e3 Fix loading of texture shaders 2022-12-03 20:37:58 +01:00
Henrik Rydgård
f3ba8fb334 Address feedback, also sort texture shaders 2022-12-03 19:30:50 +01:00
Henrik Rydgård
f5c0dc717a Sort post-shaders alphabetically in the list. 2022-12-03 18:58:47 +01:00
Henrik Rydgård
238c9439e3
Merge pull request #16491 from unknownbrackets/cleanup
Quick cleanup
2022-12-03 16:38:32 +01:00
Unknown W. Brackets
e50eae1bfb GPU: Cleanup some bounds checks, assignments. 2022-12-03 07:17:12 -08:00
Henrik Rydgård
0f12d44e59 Remove some unused/unnecessary code 2022-12-03 12:05:10 +01:00
Henrik Rydgård
92df6b832c Safer and simpler alternative to cbfa4bf.
See #16483
2022-12-03 12:05:08 +01:00
Henrik Rydgård
02b8bf33fb
Merge pull request #16458 from hrydgard/desktop-friendly-msaa
Implement MSAA support for desktop GPUs in Vulkan
2022-12-03 11:22:41 +01:00
Henrik Rydgård
4589473231
Merge pull request #16486 from unknownbrackets/softgpu-opt
softgpu: Apply optimizations to states generically
2022-12-03 11:08:10 +01:00
Henrik Rydgård
d6b9f39215
Merge pull request #16483 from lvonasek/hotfix_simpsons_crash
Simpsons crash on GLES fixed
2022-12-03 10:40:02 +01:00
Unknown W. Brackets
204789a27f softgpu: Skip fog when no verts have fog. 2022-12-02 21:55:49 -08:00
Unknown W. Brackets
0c42e45e92 softgpu: Cleanup reapply logic.
This makes more sense to read.
2022-12-02 21:42:57 -08:00
Unknown W. Brackets
4d92533907 softgpu: Apply optimizations to states generically.
This is for optimizations we can only do when we know the vertex values.
2022-12-02 21:30:53 -08:00
Unknown W. Brackets
6bd0eec54d softgpu: Calc flags on state as we queue verts.
Might be some other ways, like doing this directly in a vertex reader.
Also am thinking about doing things regarding UVs or positions.

Flags not yet used, keeping separate for perf checks.
2022-12-02 21:28:50 -08:00
Unknown W. Brackets
a04b7cf3b3 softgpu: Force shading flag off in clearMode.
Probably fixes a line shading bug, and clearer anyway.
2022-12-02 21:20:59 -08:00
Unknown W. Brackets
778a0487cb softjit: Switch to DenseHashMap. 2022-12-02 20:59:13 -08:00
Unknown W. Brackets
0c19f6ae1d
Merge pull request #16484 from lvonasek/compat_openxr_fixes
OpenXR - HUD support for even more games
2022-12-02 14:03:23 -08:00
Lubos
0060a14fa7 OpenXR - Adjust the render resolution for VR 2022-12-02 20:48:35 +01:00
Henrik Rydgård
116bc9d59a
Merge pull request #16485 from unknownbrackets/softgpu-fog-nan
softgpu: Handle infnan fog coefficients better
2022-12-02 19:49:32 +01:00
Unknown W. Brackets
1121a6fb68 softgpu: Handle inf-end + negative constant slope. 2022-12-02 10:20:30 -08:00
Unknown W. Brackets
38de2f11af softgpu: Handle infnan fog coefficients better.
If we ended up with a dot product that had opposing inf signs, the add
would result in NAN and cause problems.
2022-12-02 10:15:15 -08:00
Unknown W. Brackets
c5844c4174 GE Debugger: Add breakpoint symbol for prim count.
This way you can break when a register is changed and prim count is in a
certain range, which can be convenient.
2022-12-02 10:14:36 -08:00
Lubos
39c399df47 OpenXR - GTA Chinatown wars rendering fixed 2022-12-02 17:53:03 +01:00
Lubos
769b1d7342 OpenXR - Assasins Creed rendering fixed 2022-12-02 17:45:29 +01:00
Lubos
66cbe55ffc OpenXR - Tony Hawk HUD fixed 2022-12-02 16:47:26 +01:00
Henrik Rydgård
35777d5eef Use proper copies for depth blits between multisampled framebuffers. Needed to keep all the information. 2022-12-02 15:26:29 +01:00
Lubos
1e2cf07c6b OpenXR - Monster Hunter HUD fixed 2022-12-02 15:16:41 +01:00
Lubos
b41a782fcd Revert "Centralize ClearCacheNextFrame"
This reverts commit cbfa4bfc8e.
2022-12-02 14:32:27 +01:00
Henrik Rydgård
cd0acec3f0 Crashfix the other backends 2022-12-02 13:49:28 +01:00
Henrik Rydgård
a349e2b85b
Merge pull request #16481 from unknownbrackets/gedebugger
Cleanup some GE debugger logspam, small texture proj optimization
2022-12-02 11:10:49 +01:00
Unknown W. Brackets
106d730a20 GPU: Optimize out common case texture proj.
NFS Most Wanted 5-1-0 uses this when it could use uv scale/offset.
2022-12-01 23:20:25 -08:00
Unknown W. Brackets
33abbca464 softgpu: Optimize out texture proj for UVs.
Seen in NFS Most Wanted 5-1-0.
2022-12-01 23:13:20 -08:00
Unknown W. Brackets
d7224a8401 GE Debugger: Cleanup logspam on game exit.
If you're stopped on a frame and quit, it was previously logging every
command as it exited, thinking it was waiting on each.
2022-12-01 23:12:14 -08:00
Unknown W. Brackets
c5a98e62dd softgpu: Cull verts outside post-viewport Z.
Shouldn't have removed this before, points are still culled when depth
clamp is off and throughmode is off.

Fixes Crazy Taxi graphics glitches.
2022-12-01 21:57:48 -08:00
Henrik Rydgård
8a3e92aa38 Not pretty, but with this, you can switch MSAA level at runtime. 2022-12-01 23:41:31 +01:00
Unknown W. Brackets
a1f6a40d10 softgpu: Interpolate Z for 3D lines.
Important for Me & My Katamari, see #16131.
2022-12-01 14:39:19 -08:00
Henrik Rydgård
7950a00c14 Headless buildfix. Crashfix in shader generator test. 2022-12-01 22:49:00 +01:00
Henrik Rydgård
b9ea8de135 Use raster copies to work around lack of working copy support in MSAA mode. 2022-12-01 22:49:00 +01:00
Henrik Rydgård
8208768c15 Add a pipeline flag for USES_DISCARD. Will be used for the MSAA quality setting. 2022-12-01 22:49:00 +01:00
Henrik Rydgård
e3679df6cf Fix switching between MSAA levels 2022-12-01 22:49:00 +01:00
Henrik Rydgård
4dfce4f6bc Basically working MSAA on desktop GPUs! Some glitches remain. 2022-12-01 22:49:00 +01:00
Henrik Rydgård
06af304c8d Multisampling groundwork 2022-12-01 22:49:00 +01:00
Unknown W. Brackets
4866518b84
Merge pull request #16477 from hrydgard/invalidation-refactor
Add a flags parameter to InvalidateCachedState and rename it Invalidate.
2022-12-01 11:05:04 -08:00
Henrik Rydgård
331d024a8c Add a flags parameter to InvalidateCachedState and rename it Invalidate.
Also rename the old InvalidationFlags enum to InvalidateCallbackFlags.
2022-12-01 19:15:38 +01:00
Lubos
2be8f46a0c Merge branch 'master' into compat_openxr_fixes 2022-12-01 18:26:26 +01:00
Henrik Rydgård
e6f0f84a45 SSE optimize Float4ToUint8x4, some uses 2022-12-01 16:32:23 +01:00
Henrik Rydgård
d02f46cb27 Minor VertexReader optimizations 2022-12-01 16:00:47 +01:00
Henrik Rydgård
423fa6d848 Couple more FormatMemWriteTagAt 2022-12-01 16:00:47 +01:00
Henrik Rydgård
6560123257 Restore optimization of memory info strings, avoiding allocations 2022-12-01 15:39:45 +01:00
Henrik Rydgård
40ae99073b Remove std::string from VulkanTexture 2022-12-01 12:17:03 +01:00
Unknown W. Brackets
5bc51cb01d GE Debugger: Remove dup block transfer record.
We already record it as a block transfer, we don't need to also do it as a
memcpy.
2022-12-01 01:36:27 -08:00
Unknown W. Brackets
73489349cc GPU: Oops, simplify an expression. 2022-12-01 01:34:48 -08:00
Unknown W. Brackets
cbe96d3774 GPU: Use common block transfer logic in all cases. 2022-12-01 01:34:16 -08:00
Unknown W. Brackets
3589c1e826 softgpu: Handle block transfer VRAM wrapping.
Note: mirrors still act as mirrors, swizzle and all.
2022-12-01 01:31:44 -08:00
Unknown W. Brackets
1c5f0d575c softgpu: Improve meminfo detail on block transfer.
Gaps are useful to understand.
2022-12-01 01:31:44 -08:00
Unknown W. Brackets
68515aaee2 softgpu: Account for width!=stride in xfer checks. 2022-12-01 01:31:43 -08:00
Unknown W. Brackets
2adc18cfba softgpu: Correct src/dst overlap in block transfer.
If dest is inside src, it seems to consistently copy in blocks of 64
bytes.
2022-12-01 01:31:43 -08:00
Henrik Rydgård
c3aaf5b184
Merge pull request #16472 from unknownbrackets/fetch-fix
GLES: Correct unit tests for framebuffer fetch
2022-12-01 10:16:45 +01:00
Henrik Rydgård
4b7084401d
Merge pull request #16470 from unknownbrackets/softgpu-inversion
softgpu: Correctly fix inversions, matching tests
2022-12-01 09:59:56 +01:00
Unknown W. Brackets
fc5dcd0c16 GLES: Correct unit tests for framebuffer fetch. 2022-12-01 00:59:22 -08:00
Unknown W. Brackets
d763dca024 GPU: Correct fetch assert. 2022-12-01 00:17:14 -08:00
Unknown W. Brackets
dc962094f8 softgpu: Correctly fix inversions, matching tests.
Inversions are allowed just fine, but if clipping results in coordinates
outside range, the triangle should be culled.  Fixes more wanted
inversions.
2022-11-30 23:20:39 -08:00
Lubos
09d48075bc Merge branch 'master' into compat_openxr_fixes 2022-11-30 22:00:33 +01:00
Henrik Rydgård
f4385e1bea
Merge pull request #16456 from hrydgard/soft-gpu-range-checks
SoftGPU: Range check block copies.
2022-11-30 14:56:15 +01:00
Henrik Rydgård
d72ad3b3f4 Fragment shader generator: Move the framebuffer fetch bit to the shader ID.
Will resolve a future issue in the multisampling PR, where the
GPU_USE_FRAMEBUFFER_FETCH flag changes at runtime if you switch between no AA and MSAA.

Just figured I'd get it in separately for safety.
2022-11-30 00:26:15 +01:00
Lubos
de78007e66 OpenXR - Enable HUD in a few more games 2022-11-29 22:17:12 +01:00
Lubos
812c7d13aa OpenXR - HUD disappearing in Flatout fixed 2022-11-29 21:25:13 +01:00
Henrik Rydgård
390bf3e912 Fix Burnout Dominator lens flare on OpenGL ES
Not the prettiest solution, but works: Use R8_UNORM as a fallback
if R16_UNORM is not available.
2022-11-29 13:05:18 +01:00
Lubos
d466ae161a OpenXR - HUD max scale fixed 2022-11-28 19:46:46 +01:00
Lubos
164c27f5ec OpenXR - Screen stretching fixed 2022-11-28 19:25:13 +01:00
Henrik Rydgård
9bb0c91a75 Sneak in a minor software transform optimization 2022-11-28 11:10:50 +01:00
Henrik Rydgård
6c8ccc149e Stop logspam from bad block transfer corners. 2022-11-28 10:46:45 +01:00
Henrik Rydgård
3246baec4b SoftGPU: Range check block copies.
Needs testing to verify if we should copy zeroes instead if the src range is
partial, etc, quite a few possible edge cases.

Though on its own, this probably fixes the crash in #16427.

Still don't understand why that one has issues in hardware renderers
though since they do bounds-check the copies.
2022-11-28 10:39:46 +01:00
Henrik Rydgård
ed151473c2
Merge pull request #16454 from unknownbrackets/fb-depal-fb
GPU: Support framebuf depal from rendered CLUT
2022-11-28 09:47:22 +01:00
Henrik Rydgård
06b7fb9a6a
Merge pull request #16452 from unknownbrackets/gedebugger
GE Debugger: Correct LastVRAM mirror wrap around
2022-11-28 08:02:09 +01:00
Unknown W. Brackets
9425d0670a GPU: Prevent decimating CLUT framebuffers.
Fixes color changing after a few moments in Kurohyo.
2022-11-27 21:24:02 -08:00
Unknown W. Brackets
a7c4258e9f GPU: Support framebuf depal from rendered CLUT.
Using a temporary always for simplicity.
2022-11-27 21:16:24 -08:00
Unknown W. Brackets
194c4b0286 TexCache: Support offset in rendered CLUTs.
We already copy to a temp, so just use that copy to normalize out the
offset.  Should even get RECT2LIN correct, but most cases are 1 pixel high
anyway.
2022-11-27 21:15:15 -08:00
Unknown W. Brackets
a6bc9acf16 GE Debugger: Correct LastVRAM mirror wrap around.
Oops, this fixes crashes when textures are used near the edge of VRAM.
2022-11-27 19:59:57 -08:00
Henrik Rydgård
72029b678a Empirical attempt at fixing #15661
Basically, software culling fails in some configuration, like the one we
end up with on Mali.

As noted by unknownbrackets in #15661, the viewport Z scale, offset is -0.0, 0.0.

We end up with CalcCullParams computing minZValue == maxZValue == 1.0f,
and with the vertices ending up with z,w == 1.0, 1.0.
and as a result, the inside/outside calculations will always decide that
it's outside.

Changing the comparisons from >= / <= to > / < fixes the problem, but I
don't know if this might break something else.

Anyhow, here's the simple way to repro on PC:

Change the ending of GPU_Vulkan::CheckFeatures to:

```c
	return GPU_USE_LIGHT_UBERSHADER | GPU_USE_BLEND_MINMAX | GPU_USE_TEXTURE_NPOT | GPU_USE_INSTANCE_RENDERING |
		GPU_USE_VERTEX_TEXTURE_FETCH | GPU_USE_TEXTURE_FLOAT | GPU_USE_16BIT_FORMATS | GPU_USE_TEXTURE_LOD_CONTROL |
		GPU_USE_DEPTH_TEXTURE | GPU_USE_ACCURATE_DEPTH;
```
2022-11-27 23:16:16 +01:00
Henrik Rydgård
200e2f26c4 OffsetY fix for non-vulkan backends 2022-11-27 22:58:49 +01:00
Henrik Rydgård
d667bd84a3 Add back the old stretch-if-close-to-16:9 hack 2022-11-27 16:16:18 +01:00
Henrik Rydgård
bdfde4cbac Implement the new screen sizing parameters 2022-11-27 16:16:04 +01:00
Henrik Rydgård
e4998ade6f
Merge pull request #16442 from unknownbrackets/vulkan-geometry-safety
Vulkan: Only use geometry shaders with accurate depth
2022-11-27 09:02:57 +01:00
Unknown W. Brackets
1d00824528 Vulkan: Only use geometry shaders with accurate z.
Just to be safe, since that's what it's most well tested with.
2022-11-26 23:28:57 -08:00
Unknown W. Brackets
909f3feaea softgpu: Allow inversions when w >= -1.0.
This seems to match desired cases well, see #16131.  Likely still
inaccurate to what hardware actually does.
2022-11-26 12:11:56 -08:00
Henrik Rydgård
0b375bb357 Colin McRae: Use compat flag to avoid GPU readbacks for VRAM->VRAM copies.
Improves performance when the sun is visible, see #7810
2022-11-26 18:53:13 +01:00
Henrik Rydgård
9c033fb57c
Merge pull request #16437 from lvonasek/feature_openxr_hud_improvement
OpenXR - HUD improvements
2022-11-25 21:21:57 +01:00
Lubos
aa66b93124 MOve VR heuristics into a standalone method 2022-11-25 16:05:30 +01:00
Lubos
b2d809f4cd typos fixed 2022-11-25 15:58:51 +01:00
Lubos
1ef036d07c OpenXR - Farplane distance limit adjusted 2022-11-25 13:33:53 +01:00
Lubos
390ee28cd9 OpenXR - HUD fixes 2022-11-25 12:01:51 +01:00
Lubos
0b089dd1e5 OpenXR - HUD support improved 2022-11-25 11:08:49 +01:00
Henrik Rydgård
d97035fffc
Merge pull request #16434 from unknownbrackets/stencil-opt
Vulkan: Use stencil export when available
2022-11-25 10:06:41 +01:00
Lubos
3aae47c331 OpenXR - Add a TODO for follow-up PR 2022-11-25 09:31:44 +01:00
Lubos
08432dd4e1 OpenXR - Camera controls adjust HUD instead of FOV 2022-11-25 09:25:23 +01:00
Lubos
a58ea86318 OpenXR - HUD scale option added 2022-11-25 09:18:16 +01:00
Lubos
5417e828de OpenXR - Do not rescale the postprocess effects 2022-11-25 09:05:48 +01:00
Unknown W. Brackets
b33662550f Vulkan: Use stencil export when available.
This prevents multiple passes to upload stencil buffers.
2022-11-24 18:48:46 -08:00
Unknown W. Brackets
d243d45741 GPU: Upload stencil to latest buffer.
Just being safe.
2022-11-24 16:33:31 -08:00
Lubos
0e2fd7c2a2 OpenXR - Fix HUD in many games which breaks postprocess effects 2022-11-24 19:17:00 +01:00
Henrik Rydgård
3dd45c6561 Can't forget the texture in the callback, breaks texture-from-framebuffer-copy.
Was probably redundant anyway.
2022-11-24 11:02:21 +01:00
Henrik Rydgård
70d1d8fa07 Replace the "GetCurrentStepId"-based state invalidation with callbacks 2022-11-24 10:52:42 +01:00
Henrik Rydgård
cb7329cd11
Merge pull request #16426 from hrydgard/loadclut-fix
Rebind framebuffer after LoadCLUT-from-framebuffer
2022-11-24 10:48:26 +01:00
Henrik Rydgård
7b154d6895 Don't forget to rebind the framebuffer after copying a framebuffer to CLUT. 2022-11-24 10:12:12 +01:00
Henrik Rydgård
9bc0d662c9 Add more affected games to compat setting. Reorder checks, and check vendor flag. 2022-11-24 10:09:47 +01:00
Henrik Rydgård
39f2ddd128 Add compat flag / bug check for games on old Adreno/GL affected by #16015
See #16015

Partly derived from https://github.com/hrydgard/ppsspp/compare/master...unknownbrackets:ppsspp:adreno-deadlock

But this one surgically activates it only for the known affected games, to avoid any additional
performance regressions in the release.

Entirely untested.
2022-11-24 10:05:35 +01:00
Henrik Rydgård
f6fcc9e9a7 Add a way to view the "GPU_USE_" flags at runtime. Useful for sanity checking on-device. 2022-11-23 16:17:41 +01:00
Henrik Rydgård
7eee7f2573 Fix shader debug description issue. 2022-11-23 15:41:20 +01:00
Henrik Rydgård
75dc856e2c Test fix 2022-11-23 08:52:46 +01:00
Henrik Rydgård
6d9bb1b29e Move post-processing settings to DisplayLayoutScreen 2022-11-22 23:29:50 +01:00
Lubos
70d30d1cf6 OpenXR - Aspect ratio of menu background fixed 2022-11-22 21:49:52 +01:00
Henrik Rydgård
5c2663e37c
Merge pull request #16413 from unknownbrackets/heap-partition
Kernel: Respect partition param in heap funcs
2022-11-22 10:18:47 +01:00
Henrik Rydgård
ddd2c6e343
Merge pull request #16409 from hrydgard/preserve-framebuffers
Preserve framebuffer on pause screen even if render resolution is changed
2022-11-22 10:03:47 +01:00
Unknown W. Brackets
2f4e0e7d50 D3D11: Remove unused hack USE flag.
Only GLES uses this now, we always have accurate depth here.
2022-11-22 00:12:32 -08:00
Henrik Rydgård
8f103f3f47 Extract the Vulkan descriptor binding cleanup from #16345 2022-11-21 20:30:20 +01:00
Henrik Rydgård
fe1446bf92 Test crashfix 2022-11-21 19:57:59 +01:00
Henrik Rydgård
cbfa4bfc8e Centralize ClearCacheNextFrame 2022-11-21 18:13:13 +01:00
Henrik Rydgård
c3604428b9 Only check for display resized in emuscreen-under-pause-screen, not the other changes. 2022-11-21 17:59:56 +01:00
Henrik Rydgård
ce5a1b8b7e Some minor "centralization" 2022-11-21 17:55:30 +01:00
Henrik Rydgård
d73196c7d6 Split up the GPU config change notifications 2022-11-21 15:14:20 +01:00
Henrik Rydgård
eff4118769 One more refactoring step 2022-11-21 14:54:48 +01:00
Henrik Rydgård
7596713059 Refactor: Split up updating the display and render size. 2022-11-21 14:35:12 +01:00
Henrik Rydgård
f67ef7ab99
Merge pull request #16404 from hrydgard/transparent-pause-screen
Make the pause screen "transparent"
2022-11-21 14:27:59 +01:00
Henrik Rydgård
fd110ef6a9
Merge pull request #16408 from unknownbrackets/jit-wx
softgpu: Fix compile hazard while running
2022-11-20 21:42:10 +01:00
Unknown W. Brackets
4d06400548 softgpu: Fix compile hazard while running.
This prevents any clearing of cache while other threads may be using
previously cached funcs, and avoids wx exclusive hazards.
2022-11-20 12:04:02 -08:00
Henrik Rydgård
250ea5e592
Merge pull request #16407 from unknownbrackets/jit-wx
In jits, protect and unprotect using better estimates
2022-11-20 20:39:04 +01:00
Unknown W. Brackets
ce51942508 softgpu: Correct WX-exclusive platform hazards.
Should mainly affect BSD at this point.
2022-11-20 10:55:35 -08:00
Unknown W. Brackets
b2798c7ada jit: Add more reasonable estimates for RX protect. 2022-11-20 10:55:35 -08:00
Henrik Rydgård
8d96e777a1
Merge pull request #16401 from unknownbrackets/gedebugger-tex
GE Debugger: Correct texture address corruption in playback
2022-11-20 18:27:18 +01:00
Henrik Rydgård
37ec31dedd Fix resizing issue. Took some refactoring. 2022-11-20 12:57:32 +01:00
Henrik Rydgård
a3874ebcef
Merge pull request #16402 from unknownbrackets/softgpu-inversion
softgpu: Throw away all inverted polygons
2022-11-20 09:55:49 +01:00
Unknown W. Brackets
71b4407889 softgpu: Throw away all inverted polygons.
This is actually incorrect in some cases, but there are a number of games
affected by inversions, and they're practically always undesired.
2022-11-19 20:30:49 -08:00
Unknown W. Brackets
6c2001d12d GE Debugger: Correct texture address corruption.
Happened when playing back frame dumps that set bufw after specifying the
texture address, but before drawing.

Seen in Syphon Filter.
2022-11-19 14:59:52 -08:00
Henrik Rydgård
56a879bbd6
Merge pull request #16395 from unknownbrackets/blit-prefer-raster
GPU: Prefer raster for depth blit if supported
2022-11-18 16:50:35 +01:00
Unknown W. Brackets
47e5df3844 GPU: Prefer raster for depth blit if supported.
This seems to work around an apparent NVIDIA driver bug.
2022-11-17 18:32:38 -08:00
Lubos
db8b159d9e OpenXR - Force PSP menu aspect ratio 2022-11-17 17:30:29 +01:00
Unknown W. Brackets
7e7eabf86a softgpu: Use threads on self-render if safe.
Some games, such as Prince of Persia, self-render 1:1 to colorize, rather
than to scale or blur.  We can still use threads in these cases.
2022-11-13 12:34:31 -08:00
Unknown W. Brackets
d8716b5d90 softgpu: Fix off-by-one rendering after half-pixel.
If the X is after a half-pixel offset, the first pixel we draw is the next
one.  This wasn't being accounted for properly in one place.
2022-11-13 10:22:09 -08:00
Henrik Rydgård
fd43a0eade
Merge pull request #16384 from unknownbrackets/softgpu-fog
softgpu: Correct tex on fogged rectangles
2022-11-13 18:56:09 +01:00
Unknown W. Brackets
a66056217f softgpu: Avoid splitting rectangles for fog.
If the fog factor would result in the same amount of fog, we're just
adding more work for no reason.
2022-11-13 09:23:06 -08:00
Unknown W. Brackets
21064edfca softgpu: Correct tex on fogged rectangles. 2022-11-13 09:17:29 -08:00
Unknown W. Brackets
aac2faa674 GPU: Automatically reduce depth range on == test.
Fixes graphic issues in Blade Dancer, possibly other games.
2022-11-13 08:13:22 -08:00
Unknown W. Brackets
01d7d73438 GPU: Remove unused GPU_USE flag. 2022-11-13 08:09:57 -08:00
Unknown W. Brackets
4a367148e6 GPU: Centralize more GPU_USE flags, like depth. 2022-11-13 08:04:47 -08:00
Henrik Rydgård
1ae6047da9
Merge pull request #16379 from unknownbrackets/stencil-android
Fix alpha/stencil replace on Adreno when color masked
2022-11-13 10:12:39 +01:00
Unknown W. Brackets
eae85836c9 GPU: Add a small error-compensation to depth clip.
This was causing a depth that should've calculated as zero to be clipped,
because the multiply and division resulted in a value that was off by
about 2 / pow(2, 24) in the negative direction.
2022-11-12 20:01:46 -08:00
Unknown W. Brackets
66668d4b3f Vulkan: Correct alpha in Adreno workaround. 2022-11-12 17:41:48 -08:00
Unknown W. Brackets
98758573e3 GPU: Convert alphamask to FF/00 for 5551.
When masking via uniform, we don't care about the lower bits of alpha.
Games often use 7F / 80 to control writes of FF/00.
2022-11-12 17:41:48 -08:00
Lubos
72d197fc47 Revert "OpenXR - Disable range culling properly"
This reverts commit d1dabd40ee.
2022-11-10 18:44:11 +01:00
Unknown W. Brackets
70c3205564 GPU: Correct equal depth checks. 2022-11-09 20:34:29 -08:00
Henrik Rydgård
2886c33c06
Merge pull request #16370 from lvonasek/compat_openxr_sonic
OpenXR - Sonic Rivals fixed
2022-11-09 21:28:34 +01:00
Lubos
b980f55645 OpenXR - Don't get mirroring from identity matrix 2022-11-09 19:07:45 +01:00
Unknown W. Brackets
1c0a37f252 GPU: Correct vertex decoder in software transform.
It was meant to flip to skin in decode.
2022-11-09 07:07:39 -08:00
Henrik Rydgård
a8537576e5
Merge pull request #16361 from unknownbrackets/depth-equal
GPU: Avoid clears for non-simple depth values
2022-11-09 09:57:12 +01:00
Unknown W. Brackets
745d9ad320 GPU: Avoid enabling depth test pointlessly.
See #16015.  Attempting to avoid a driver bug.
2022-11-08 20:06:08 -08:00
Unknown W. Brackets
855d16ffb3 GPU: Prefer scaling depth to 16-bit if using 24.
In most cases, this will be a lot faster than pixel depth rounding, and
may avoid more issues in vertex rounding.
2022-11-08 20:06:08 -08:00
Unknown W. Brackets
3333f2a5aa GPU: Avoid clears for non-simple depth values.
Some drivers don't round depth the same way for a clear vs for drawing,
which can cause mismatches.  We only do this if we see equals-style depth
comparison funcs used in drawing.
2022-11-08 20:06:08 -08:00
Unknown W. Brackets
585569c2c2 TexCache: Cleanup BGRA flag dirtying. 2022-11-08 20:01:14 -08:00
Henrik Rydgård
c6084c16c3 Fix GLSL compilation issues on really old Adreno drivers.
They don't seem to accept unsigned integers as switch cases.

Fixes some stuff in #16295 , not sure if all of it.
2022-11-08 22:59:43 +01:00
Henrik Rydgård
584ca5db6e
Merge pull request #16364 from unknownbrackets/gpu-self-copy
GPU: Avoid self memcpy()
2022-11-08 18:05:07 +01:00
Unknown W. Brackets
1f20e11d61 GPU: Avoid self memcpy(). 2022-11-08 07:41:32 -08:00
Henrik Rydgård
87bd7aaccc
Merge pull request #16356 from lvonasek/cleanup_camera_control
OpenXR - Camera adjust using any controller
2022-11-08 12:28:44 +01:00
Luboš Vonásek
92384c2854
Space added 2022-11-08 07:09:27 +01:00
Unknown W. Brackets
bc53a0d7c4 TexCache: Correct 16->32 for CLUT4 with shift. 2022-11-07 18:41:47 -08:00
Unknown W. Brackets
17f6c00c3c TexCache: Fix 16->32 colors with CLUT start pos. 2022-11-07 18:34:10 -08:00
Unknown W. Brackets
04cd6c4f7d TexCache: Align expandClut buffer, cleanup sizes.
We shouldn't need larger than 2 KB CLUT buffers, since it's actually only
1 KB.  We have a hack that allows 2 KB for separate mip map levels.
2022-11-07 18:18:02 -08:00
Henrik Rydgård
970c266b41 Restore parallel GLSL builds 2022-11-08 00:30:21 +01:00
Henrik Rydgård
4d637342f7 Log source code for failed pipeline creations 2022-11-08 00:21:08 +01:00
Henrik Rydgård
4e8f97d64d Output shader descriptions directly in the source code 2022-11-08 00:21:08 +01:00
Lubos
d1dabd40ee OpenXR - Disable range culling properly 2022-11-07 22:10:12 +01:00
Henrik Rydgård
24d5cd087c Experiment (Vulkan): Temporarily disable GLSL parallel compilation on Android. For #16341 investigation. 2022-11-07 14:30:24 +01:00
Henrik Rydgård
ad14d628b6 Turn off boundSecondaryIsInputAttachment_ when we don't have one. 2022-11-07 09:30:47 +01:00
Henrik Rydgård
668904a515 Vulkan: Use the very same view as input attachment and color attachment, not just the same image
Fixes most of the new validation errors seen #16351, though one remains.

I believe that to be a bug in the validation layers, will investigate
later.
2022-11-07 09:14:55 +01:00
Henrik Rydgård
41c812651d
Merge pull request #16347 from unknownbrackets/softgpu-skin
Always skin in decode for software transform and rendering
2022-11-06 20:21:02 +01:00
Henrik Rydgård
69941c0d72 Android fix 2022-11-06 20:01:22 +01:00
Henrik Rydgård
c91e7912bf Change "Simulate block transfer" to "Skip GPU Readbacks". Group the speed hacks together 2022-11-06 19:30:38 +01:00
Henrik Rydgård
519db766b6 Change "Rendering Mode" to just a "Skip buffer effects" checkbox. Reuse translations. 2022-11-06 19:26:56 +01:00
Unknown W. Brackets
31cb3a8eae
Merge pull request #16346 from hrydgard/remove-retain-changed-textures-setting
Change the "Retain changed textures" option into a compat.ini option.
2022-11-06 10:18:21 -08:00
Unknown W. Brackets
527947fd81 GPU: Correct softgpu curve issue. 2022-11-06 09:06:07 -08:00
Unknown W. Brackets
3de2557ecb GPU: Always skin in decode for software transform. 2022-11-06 08:55:07 -08:00
Unknown W. Brackets
7880eb15c1 softgpu: Always use software skinning.
There's only software skinning, after all.
2022-11-06 08:44:22 -08:00
Unknown W. Brackets
6c36f03a0d GPU: Purify vertTypeIsSkinningEnabled(). 2022-11-06 08:40:54 -08:00
Henrik Rydgård
95cb358fbf Change the "Retain changed textures" option into a compat.ini option.
This option benefits so few games and can hurt others, so that it's
better that we specifically enable it for known cases like Popolocrois.
2022-11-06 17:28:50 +01:00
Unknown W. Brackets
66472c39ce GPU: Use skinned position always in bounding check.
Meanwhile, move to a flag on decoder options instead of global check.
2022-11-06 08:23:31 -08:00
Unknown W. Brackets
a5d3af9cb0 GPU: Cleanup GetVertTypeID() usage. 2022-11-06 08:01:57 -08:00
Henrik Rydgård
b4507cd5cc Make a lot more code VR build for all platforms 2022-11-06 14:36:51 +01:00
Henrik Rydgård
0f37854ef9 Drop some D3D11 screen rotation support (was only used on Windows Phone) 2022-11-05 22:17:06 +01:00
Henrik Rydgård
ad6725b684 VK/D3D11: Move the rarely used "u_rotation" uniform to the frame uniform buffer.
This uniform is used in two cases:

* Non-buffered rendering in Vulkan, software transform
* Non-buffered rendering in D3D11 level 9 on Windows Phone, software transform
  - which I don't think anyone builds for anymore

Nice to not have it in the main uniform buffer, but mainly a
demonstrator/test of moving stuff to the new frame-global buffer, and
setting up the infrastructure.
2022-11-05 22:14:05 +01:00
Lubos
c6b83dd9d8 OpenXR - Enable camera movement and stereo in flatscreen mode 2022-11-03 20:00:30 +01:00
Henrik Rydgård
03a90b1bbf
Merge pull request #16321 from unknownbrackets/gedebugger-record
GE Debugger: Try harder to identify unchanged VRAM
2022-11-02 07:15:39 +01:00
Unknown W. Brackets
1ffdf0d5b8 GE Debugger: Respect unchanged VRAM each frame.
Oops, wasn't setting the version each run after caching the frame dump
data.
2022-11-01 22:56:29 -07:00
Unknown W. Brackets
00e8720749 GE Debugger: Try harder to identify unchanged VRAM.
If we exit to the CPU (stall), we don't know if VRAM gets changed by the
CPU.  We can check to avoid making the dump require unnecessary copying.
2022-11-01 22:47:46 -07:00
Unknown W. Brackets
5afb009b56 GE Debugger: Dump textures only if possibly used. 2022-11-01 22:15:11 -07:00
Unknown W. Brackets
e7185f93b3 GE Debugger: Restrict marking of dirty VRAM better. 2022-11-01 22:14:23 -07:00
Henrik Rydgård
7967da0f6f Vulkan: Fix descriptor set binding in geometry shader generator. Should fix #16315 2022-11-01 13:43:48 +01:00
Unknown W. Brackets
0a98ac43fa Debugger: Allow currently-invalid memory reference. 2022-10-29 17:43:35 -07:00
Henrik Rydgård
c6fe91224a Vulkan: Fixes validation errors with "null" textures
These arise in non-buffered rendering when we don't have a framebuffer
to texture from.
2022-10-28 18:40:55 +02:00
Henrik Rydgård
8e0b82f92e Address feedback 2022-10-28 17:42:21 +02:00
Henrik Rydgård
d9cfcf215e Need to request the proper type of uniform buffer descriptors.
Otherwise, assert on Mali.
2022-10-28 10:20:47 +02:00
Henrik Rydgård
10eb21d3b3 Add some extra checking for valid stereo shader. 2022-10-28 10:17:29 +02:00
Henrik Rydgård
ab1cebec51 Actually bind a global uniform buffer, too. Not yet used. 2022-10-28 10:15:36 +02:00
Henrik Rydgård
96a5c52037 Vulkan: Reserve descriptor set 0 for frame-global data, move everything else to set 1 2022-10-28 09:39:56 +02:00
Henrik Rydgård
85e7933e7a Format string fix 2022-10-27 11:06:00 +02:00
Henrik Rydgård
e058f8aee6 Shadergen fix for OpenGL 2022-10-27 11:05:59 +02:00
Henrik Rydgård
6d9008dab5 Fix validation issue with clears, remove redundant code 2022-10-27 11:05:59 +02:00
Henrik Rydgård
e0bbebc65e Clean up GPU_Vulkan::BuildReportingInfo a bit 2022-10-27 11:05:59 +02:00
Henrik Rydgård
763afd4a8e Improve compatibility checks for stereo rendering. 2022-10-27 11:05:59 +02:00
Henrik Rydgård
931c869ca9 Fix for stereo with textureProj (emulated projection). 2022-10-27 11:05:59 +02:00
Henrik Rydgård
7d5bb79257 Fix depal texture binding bug 2022-10-27 11:05:59 +02:00
Henrik Rydgård
31fd928a5c Name more image views. Very useful with a little patch to the Vulkan debug layers. 2022-10-27 11:05:59 +02:00
Henrik Rydgård
cd203291ba Fix rendering in non-stereo mode 2022-10-27 11:05:59 +02:00
Henrik Rydgård
15d4495f76 Pass shadergen tests 2022-10-27 11:05:59 +02:00
Henrik Rydgård
2a1526c352 Address feedback 2022-10-27 11:05:59 +02:00
Henrik Rydgård
390a136cb5 Stereo now works through shader depal too 2022-10-27 11:05:59 +02:00
Henrik Rydgård
8413473fa4 Fix more cases, GTA works now. 2022-10-27 11:05:59 +02:00
Henrik Rydgård
524e92374f Use arrays more consistently. 2022-10-27 11:05:59 +02:00
Henrik Rydgård
91259aaad7 Always use array textures for framebuffers in Vulkan for simplicity. 2022-10-27 11:05:58 +02:00
Henrik Rydgård
2bea495981 wip 2022-10-27 11:05:58 +02:00
Henrik Rydgård
6af4644ab2 Stereo on mobile fixes 2022-10-27 11:05:58 +02:00
Henrik Rydgård
0de12f5ca9 Some refactoring of framebuffer views, layer issues, more work. 2022-10-27 11:05:58 +02:00
Henrik Rydgård
2e87f0bc0b More work. Things are starting to work now. 2022-10-27 11:05:58 +02:00
Henrik Rydgård
c668736924 Add a couple of stereo display shaders, add infrastructure, compile stereo pipelines 2022-10-27 11:05:58 +02:00
Henrik Rydgård
12d1f94d47 Start stereo postshader work 2022-10-27 11:05:58 +02:00
Henrik Rydgård
fb250c4b29 More multiview work 2022-10-27 11:05:58 +02:00
Henrik Rydgård
d3804ec2e5 Misc multiview hackery 2022-10-27 11:05:58 +02:00
Henrik Rydgård
bbb55e9b1d
Merge pull request #16284 from unknownbrackets/gedebugger
GE Debugger: Correct UV display with prescale
2022-10-26 09:32:57 +02:00
Unknown W. Brackets
1e1c75d552 GE Debugger: Correct UV display with prescale.
Sometimes these weren't flushed yet, and it made the texture preview and
vertices confusing and wrong (using old factors, not just no factors.)
2022-10-25 22:14:16 -07:00