Commit Graph
127902 Commits
Author SHA1 Message Date
izzy2lost 39435acbc7 fix spy vs spy hitman metal slug etc. 2026-04-08 02:35:00 -04:00
izzy2lost 204262911e a couple fixes 2026-04-08 02:35:00 -04:00
izzy2lost fcfecd9ad2 Better part 2? 2026-04-08 02:35:00 -04:00
izzy2lost 70aef9f9d3 Better still needs work 2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 9fdec7beba Port Android Vulkan color surface conversion before upload
Adds host-side conversion for color surface formats that Adreno GPUs
cannot render to natively (e.g. X1R5G5B5, X8R8G8B8, A8R8G8B8),
converting from the Xbox surface layout to the Vulkan host format
used as a fallback render target on Android.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 81d6b5bd92 Raise Vulkan uniform buffer size from 8MB to 64MB
Prevents UBO overflow when running complex scenes with many draw calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 903de37ec7 Fix wrong VkFormat in display image layout transition
VK_FORMAT_R8G8B8_UNORM was used in a layout transition for the display
image, but it was created with VK_FORMAT_R8G8B8A8_UNORM. This mismatch
could cause validation errors or rendering artifacts on strict drivers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 5a7ca49b66 Fix texture dirty tracking to only mark changed on register write
Only set texture_dirty when the register value actually changes,
avoiding spurious texture re-uploads on every draw call when the game
sets the same texture parameters repeatedly (common for UI rendering).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 9f760de081 Re-apply R12/oPos concurrency fix in vertex shader (PR 2720)
When paired MAC+ILU instructions write to oPos (output register 0)
while also having temp register output, use _temp_r12 as intermediate
to avoid reading stale oPos value as R12.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 1d10f6cb2a Re-apply stale VRAM fix and SPIRV cache persistence
- gl/surface.c, vk/surface.c: Mark DIRTY_MEMORY_NV2A on download to
  prevent stale buffer reads after surface write-back (PR 2800 fix)
- vk/draw.c: Fallback to empty pipeline cache on corrupt data (PR 2799)
- vk/glsl.c: Persist compiled SPIRV to disk cache (spirv_cache.bin) to
  avoid re-compiling shaders on subsequent launches (PR 2799)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:35:00 -04:00
izzy2lostandClaude Sonnet 4.6 e71284cfbf Re-apply Vulkan zeta surface texture correctness fix
Track VkImageLayout on SurfaceBinding and transition correctly between
DEPTH_STENCIL_ATTACHMENT_OPTIMAL and DEPTH_STENCIL_READ_ONLY_OPTIMAL
when depth surfaces are used as textures.

- renderer.h: Add image_layout to SurfaceBinding; tex_surface_direct_layout[] to PGRAPHVkState
- image.c: Add DEPTH_STENCIL_READ_ONLY_OPTIMAL transition cases for TRANSFER_SRC/DST
- surface.c: Replace hardcoded layouts with image_layout tracking throughout
- draw.c: Barrier in begin_render_pass to restore zeta from READ_ONLY to ATTACHMENT
- shaders.c: Use tex_surface_direct_layout[] instead of hardcoded GENERAL
- texture.c: Add bind_zeta_surface_as_texture(); use image_layout in all s2t paths;
  direct-bind depth surfaces without stencil in DEPTH_STENCIL_READ_ONLY_OPTIMAL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:34:59 -04:00
izzy2lostandClaude Sonnet 4.6 997c8d0b30 Restore correct surface-to-texture view semantics for Vulkan
Re-applies the fix from 372e3eacbb that was lost in the sloppy-stuff
mega-commit. When a color surface is used as a texture, the surface's
raw image_view may not have the correct component swizzle for the
texture format (e.g. X8R8G8B8 forces alpha=1 via swizzle, but the
surface view has the real alpha). This creates a per-texture view with
the correct swizzle from kelvin_color_format_vk_map. If the VkFormats
don't match at all (different internal layouts), fall back to a copy
via copy_surface_to_texture rather than binding directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:34:59 -04:00
izzy2lostandClaude Sonnet 4.6 ee2fb9a94b Restore signed texture channel handling in fragment shaders
Re-applies the fix from 0f623fe906 that was lost in the sloppy-stuff
mega-commit. The RSIGNED/GSIGNED/BSIGNED/ASIGNED bits in TEXFILTER0
tell the hardware to interpret each sampled texture channel as a signed
value (-1..1). Without this, bump-mapped and environment-mapped surfaces
render with incorrect channel values, causing visual artifacts in games
that use G8B8/R6G5B5 bump map textures with the signed filter flags set.

Changes:
- texture.h: add PgraphTextureSignedChannel enum and
  pgraph_get_texture_signed_component_mask_from_filter()
- psh.h: add tex_signed[4] to PshState
- psh.c: populate tex_signed from filter register, add
  apply_signed_texture_remap(), update BUMPENVMAP/BUMPENVMAP_LUM
  cases to check per-channel signed flags, apply remap after sampling
- gl/texture.c: remove NV2A_UNIMPLEMENTED stubs for SIGNED flags
  (handled in shader now, same as VK path)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:34:59 -04:00
izzy2lost d726dbc780 sloppy stuff 2026-04-08 02:34:59 -04:00
izzy2lost 5603c855b9 Port hakuX Phase 4 async compile worker 2026-04-08 02:34:57 -04:00
izzy2lost 167c027ff5 Port hakuX Phase 3 conservative draw reordering 2026-04-08 02:34:57 -04:00
izzy2lost 0c22bd3a36 Port hakuX Phase 2 bindless descriptor indexing 2026-04-08 02:34:57 -04:00
izzy2lost ad2aa65503 Port hakuX Phase 1 super fast path foundation 2026-04-08 02:34:56 -04:00
izzy2lost e72dc18125 Port hakuX Phase 0 generation counter foundation 2026-04-08 02:34:56 -04:00
izzy2lost 63c11613f2 Revert "Align Android Vulkan texture uploads with GL safe path"
This reverts commit 4b826a92418e66cf76e5a4c34a91e2b6f5eba7c0.
2026-04-08 02:34:54 -04:00
izzy2lost 1b06bef335 Fix Vulkan direct surface binding after Android texture conversion 2026-04-08 02:34:53 -04:00
izzy2lost a78036a988 Align Android Vulkan texture uploads with GL safe path 2026-04-08 02:34:53 -04:00
izzy2lost a4a1c4b61b Fix Vulkan direct surface texture view semantics 2026-04-08 02:34:53 -04:00
izzy2lost 4d995d1109 Handle signed texture sampler channels in shaders 2026-04-08 02:34:53 -04:00
izzy2lost f6522b69ea Improve Vulkan zeta surface texture correctness 2026-04-08 02:34:53 -04:00