Commit Graph

909 Commits

Author SHA1 Message Date
Henri Verbeet
e83f4f40f9 vkd3d-shader/spirv: Handle "IdRef" operands. 2025-03-10 14:47:03 +01:00
Henri Verbeet
bebc550f02 vkd3d-shader/spirv: Implement outputting opcode names. 2025-03-10 14:47:00 +01:00
Henri Verbeet
997f3f8266 vkd3d-shader/spirv: Implement outputting instruction offsets. 2025-03-10 14:45:06 +01:00
Giovanni Mascellani
8c785f1dc9 vkd3d-shader/spirv: Emit immediate words for unhandled instructions.
The assembler can parse these to reconstruct the original bytecode.
2025-03-10 14:45:06 +01:00
Henri Verbeet
5ab5a721a1 vkd3d-shader/spirv: Do not sign-extend *ptr in vkd3d_spirv_build_string().
"char" is (potentially) signed, so casting it to uint32_t will
sign-extend it. Because we use |= to assign it to "word", and don't
otherwise mask out the higher bits either, we effectively set subsequent
bytes in the same word to 0xff for input bytes > 0x7f. That potentially
includes the \0 terminator. For example, "é" (U+00e9) is "\xc3\xa9"
when encoded as UTF-8, and would get us 0xffffffc3 instead of
0x0000a9c3.
2025-03-05 14:10:58 +01:00
Giovanni Mascellani
8297ea9aa6 vkd3d/device: Require VK_KHR_zero_initialize_workgroup_memory when appropriate.
That extension (and the corresponding feature) must be enabled when
the Initializer operand is used for workgroup variables.
2025-02-26 16:11:50 +01:00
Henri Verbeet
fe4143ad19 vkd3d-shader/dxil: Generate I/O signatures with 16-bit component types for native 16-bit shaders.
Which incidentally matches the I/O signatures from the DXBC container.
2025-02-24 15:10:08 +01:00
Henri Verbeet
985d317e0e Release 1.15. 2025-02-19 12:00:00 +01:00
Giovanni Mascellani
343022cdc1 vkd3d-shader/spirv: Interpret the write mask as a destination swizzle for double comparison operations.
This fixes a failure on a shader in Wild hearts.
2025-01-22 14:51:16 +01:00
Shaun Ren
4fbfb44681 vkd3d-shader/spirv: Emit the tessellator domain for domain shaders.
Commit 1ed8d907b3 inadvertently dropped
emitting the tessellator domain for domain shaders. Although Vulkan
environments allow us to write the tessellator domain from the hull
shader, the domain shader, or both, that's not generally true for OpenGL
environments.
2025-01-20 15:50:04 +01:00
Francisco Casas
8056058aa1 vkd3d-shader: Avoid passing NULL to memset(). (ubsan)
Otherwise ubsan reports errors such as:

    libs/vkd3d-shader/spirv.c:7266:5: runtime error: null pointer passed as argument 1, which is declared to never be null
2025-01-10 19:51:55 +01:00
Elizabeth Figura
efe686105d vkd3d-shader/spirv: Correctly implement DTOU. 2024-12-18 17:30:16 +01:00
Elizabeth Figura
4130ce5bb9 vkd3d-shader/spirv: Correctly implement DTOI. 2024-12-18 17:30:16 +01:00
Elizabeth Figura
f416713608 vkd3d-shader/spirv: Correctly implement DTOF. 2024-12-18 17:30:16 +01:00
Giovanni Mascellani
64126a00c3 vkd3d-shader/ir: Give more meaningful names to I/O normalisation levels.
The previous names "not normalised" and "fully normalised" have meanings
which are likely to change with time. OTOH including a description of the
normalisation level in the enumerant seems excessive. Relating
normalisation levels to shader model versions might be a reasonable
compromise.
2024-12-12 17:21:49 +01:00
Henri Verbeet
b484288a82 vkd3d-shader/spirv: Parse SPIR-V instructions. 2024-12-09 16:09:16 +01:00
Giovanni Mascellani
ac2901d2cb vkd3d-shader/spirv: Parse the SPIR-V instruction schema. 2024-12-09 16:09:16 +01:00
Giovanni Mascellani
9b4f5dab77 vkd3d-shader/spirv: Parse the SPIR-V id bound. 2024-12-09 16:09:16 +01:00
Giovanni Mascellani
3f548ccf9c vkd3d-shader/spirv: Parse the SPIR-V generator magic number. 2024-12-09 16:09:16 +01:00
Giovanni Mascellani
e218dae281 vkd3d-shader/spirv: Parse the SPIR-V version number. 2024-12-09 16:08:33 +01:00
Giovanni Mascellani
6cac18e395 vkd3d-shader/spirv: Parse the SPIR-V magic number. 2024-12-09 15:41:24 +01:00
Giovanni Mascellani
49fba97b0a vkd3d-shader/spirv: Introduce a SPIR-V parser. 2024-12-09 14:22:24 +01:00
Giovanni Mascellani
1c93d706d7 vkd3d-shader/ir: Merge removing I/O declarations in the general instruction lowering pass. 2024-12-03 14:36:13 +01:00
Giovanni Mascellani
18e422dfe4 vkd3d-shader/ir: Encode I/O declarations in vsir_program.
Most I/O registers are already described by the shader signatures.
The registers that are not do not have any property other then
being used by the program or not, so they can be collectively
described with a bitmap.
2024-12-03 14:19:24 +01:00
Giovanni Mascellani
a92b602b33 vkd3d-shader/spirv: Merge emitting input and output registers.
The register storage class is now represented in
vkd3d_register_builtins, so the spirv_compiler_emit_io_register()
doesn't need to know it from the caller.
2024-12-03 13:48:39 +01:00