Commit Graph

33 Commits

Author SHA1 Message Date
Herman S.
20b226dbdf [Vulkan] Update glslang to 16.0.0 and introduce compat layer 2026-02-17 15:34:23 +09:00
Margen67
4cb783bf22 Header cleanup 2025-07-19 14:42:21 -07:00
Xphalnos
5f918ef28d [Misc] Replaced const with constexpr where possible 2025-03-25 19:50:37 +01:00
Triang3l
3d30b2eec3 [Vulkan] Shader memory export (#145) 2024-05-25 16:31:50 +03:00
Triang3l
8e7301f4d8 [SPIR-V] Use a helper class for most if/else branching
Simplifies emission of the blocks themselves (including inserting blocks
into the function's block list in the correct order), as well as phi after
the branching.

Also fixes 64bpp storing with blending in the fragment shader interlock
render backend implementation (had a typo that caused the high 32 bits to
overwrite the low ones).
2024-05-16 23:05:49 +03:00
Triang3l
53f98d1fe6 [GPU/D3D12] Memexport from anywhere in control flow + 8/16bpp memexport
There's no limit on the number of memory exports in a shader on the real
Xenos, and exports can be done anywhere, including in loops. Now, instead
of deferring the exports to the end of the shader, and assuming that export
allocs are executed only once, Xenia flushes exports when it reaches an
alloc (allocs terminate memory exports on Xenos, as well as individual ALU
instructions with `serialize`, but not handling this case for simplicity,
it's only truly mandatory to flush memory exports before starting a new
one), the end of the shader, or a pixel with outstanding exports is killed.

To know which eM# registers need to be flushed to the memory, traversing
the successors of each exec potentially writing any eM#, and specifying
that certain eM# registers might have potentially been written before each
reached control flow instruction, until a flush point or the end of the
shader is reached.

Also, some games export to sub-32bpp formats. These are now supported via
atomic AND clearing the bits of the dword to replace followed by an atomic
OR inserting the new byte/short.
2023-05-05 21:32:02 +03:00
Triang3l
8aaa6f1f7d [SPIR-V] Wrap 4-operand ops and 1-3-operand GLSL std calls 2023-04-19 21:44:24 +03:00
Triang3l
19d56001d2 [SPIR-V] Wrap NoContraction operations 2023-04-19 11:53:45 +03:00
Triang3l
78f1d55a36 [SPIR-V] Use Builder createSelectionMerge directly 2023-04-19 11:11:28 +03:00
Triang3l
64d2a80f79 [SPIR-V] Cleanup ALU emulation conditionals 2023-04-19 10:35:09 +03:00
Triang3l
eede38ff63 [SPIR-V] Remove more vec2-4 reserve calls 2023-04-18 22:05:02 +03:00
Triang3l
887fda55c2 [SPIR-V] Remove temp reserve for 4 or less elements 2023-04-13 22:43:44 +03:00
Triang3l
45050b2380 [GPU] Vulkan fragment shader interlock RB and related fixes/cleanup
Also fixes addressing of MSAA samples 2 and 3 for 64bpp color render targets in the ROV RB implementation on Direct3D 12.
Additionally, with FSI/ROV, alpha test and alpha to coverage are done only if the render target 0 was dynamically written to (according to the Direct3D 9 rules for writing to color render targets, though not sure if they actually apply to the alpha tests on Direct3D 9, but for safety).
There is also some code cleanup for things spotted during the development of the feature.
2022-10-09 22:06:41 +03:00
Triang3l
d8b0227cbd [SPIR-V] Fix cubemap X axis 2022-06-25 16:25:29 +03:00
Triang3l
b88f715140 Merge branch 'master' into vulkan 2022-05-03 00:13:17 +03:00
Triang3l
8665fa7517 [SPIR-V] Vertex index writing to r0.x 2020-11-03 23:31:52 +03:00
Triang3l
6030a4cf72 [SPIR-V] Add missing EnsureBuildPointAvailable in ALU 2020-11-02 12:17:47 +03:00
Triang3l
de8b0a85ac [SPIR-V] Remaining scalar ALU instructions 2020-11-01 22:30:05 +03:00
Triang3l
cb35aaf13b [SPIR-V] Scalar kill instructions 2020-11-01 22:22:34 +03:00
Triang3l
7512560416 [SPIR-V] SALU address and predicate 2020-11-01 22:17:12 +03:00
Triang3l
0f6aff6f74 [SPIR-V] Unary math functions 2020-11-01 21:48:14 +03:00
Triang3l
d466ebbbe1 [SPIR-V] Scalar ALU comparison and simple unary 2020-11-01 21:12:09 +03:00
Triang3l
06b47d1df0 [SPIR-V] Scalar addition and multiplication 2020-11-01 20:42:59 +03:00
Triang3l
fd4ba5622a [SPIR-V] Cube: multiply the major axis by 2 2020-11-01 15:56:51 +03:00
Triang3l
c173ecc4ef [SPIR-V] Remaining VALU instructions 2020-11-01 15:45:26 +03:00
Triang3l
d9f57c1ad8 [SPIR-V] Max4 2020-11-01 13:12:31 +03:00
Triang3l
b32ca5fb4f [SPIR-V] Cube vector instruction 2020-10-31 21:42:51 +03:00
Triang3l
0949fac826 [SPIR-V] Dot product 2020-10-31 20:15:01 +03:00
Triang3l
06502d80d9 [SPIR-V] Vector max/min, comparison, unary 2020-10-31 19:15:00 +03:00
Triang3l
1acc5eff05 [SPIR-V] Vector mul, mad 2020-10-31 17:56:46 +03:00
Triang3l
738cb0b847 [SPIR-V] Result storing 2020-10-29 22:07:02 +03:00
Triang3l
4dba2d8d89 [SPIR-V] Operand loading 2020-10-27 22:48:47 +03:00
Triang3l
1c83c8dcfa [SPIR-V] Instruction predication 2020-10-26 22:12:01 +03:00