summaryrefslogtreecommitdiff
path: root/src/sna/brw/brw_sf.c
blob: 0c69433d6a10803530350fcdd4c1ee92b6a5ba94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "brw.h"

void brw_sf_kernel__nomask(struct brw_compile *p)
{
	struct brw_reg inv, v0, v1, v2, delta;

	v0 = brw_vec4_grf(3, 0);
	v1 = brw_vec4_grf(4, 0);
	v2 = brw_vec4_grf(5, 0);
	delta = brw_vec8_grf(7, 0);

	inv = brw_vec4_grf(6, 0);
	brw_math_invert(p, inv, brw_vec4_grf(1, 11));

	brw_MOV(p, brw_message_reg(3), v0);

	brw_ADD(p, delta, v1, brw_negate(v2));
	brw_MUL(p, brw_message_reg(1), delta, brw_vec1_grf(6,0));

	brw_ADD(p, delta, v2, brw_negate(v0));
	brw_MUL(p, brw_message_reg(2), delta, brw_vec1_grf(6,2));

	brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0 ,0),
		      false, true, 4, 0, true, true, 0,
		      BRW_URB_SWIZZLE_TRANSPOSE);
}

void
brw_sf_kernel__mask(struct brw_compile *p)
{
	struct brw_reg inv, v0, v1, v2;

	v0 = brw_vec8_grf(3, 0);
	v1 = brw_vec8_grf(4, 0);
	v2 = brw_vec8_grf(5, 0);

	inv = brw_vec4_grf(6, 0);
	brw_math_invert(p, inv, brw_vec4_grf(1, 11));

	brw_MOV(p, brw_message_reg(3), v0);

	brw_ADD(p, brw_vec8_grf(7, 0), v1, brw_negate(v2));
	brw_MUL(p, brw_message_reg(1), brw_vec8_grf(7, 0), brw_vec1_grf(6,0));

	brw_ADD(p, brw_vec8_grf(7, 0), v2, brw_negate(v0));
	brw_MUL(p, brw_message_reg(2), brw_vec8_grf(7, 0), brw_vec1_grf(6,2));

	brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0 ,0),
		      false, true, 4, 0, true, true, 0,
		      BRW_URB_SWIZZLE_TRANSPOSE);
}