4
Computerator is a tool to launch compute shaders, written in assembly.
5
The main purpose is to have an easy way to experiment with instructions
6
without dealing with the entire compiler stack (which makes controlling
7
the order of instructions, the registers chosen, etc, difficult). The
8
choice of compute shaders is simply because there is far less state
14
The shader assembly can be prefixed with headers to control state setup:
16
* ``@localsize X, Y, Z`` - configures local workgroup size
17
* ``@buf SZ (cN.c)`` - 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
The iova of the buffer is written as a vec2 to ``cN.c``
21
* ``@const(cN.c)`` configures a const vec4 starting at specified
22
const register, ie ``@const(c1.x) 1.0, 2.0, 3.0, 4.0`` will populate
23
``c1.xyzw`` with ``vec4(1.0, 2.0, 3.0, 4.0)``
24
* ``@invocationid(rN.c)`` will populate a vec3 starting at the specified
25
register with the local invocation-id
26
* ``@wgid(rN.c)`` will populate a vec3 starting at the specified register
27
with the workgroup-id (must be a high-reg, ie. ``r48.x`` and above)
28
* ``@numwg(cN.c)`` will populate a vec3 starting at the specified const
37
@const(c0.x) 0.0, 0.0, 0.0, 0.0
38
@const(c1.x) 1.0, 2.0, 3.0, 4.0
39
@wgid(r48.x) ; r48.xyz
40
@invocationid(r0.x) ; r0.xyz
44
stib.untyped.1d.u32.1 g[0] + r0.y, r0.x
53
cat myshader.asm | ./computerator --disasm --groups=4,4,4