Commit Graph

9567 Commits

Author SHA1 Message Date
Henrik Rydgård 0b154ca6ef Depth raster: Handle triangles with culling disabled properly. 2026-03-31 18:17:01 -06:00
Henrik Rydgård 10b6c14a9e Avoid memory access functions that can cause memory exceptions in ImDebugger. Minor opt. 2026-03-31 17:53:00 -06:00
Henrik Rydgård df5ad56546 Merge pull request #21324 from hrydgard/silent-hill-shadows
WIP: Apply changes by fcrwr, fixing (mostly) shadows in Silent Hill: Shattered memories
2026-03-18 09:06:55 +01:00
Henrik Rydgård 30c717cb4a Merge pull request #21386 from chealy/gpu-shader-optimizations
GPU: Shader optimizations using inversesqrt and dead code removal
2026-03-17 22:31:06 +01:00
Henrik Rydgård c1f8421dc2 Merge pull request #21342 from fcrwr/block-transfer-clipping
Fix block transfer clipping
2026-03-17 22:28:04 +01:00
Henrik Rydgård 75453632f9 Handle inset adjustements on the C++ side, handle them better in the UI. 2026-03-14 18:13:37 +01:00
Henrik Rydgård b4646a49d5 Blacklist the "MMPX Advanced" texture upscaler on mobile GPUs. 2026-03-13 09:04:27 +01:00
Chris Healy 6dae3327a6 GPU: Remove dead helper functions from fragment shader
Remove two unused helper functions that were left behind after refactoring:

1. unpackUVec3: Left over from commit 4329aaa31c ("GPU: Apply color
   test mask as a uint") which refactored color test to use
   roundAndScaleTo8x4 with direct uint comparison instead of unpacking
   to uvec3 components.

2. packFloatsTo8x4: Left over from commit aec22491fe ("Don't expand
   alphaColorRef to 128 bytes") which changed u_alphacolorref from vec4
   to uint, making the float-to-uint packing function unnecessary.

Both functions were defined but never called, wasting shader compilation
time and binary size for shaders that enable color testing.

Signed-off-by: Chris Healy <cphealy@gmail.com>
2026-03-08 19:13:41 -07:00
Chris Healy 9ed5dcdc27 GPU: Use inversesqrt for light distance and half-vector calculations
Replace length()/normalize() with inversesqrt() pattern for better
performance on mobile GPUs. The inversesqrt instruction is a single
hardware operation, while length() requires sqrt(dot()) and normalize()
requires inversesqrt internally plus a multiply.

Changes:
1. Light distance calculation:
   Before: distance = length(toLight); toLight /= distance;
   After:  distSq = dot(toLight, toLight);
           invDist = inversesqrt(distSq);
           distance = distSq * invDist;
           toLight *= invDist;

2. Specular half-vector normalization:
   Before: ldot = dot(normalize(toLight + vec3(0,0,1)), worldnormal);
   After:  halfVec = toLight + vec3(0,0,1);
           halfInvLen = inversesqrt(dot(halfVec, halfVec));
           ldot = dot(halfVec, worldnormal) * halfInvLen;

Also reuses distSq in attenuation calculation to avoid recomputing
distance*distance.

Offline shader compiler results (vertex shader with 4-light ubershader):

Mali (malioc):
  G31 (Bifrost): 44.90 -> 40.50 cycles (-9.8%)
  G52 (Bifrost): 14.97 -> 13.50 cycles (-9.8%)
  G310 (Valhall): 13.88 -> 12.88 cycles (-7.2%)
  G57 (Valhall):  7.60 ->  6.97 cycles (-8.3%)

PowerVR (Profiling Compilers):
  Series 8 GE8300: 322 -> 302 ALU cycles (-6.2%)
  Series 9 GM9445: 296 -> 280 ALU cycles (-5.4%)
  Series B BXM:    560 -> 540 instructions (-3.6%)

Signed-off-by: Chris Healy <cphealy@gmail.com>
2026-03-08 19:13:41 -07:00
Henrik Rydgård 5a27f20387 Merge pull request #21380 from hrydgard/last-fixes
iOS: Try to avoid leaking file sandbox bookmarks, avoid trying to install zips where it's not possible
2026-03-08 13:46:25 +01:00
Henrik Rydgård 0a1be41fa7 Additional fixes to ZipFileLoader 2026-03-08 12:33:46 +01:00
Henrik Rydgård ffd21dba00 Quick workaround for Gripshift.
Fixes #21367
2026-03-07 18:59:03 +01:00
ChrisF ca8736fc6a Adds one more image size (128x128) option for DXT1 block skipping in texture replacement 2026-03-06 14:07:03 -05:00
fcrwr cc4bf75717 Fix block transfer clipping
Fix block transfer clipping that happened due to code not taking block
transfer offsets into account when finding framebuffers for block
transfer and when creating ram framebuffer.
2026-03-04 19:46:28 +05:00
fcrwr f3c98442d5 Apply changes by fcrwr, fixing (mostly) shadows in Silent Hill: Shattered Memories
The game actually implements proper shadow mapping using some wicked
trickery, including framebuffer color reinterpretation. This finally
gets it working, by filling in some gaps in the existing mechanisms.

Unfortunately there's some precision issue that needs to be looked at,
as it can currently look quite stripy, very typical of shadow mapping.
2026-03-02 19:23:43 +01:00
Henrik Rydgård 5e6ec70280 Minor stuff 2026-03-01 12:09:43 +01:00
Henrik Rydgård 845f9f3d55 Add missing check to Vulkan init. Disable validation on android-x86-64
The latter is broken in the Android SDK emulator.
2026-02-27 23:57:50 +01:00
Henrik Rydgård bae1a7c7f9 Add "FastEmulatedGPU" compat flag. For games like Outrun that have intermittent slowdowns on hardware, it's unnecessary under emulation. 2026-02-26 10:44:16 +01:00
Henrik Rydgård 5dc169ecbe Fix more race conditions if you exit during game bootup 2026-02-24 00:56:45 +01:00
Henrik Rydgård 202259eb09 Add a quick workaround for Mahjongg Artifacts framebuffer expiration.
Fixes #15828, well at least except for savestate support.
2026-02-22 23:42:13 +01:00
Henrik Rydgård 5aeb38412d Fix another valgrind warning 2026-02-19 11:46:14 +01:00
Henrik Rydgård 5a5c7028b9 Assorted warning fixes and data initialization to please valgrind 2026-02-19 11:24:46 +01:00
Henrik Rydgård 12d280839c Microoptimizations in VertexDecoder interpreter 2026-02-17 11:59:30 +01:00
Henrik Rydgård c89582cfd6 Merge pull request #21267 from hrydgard/delete-mips-jit
Delete remains of support for the MIPS architecture as host
2026-02-17 10:55:57 +01:00
Henrik Rydgård f046857d2b Delete remains of support for the MIPS architecture as host 2026-02-17 10:20:51 +01:00
Henrik Rydgård 0c70c4f9b4 Simplify 2026-02-17 10:18:08 +01:00
Henrik Rydgård e71ffc59a6 Remove unnecessary IsStarted method 2026-02-17 10:18:08 +01:00
Henrik Rydgård ae6ba469c1 Fix some more screenshot problems
Followup to #21249
2026-02-13 14:56:31 +01:00
Henrik Rydgård 386fc442a6 Rework the internal screenshot API, fix bug causing screenshotting to get stuck 2026-02-13 12:34:26 +01:00
Henrik Rydgård 8ceffa08cb Ignore extreme Y offsets when matching framebuffers.
Fixes #15828
2026-02-12 11:03:46 +01:00
Henrik Rydgård 3ecb54e70a More tweaking of gamelist icons 2026-02-11 01:24:11 +01:00
Henrik Rydgård 5d080d1de8 Add a quick check against bad clut vs depth texture framebuffer matches
See #15828 and #20847
2026-02-10 15:51:49 +01:00
Henrik Rydgård 88266eee50 Warning fixes, comments 2026-02-10 13:59:32 +01:00
Henrik Rydgård d8b8a51309 Correct a bunch of edge cases, move some code around 2026-02-08 17:07:22 +01:00
Henrik Rydgård df2d00208e Improve screenshots in "Skip buffer effects" mode 2026-02-08 16:33:48 +01:00
Henrik Rydgård 1599ea7b1d SaveState: Separate screenshot operations from other ops 2026-02-08 16:11:44 +01:00
Henrik Rydgård eb234a1563 Finish the split. Greatly simplifies the render code in EmuScreen. 2026-02-08 10:46:16 +01:00
Henrik Rydgård 2ea94534e6 Split up FramebufferManagerCommon::CopyDisplayToOutput 2026-02-08 10:17:42 +01:00
Henrik Rydgård aa17599f66 Make things more consistent in the no-present case 2026-02-08 10:13:34 +01:00
Henrik Rydgård 814713e932 More refactor 2026-02-08 01:06:35 +01:00
Henrik Rydgård c139d4aaff Split up Presentation::CopyToOutput into passes and output. 2026-02-08 01:06:35 +01:00
Henrik Rydgård f01aaeafb1 Split CopyDisplayToOutput in preparation for the next step 2026-02-08 01:06:32 +01:00
Henrik Rydgård dd28f75852 Buildfixes 2026-02-07 12:03:44 +01:00
Henrik Rydgård 34108551da Fix a problem with copies to RAM - forgot to set up the copy dest rectangle
Fixes #21187
2026-02-05 14:04:34 +01:00
Henrik Rydgård d4896fbecd VtxDec_Tu16_C8888_Pfloat: Avoid over-reading the input 2026-02-05 13:34:34 +01:00
Henrik Rydgård 991d7bdfab VertexDecoder: Refactor away lowerbound/upperbound parameters 2026-02-05 13:26:17 +01:00
Henrik Rydgård 841e4c8564 Add various checks trying to avoid various crashes found in Google Play crash reports. 2026-02-05 11:12:53 +01:00
Henrik Rydgård 7b1ba55e72 Prevent touch controls from fading away while being held.
Fixes #20531
2026-02-04 00:00:38 +01:00
Henrik Rydgård 7db8709e56 Buildfix 2026-02-02 09:44:18 +01:00
Henrik Rydgård e6a2a36bb8 Touch screen controls layout: In portrait mode, move everything up a bit by default. More comfortable. 2026-02-01 14:19:51 +01:00