Commit Graph
163 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 159851b836 GPU: Patches drawn as lines zigzag like the GE's
Each quad is its left edge down, the diagonal from the bottom left up to the
top right, then its right edge down (gpu/probe exp175, exact; fixes
gpu/primitives/bezier and spline, whose end pixels depend on direction and
order).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 cadf5d8b2d SoftGPU: Evaluate spline patches as the GE does
De Boor at t = k/256 with the Bezier path's lerps. Each blending factor
(t - knot) / span is quantized in 1/256 from the nearer of its two knots,
and a segment's last point is evaluated as the next one's first. Colors,
texture coordinates, generated UVs and normals work as for Bezier
patches. Bit exact on gpu/probe exp144-146; software renderer only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 410a17443a SoftGPU: Bezier normals as the GE computes them
The cross product of two tangents, each the difference of the de
Casteljau's last two points: the row's along u, and the columns' last
points evaluated along u for v. The lerps pass their operand through at
the patch edges. Vertex normals stay unused (gpu/probe exp142-143).

Patch normals are now also generated for shade mapping with lighting
off, on every backend: the GE uses them there too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 04c03ad922 SoftGPU: Evaluate Bezier patches as the GE does
Columns before rows, de Casteljau at t = k/256 (rounded toward the patch
middle). Positions and UVs lerp in 16-bit fixed point at the larger
operand's exponent; colors in 15-bit fixed point. Generated UVs are k/256.
Bit exact on gpu/probe exp48-51 and exp139-140. Software renderer only,
since it's about 15x slower than the float weights.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 0715f43ab8 Splines: Detect poles relative to the other derivative
With animated control points the pole is only nearly degenerate, so the
vanishing derivative is rounding noise rather than exactly zero, and the
absolute threshold missed it. The resulting random normals still showed
as dark patches on Pac-Man Arrangement's ghosts (#12354).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 13:20:01 -06:00
Henrik RydgårdandClaude Opus 5.5 22c2cea923 Splines: Fix a single patch with both edges open
With only one patch, the open-last-edge adjustment assumed the first edge
was closed, so one knot interval came out as 2 instead of 1, and the
patch wasn't the Bezier patch a fully clamped cubic is. Positions were off
by up to about 7% of the patch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 11:11:23 -06:00
Henrik RydgårdandClaude Opus 5.5 f87a07b1a3 Splines: Use the limit normal at a pole instead of NaN
Where all the control points along a patch edge meet at one point, like
the top of a dome, one derivative is zero and so is the cross product,
and normalizing it gave NaN. Use the limit instead, built from the mixed
second derivative. Fixes the dark spots on the ghosts' heads in Pac-Man
Arrangement (#12354).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 10:57:05 -06:00
Henrik Rydgård 61e1ef8f7a Remove the "Software skinning" option. Now always on. 2026-07-14 17:02:57 +02:00
Henrik Rydgård e2fbf295cf Spline: Avoid having to modify and restore gstate_c.uv 2026-07-03 12:55:34 +02:00
Henrik Rydgård 8804042a9d NormalizeVertices: Take UV scale as a parameter 2026-07-03 12:55:34 +02:00
Henrik Rydgård 623545bd24 Delete the "Hardware tessellation" feature.
Very hard to maintain and debug, not worth it.
2026-06-16 16:17:14 +02:00
Henrik Rydgård 44ece6dfa2 Determine the clip flags directly when culling, simplifying the code. 2026-05-30 19:07:59 +02:00
Henrik Rydgård b1723086be Plumb through depth information (although not yet always generated) 2026-05-30 19:07:58 +02:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård a2a089b8c1 Remove the member function NormalizeVertices 2024-12-17 19:15:03 +01:00
Henrik Rydgård a07da939ef Some NormalizeVertices interface cleanup 2024-12-17 19:13:38 +01:00
Henrik Rydgård e74101a2fb applySkinInDecode belongs in the VertexTypeID, not in the options. 2024-12-17 18:24:18 +01:00
Henrik Rydgård 11dbae3457 Remove the "DispatchFlush" mechanism, not convinced it's a win 2024-12-15 13:42:05 +01: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
Herman Semenov b57dab2812 [GPU] Make static and const methods if possible 2024-04-05 17:04:31 +03:00
Henrik Rydgård 078018a943 Move the clockwise calculation out of DrawEngineCommon 2023-10-10 13:16:34 +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 c476d986f7 Bump the index/vertex cpu-side buffer sizes a little. Replaces #17387 2023-05-03 00:24:43 +02:00
Герман Семенов 122b63b9a8 GPU: using if constexpr C++17 optimization 2023-04-02 16:36:37 +02:00
Unknown W. Brackets 66472c39ce GPU: Use skinned position always in bounding check.
Meanwhile, move to a flag on decoder options instead of global check.
2022-11-06 08:23:31 -08:00
Unknown W. Brackets a5d3af9cb0 GPU: Cleanup GetVertTypeID() usage. 2022-11-06 08:01:57 -08: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 2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
Unknown W. Brackets e82fd3bd33 GPU: Avoid spline crashes on bad data.
If we get 0 prims, we can generate confusing index bounds and go out of
bounds.  Similarly, if we get a crazy number of control points and fail to
allocate, we can crash.
2022-01-01 16:40:59 -08: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 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
Kingcom 5109fd7cdc CMake: Correct build on Windows. 2021-02-15 06:09:12 -08:00
Henrik Rydgård 821817e6d4 Move the profiler to Common 2020-10-04 11:42:16 +02:00
Unknown W. Brackets 30ede8240c GPU: Move hw transform decision to draw engine. 2020-04-04 11:14:32 -07:00
Unknown W. Brackets cba6a63058 GPU: Generate normals for curves with lighting.
Improves #12354.  This needs to happen even if the vertex has no normals.
2019-09-28 15:08:37 -07:00
Henrik Rydgård 79d4b0f5a2 Check that allocations in SplineCommon succeed. Attempt at #11660 but not optimistic. 2019-01-06 13:51:17 +01:00
Unknown W. Brackets 8a7ec4fc19 GPU: Fix curve breakage due to cull flipping. 2018-12-16 13:00:36 -08:00
xebra 04708fe88a [spline/bezier]Unify SubmitSpline/Bezier. 2018-11-13 18:22:34 +09:00
xebra 46d30d02cf [spline/bezier]minor fix 2018-10-07 23:54:32 +09:00
xebra eca9386c05 [spline/bezier]Reduce static buffers. Get rid of the spline buffer using half of the vertex buffer. 2018-10-07 23:54:31 +09:00
xebra 5f07213c25 [spline/bezier]minor fix 2018-10-07 23:54:30 +09:00
xebra 5f9022ae14 [spline/bezier]minor fix 2018-10-07 23:54:29 +09:00
xebra ef53195ae8 [spline/bezier]Surround with namespace Spline. 2018-10-07 23:54:28 +09:00
xebra 10afcf2dbb [spline/bezier]Improve basic spline/bezier structures. 2018-10-07 23:54:26 +09:00
xebra 41823f8780 [spline/bezier]Fix GLES texture resolution of HW tess to real 2D to avoid huge width in FF4CC mist dragon morphing. 2018-10-07 23:54:23 +09:00
xebra 89786b943d [spline/bezier]Instanced rendering for B-Spline is very slow when using weak GPU, so disabled it and simplify the shaders.
Add changing the quality of HW tessellation.
2018-10-07 23:54:22 +09:00
xebra d98fa06b5f [spline/bezier]Fix to build for Android(clang). 2018-10-07 23:54:21 +09:00
xebra 019e276798 [spline/bezier]Modify ControlPoints and fix VertexPreview. 2018-10-07 23:54:20 +09:00
xebra 1c604d5b60 [spline/bezier]Put the control points stuffs all in one structure. 2018-10-07 23:54:19 +09:00