Commit graph

239 commits

Author SHA1 Message Date
squidbus a89c29c2ca
shader_recompiler: Rework image read/write emit. (#1819)
Some checks are pending
Build and Release / get-info (push) Waiting to run
Build and Release / pre-release (push) Blocked by required conditions
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
2024-12-25 01:13:32 +02:00
IndecisiveTurtle 7b24b42711 data_share: Emit barrier before reads
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* Fixes artifacts in TLG when using NVIDIA gpus. When LDS is written and read in the same basic block, the barrier pass wont handle it properly, so insert a barrier before reads
2024-12-24 16:04:30 +02:00
Daniel R. c284cf72e1
Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
TheTurtle 092d42e981
renderer_vulkan: Implement rectlist emulation with tessellation (#1857)
* renderer_vulkan: Implement rectlist emulation with tessellation

* clang format

* renderer_vulkan: Use tessellation for quad primitive as well

* vk_rasterizer: Handle viewport enable flags

* review

* shader_recompiler: Fix quad/rect list FS passthrough semantics.

* spirv: Bump to 1.5

* remove pragma

---------

Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com>
2024-12-24 13:28:47 +02:00
georgemoralis b0b74243af clang-fix 2024-12-19 10:25:03 +02:00
TheTurtle 188eebb92a
ir: Add heuristic based LDS barrier pass (#1801)
* ir: Add heuristic based LDS barrier pass

* Attempts to insert barriers after zero-depth divergant conditional blocks in shaders that use shared memory

* lds_barriers: Limit to nvidia

* Intel has historically had problems with cs barriers, will debug other time
2024-12-19 10:18:28 +02:00
Stephen Miller 32435674f2
Misc UE4 fixes (#1821)
* Add ExecLo case to S_SAVEEXEC_B64

Seen in CUSA38209

* S_BCNT1_I32_B32

Turtle said our implementation of S_BCNT1_I32_B64 was meant to be for S_BCNT1_I32_B32, so renaming the opcode is the fix.
2024-12-18 22:05:35 +02:00
Marcin Mikołajczyk b1b4c8c487
Handle setting Vcc in Translator::SetDst64 (#1826) 2024-12-18 21:57:58 +02:00
Marcin Mikołajczyk be4c38bf1c
Handle 32bit int ImageFormat (#1823) 2024-12-18 21:48:00 +02:00
squidbus 8a4e03228a
spirv_emit_context: Prevent double-add of GS in attributes to interface. (#1800)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
2024-12-16 02:11:15 +02:00
baggins183 9aa1c13c7e
Fix some compiler problems with ds3 (#1793)
- Implement S_CMOVK_I32
- Handle Isoline abstract patch type
2024-12-15 16:30:19 +02:00
psucien 0fd1ab674b
GPU processor refactoring (#1787)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* coroutine code prettification

* asc queues submission refactoring

* better asc ring context handling

* final touches and review notes

* even more simplification for context saving
2024-12-15 00:54:46 +02:00
Vladislav Mikhalin 876445faf1
recompiler: emit a label right after s_branch to prevent dead code interferrence (#1785) 2024-12-14 22:46:55 +02:00
squidbus f93677b953
resource_tracking_pass: Fix converting dimensions to float for normalization. (#1790) 2024-12-14 22:46:35 +02:00
TheTurtle e9ede8d627
Revert "DmaData and Recompiler fixes (#1775)" (#1784)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This reverts commit cafd40f2c2.
2024-12-14 16:17:14 +02:00
squidbus 27447537c3
externals: Update sirit to fix debug assert (#1783) 2024-12-14 16:12:41 +02:00
squidbus e752f04cde
shader_recompiler: Fixups from stencil changes (#1776) 2024-12-14 14:33:24 +02:00
Vladislav Mikhalin cafd40f2c2
DmaData and Recompiler fixes (#1775)
* liverpool: fix dmadata packet handling

* recompiler: emit a label right after s_branch to prevent dead code interferrence

* specialize barriers
2024-12-14 14:33:06 +02:00
baggins183 3c0c921ef5
Tessellation (#1528)
* shader_recompiler: Tessellation WIP

* fix compiler errors after merge

DONT MERGE set log file to /dev/null

DONT MERGE linux pthread bb fix

save work

DONT MERGE dump ir

save more work

fix mistake with ES shader

skip list

add input patch control points dynamic state

random stuff

* WIP Tessellation partial implementation. Squash commits

* test: make local/tcs use attr arrays

* attr arrays in TCS/TES

* dont define empty attr arrays

* switch to special opcodes for tess tcs/tes reads and tcs writes

* impl tcs/tes read attr insts

* rebase fix

* save some work

* save work probably broken and slow

* put Vertex LogicalStage after TCS and TES to fix bindings

* more refactors

* refactor pattern matching and optimize modulos (disabled)

* enable modulo opt

* copyright

* rebase fixes

* remove some prints

* remove some stuff

* Add TCS/TES support for shader patching and use LogicalStage

* refactor and handle wider DS instructions

* get rid of GetAttributes for special tess constants reads. Immediately replace some upon seeing readconstbuffer. Gets rid of some extra passes over IR

* stop relying on GNMX HsConstants struct. Change runtime_info.hs_info and some regs

* delete some more stuff

* update comments for current implementation

* some cleanup

* uint error

* more cleanup

* remove patch control points dynamic state (because runtime_info already depends on it)

* fix potential problem with determining passthrough

---------

Co-authored-by: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2024-12-14 12:56:17 +02:00
squidbus 8caca4df32
shader_recompiler: Support VK_AMD_shader_image_load_store_lod for IMAGE_STORE_MIP (#1770)
* shader_recompiler: Support VK_AMD_shader_image_load_store_lod for IMAGE_STORE_MIP

* emit_spirv: Fix missing extension declaration.
2024-12-14 12:03:42 +02:00
squidbus f1c23d514b
shader_recompiler: Implement FREXP instructions. (#1766) 2024-12-13 21:51:39 +02:00
TheTurtle 722a0e36be
graphics: Improve handling of color buffer and storage image swizzles (#1763)
* liverpool_to_vk: Remove wrong component swap formats

* shader_recompiler: Handle storage and buffer format swizzles

* shader_recompiler: Skip unsupported depth export

* image_view: Remove image format swizzle

* Platform support is not always guaranteed
2024-12-13 21:49:37 +02:00
squidbus 028be3ba5d
shader_recompiler: Emulate unnormalized sampler coordinates in shader. (#1762)
* shader_recompiler: Emulate unnormalized sampler coordinates in shader.

* Address review comments.
2024-12-13 21:49:07 +02:00
TheTurtle 5be807fc8a
hot-fix: Fix order of operands
Some checks are pending
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / get-info (push) Waiting to run
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / pre-release (push) Blocked by required conditions
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
2024-12-13 00:31:49 +02:00
squidbus 0b59ebb22f
shader_recompiler: Implement S_ABS_I32 (#1713)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2024-12-09 12:12:33 +01:00
squidbus 71a82199ed
shader_recompiler: Fix check for fragment depth store. (#1694) 2024-12-08 10:20:05 +02:00
IndecisiveTurtle cde84e4bac shader_recompiler: Fix mistake 2024-12-07 23:45:23 +02:00
squidbus c076ba69e8
shader_recompiler: Implement V_LSHL_B64 for immediate arguments. (#1674) 2024-12-07 23:28:17 +02:00
¥IGA 2266622dcf
Support for Vulkan 1.4 (#1665)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2024-12-07 19:41:41 +02:00
Vladislav Mikhalin 8eacb88a86
recompiler: fixed fragment shader built-in attribute access (#1676)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* recompiler: fixed fragment shader built-in attribute access

* handle en/addr separately

* handle other registers as well
2024-12-07 01:20:09 +02:00
TheTurtle 9e618c0e0c
video_core: Add multipler to handle special cases of texture buffer stride mismatch (#1640)
* page_manager: Enable userfaultfd by default

* Much faster than page faults and causes less problems

* shader_recompiler: Add texel buffer multiplier

* Fixes format mismatch assert when vsharp stride is multiple of format stride

* shader_recompiler: Specialize UBOs on size

* Some games can perform manual vertex pulling and thus bind read only buffers of varying size. We only recompile when the vsharp size is larger than size in shader, in opposite case its not needed

* clang format
2024-12-06 19:54:59 +02:00
squidbus d05846a327
specialization: Fix fetch shader field type (#1675) 2024-12-06 12:59:55 +02:00
IndecisiveTurtle 77da8bac00 core: Return proper address of eh frame/add more opcodes 2024-12-06 00:47:11 +02:00
TheTurtle 22a2741ea0
shader_recompilers: Improvements to SSA phi generation and lane instruction elimination (#1667)
* shader_recompiler: Add use tracking for Insts

* ssa_rewrite: Recursively remove phis

* ssa_rewrite: Correct recursive trivial phi elimination

* ir: Improve read lane folding pass

* control_flow: Avoid adding unnecessary divergant blocks

* clang format

* externals: Update ext-boost

---------

Co-authored-by: Frodo Baggins <baggins31084@proton.me>
2024-12-05 23:14:16 +02:00
squidbus 920acb8d8b
renderer_vulkan: Parse fetch shader per-pipeline (#1656)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* shader_recompiler: Read image format info directly from sharps instead of storing in shader info.

* renderer_vulkan: Parse fetch shader per-pipeline

* Few minor fixes.

* shader_recompiler: Specialize on vertex attribute number types.

* shader_recompiler: Move GetDrawOffsets to fetch shader
2024-12-04 13:03:47 +02:00
TheTurtle eb844b9b63
shader_recompiler: Implement manual barycentric interpolation path (#1644)
* shader_recompiler: Implement manual barycentric interpolation path

* clang format

* emit_spirv: Fix typo

* emit_spirv: Simplify variable definition

* spirv_emit: clang format
2024-12-02 23:20:54 +02:00
Jamie Tong b0860d6e8c
implement DS_AND_B32, DS_OR_B32, DS_XOR_B32 (#1593)
* implement DS_OR_B32

* implement DS_AND_B32, DS_XOR_B32
2024-11-30 22:39:11 +02:00
Vladislav Mikhalin 086c5802f4
Fixed DS_SWIZZLE_32 (#1619) 2024-11-29 22:13:36 +02:00
psucien d6d1ec4f22 hot-fix: apply vgt index offset to draw commands
Some checks are pending
Build and Release / get-info (push) Waiting to run
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2024-11-29 14:17:53 +01:00
psucien 3d95ad0e3a
Image binding and texture cache interface refactor (1/2) (#1481)
* video_core: texture_cache: interface refactor and better overlap handling

* resources binding moved into vk_rasterizer

* remove `virtual` flag leftover
2024-11-24 17:07:51 +01:00
baggins183 fde1726af5
recompiler: fix how srt pass handles step rate sharps in special case (#1587) 2024-11-24 11:49:59 +01:00
psucien 5976300788 hot-fix: proper offset calculation for single offset lds instructions 2024-11-23 10:14:19 +01:00
TheTurtle c4506da0ae
kernel: Rewrite pthread emulation (#1440)
* libkernel: Cleanup some function places

* kernel: Refactor thread functions

* kernel: It builds

* kernel: Fix a bunch of bugs, kernel thread heap

* kernel: File cleanup pt1

* File cleanup pt2

* File cleanup pt3

* File cleanup pt4

* kernel: Add missing funcs

* kernel: Add basic exceptions for linux

* gnmdriver: Add workload functions

* kernel: Fix new pthreads code on macOS. (#1441)

* kernel: Downgrade edeadlk to log

* gnmdriver: Add sceGnmSubmitCommandBuffersForWorkload

* exception: Add context register population for macOS. (#1444)

* kernel: Pthread rewrite touchups for Windows

* kernel: Multiplatform thread implementation

* mutex: Remove spamming log

* pthread_spec: Make assert into a log

* pthread_spec: Zero initialize array

* Attempt to fix non-Windows builds

* hotfix: change incorrect NID for scePthreadAttrSetaffinity

* scePthreadAttrSetaffinity implementation

* Attempt to fix Linux

* windows: Address a bunch of address space problems

* address_space: Fix unmap of region surrounded by placeholders

* libs: Reduce logging

* pthread: Implement condvar with waitable atomics and sleepqueue

* sleepq: Separate and make faster

* time: Remove delay execution

* Causes high cpu usage in Tohou Luna Nights

* kernel: Cleanup files again

* pthread: Add missing include

* semaphore: Use binary_semaphore instead of condvar

* Seems more reliable

* libraries/sysmodule: log module on `sceSysmoduleIsLoaded`

* libraries/kernel: implement `scePthreadSetPrio`

---------

Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com>
Co-authored-by: Daniel R. <47796739+polybiusproxy@users.noreply.github.com>
2024-11-21 22:59:38 +02:00
Daniel R. 6904764aab
shader_recompiler/frontend: implement V_MIN3_U32 2024-11-21 19:52:48 +01:00
Daniel R. e968b1c23f
video_core/amdgpu: heuristic for shader binary info
Games can strip the first shader instruction (meant for debugging) which we rely on for obtaining shader information (e.g. LittleBigPlanet 3). For this reason, we start a search through the code start until we arrive at the shader binary info.
2024-11-21 19:24:13 +01:00
¥IGA c83ac654ce
Bump to Clang 18 (#1549) 2024-11-21 12:08:22 +02:00
Ruah Devlin 96cd79f272
Implement V_MED3_U32 vector ALU Opcode (#1553) 2024-11-20 17:23:59 +01:00
Daniel R. 17c47bcd96
shader_recompiler/frontend: Implement bitcmp instructions (#1550)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
2024-11-19 21:38:32 +01:00
Lander Gallastegi b64dcd2f56
Assert fix (#1521) 2024-11-12 09:26:48 +02:00
psucien 204bba9be8 hot-fix: pr merge conflict resolved 2024-11-05 22:59:45 +01:00