Commit graph

466 commits

Author SHA1 Message Date
Unknown W. Brackets
95d2083f04 Ge: Move matrix reading into GPU.
Let's keep managing its state / registers internal.
2022-09-27 22:23:02 -07: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
76f03d30bf Remove suspicious dirty flag 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
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
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
Henrik Rydgård
aa19712fc3 Unify depth texture and framebuffer fetch checks 2022-09-20 10:47:49 +02:00
Henrik Rydgård
09bcf3ec13 Unify range culling detection 2022-09-20 10:15:04 +02:00
Henrik Rydgård
1ae7c0132c Start unifying setting of the GPU feature flags, now that thin3d has feature detection. 2022-09-20 10:07:01 +02:00
Unknown W. Brackets
9f84cde062 GPU: Fix crash on imm vert triangles.
Was crashing because the frag and vert shaders didn't match up.
2022-09-18 06:16:26 -07:00
Unknown W. Brackets
6877ff1af2 softgpu: Fix state/continuation for imm prims. 2022-09-18 06:16:26 -07:00
Unknown W. Brackets
596b07bd2e softgpu: Support fog and color1 on imm verts. 2022-09-18 06:16:26 -07:00
Unknown W. Brackets
35ba01e01f softgpu: Refactor imm draws to bypass vert read. 2022-09-18 06:16:25 -07:00
Unknown W. Brackets
402492a958 GE Debugger: Show imm prim flag detail in disasm. 2022-09-06 22:31:09 -07:00
Unknown W. Brackets
880f6f8d49 GPU: Handle more flags on imm prim command. 2022-09-06 22:20:45 -07:00
Unknown W. Brackets
f274267143 GPU: Allow usage of texturing in immediate verts.
And respect the other flags that I can reproduce working in a test.
I can't seem to get the fog to work at all, or the shading mode, or the
secondary color.  Maybe depends on other flags or bits in other regs...
2022-09-06 22:20:45 -07:00
Unknown W. Brackets
ceb2af369c GPU: Handle immediate prims more accurately.
This allows for lines, points, textures, and similar things.  Also
corrects offset handling.  Still some flags on VAP that seemingly don't
work, and this doesn't consider the texture flag on it.
2022-09-06 22:20:45 -07:00
Unknown W. Brackets
d249674858 softgpu: Fix immediate rendering crash. 2022-09-06 18:55:25 -07:00
Unknown W. Brackets
23f61171f9 softgpu: Implement matrix data wrap-around.
Overflow writes to other matrices.  Matches hardware tests.
2022-09-05 19:38:54 -07:00
Henrik Rydgård
f399e3c7e6 Disable BlueToAlpha mode when logic op is present. Re-enable for Outrun and DiRT. 2022-09-05 09:51:17 +02:00
Henrik Rydgård
ecb84987ef Remove allocation from the heaviest MemBlockInfo path (BlockTransfer). Required some refactoring. 2022-09-01 11:59:35 +02:00
Henrik Rydgård
437d6d30a0 KillZone: Fix margin detection on the title screen, fixing some glitches. Need more fixes though to fix the shimmer effect.
See #6207 comments
2022-08-31 11:40:42 +02:00
Henrik Rydgård
70f7f74a05 Check X coordinate of through-mode drawcalls to figure out which of the splits to render to 2022-08-31 01:09:23 +02:00
Henrik Rydgård
44d822be3b Address feedback 2022-08-30 06:41:37 +02:00
Henrik Rydgård
847e05140b Add another stat, for self-tex 2022-08-29 17:41:29 +02:00
Henrik Rydgård
f228de76ef Fix OpenGL bug when framebuffer fetch is available. Add two new stats. 2022-08-29 15:39:29 +02:00
Henrik Rydgård
cd37bffdaa Better framebuffer checks, remove all ways that framebuffer formats can change. 2022-08-29 11:06:45 +02:00
Henrik Rydgård
f79acd651d Comment updates 2022-08-25 00:29:44 +02:00
Henrik Rydgård
99404f0a15 Fix BlueToAlpha together with reinterpret. Add back fake reinterpret for now. 2022-08-24 14:40:37 +02:00
Henrik Rydgård
5d50d02227
Merge pull request #15894 from unknownbrackets/debugger
GE Debugger: Record only one flip if display framebuf not changed, step on vsync
2022-08-24 06:27:31 +02:00
Unknown W. Brackets
27d00199c8 GE Debugger: Fix bad read on step at start of VRAM. 2022-08-23 19:50:19 -07:00
Unknown W. Brackets
a901fa4315 GE Debugger: Add separate step based on vsync.
I think there were some games where this would step in the middle of a
frame, but not seeing it commonly now.  So make it the default, but allow
both methods in the menu.

Fixes #15893.
2022-08-23 19:48:34 -07:00
Unknown W. Brackets
c581a83896 GPU: Centralize SetDisplayFramebuffer(). 2022-08-23 19:29:06 -07:00
Unknown W. Brackets
86085335ca GE Debugger: Record 1 flip if no display calls.
Before we were waiting 4 flips before ending recording.
2022-08-23 19:20:14 -07:00
Henrik Rydgård
51686f4936 Copy color from overlapping framebuffers on bind, under certain conditions.
Leads to much faster performance in Juiced 2.

This will later be expanded to handle more things in a more elegant way,
like the framebuffer overlap in God of War for the shadows and
color reinterpretation in a generic way.

Fixes #15728
2022-08-22 16:06:55 +02:00
Henrik Rydgård
29ea3ffe0c Restore the clearing optimization, avoiding unnecessary depth copies 2022-08-20 09:46:15 +02:00
Henrik Rydgård
12db0e52d4 Fix deferred-depth for bezier/spline. Move updating of last_frame_depth_render to GPUCommon. 2022-08-20 08:29:33 +02:00
Henrik Rydgård
a0ac2dffc7 Defer depth copies until depth buffer is actually used.
Fixes
2022-08-20 08:29:33 +02:00
Henrik Rydgård
9f2447c0b4 Assorted minor cleanup 2022-08-16 10:55:44 +02:00
Unknown W. Brackets
710abcc288 GPU: Write stencil fail to alpha is RGB masked.
See #15813 (Hunter x Hunter) which does this for shadows.
2022-08-09 18:45:49 -07:00
Unknown W. Brackets
20c2ec1392 GPU: Skip alpha stencil upload when safe.
Otherwise, let's not do things that give different behavior at 1x or are
inconsistent.
2022-08-06 21:12:59 -07:00
Henrik Rydgård
41e327a66b Cleanup and testfixes 2022-08-03 13:34:59 +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
0caaa74be9 Possible flicker fix for Macross 2022-07-31 10:43:48 +02:00
Henrik Rydgård
f061eadc04 Initial implementation of 3D texturing through equal-size mips (see #6357)
Vulkan-only currently, though all the other backends except ES 2.0
without GL_OES_texture_3d can support it with some work.
2022-07-31 10:43:47 +02:00
Unknown W. Brackets
1233d1d376 Reporting: Disable when debugger methods used.
This won't catch all means of hacking memory, but will catch some.
Trying to reduce noise in reporting from debugging.
2022-07-30 18:21:32 -07:00
Henrik Rydgård
89845eae7a Add GPU stat for number of depth copies per frame
Will be useful for evaluating #15700
2022-07-24 17:12:43 +02:00
Henrik Rydgård
e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Unknown W. Brackets
c15c4a6967 UI: Add analog speed limit mapping.
Only shows up as a setting if mapped, to avoid cluttering settings.
2022-07-04 19:14:05 -07:00
Unknown W. Brackets
a60d27a4f3 GPU: Fix skip buffer effects rendering.
Broken by blue-to-alpha changes.  Without calling SetRenderFramebuffer, we
were never reconsidering the initial SKIPDRAW_NON_DISPLAYED_FB flag and
all drawing was getting skipped.
2022-05-22 12:24:03 -07:00