• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3set -e
4
5gen_shader() {
6	imm=$1
7	if [ "$2" = "half" ]; then
8		h="h"
9		mov="cov.u16u32"
10	else
11		h=""
12		mov="mov.u32u32"
13	fi
14	cat <<EOF
15@localsize 1, 1, 1
16@buf 4  ; g[0]
17mov.u32u32 r0.x, 0
18(rpt5)nop
19(rpt5)nop
20add.f ${h}r2.x, ${h}r0.x, $imm
21(rpt5)nop
22$mov r1.x, ${h}r2.x
23(rpt5)nop
24; and store results:
25stib.b.untyped.1d.u32.1.imm r1.x, r0.x, 0
26(sy)nop
27end
28EOF
29}
30
31
32run() {
33	echo "TEST: $*"
34	gen_shader $* | ./computerator -g 1,1,1 -d
35}
36
37for n in `seq 0 16`; do
38	run "$n" "full"
39	run "h($n)" "half"
40done
41