186 Commits

Author SHA1 Message Date
Henrik Rydgård 41b77bf1ae More log cleanup 2025-04-14 22:27:51 +02:00
Henrik Rydgård e633505f41 Actually, let's just delete the old reporting checks. There aren't many mysteries left here. 2025-04-11 08:57:02 +02:00
Henrik Rydgård 6f7a848113 Move some checks out of the hot path in the software transform 2025-04-11 08:57:02 +02:00
Henrik Rydgård 449e3e1360 Very minor soft transform optimization 2024-12-28 18:45:03 +01:00
Henrik Rydgård c91169e702 Restore removed <algorithm> includes.
Turns out these were needed after all. For some reason, on Windows and
Mac, <algorithm> gets auto-included by something else so I don't notice
when it's missing, and MSVC's include dependency tracker doesn't see it
either.
2024-12-19 09:53:07 +01:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård ee297e974d Move more code into SoftwareTransformCommon, cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård a07da939ef Some NormalizeVertices interface cleanup 2024-12-17 19:13:38 +01:00
Henrik Rydgård fec232f8a8 GPU: Move things around a little, out of DrawEngine. 2024-12-17 19:13:38 +01:00
Henrik Rydgård 14bb7a6062 Reduce Windows debugger crashes on shutdown 2024-10-29 11:20:03 +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
Herman Semenov b57dab2812 [GPU] Make static and const methods if possible 2024-04-05 17:04:31 +03: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 103d8b1019 Don't apply smart 2d texture filter to video. 2024-01-18 23:38:44 +01:00
Henrik Rydgård dac4c7adb0 Add checks against overrunning the index buffer space 2024-01-15 10:25:18 +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 cf5d76faf5 Continue replacing 'maxIndex' with 'numDecodedVerts'. Not an ideal name but better. 2024-01-14 23:41:05 +01:00
Henrik Rydgård 4360fe786c Add a setting for smart 2D texture filtering 2024-01-12 11:10:53 +01:00
Henrik Rydgård 8de7a97883 Check small triangle draws in through-mode for pixel mapping too 2024-01-11 14:32:52 +01:00
Henrik Rydgård e3841ddb4a Accept 1D stretch as pixel mapped 2024-01-11 12:56:03 +01:00
Henrik Rydgård 944b3c5be5 Add pixel mapping detection for through mode RECT primitives 2024-01-11 12:56:03 +01:00
Henrik Rydgård 6e12465dc4 Move through-mode UV scaling for rects from Transform to ExpandRectangles 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 aca3bbc9a0 DrawEngine: Remove the confusing MaxIndex accessor, replace with directly reading numDecodedVerts_ 2023-12-10 11:58:47 +01:00
Henrik Rydgård db421165c0 Merge pull request #18172 from hrydgard/more-lenient-clear-detection
Make clear detection a bit more lenient
2023-09-29 09:52:08 +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 81f47caf2f Clarify the primitive expansion, add reporting 2023-09-22 10:27:02 +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 e6a864ee04 Make clear detection a bit more lenient. Allows using clears in Assassin's Creed and likely more. 2023-09-18 23:57:20 +02:00
Henrik Rydgård f42c682d34 Revert "Merge pull request #16628 from hrydgard/remove-fog-fshader-flag"
This reverts commit 10dee90c83, reversing
changes made to 34c11c8acf.
2023-05-08 22:01:38 +02:00
Henrik Rydgård 805591e493 Replace all uses of ToScaledDepthFromIntegerScale. 2023-02-11 13:27:44 +01:00
Henrik Rydgård d65dae7185 Depth scale functions: Clean up the naming, add a failing test 2023-02-10 14:57:45 +01:00
Henrik Rydgård 26c748f959 Make fog-enable driven by uniform instead of fragment shader flag bit 2023-01-04 10:14:11 +01:00
Unknown W. Brackets 6584899891 GPU: Account for perspective in non-centered lines. 2022-12-26 10:13:38 -08:00
Henrik Rydgård c25e563d13 Fix rendering of lines with the same x/y but different z.
Also enabled centered lines in WebFest homebrew.
2022-12-26 18:16:54 +01:00
Unknown W. Brackets a7b7bf7826 Global: Set many read-only params as const.
This makes what they do and which args to use clearer, if nothing else.
2022-12-10 21:13:36 -08:00
Henrik Rydgård e6f0f84a45 SSE optimize Float4ToUint8x4, some uses 2022-12-01 16:32:23 +01:00
Henrik Rydgård d02f46cb27 Minor VertexReader optimizations 2022-12-01 16:00:47 +01:00
Henrik Rydgård 72029b678a Empirical attempt at fixing #15661
Basically, software culling fails in some configuration, like the one we
end up with on Mali.

As noted by unknownbrackets in #15661, the viewport Z scale, offset is -0.0, 0.0.

We end up with CalcCullParams computing minZValue == maxZValue == 1.0f,
and with the vertices ending up with z,w == 1.0, 1.0.
and as a result, the inside/outside calculations will always decide that
it's outside.

Changing the comparisons from >= / <= to > / < fixes the problem, but I
don't know if this might break something else.

Anyhow, here's the simple way to repro on PC:

Change the ending of GPU_Vulkan::CheckFeatures to:

```c
	return GPU_USE_LIGHT_UBERSHADER | GPU_USE_BLEND_MINMAX | GPU_USE_TEXTURE_NPOT | GPU_USE_INSTANCE_RENDERING |
		GPU_USE_VERTEX_TEXTURE_FETCH | GPU_USE_TEXTURE_FLOAT | GPU_USE_16BIT_FORMATS | GPU_USE_TEXTURE_LOD_CONTROL |
		GPU_USE_DEPTH_TEXTURE | GPU_USE_ACCURATE_DEPTH;
```
2022-11-27 23:16:16 +01: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 9b8a5d1db3 Rename GPU_SUPPORTS_ to GPU_USE_ 2022-10-17 08:47:03 +02:00
Henrik Rydgård daca0b2109 Rename gstate_c.Supports to gstate_c.Use 2022-10-17 08:46:37 +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 0a24004eac GPU: Account for w properly in lines, fixing width.
See #15756.
2022-09-20 15:12:16 -07:00