Commit graph

248 commits

Author SHA1 Message Date
TheTurtle
dcc662ff1a
ir_passes: Integrate DS barriers in block (#2020) 2025-01-02 22:52:10 +02:00
squidbus
41d64a200d
shader_recompiler: Add swizzle support for unsupported formats. (#1869)
* shader_recompiler: Add swizzle support for unsupported formats.

* renderer_vulkan: Rework MRT swizzles and add unsupported format swizzle support.

* shader_recompiler: Clean up swizzle handling and handle ImageRead storage swizzle.

* shader_recompiler: Fix type errors

* liverpool_to_vk: Remove redundant clear color swizzles.

* shader_recompiler: Reduce CompositeConstruct to constants where possible.

* shader_recompiler: Fix ImageRead/Write and StoreBufferFormatF32 types.

* amdgpu: Add a few more unsupported format remaps.
2024-12-31 06:14:47 +02:00
squidbus
284f473a52
shader_recompiler: Fix BitCount64 and FindILsb64 (#1978) 2024-12-31 06:10:29 +02:00
baggins183
62780e4e43
Initialize V0 to PrimitiveId in hull shader (#1985) 2024-12-31 06:00:52 +02:00
baggins183
62c47cb1b7
recompiler: handle reads of output variables in hull shaders (#1962)
* Handle output control point reads in hull shader. Might need additional barriers

* output storage class
2024-12-29 12:37:15 +02:00
jas0n098
63d2d1ebe8
Handle RectList primitives in Geometry shaders (#1936) 2024-12-28 13:19:41 +02:00
Stephen Miller
122fe22a32
Implement IMAGE_GATHER4 and IMAGE_GATHER4_O (#1939)
* Implement IMAGE_GATHER4_O

Used by The Last of Us Remastered.

* Fix type on IMAGE_GATHER4_C_LZ

Had a different set of types compared to the other IMAGE_GATHER4 ops.

* IMAGE_GATHER4
2024-12-28 02:42:41 +02:00
georgemoralis
3218c36b22
knack fixes by niko (#1933) 2024-12-27 23:03:03 +02:00
squidbus
b1f74660df
shader_recompiler: Implement S_BCNT1_I32_B64 and S_FF1_I32_B64 (#1889)
* shader_recompiler: Implement S_BCNT1_I32_B64

* shader_recompiler: Implement S_FF1_I32_B64

* shader_recompiler: Implement IEqual for 64-bit.

* shader_recompiler: Fix immediate type in S_FF1_I32_B32
2024-12-27 16:46:07 +02:00
squidbus
a89c29c2ca
shader_recompiler: Rework image read/write emit. (#1819) 2024-12-25 01:13:32 +02:00
IndecisiveTurtle
7b24b42711 data_share: Emit barrier before reads
* 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) 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)
* 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)
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 2024-12-13 00:31:49 +02:00
squidbus
0b59ebb22f
shader_recompiler: Implement S_ABS_I32 (#1713) 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) 2024-12-07 19:41:41 +02:00
Vladislav Mikhalin
8eacb88a86
recompiler: fixed fragment shader built-in attribute access (#1676)
* 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)
* 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 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