Commit Graph

550 Commits

Author SHA1 Message Date
Henri Verbeet
043f6f21b0 vkd3d-shader/ir: Create SSA values with the corresponding dimension in vsir_program_lower_sm4_sincos().
For example, in the final test from trigonometry.shader_test, we have:

    sincos r1.x <v4:float>, null <float>, l(3.00000000e+01) <s:float>

which currently gets turned into

    mov sr0.xyzw <v4:float>, l(3.00000000e+01) <s:float>
    sin r1.x <v4:float>, sr0.xyzw <v4:float>

That doesn't seem ideal, and should possibly be rejected by the
validator, but ends up working out well enough for the SPIR-V backend.
It's a bit more problematic to deal with for the GLSL backend.
2025-06-26 16:02:38 +02:00
Francisco Casas
96cd4cc954 vkd3d-shader/ir: Avoid a compiler warning in vsir_block_list_init().
The following warning appears during compilation with
gcc 15.1.1 20250425:

  In function 'vsir_block_list_init',
      inlined from 'vsir_block_init' at vkd3d/libs/vkd3d-shader/ir.c:3821:5,
      inlined from 'vsir_cfg_init' at vkd3d/libs/vkd3d-shader/ir.c:4285:28:
  vkd3d/libs/vkd3d-shader/ir.c:3758:5: warning: 'memset' writing 24 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
   3758 |     memset(list, 0, sizeof(*list));
        |     ^
  In function 'vsir_cfg_init':
  lto1: note: destination object is likely at address zero

looking at the code in vsir_cfg_init() this seems like an spurious
warning. Looking on the internet, these bogus warnings with memset()
seem to be a common occurrence.

memset() is replaced with a zero value assignment to avoid this.
2025-06-26 15:56:43 +02:00
Giovanni Mascellani
3c469edc8e vkd3d-shader/ir: Validate GEU instructions. 2025-06-25 16:53:19 +02:00
Giovanni Mascellani
e267ea9551 vkd3d-shader/ir: Validate GEO instructions. 2025-06-25 16:52:28 +02:00
Giovanni Mascellani
8feeb07900 vkd3d-shader/ir: Validate FREM instructions. 2025-06-25 16:51:58 +02:00
Giovanni Mascellani
32cab7c81e vkd3d-shader/ir: Validate FRC instructions. 2025-06-25 16:51:02 +02:00
Giovanni Mascellani
afec7cc96b vkd3d-shader/ir: Validate EXP instructions. 2025-06-25 16:50:03 +02:00
Giovanni Mascellani
8cf7a12502 vkd3d-shader/ir: Validate EQU instructions. 2025-06-25 16:48:45 +02:00
Giovanni Mascellani
a6e6e36994 vkd3d-shader/ir: Validate DEQO instructions. 2025-06-25 16:47:52 +02:00
Giovanni Mascellani
17b0e0d1d9 vkd3d-shader/ir: Validate EQO instructions. 2025-06-25 16:46:59 +02:00
Giovanni Mascellani
596f02210d vkd3d-shader/ir: Lower UDIV to UDIV_SIMPLE and UREM. 2025-06-25 16:44:00 +02:00
Giovanni Mascellani
82ef9bf2e5 vkd3d-shader/ir: Introduce VSIR_OP_UREM.
It is meant to compute the unsigned integer remainder.
2025-06-25 16:43:34 +02:00
Giovanni Mascellani
78e0f8412d vkd3d-shader/ir: Introduce VSIR_OP_UDIV_SIMPLE.
It is meant to compute the unsigned integer division, without
computing the modulo at the same time.
2025-06-25 16:40:43 +02:00
Giovanni Mascellani
ada09d003d vkd3d-shader/ir: Repurpose IDIV to compute plain signed division.
It doesn't compute signed remainder any more.
2025-06-25 16:39:50 +02:00
Giovanni Mascellani
823a8724de vkd3d-shader/ir: Introduce VSIR_OP_IREM.
It is meant to compute the signed integer remainder.
2025-06-25 16:38:38 +02:00
Henri Verbeet
d219cccc99 vkd3d-shader/ir: Rename the VKD3DSIH_* enum elements to VSIR_OP_*. 2025-06-25 15:53:41 +02:00
Elizabeth Figura
cd43ab1ca2 vkd3d-shader/ir: Allow bitwise operations on VKD3D_DATA_INT. 2025-06-25 15:46:39 +02:00
Giovanni Mascellani
3a4f95aca6 vkd3d-shader/ir: Do not crash when registers cannot be resolved to signature elements. 2025-06-25 15:40:12 +02:00
Giovanni Mascellani
99db7270f0 vkd3d-shader/ir: Validate DSY_FINE instructions. 2025-06-24 15:31:39 +02:00
Giovanni Mascellani
cbd508fce6 vkd3d-shader/ir: Validate DSY_COARSE instructions. 2025-06-24 15:31:39 +02:00
Giovanni Mascellani
7acebfc978 vkd3d-shader/ir: Validate DSY instructions. 2025-06-24 15:31:39 +02:00
Giovanni Mascellani
6bf25800c2 vkd3d-shader/ir: Validate DSX_FINE instructions. 2025-06-24 15:31:39 +02:00
Giovanni Mascellani
95e095992d vkd3d-shader/ir: Validate DSX_COARSE instructions. 2025-06-24 15:31:39 +02:00
Giovanni Mascellani
96bb2953cc vkd3d-shader/ir: Validate DSX instructions. 2025-06-24 15:31:39 +02:00
Giovanni Mascellani
ad320776a1 vkd3d-shader/ir: Validate DRCP instructions. 2025-06-24 15:31:39 +02:00