Unknown W. Brackets
38818f9f6e
GLES: Fix colortest/logicop uint/int conversion.
...
Shown well in #16119 .
2022-09-27 19:24:54 -07:00
Henrik Rydgård
ca5c69d3dd
Vulkan: Better debug names for RENDER passes.
2022-09-27 23:41:09 +02:00
Henrik Rydgård
e538f5a441
Better bit scrambling when computing draw call IDs for vertex cache.
...
Fixes #13324
2022-09-27 10:09:52 +02:00
Unknown W. Brackets
97ae4ae712
GPU: Correct flat normal projection mapping.
2022-09-26 15:11:11 -07:00
Unknown W. Brackets
34a8056017
GPU: Correct normalized zero normal proj map.
...
Unlike lighting, this does not use 0, 0, 1.
2022-09-26 15:11:11 -07:00
Unknown W. Brackets
59f11df98b
Merge pull request #16116 from hrydgard/color-test-fix
...
Fix color test.
2022-09-26 14:18:12 -07:00
Henrik Rydgård
9b46adb985
Fix color test.
...
Fixes the new color test bug reported in #13324 , though doesn't fix that
issue (didn't confirm it still is one).
2022-09-26 22:51:46 +02:00
Henrik Rydgård
1c0d66aef7
Add compatibility flag for loading pixels on framebuffer create using nearest filtering
...
Solves the last problem with the speedometers - so we can finally say: Fixes #8509
Render-to-CLUT for speedometers renders on top of an image that just comes from the
underlying memory, so it's been drawn to the framebuffer with DrawPixels. That adds
filtering so at higher resolutions, there's some blurring of the CLUT, causing
artifacts. We can solve this two ways: either we force on lower-resolution-for-effects
for Ridge Racer games, or we use nearest filtering when doing DrawPixels of the
memory under a framebuffer. For best result, we do the latter.
(The speedometers look even better with nearest filtering, but that's a more
general issue of UI looking better that way).
2022-09-26 20:47:55 +02:00
Unknown W. Brackets
4329aaa31c
GPU: Apply color test mask as a uint.
...
This is simpler and allows us to unify paths better.
2022-09-26 06:57:41 -07:00
Unknown W. Brackets
a19a057e8c
GPU: Consistently use uvec3 for colortest.
2022-09-26 06:57:41 -07:00
Henrik Rydgård
d9f74d2fb7
ivec->uvec, comment fix
2022-09-26 13:05:25 +02:00
Henrik Rydgård
fc30b04430
ShaderUniforms: cleanup, put every "4-float" on a line for clarity
2022-09-26 13:05:25 +02:00
Henrik Rydgård
cfa427c37a
Shuffle constants around, squeezing them into gaps. Saves another 16 bytes.
2022-09-26 13:05:24 +02:00
Henrik Rydgård
f4b71e2dc7
Fragment shader uniforms: Pack color mask in 32 bits instead of expand to 128 bits.
...
Allows us to save 16 bytes from the main uniform buffer, since there's
free 32-bit spaces here and there to use.
2022-09-26 13:04:56 +02:00
Henrik Rydgård
07ca9e4656
Fold the "materialUpdate" flag into the light ubershader part.
...
This reduces the number of vertex shaders and thus pipelines by quite a
bit more in a few games, like Tekken and GoW, continuing the fight
against shader compile stutter.
The perf impact should be minimal if not positive due to less pipeline
changes.
GLES fixes
Make the vertex input declarations match (always declare fog input). Fixes D3D11 validation
Tess fix
2022-09-26 12:06:16 +02:00
Henrik Rydgård
ad1021ea4b
Add some recent flags to FragmentShaderDesc
2022-09-26 12:06:16 +02:00
Henrik Rydgård
196f8e3461
Prepare for dynamic mat update
2022-09-26 11:21:40 +02:00
Henrik Rydgård
9d1355e137
Always do the vertex shader part of the fog computation.
...
In #16104 , we drastically reduced the number of shader variants for
games that use flexible lighting setups. I looked at a few games and it
seems that a lot of games have the same shaders with fog on/off, while
fog is super cheap to compute. So let's just always do it, reducing
vertex shader variants further (though the amount of pipelines will probably
remain the same, since we still specialize the fragment shader).
Might also be worth adding a dynamic bool for the fragment shader, but
if so, doing it separately.
2022-09-26 09:30:54 +02:00
Henrik Rydgård
f30252f8d5
Oops! Also, testfix
2022-09-25 23:35:08 +02:00
Henrik Rydgård
96f054f098
Fix light ubershader for D3D11 and OpenGL, GLES unsigned/signed stuff
2022-09-25 23:35:08 +02:00
Henrik Rydgård
7adba20fac
Experiment: Generate "Ubershaders" that can handle all lighting configurations
...
This drastically reduces the shader compile stutter that happens when a lot of new
light setups are created, like on the first punch in Tekken 6.
There's more stuff that might benefit from being made dynamic like this.
These branches are very cheap on modern GPUs since they're branching on
a uniform variable, so no divergence.
Only tested on Vulkan. I think we'll need to keep the old path too for
gpus like Mali-450...
2022-09-25 23:35:01 +02:00
Henrik Rydgård
70c5ca62e6
Remove debug log. Add some new debug log though, unrelated to this PR, for fb clut + fb texture. Plus a couple asserts.
2022-09-25 09:56:39 +02:00
Unknown W. Brackets
c76d31dfa8
GPU: Cleanup unused CheckAlpha() funcs.
2022-09-24 02:00:03 -07:00
Henrik Rydgård
ac7ca963db
Make valgrind happy
2022-09-23 12:24:43 +02:00
Unknown W. Brackets
93c909a88e
GPU: Upload depth only on first usage.
...
Fixes various glitches in Kingdom Hearts, etc.
2022-09-23 00:04:14 -07:00
Henrik Rydgård
a6d6e0a3cc
Texture/Framebuffer match: Ignore stride if texHeight == 1. Fixes Ridge Racer lens flares.
2022-09-22 22:11:16 +02:00
Henrik Rydgård
078fa9beb2
Fix corruption of Ridge Racer speedometers with AutoMaxQuality enabled.
...
See #8509
2022-09-22 15:27:17 +02:00
Henrik Rydgård
c108db0e71
Merge pull request #16081 from hrydgard/zbuffer-upload-heuristic
...
Fix green flashes with Burnout Dominator lens flare
2022-09-22 11:02:27 +02:00
Henrik Rydgård
a31c5c8239
Cleanup logic
2022-09-22 10:48:45 +02:00
Henrik Rydgård
e9bcefb052
Merge pull request #16080 from unknownbrackets/softgpu-spline
...
softgpu: Avoid unnecessary flushing for curves
2022-09-22 10:05:23 +02:00
Henrik Rydgård
bd196f7a50
Preserve depth buffer on framebuffer resize, if has been used.
2022-09-22 09:59:49 +02:00
Henrik Rydgård
188ab67d6a
More lenient heuristic for uploading depth buffers. Still behind compat flag. See #11100
2022-09-22 09:29:33 +02:00
Henrik Rydgård
287e025978
Minor cleanups around dirtying of render state
2022-09-22 09:12:58 +02:00
Unknown W. Brackets
fc39f042ae
softgpu: Avoid unnecessary flushing for curves.
...
We don't need to flush all drawing between curves in softgpu, let them
queue up.
2022-09-22 00:08:38 -07:00
Unknown W. Brackets
1e78f3aa57
GPU: Correct neg normal for hwtess texgen.
2022-09-21 22:06:32 -07:00
Unknown W. Brackets
a681d149db
GPU: Use hardware tess params for texgen.
...
Fixes field in Test Drive Unlimited with hardware tessellation.
2022-09-21 21:15:58 -07:00
Henrik Rydgård
a92aaf9311
Dirty more state after depal
2022-09-21 23:57:19 +02:00
Henrik Rydgård
8ed1694a2f
Don't try to replace or scale CLUT8-on-GPU textures.
...
See #8509
2022-09-21 23:50:03 +02:00
Henrik Rydgård
78ab013914
Shouldn't 'floor' there
2022-09-21 18:37:40 +02:00
Henrik Rydgård
94ae0fabfa
CLUTs can be loaded from small rectangular textures. Need to linearize.
...
Fixes #8406 , although technically, we should wrap by bufw, not the
texture width.
2022-09-21 18:33:15 +02:00
Henrik Rydgård
3ff400e40e
Merge pull request #16069 from unknownbrackets/depth-clamp
...
GPU: Simplify depth clamped clip planes
2022-09-21 10:01:49 +02:00
Henrik Rydgård
7f0405b777
Merge pull request #16067 from unknownbrackets/lines
...
GPU: Account for w properly in lines, fixing width
2022-09-21 09:13:39 +02:00
Unknown W. Brackets
f8d29fdc1a
GPU: Simplify depth clamped clip planes.
...
There's no need to think about the scaled Z if we're using w anyway, just
use the existing Z clipping.
2022-09-20 16:23:19 -07:00
Henrik Rydgård
a223e2a572
Merge pull request #16068 from unknownbrackets/depth-clamp
...
GPU: Clip clamped depth accounting for perspective
2022-09-21 01:15:12 +02:00
Unknown W. Brackets
2fc7f72d72
GPU: Clip clamped depth accounting for perspective.
2022-09-20 15:55:39 -07:00
Unknown W. Brackets
0a24004eac
GPU: Account for w properly in lines, fixing width.
...
See #15756 .
2022-09-20 15:12:16 -07:00
Henrik Rydgård
0c39c434d0
Merge pull request #16065 from unknownbrackets/softgpu-tests
...
Correct some minor issues shown in a few tests
2022-09-20 23:27:41 +02:00
Unknown W. Brackets
bf86f00df8
GPU: Correct display framebuffer reading.
...
The displayFramebuf_ might not be set yet, but that doesn't mean we want
an INVALID format and zero stride. We might also be rendering to a
different target, but still want the display.
2022-09-20 14:01:36 -07:00
Henrik Rydgård
355c18512f
Fix BGRA issue on D3D with GPU CLUT textures
2022-09-20 22:31:54 +02:00
Henrik Rydgård
85d1f28997
Throw in assorted warning fixes
2022-09-20 18:04:08 +02:00