• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

examples/23-Nov-2023-341247

README.rstD23-Nov-20231.6 KiB5545

a6xx.cD23-Nov-202315.5 KiB495357

ir3_asm.cD23-Nov-20232.1 KiB6228

ir3_asm.hD23-Nov-20231.6 KiB4516

main.cD23-Nov-20237.4 KiB316221

main.hD23-Nov-20232.6 KiB8739

meson.buildD23-Nov-20231.7 KiB5549

README.rst

1Overview
2========
3
4Computerator is a tool to launch compute shaders, written in assembly.
5The main purpose is to have an easy way to experiment with instructions
6without dealing with the entire compiler stack (which makes controlling
7the order of instructions, the registers chosen, etc, difficult).  The
8choice of compute shaders is simply because there is far less state
9setup required.
10
11Headers
12-------
13
14The shader assembly can be prefixed with headers to control state setup:
15
16* ``@localsize X, Y, Z`` - configures local workgroup size
17* ``@buf SZ`` - configures an SSBO of the specified size (in dwords).
18  The order of the ``@buf`` headers determines the index, ie the first
19  ``@buf`` header is ``g[0]``, the second ``g[1]``, and so on
20* ``@const(cN.c)`` configures a const vec4 starting at specified
21  const register, ie ``@const(c1.x) 1.0, 2.0, 3.0, 4.0`` will populate
22  ``c1.xyzw`` with ``vec4(1.0, 2.0, 3.0, 4.0)``
23* ``@invocationid(rN.c)`` will populate a vec3 starting at the specified
24  register with the local invocation-id
25* ``@wgid(rN.c)`` will populate a vec3 starting at the specified register
26  with the workgroup-id (must be a high-reg, ie. ``r48.x`` and above)
27* ``@numwg(cN.c)`` will populate a vec3 starting at the specified const
28  register
29
30Example
31-------
32
33```
34@localsize 32, 1, 1
35@buf 32  ; g[0]
36@const(c0.x)  0.0, 0.0, 0.0, 0.0
37@const(c1.x)  1.0, 2.0, 3.0, 4.0
38@wgid(r48.x)        ; r48.xyz
39@invocationid(r0.x) ; r0.xyz
40@numwg(c2.x)        ; c2.xyz
41mov.u32u32 r0.y, r0.x
42(rpt5)nop
43stib.untyped.1d.u32.1 g[0] + r0.y, r0.x
44end
45nop
46```
47
48Usage
49-----
50
51```
52cat myshader.asm | ./computerator --disasm --groups=4,4,4
53```
54
55