47 Commits

Author SHA1 Message Date
Henrik Rydgård d6ebfed432 Fix some bugs and warnings from a pass of static analysis 2026-01-29 17:41:54 +01:00
Unknown W. Brackets 0be891c7ff softgpu: Minor opt, ignore unused z_stride. 2022-10-02 21:31:07 -07:00
Unknown W. Brackets 794a5c07ad softgpu: Ignore a needless color test case.
This happens in Ridge Racer, and we can entirely skip the color test.
2022-09-24 02:00:03 -07:00
Unknown W. Brackets 596b07bd2e softgpu: Support fog and color1 on imm verts. 2022-09-18 06:16:26 -07:00
Henrik Rydgård 2791ab3226 Merge pull request #16011 from unknownbrackets/softgpu-rect
Detect more triangles as rectangles in softgpu
2022-09-12 08:35:13 +02:00
Unknown W. Brackets 3c9372fb75 softgpu: Ignore stencil test mask in ALWAYS mode.
Small codegen improvement since we can directly use ref and avoid loading
the unmasked reference.
2022-09-11 22:39:56 -07:00
Unknown W. Brackets 1f6870798b softgpu: Include early Z in func description. 2022-09-11 22:39:32 -07:00
Unknown W. Brackets 8a2115be46 softgpu: Enable early Z tests a bit more often.
This helps in cases where sfail doesn't matter.
2022-09-11 18:39:39 -07:00
Unknown W. Brackets 15d5fa48f7 softgpu: Check depth test early on simple stencil.
If we don't need to write stencil on sfail/zfail, we can do the depthtest
early, which allows us to more often skip texture sampling.

This gives a good improvement in Chains of Olympus.
2022-09-10 21:24:19 -07:00
Unknown W. Brackets 7a83f8bab5 softgpu: Use vertType prim override for flags.
These parameters are a real shame, was so clean before...
2022-09-06 22:20:45 -07:00
Unknown W. Brackets 99d7703d33 samplerjit: Precalculate DXT1/3/5 offsets.
This improves WALL-E by 8% overall.
2022-02-05 13:04:17 -08:00
Unknown W. Brackets a40d32d581 samplerjit: Validate compile in a unit test. 2022-01-29 20:31:18 -08:00
Unknown W. Brackets 0d93200faf softjit: Add tests for compile success. 2022-01-29 18:47:36 -08:00
Henrik Rydgård 0e2f5d66b6 Merge pull request #15345 from unknownbrackets/softgpu-blend
Fix some minor softgpu blending bugs
2022-01-24 09:37:59 +01:00
Unknown W. Brackets 07b67ef572 softgpu: Fix pixel ID for invalid blend factors.
They should still be treated as FIX, we were accidentally using our
special values.
2022-01-24 00:08:33 -08:00
Unknown W. Brackets 76f9103e97 softgpu: Add a table and initial dirty flags.
Not actually using the dirty flags to skip state, but have moved to
Execute_* functions and everything else like other graphics backends.
2022-01-23 08:08:40 -08:00
Unknown W. Brackets d6fa301ab1 softgpu: Track CLUTs as states for binning.
This way we can have multiple CLUTs in process at once, which helps.
2022-01-16 08:14:09 -08:00
Unknown W. Brackets 6da7765309 softgpu: Correct logic op state update. 2022-01-15 22:31:28 -08:00
Unknown W. Brackets edb79d968f softgpu: Cache CLUT params in sampler state.
And now there's no more gstate for pixel drawing or sampling.  Just a
little left in rasterization.
2022-01-15 18:09:09 -08:00
Unknown W. Brackets c0e85e6170 softgpu: Move texenv color into sampler state. 2022-01-15 17:52:40 -08:00
Unknown W. Brackets ad3635c82a softgpu: Move tex size to cached state. 2022-01-15 17:22:43 -08:00
Unknown W. Brackets 092b03bd67 softgpu: Move fixed blend factor to draw pix state.
This is the last of the gstate.
2022-01-15 13:03:11 -08:00
Unknown W. Brackets f4f7ea2736 softgpu: Cache colortest params in draw pix state. 2022-01-15 13:03:11 -08:00
Unknown W. Brackets aa9d751248 softgpu: Cache alpha/stencil test masks in state. 2022-01-15 13:03:11 -08:00
Unknown W. Brackets f1ce2e7715 softgpu: Cache minz/maxz in draw pixel state. 2022-01-15 13:03:10 -08:00
Unknown W. Brackets 0b3f096c01 softgpu: Cache strides in draw pixel state. 2022-01-15 13:03:10 -08:00
Unknown W. Brackets e9f3720e20 softgpu: Cache fog color draw pixel state. 2022-01-15 13:03:10 -08:00
Unknown W. Brackets 880826bab4 softgpu: Remove disable of cached pixel state.
That mode is slower now (with the other state changes), and we don't want
to read gstate anymore anyway.
2022-01-15 11:22:50 -08:00
Unknown W. Brackets 0993771104 samplerjit: Fix standard bufw check.
Oops, bufw could be intentionally higher while w is 16 bytes.
2022-01-05 00:11:34 -08:00
Unknown W. Brackets 5e3bef7e14 samplerjit: Avoid gather if overread could crash.
This should be rare, but a game could easily shove a CLUT4 texture at the
end of VRAM, and then accessing the last index would segfault.
2022-01-02 17:28:52 -08:00
Unknown W. Brackets 355bad666c softjit: Optimize common case bloom blending.
Bloom often uses fixed ONE + ONE, which is a lot less work for us.  And
bloom often runs over and over again on pixels, so saving work is good.
2022-01-02 08:47:04 -08:00
Unknown W. Brackets 06e954fe2a samplerjit: Create a separate fetch func.
This allows nearest to become more similar to linear, where it applies the
texture function.
2022-01-01 16:58:04 -08:00
Unknown W. Brackets 3bc6009158 samplerjit: Refactor sampler ID calculation.
Make it the same as pixel func IDs.
2022-01-01 16:58:04 -08:00
Unknown W. Brackets 75a918f96f softjit: Get rid of pointless AGE00 tests. 2021-12-01 21:44:10 -08:00
Unknown W. Brackets f47fb7e14e softjit: Normalize some stencil test patterns. 2021-12-01 21:43:52 -08:00
Unknown W. Brackets ba69e39256 softjit: Avoid tests for greater than 0.
They take more instructions, and can be somewhat common.
2021-12-01 21:40:10 -08:00
Unknown W. Brackets 6fbcf67093 softjit: Fix disabled cache. 2021-11-27 11:32:47 -08:00
Unknown W. Brackets 1f9dc3a568 softjit: Precalculate write mask and dither.
This is slightly abusing PixelFuncID, but the intent is to provide some
memory that's easily accessible from the jit func, but still associated
with that calculation (i.e. not global.)
2021-11-26 10:12:54 -08:00
Unknown W. Brackets 961273fcf5 softjit: Apply color write mask. 2021-11-26 08:21:14 -08:00
Unknown W. Brackets dad85b97f1 softgpu: Use KEEP for any invalid stencil ops.
This just keeps the ID more consistent.
2021-11-25 21:02:20 -08:00
Unknown W. Brackets d4bf7ea392 sofgpu: Disable alpha blend for invalid equations. 2021-11-25 19:23:41 -08:00
Unknown W. Brackets 73de8db996 softgpu: Fix stencil DECR on 5551. 2021-11-25 19:21:56 -08:00
Unknown W. Brackets 53c6a3933d softgpu: Use ALWAYS for alpha/depth test in clear. 2021-11-25 19:21:55 -08:00
Unknown W. Brackets 876c8cd368 softgpu: Fix PixelFuncID size.
Oops, can't use unions in bitfields.  Also improve typesafety.
2021-11-21 09:40:13 -08:00
Unknown W. Brackets 28bc91bd79 softgpu: Add func to tersely name pixel funcs. 2021-11-21 08:23:32 -08:00
Unknown W. Brackets aa3786ed21 softgpu: Force off alpha blend if uselessly on.
This is a simple optimization to prevent some work games sometimes waste.
2021-11-20 15:27:04 -08:00
Unknown W. Brackets 953200c995 softgpu: Add func to calculate pixel func ID.
This normalizes some things, and eventually can be used for a jit key.
2021-11-20 15:27:04 -08:00