Commit Graph

6655 Commits

Author SHA1 Message Date
Henrik Rydgård
e57770977b We don't use primitiveRestart for anything, let's not enable it. It has costs on some hardware. 2021-10-08 22:22:08 +02:00
Henrik Rydgård
d7ac6aa63d Fix an assortment of minor VK barrier bugs in mostly texture upload 2021-10-08 21:58:03 +02:00
Henrik Rydgård
b426d12a17 More best-practices adjustments 2021-10-08 21:32:40 +02:00
Henrik Rydgård
ddc0f0829b Replaced textures: Don't leak handles on failure, check allocation success 2021-10-08 19:09:43 +02:00
Henrik Rydgård
59ac4d3e27 Vulkan: Rework mipmap generation and its image barrier/layout handling.
Fixes bugs on mobile with texture scaling + auto max quality texturing
(since that generates mipmaps with blits from an image which was just generated from
compute, making proper barriers very critical).
2021-10-05 22:50:49 +02:00
Henrik Rydgård
887f6101d5 Remove the "Auto" texture scale factor. It's a performance trap and not really useful. 2021-10-05 20:41:40 +02:00
Unknown W. Brackets
b1009f70f9 softgpu: Allow end coordinate at bounds.
Oops, was excluding some valid usage that wouldn't wrap.
2021-09-30 06:33:25 -07:00
Unknown W. Brackets
953916a842 softgpu: Avoid fast path for clamp/wrap cases.
It doesn't clamp or wrap, and those are uncommon for the fast path.
Fixes #14951.
2021-09-29 19:19:21 -07:00
Henrik Rydgård
992ad801e7 Add a crude way to blacklist post/texture shaders from certain vendors.
Use it to work around #14530 for now.
2021-09-28 23:39:52 +02:00
Unknown W. Brackets
2d9719ed26 TexCache: Avoid hashing videos at all in lazy mode. 2021-09-19 07:35:25 -07:00
Unknown W. Brackets
e2c7366c92 TexCache: Prevent lazy cache on video textures. 2021-09-19 07:31:31 -07:00
Unknown W. Brackets
c755dedbf6
Merge pull request #14842 from unknownbrackets/texfilt
Vulkan: Expand 16-bit textures to generate mips
2021-09-13 07:26:43 -07:00
Unknown W. Brackets
c37c078254 Vulkan: Only force 32-bit if needed.
If there are mips already, we can keep 16-bit.
2021-09-13 00:07:01 -07:00
Unknown W. Brackets
d9f62d690a Vulkan: Expand 16-bit textures to generate mips.
When using "Auto Max Quality", we can't use 16-bit formats.
See #14804.
2021-09-13 00:03:42 -07:00
Unknown W. Brackets
6762903087 TexCache: Correct confusing red/blue var names.
This decodes to RGBA (R least significant), so it's confusing to refer to
it as BGRA.  It's actually the 565 colors in the DXT data that are BGR.
2021-09-12 17:21:45 -07:00
Unknown W. Brackets
08816a544d softgpu: Implement DXT5 in samplerx86. 2021-09-12 17:17:09 -07:00
Unknown W. Brackets
c4de5bfb9f softgpu: Implement DXT3 in samplerx86. 2021-09-12 14:53:55 -07:00
Unknown W. Brackets
ee9d19430f softgpu: Implement DXT1 decoding in samplerx86. 2021-09-12 13:57:28 -07:00
Unknown W. Brackets
a0eeb52444 softgpu: Decode DXT texels directly.
This improves performance a lot compared to decoding the whole block.
Eventually we may implement a cache, but threading makes that complex to
make properly fast.
2021-09-12 09:37:34 -07:00
Unknown W. Brackets
1ee5352d3e TexCache: Correct DXT5 alpha calculation.
This matches PSP alpha values from an exhaustive test.
2021-09-12 09:35:53 -07:00
Unknown W. Brackets
121c56e6db softgpu: Clip only on -Z, cull if entirely outside.
This is important for several issues, like #12058 or #12060, where
something is drawn entirely outside valid Z, and should be culled.
2021-09-09 20:13:42 -07:00
Unknown W. Brackets
0b73c1ce83 softgpu: Correct guardband cull behavior.
Culling is based on whether clipping happens, not whether clamping
happens.  This is important for issues like #12348.
2021-09-09 20:05:41 -07:00
Henrik Rydgård
5876388c65 Vulkan scissor fix (validation errors). 2021-09-10 01:15:29 +02:00
Stuart Kenny
f442f4012c Expose texture shader core option. 2021-09-08 16:42:11 +01:00
Henrik Rydgård
5dab9994b6 Bezier/Spline: Fix logical error (must flush buffered data before we modify submitType).
Should fix #14774
2021-09-07 23:52:06 +02:00
Henrik Rydgård
e2b0137400 VK: Only autogenerate mipmaps for R8G8B8A8 format textures.
Quickfix for bug with Auto High Quality texture filtering.

Fixes #14804 (good enough for now at least).
2021-09-07 23:41:03 +02:00
Unknown W. Brackets
b5ba469826 softgpu: Prevent pixel gaps when drawing sprites.
If you end a sprite at 255.9, it draws the pixel at 255.  This uses the
same logic to handle that as in the triangle path.
2021-09-06 22:05:39 -07:00
Henrik Rydgård
b5e8e22dc9
Merge pull request #14789 from hrydgard/auto-max-quality-texfilter
Add new texture filtering mode "Auto Max Quality"
2021-09-07 00:58:48 +02:00
Unknown W. Brackets
7addc18a6b softgpu: Avoid overflow infinite loop.
For certain large values, it would overflow and continue looping
endlessly.
2021-09-05 23:24:08 -07:00
Henrik Rydgård
1df31e9304 Fix windows menus for the new tex filtering options. 2021-09-05 23:54:41 +02:00
Henrik Rydgård
6b76bcf070 Add new texture filtering "Auto Max Quality" that tweaks texture filtering for best quality.
It does this by enforcing mipmapping and minification filters, and
always autogenerates mipmaps and enforces anisotropic filtering for all
modes (if that's separately enabled).

This looks nice and flicker free in most games without any additional
tweaking, including GTA and Burnout which have long been painfully
flickery in the distance due to undersampling.

Needs a bit more testing before merge, maybe.

Fixes #13888
2021-09-03 00:14:58 +02: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
6e8e375eea Increase the range of cardboard setting sliders to 150%. See #14768 2021-08-29 15:27:51 +02:00
Henrik Rydgård
c0d80b63a9 Hack the math better in cardboard VR mode, to avoid issues with very wide aspect ratios.
Fixes #12982
2021-08-28 22:28:02 +02:00
Henrik Rydgård
0c34c939ad
Merge pull request #14749 from amverweij/rename-vk-externals-v3
Rename Vulkan externals
2021-08-21 13:45:06 +02:00
Bram Verweij
a31cbe42d2 Rename namespace to PPSSPP_VK, remove indentation 2021-08-21 12:39:15 +02:00
Bram Verweij
cc00a4132d Prevent dlopen collisions between ppsspp_libretro.so and libvulkan.so 2021-08-20 11:22:57 +02:00
Henrik Rydgård
928bc88b01 Rename Unthrottle to Fast-forward globally 2021-08-18 09:28:13 +02:00
Unknown W. Brackets
4cb6976029 GPU: Use an empty vertex buf for reinterpret.
See #14552.
2021-08-07 22:22:36 -07:00
Unknown W. Brackets
9a841664a6 D3D11: Use right state in flush before output.
We were accidentally changing the blend state for the final draw in a
frame.  This could cause apparently random issues if a game didn't align
drawing with vblanks.

Fixes #13152.
2021-08-02 23:45:49 -07:00
Henrik Rydgård
bea9f67c02 Fix assorted path issues 2021-07-19 17:34:51 +02:00
Henrik Rydgård
b0558b2174 Assorted directory fixes 2021-07-19 17:34:50 +02:00
Henrik Rydgård
69ae3f4c02 Better protection against broken viewports.
It's ok if this emits a single pixel sized viewport, since the cause of
this is generally the viewport being specified outside the scissor
rectangle.

Fixes #13921
2021-07-12 21:19:26 +02:00
Henrik Rydgård
7359c8f083 Revert "Make sure we don't try to set a negative viewport size."
This reverts commit 0386cafe53.
2021-07-12 21:03:29 +02:00
Henrik Rydgård
bd15ae4f75 Fix bug in homebrew store with files with "." in their names.
Also, move the homebrew store button to the top bar instead of the
bottom of the list.
2021-07-12 11:55:15 +02:00
Henrik Rydgård
deee9f9720 Unify the Vulkan format definitions / swizzles
To make the next attempt at #14602 easier.
2021-07-11 11:26:40 +02:00
Henrik Rydgård
3595e092c9 Turn off all 16-bit formats if B5G6R5 format is not available.
Works around #14602 for now.
2021-07-10 23:33:46 +02:00
Henrik Rydgård
7e048dbbff Revert "Merge pull request #14588 from hrydgard/vk-correct-565-format"
This reverts commit 43c16f1ea2, reversing
changes made to 25cfb92a9c.
2021-07-10 20:01:16 +02:00
Henrik Rydgård
95dc7bb185 Minor cleanup 2021-07-10 20:00:50 +02:00
Henrik Rydgård
90460df9b5 HLSL depal simplification 2021-07-09 21:09:44 +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
9a2e220e0d Vulkan: Use the mandatory-support RGB565 format and not the opposite one.
Had apparently misread the spec.

Fixes validation (and probably rendering) errors on Linux/Intel.

https://www.khronos.org/registry/vulkan/specs/1.2/html/chap33.html#features-required-format-support
2021-07-07 19:07:29 +02:00
Unknown W. Brackets
87716a158f
Merge pull request #14391 from hrydgard/new-threadpool
New ThreadManager, replacing threadpools and "PrioritizedWorkQueue"
2021-06-13 07:08:32 -07: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
Unknown W. Brackets
17071e7fec Postshader: Add uniform for delta since last frame.
Useful mainly when using previous frame output.
2021-06-12 11:27:26 -07:00
Unknown W. Brackets
7bbaae492b Postshader: Let shaders use the previous frame.
This is useful for i.e. simulating the slow update speed of the PSP's LCD
screen, but could in theory be used for other effects.
2021-06-12 10:54:36 -07:00
Henrik Rydgård
73871b9b7e Implement new thread manager, port stuff to it. 2021-06-12 13:03:53 +02:00
Unknown W. Brackets
1f6860d6c1 GPU: Clamp DXT texture memory bound.
See #13109.  This should handle any texture read that starts near a VRAM
or RAM boundary without crashing.
2021-06-06 11:52:26 -07:00
Henrik Rydgård
0cd7af44f1 Fix ZipAssetReader file listing. Fixes post shaders on Android 2021-05-13 11:49:33 +02:00
Henrik Rydgård
a40b1dec5f Use Path for fullName in dirlisting. Bugfixes.
Buildfixes

UWP: Buildfix.

headless: Buildfix.

Common: Buildfix.

iOS: Buildfixes.

libretro: Buildfix.

Qt: Buildfix.
2021-05-13 10:39:16 +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
3304814fd6 GPU: Minor cleanup duplicate header/conditions. 2021-05-08 09:12:22 -07: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
Henrik Rydgård
08843673d9 Rename a couple of functions. 2021-04-25 20:39:32 +02:00
Henrik Rydgård
1b13badeb4 Move remaining FileUtil functions into the File namespace. 2021-04-25 20:38:22 +02:00
Unknown W. Brackets
086b8229f5 GE Debugger: Keep dump generation deterministic. 2021-04-17 16:25:36 -07:00
Unknown W. Brackets
abb7b83fee GE Debugger: Thread dedupe pushbuf lookups.
This improves time especially for larger dumps.
2021-04-16 00:00:56 -07:00
Henrik Rydgård
a7d7631feb
Merge pull request #14369 from unknownbrackets/zstd
Use zstd for save states, GE frame dumps, and ZIMs
2021-04-12 08:35:58 +02:00
Unknown W. Brackets
a97030068c GE Debugger: Use zstd for save states. 2021-04-11 09:13:10 -07:00
Unknown W. Brackets
d3e2aa6d28 Build: Add libzstd to build. 2021-04-11 09:13:10 -07:00
Henrik Rydgård
7e8a94e7de
Merge pull request #14366 from unknownbrackets/shader-errors
Fix some shader errors from reporting
2021-04-11 08:09:09 +02:00
Unknown W. Brackets
ca1a936d56 GPU: Stop using Off as terminator for postshaders.
There's really no need to have a dummy entry at the end of the array.
2021-04-10 18:35:23 -07:00
Unknown W. Brackets
3c09b5c010 GLES: Always use fragColor0 on GL 3.0+. 2021-04-10 16:26:39 -07:00
Unknown W. Brackets
c18236b5fa GPU: Avoid switch on uint.
Vivante seems to get confused.
2021-04-10 14:01:33 -07:00
Unknown W. Brackets
a23c9e6a41 GPU: Preconvert light vecs to Vec3f.
This might align better for simd anyway, but should also prevent any
memory over-reads.  See #14353.
2021-04-05 20:55:52 -07:00
Unknown W. Brackets
e1e830c3b0 Debugger: Include src tag in Memory::Memcpy. 2021-04-03 18:14:59 -07:00
Unknown W. Brackets
8a9979b50e Debugger: Include framebuffer in framebuf pack tag. 2021-04-03 18:11:44 -07:00
Unknown W. Brackets
ee749804fc Debugger: Note GPU block transfer src as well. 2021-04-03 18:11:44 -07:00
Unknown W. Brackets
aa89ed5111 Debugger: Include source tag in memcpys. 2021-04-03 18:11:44 -07:00
Unknown W. Brackets
a42d3834f2 Build: Remove "fake" vertex decoder jit.
We don't really need this.  Just replace it with a stub that always fails
to generate a vertex decoder.
2021-03-20 17:06:21 -07:00
Paul Cercueil
ce0af0743c
VertexDecoderFake: Fix build
Fix build of VertexDecoderFake.

Tested on MIPS.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2021-03-17 21:48:12 +00:00
Henrik Rydgård
4e1bc2b3e0 Further std::string removal 2021-03-13 17:55:07 +01:00
Henrik Rydgård
42186e8e9e Warning fix, memleak fix 2021-03-11 23:28:02 +01:00
Henrik Rydgård
98f593fd5d Only do the workaround in #14273 in Vulkan. May help #14280 2021-03-11 09:14:36 +01:00
Henrik Rydgård
3ac405ab5d GLSL vulkan: Specify the precision of function arguments. Works around #14269 2021-03-09 00:09:00 +01:00
Henrik Rydgård
409a2b5e28 Work around crash in texture replacement. See #14252 2021-03-08 00:55:17 +01:00
Henrik Rydgård
f8ad621df5 PipelineManagerVulkan: Log shader source when pipeline creation fails. 2021-03-08 00:12:38 +01:00
Henrik Rydgård
71707b5102 Fix bug in vertex shader generator. See #14260. 2021-03-05 12:32:06 +01:00
Henrik Rydgård
57d4c4f406
Merge pull request #14250 from unknownbrackets/config-defines
Cleanup ppsspp_config.h usage
2021-03-03 08:58:00 +01:00
Unknown W. Brackets
d010f07529 GPU: Ignore replacements for framebufs.
Since these don't specify the texture hash/etc. info.
More importantly, prevents a crash.
2021-03-02 23:54:35 -08:00
Unknown W. Brackets
4178f09e57 Build: More consistently avoid _M_ defines.
We use PPSSPP_ARCH in several places already, this makes it more complete.
2021-03-02 21:49:21 -08:00
Unknown W. Brackets
d9aecffd72 Build: Remove old ARM define. 2021-03-02 21:26:03 -08:00
Unknown W. Brackets
e621aca9ba Build: Remove MIPS define.
We shouldn't want to use that anyway, for conflicts...
2021-03-02 21:14:09 -08:00
Unknown W. Brackets
5119d79082 Build: Remove IOS define. 2021-03-02 21:04:03 -08:00
Unknown W. Brackets
13ec384dbe Build: Explicitly include ppsspp_config.h.
This adds it to all files that use it.  Not all our builds include the
file.
2021-03-02 21:04:03 -08:00
Henrik Rydgård
0facd4d4a6
Merge pull request #14230 from unknownbrackets/texreplace
Support texture replacement filtering overrides
2021-02-28 18:09:38 +01:00
Henrik Rydgård
08c917fe7b
Merge pull request #14233 from unknownbrackets/texoffset
GPU: Dirty texparams when cropping a self-copy
2021-02-28 18:09:02 +01:00
Unknown W. Brackets
7c7b1dafa0 GPU: Dirty texparams when cropping a self-copy.
If we used UV to limit the blit, we may need to do the blit again next
time, so re-examine texture params.
2021-02-28 08:20:46 -08:00
Unknown W. Brackets
64484a59e6 GPU: Normalize zero consistently in hw transform. 2021-02-28 00:05:10 -08:00
Unknown W. Brackets
2f63f9999d GPU: Normalize 0 to 1 always in software lighting.
See #14167.  This seems to be consistent.
2021-02-27 23:51:45 -08:00
Unknown W. Brackets
82a7a26409 GPU: Look up replaced filtering options. 2021-02-27 17:17:21 -08:00
Unknown W. Brackets
fb3ad1df4b Replacement: Read in texture filtering overrides.
If you're replacing, you can know more information about linear safety for
tests.
2021-02-27 17:16:16 -08:00
Unknown W. Brackets
579482320d GPU: Revert stencil discard workaround change.
This reverts commit 0640ebb22d.

Apparently caused more problems than it solved.
2021-02-23 19:39:01 -08:00
Unknown W. Brackets
0640ebb22d GPU: Use stencil discard workaround w/o depth test. 2021-02-22 21:40:01 -08:00
Henrik Rydgård
2f3bc2d373
Merge pull request #14056 from unknownbrackets/debugger-mem
Track memory allocations and writes for debug info
2021-02-21 10:18:11 +01: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
Henrik Rydgård
bcbfee6403
Merge pull request #14185 from unknownbrackets/screenshot
GPU: Rotate screenshot framebuffer per display
2021-02-20 10:23:47 +01:00
Unknown W. Brackets
28a4057115 GPU: Rotate screenshot framebuffer per display. 2021-02-19 22:57:34 -08:00
Henrik Rydgård
aec37e8bb4 Only consider the actual PPGe texture in kernel ram reliable.
It seems some Chinese patches like to allocate kernel space for
textures.

(On that note, we should probably allocate our texture elsewhere... in
case it takes up too much space).
2021-02-19 09:53:55 +01:00
Unknown W. Brackets
277691746d GPU: Correct more vertex/index endian swaps. 2021-02-18 22:28:41 -08:00
aliaspider
9a3e5879bb Global: Correct many endian types and casts. 2021-02-18 22:25:24 -08:00
Unknown W. Brackets
229d684214 GPU: Prevent memory fault when no framebuf yet. 2021-02-16 19:29:37 -08:00
Unknown W. Brackets
e08e0cba33 GPU: Remove clear framebuf on first use speedhack.
Wasn't helping much.
2021-02-15 23:12:24 -08:00
Unknown W. Brackets
cc1b4e695d Debugger: Correct crash with no alloc tag. 2021-02-15 15:01:23 -08:00
Unknown W. Brackets
a590671e8c GPU: Cleanup comment. 2021-02-15 15:01:23 -08:00
Unknown W. Brackets
10a77d29ab Debugger: Track texture usage too. 2021-02-15 15:01:23 -08:00
Unknown W. Brackets
76ae1b4d28 Debugger: Mark framebuffers as VRAM allocations. 2021-02-15 15:01:23 -08:00
Unknown W. Brackets
88e2b9b740 Debugger: Notate memset tags directly. 2021-02-15 15:01:23 -08:00
Unknown W. Brackets
f7740edc6d Debugger: Add more metadata for memory usage. 2021-02-15 15:01:21 -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
e8ab06e66d
Merge pull request #14026 from hrydgard/vertex-minihash-align
Vertex cache minihash: Round up the starting address to a multiple of 4.
2021-02-15 15:26:47 +01:00
Kingcom
5109fd7cdc CMake: Correct build on Windows. 2021-02-15 06:09:12 -08:00
Henrik Rydgård
6df37b86bc
Merge pull request #14076 from unknownbrackets/zhp-map
GPU: Force texture invalidation for ZHP minimap
2021-02-15 11:33:32 +01:00
Unknown W. Brackets
abfeacef61 GPU: Fix a type comparison warning. 2021-02-14 10:30:10 -08:00
Unknown W. Brackets
da2e722794 Windows: Fix some format warnings. 2021-02-14 10:30:10 -08:00
Unknown W. Brackets
6247e4d0ee Windows: Add some missing override specifiers. 2021-02-14 10:30:10 -08:00
Unknown W. Brackets
2c165c9b6d Windows: Fix improper case or missing includes.
As per mingw errors/warnings.
2021-02-14 10:30:10 -08:00
Henrik Rydgård
d23bef1525
Merge pull request #14129 from unknownbrackets/gpu-copyimage
GPU: Force reinterpret off without copy image
2021-02-13 07:38:52 +01:00
Unknown W. Brackets
5aa3e3180f GPU: Force reinterpret off without copy image.
Also, assert we have it when using it, since there's ifs.
2021-02-12 20:40:21 -08:00
Henrik Rydgård
2864ff16c0 Some GLSL compilers are very particular about the sign of shift operands.. 2021-02-12 15:06:44 +01: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
ec3bfe08ae GPU: Force texture invalidation for ZHP minimap.
See #14069, our texture hash misses this change.
2021-02-07 09:02:28 -08:00
Unknown W. Brackets
c1fa4958d9 vertexjit: Only save extra regs on x64. 2021-02-01 07:06:18 -08:00
Unknown W. Brackets
30b6f1f865
Merge pull request #14043 from unknownbrackets/vertexjit-abi
vertexjit: Correct saved registers on x64
2021-01-31 15:38:00 -08:00
Unknown W. Brackets
cc4d0479bf Core: Assert debug stats remain positive. 2021-01-31 15:06:11 -08:00
Unknown W. Brackets
ddff063097 vertexjit: Correct saved registers on x64. 2021-01-31 15:05:15 -08:00
Henrik Rydgård
294f530cd0 Have the flat shading workaround obey the driver workarounds checkbox 2021-01-31 15:50:19 +01:00
Henrik Rydgård
95a14be6f9
Merge pull request #14034 from unknownbrackets/ge-pause
Ge: Restore saved context when ending a list
2021-01-31 10:52:55 +01:00
Unknown W. Brackets
f2ad47512b Ge: Restore saved context when ending a list.
Otherwise another list queued by a Head push could use the wrong context
data.  See #13346.
2021-01-31 00:28:42 -08:00
Unknown W. Brackets
5041a898a2 Ge: Improve some logging and memchecks.
Explicitly trigger memchecks on readback.
2021-01-31 00:22:49 -08:00
Henrik Rydgård
c48bdf7efc Vulkan: Fix image layout issues after compute shader uploads.
We're already in GENERAL so probably not worth to transfer to DST just
to do even more transfers due to the silliness of GenerateMip.

I'm planning to rework the whole texture upload thing to be far more
optimal with some kind of TextureUploadManager

Fixes #13987
2021-01-30 23:09:42 +01:00
Henrik Rydgård
9a24bcdd9f Vertex cache minihash: Round up the starting address to a multiple of 4. 2021-01-30 18:40:18 +01:00
Unknown W. Brackets
c630d365cd Vulkan: Allow tex shaders to specify a max scale. 2021-01-28 01:03:02 -08:00
Henrik Rydgård
136c861d17
Merge pull request #13972 from unknownbrackets/clear-stencil
GPU: Respect stencil write mask for 5551 buffers
2021-01-25 09:38:16 +01:00
Unknown W. Brackets
0e25f6a83f D3D9: Don't allow separate alpha clears.
Doesn't seem like the color mask applies to clears.
2021-01-24 16:07:13 -08: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
Henrik Rydgård
c91a3a3dd2 GE: Better naming of render passes for color reinterpret 2021-01-25 00:12:25 +01:00
Henrik Rydgård
960e2dac36 OpenGL fragment shader gen: Fix precision inconsistency for v_color0/1.
Probably won't fix anything, just want this in for, well, consistency.

Noticed it debugging the iOS flat shading issues, but doesn't fix that.
2021-01-24 18:29:55 +01:00
Henrik Rydgård
cf797d8da5
Merge pull request #13944 from unknownbrackets/vulkan-scaling
Vulkan: Prevent scaling shader leak
2021-01-18 22:55:17 +01:00
Unknown W. Brackets
97b68e6964 Vulkan: Prevent scaling shader leak.
No need to recreate if they haven't changed.
2021-01-18 13:31:43 -08:00
Unknown W. Brackets
60b354a661 GPU: Fix safe size checks when rect offscreen. 2021-01-17 19:57:32 -08:00
Henrik Rydgård
c8bbf40bb0 GL FB readback: Only use "inout" if we actually want to read from the fb. 2021-01-17 19:13:56 +01:00
Unknown W. Brackets
5e3579a780 SoftGPU: Fix sprite provoking vertex in fast path.
It was right everywhere else.
2021-01-16 20:13:16 -08:00
Henrik Rydgård
71f9196d61 VK: Re-apply the old Adreno driver bug workaround. Fixes #13910.
Should likely fix issue #13923 too.
2021-01-16 12:57:14 +01:00
Henrik Rydgård
0386cafe53 Make sure we don't try to set a negative viewport size.
Should help #13921.
2021-01-16 09:45:21 +01: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
3f01cbb98c Initialize/Deinitialize the shader translation system once globally.
Fixes #13839.
2021-01-04 23:51:34 +01:00
Henrik Rydgård
f0bb504bb1 Postshader: Improve error reporting. 2021-01-03 19:15:05 +01:00
Henrik Rydgård
63424fb5be
Merge pull request #13862 from unknownbrackets/shader-minor
GPU: Ignore color write mask if unusable
2021-01-03 18:08:43 +01:00
Unknown W. Brackets
1834a524c8 GPU: Be careful with color write mask precision. 2021-01-03 08:50:34 -08:00
Unknown W. Brackets
4006a4b143 GPU: Ignore color write mask if unusable.
We unconditionally attempt to use a shader with color write mask, so we
can't just refuse to generate a shader - it'll mean non-supporting devices
get no shader at all.

It's better to continue ignoring the mask in that case.
2021-01-03 08:15:37 -08:00
Henrik Rydgård
678d881a1b
Merge pull request #13855 from unknownbrackets/headless
Remove "Null" GPU and enable softgpu without a backend
2021-01-02 20:41:55 +01:00
Unknown W. Brackets
e1050fe855 UWP: Don't try compiling samplerjit. 2021-01-02 09:54:35 -08:00
Unknown W. Brackets
3c9ab13672 GPU: Remove NULL GPU.
We can use the software GPU without a backend now, and this is in every
way superior and will result in better tests/headless behavior.
2021-01-02 09:36:13 -08:00
Unknown W. Brackets
ed65bc2327 SoftGPU: Allow rendering with no backend at all. 2021-01-02 09:25:41 -08:00
Unknown W. Brackets
66a6b27d78 UWP: Allow software renderer.
It can use the Direct3D 11 backend now for a while, so it should work on
UWP just fine.
2021-01-02 09:24:43 -08:00
Unknown W. Brackets
6a2b3f8f78 SoftGPU: Update PPGe draw context.
Oops, this was missing.
2021-01-02 09:23:25 -08:00
Unknown W. Brackets
4240fa3053 GPU: Correct some incorrect deallocations. 2021-01-01 15:43:13 -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
bdf36a4141 Temporary workaround for Wipeout Pure lens flare flicker.
See #13344.

Will try to figure out something better after the next release...
2020-12-20 13:04:28 +01:00
Henrik Rydgård
e0aa187161 UWP: Fix dialog rendering (PPGe). 2020-12-20 12:11:02 +01:00
Henrik Rydgård
e05c3ef63f UWP: Make the home button say "Home" instead of "Browse...". 2020-12-20 11:40:02 +01:00
Henrik Rydgård
a272deeba3 Postprocessing shader, GL: Fix shader version bug. Fixes #13779 2020-12-19 23:45:31 +01:00
Henrik Rydgård
7ca0f6a1c0 D3D11: Avoid the debug layer hazard tracker after blits. 2020-12-19 20:31:58 +01:00
Henrik Rydgård
05bfac0ef0 Misc logging improvements 2020-12-19 20:31:58 +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
7061993c8f VK: Restore the ARM Mali Z hack that got lost in the refactor somehow.
Warning fixes.
2020-12-14 19:54:39 +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
0c66f6c6d0 Assorted drive-by code cleanup 2020-12-13 00:20:47 +01:00
Henrik Rydgård
2f700aa495 Fix DiRT 2's car reflections. 2020-12-13 00:19:39 +01:00
iota97
0a44d9f600 Do not use x86 for other machine 2020-12-06 15:50:50 +01:00
Henrik Rydgård
06425dae8c Remove superfluous variable from uniform buffer 2020-12-03 09:13:46 +01:00
Henrik Rydgård
c0a5fa3e8b Fix a crash if JIT space failed to allocate 2020-12-02 00:33:51 +01:00
Unknown W. Brackets
b60250fca8
Respect stage in BindFramebufferAsColorTexture().
Introduced in #13634, only matters in error cases.
2020-11-29 07:59:35 -08:00
Henrik Rydgård
f1ab6c62c8 Fix Ghosts & Goblins for older backends too.
Fixes #13717
2020-11-28 16:16:51 +01:00
Henrik Rydgård
9818c8aabd Better debug names for BlitFramebuffer operations. 2020-11-28 13:45:26 +01:00
Henrik Rydgård
d5fe6154b5 Enable color reinterpret for Ultimate Ghosts & Goblins
The game uses it by accident probably, but whatever - it's a clean fix.

Fixes, but only for "modern" APIs, #13717.
2020-11-27 23:52:33 +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
29b2f2c4ef Better GLSL version handling. Now specify the latest version supported by the device.
Correct the version check for our own implementations of packUnorm4x8 etc.
2020-11-16 23:30:07 +01:00
Henrik Rydgård
d9350d4899 Fix scale in FramebufferCommon::GetFramebuffer. Fixes #13644 2020-11-15 22:38:47 +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
653a4bddde Fix check for when to generate packUnorm4x8 replacements 2020-11-11 22:46:25 +01:00
Henrik Rydgård
575ae376a9 Don't try to texture from depth if not supported by backend. Works around #13621 2020-11-10 23:36:33 +01:00
Henrik Rydgård
34efa1281b More consistent use of GLSL precision modifiers, now use them in Vulkan too.
Might help #13464 ?
2020-11-10 22:42:41 +01:00
Henrik Rydgård
c61f9bfd09 Fix bug in the new color writemask code, failing to limit it to Outrun properly. Fixes #13650. 2020-11-10 22:07:20 +01:00
Henrik Rydgård
d99cba7308 Outrun on OpenGL: Fix weird purple highlight seen on some devices
mediump int is just not enough.
2020-11-10 22:01:57 +01:00
Henrik Rydgård
0510101f6c Fix task switching issue with reinterpret. Fixes #13649 2020-11-10 13:24:52 +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
9f33a82b49
Merge pull request #13646 from hrydgard/framebuffer-fetch-fixes
Framebuffer fetch fixes
2020-11-09 19:30:35 +01:00
Henrik Rydgård
81024d9ec0
Merge pull request #13643 from hrydgard/move-shader-translations
Reorganize end of fragment shader, move shader translator to Common
2020-11-09 19:30:12 +01:00
Henrik Rydgård
85fd7c26f7
Merge branch 'master' into framebuffer-fetch-fixes 2020-11-09 18:14:42 +01:00
Henrik Rydgård
a31fc4087b D3D11: Fix writing to SV_Depth. Fixes #13641 2020-11-09 16:05:28 +01:00
Henrik Rydgård
ba139975e0 Linker fix - need to move init_resources along. 2020-11-09 15:39:46 +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
e77a9d7368 Reorganize the end of the fragment shader generator.
Thanks unknown.
2020-11-09 11:19:02 +01:00
Henrik Rydgård
766dbc5a9f Move ShaderTranslation.cpp/h to Common/GPU. 2020-11-09 11:18:43 +01:00
Henrik Rydgård
669c18a088 Fix crashes on exit (Vulkan). Should help #13223 2020-11-09 11:13:44 +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
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