Commit Graph

143 Commits

Author SHA1 Message Date
Henrik Rydgård
1221a6e928 Minor code cleanups 2024-10-28 17:50:34 +01:00
Henrik Rydgård
096985f51f Provoking vertex (software transform): Simpler solution
Simply rotate each primitive in the index buffer to simulate a different provoking vertex.

Since at this point we have already generated a plain primitive index
buffer, it's easy to manipulate like this.

An even better solution would be to generate rotated index buffers
directly during decode, although that code is super critical and does
not need more complexity..

We could now also enable this for hardware transform but I'm leaving
that for later.
2024-07-17 14:40:52 +02:00
Henrik Rydgård
6b1e57a840 We never draw non-indexed in software transform mode, so get rid of the path. 2024-07-17 14:40:52 +02:00
Henrik Rydgård
665f03ff62 Add provoking vertex to caps, flip the flag around 2024-07-17 14:40:52 +02:00
Henrik Rydgård
e01ca5b057
Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård
cb79783539 Expand primitives: Check the vertex count too.
Still getting a few crashes, let's get rid of the last of them from this,
hopefully.
2024-01-28 22:48:40 +01:00
Henrik Rydgård
db94b0b696 Pass the limit on the number of indices to generate to BuildDrawingParams. 2024-01-15 10:09:04 +01:00
Henrik Rydgård
341fe04f4b Apply nearest filter for pixel-mapped draws 2024-01-11 12:56:03 +01:00
Henrik Rydgård
0b6ea4b2e5 Use the Tokimeki / old Juiced 2 method for Breath of Fire III
Allows us to delete a bunch of complex code.
2024-01-11 10:44:13 +01:00
Henrik Rydgård
61acce195c Avoid decoding indices when we don't need them. 2023-12-20 14:25:19 +01:00
Henrik Rydgård
aca3bbc9a0 DrawEngine: Remove the confusing MaxIndex accessor, replace with directly reading numDecodedVerts_ 2023-12-10 11:58:47 +01:00
Henrik Rydgård
12a98baf59 Cleanups, make the various SubmitPrim implementations more similar 2023-10-12 11:58:48 +02:00
Henrik Rydgård
e4ea4831e9 Delete the vertex cache option from the code. 2023-10-10 15:43:43 +02:00
Henrik Rydgård
10ccbfd68c Unify the clearing of variables after a draw call 2023-10-06 15:39:59 +02:00
Henrik Rydgård
d4703e9534 Decoded position format is always the same 2023-10-06 15:39:58 +02:00
Henrik Rydgård
e63bb0459c Add a new stat, so we can see per game if the optimization has an effect 2023-10-03 11:01:37 +02:00
Henrik Rydgård
92ffef2626 Remove some state from IndexGenerator, fix bugs. Mostly works except vertex cache. 2023-10-03 11:01:37 +02:00
Henrik Rydgård
9b411af1f5 It's running. 2023-10-03 11:01:37 +02:00
Henrik Rydgård
abbd1c83bd Revert "Merge pull request #18184 from hrydgard/expand-lines-mem-fix"
This reverts commit 65b995ac6c, reversing
changes made to 01c3c3638f.
2023-09-27 20:04:37 +02:00
Henrik Rydgård
966144fa64 Bounds check writing to the index buffer when expanding lines/rects/points 2023-09-20 19:26:36 +02:00
Henrik Rydgård
3f2ef508c9 Make it easier to reason about space in the inds buffer by moving an offset instead of the pointer. 2023-09-20 19:23:24 +02:00
Henrik Rydgård
10f93875c6 Fix the semantics of DenseHashMap to be consistent even when inserting nulls 2023-09-11 12:07:18 +02:00
Henrik Rydgård
952e125c7e Break out rendering of "notices" from OnScreenDisplay. They can now also be used as views.
Use it for the new message in ControlMappingScreen, when you try to map
a combo when that's disabled. It'll have more uses.
2023-07-07 15:23:19 +02:00
Henrik Rydgård
186b0f105c Simplify the vertex cache ID handling 2023-06-12 13:16:13 +02:00
Henrik Rydgård
f16f879b41 Some renaming to follow the standard of appending _ to member vars 2023-05-23 18:00:50 +02:00
Henrik Rydgård
d51d1413a3 DrawEngineCommon: Rename decoded to decoded_ 2023-05-23 16:46:43 +02:00
Henrik Rydgård
16b243b007 Centralize allocation of vertex decode buffers 2023-04-24 12:11:58 +02:00
Unknown W. Brackets
15f087b71a D3D11: Correct equal clear check. 2023-02-26 23:59:48 -08:00
Henrik Rydgård
85e6b4e592 Increment numFlushes near the other stat increments
Might be better for the cache, heh.
2023-01-04 17:10:56 +01:00
Henrik Rydgård
f069de2dd2 Pass the vertex decoder into the vertex shader IDs generator
Instead of just the vertex type.

This will allow things like the vertex decoder supplying defaults, in
order to reduce the number of unique vertex shaders at the cost of
slightly larger vertex data.

This doesn't actually do that yet though, it's just a refactor that can
be done separately.

Part of #16567
2022-12-30 22:57:05 +01:00
Henrik Rydgård
67cba831dd Slightly more useful assert message in Hashmaps.h 2022-12-29 00:39:59 +01:00
Unknown W. Brackets
49f6c461ad Reporting: Fix some header includes.
Particularly in Common, avoid including Core/Reporting.h.
2022-12-27 14:58:20 -08:00
Unknown W. Brackets
e5dbdba638 GPU: Keep prevPrim_ set on flush.
For continuing previous verts, see #16612.  We still don't handle these
quite accurately (outside software rendering), but this should be better.
2022-12-18 07:14:19 -08:00
Henrik Rydgård
ee19db091f Add accessor for UseFlags 2022-12-13 18:27:45 +01:00
Unknown W. Brackets
9cfcbc46e6 Global: Cleanup initialization/pointer checks.
Cleaning up a lot of cases of uninitialized data, unchecked return values
for failures, and similar.
2022-12-10 21:13:36 -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
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
Unknown W. Brackets
70c3205564 GPU: Correct equal depth checks. 2022-11-09 20:34:29 -08: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
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
3de2557ecb GPU: Always skin in decode for software transform. 2022-11-06 08:55:07 -08:00
Unknown W. Brackets
6c36f03a0d GPU: Purify vertTypeIsSkinningEnabled(). 2022-11-06 08:40:54 -08:00
Henrik Rydgård
daca0b2109 Rename gstate_c.Supports to gstate_c.Use 2022-10-17 08:46:37 +02:00
Unknown W. Brackets
b9b59f7806 GPU: Mask away unused bits in framebuf/zbuf ptr.
Lower 4 bits are ignored during rendering, and mirrors (even even the 8
bit at the top) are ignored.
2022-10-02 20:44:35 -07:00
Henrik Rydgård
b84cda2876 Plumb the computed pipeline state into ComputeFragmentShaderID. 2022-09-02 22:16:57 +02:00
Unknown W. Brackets
86e754fb4a D3D11: Correct viewport offset sign handling. 2022-08-22 21:29:49 -07:00
Unknown W. Brackets
b5a4843c1f GPU: Purify ConvertViewportAndScissor().
This makes it harder to misuse.  See #15856.
2022-08-20 14:21:11 -07:00
Unknown W. Brackets
d61619db47 GPU: Dirty params when converting viewport state.
This flag will be false when we convert next time, so parameters won't get
updated as expected.
2022-08-20 14:03:24 -07: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