2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
33 #include "main/glheader.h"
34 #include "main/macros.h"
35 #include "main/enums.h"
37 #include "intel_batchbuffer.h"
39 #include "brw_defines.h"
40 #include "brw_context.h"
47 * Determine the vert_result corresponding to the given half of the given
48 * register. half=0 means the first half of a register, half=1 means the
51 static inline int vert_reg_to_vert_result(struct brw_sf_compile
*c
, GLuint reg
,
54 int vue_slot
= (reg
+ c
->urb_entry_read_offset
) * 2 + half
;
55 return c
->vue_map
.slot_to_vert_result
[vue_slot
];
59 * Determine the register corresponding to the given vert_result.
61 static struct brw_reg
get_vert_result(struct brw_sf_compile
*c
,
65 int vue_slot
= c
->vue_map
.vert_result_to_slot
[vert_result
];
66 assert (vue_slot
>= c
->urb_entry_read_offset
);
67 GLuint off
= vue_slot
/ 2 - c
->urb_entry_read_offset
;
68 GLuint sub
= vue_slot
% 2;
70 return brw_vec4_grf(vert
.nr
+ off
, sub
* 4);
74 have_attr(struct brw_sf_compile
*c
, GLuint attr
)
76 return (c
->key
.attrs
& BITFIELD64_BIT(attr
)) ? 1 : 0;
79 /***********************************************************************
82 static void copy_bfc( struct brw_sf_compile
*c
,
85 struct brw_compile
*p
= &c
->func
;
88 for (i
= 0; i
< 2; i
++) {
89 if (have_attr(c
, VERT_RESULT_COL0
+i
) &&
90 have_attr(c
, VERT_RESULT_BFC0
+i
))
92 get_vert_result(c
, vert
, VERT_RESULT_COL0
+i
),
93 get_vert_result(c
, vert
, VERT_RESULT_BFC0
+i
));
98 static void do_twoside_color( struct brw_sf_compile
*c
)
100 struct brw_compile
*p
= &c
->func
;
101 GLuint backface_conditional
= c
->key
.frontface_ccw
? BRW_CONDITIONAL_G
: BRW_CONDITIONAL_L
;
103 /* Already done in clip program:
105 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
108 /* XXX: What happens if BFC isn't present? This could only happen
109 * for user-supplied vertex programs, as t_vp_build.c always does
112 if (!(have_attr(c
, VERT_RESULT_COL0
) && have_attr(c
, VERT_RESULT_BFC0
)) &&
113 !(have_attr(c
, VERT_RESULT_COL1
) && have_attr(c
, VERT_RESULT_BFC1
)))
116 /* Need to use BRW_EXECUTE_4 and also do an 4-wide compare in order
117 * to get all channels active inside the IF. In the clipping code
118 * we run with NoMask, so it's not an option and we can use
119 * BRW_EXECUTE_1 for all comparisions.
121 brw_push_insn_state(p
);
122 brw_CMP(p
, vec4(brw_null_reg()), backface_conditional
, c
->det
, brw_imm_f(0));
123 brw_IF(p
, BRW_EXECUTE_4
);
125 switch (c
->nr_verts
) {
126 case 3: copy_bfc(c
, c
->vert
[2]);
127 case 2: copy_bfc(c
, c
->vert
[1]);
128 case 1: copy_bfc(c
, c
->vert
[0]);
132 brw_pop_insn_state(p
);
137 /***********************************************************************
141 #define VERT_RESULT_COLOR_BITS (BITFIELD64_BIT(VERT_RESULT_COL0) | \
142 BITFIELD64_BIT(VERT_RESULT_COL1))
144 static void copy_colors( struct brw_sf_compile
*c
,
148 struct brw_compile
*p
= &c
->func
;
151 for (i
= VERT_RESULT_COL0
; i
<= VERT_RESULT_COL1
; i
++) {
154 get_vert_result(c
, dst
, i
),
155 get_vert_result(c
, src
, i
));
161 /* Need to use a computed jump to copy flatshaded attributes as the
162 * vertices are ordered according to y-coordinate before reaching this
163 * point, so the PV could be anywhere.
165 static void do_flatshade_triangle( struct brw_sf_compile
*c
)
167 struct brw_compile
*p
= &c
->func
;
168 struct intel_context
*intel
= &p
->brw
->intel
;
169 struct brw_reg ip
= brw_ip_reg();
170 GLuint nr
= _mesa_bitcount_64(c
->key
.attrs
& VERT_RESULT_COLOR_BITS
);
176 /* Already done in clip program:
178 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
184 brw_push_insn_state(p
);
186 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
*2+1)));
187 brw_JMPI(p
, ip
, ip
, c
->pv
);
189 copy_colors(c
, c
->vert
[1], c
->vert
[0]);
190 copy_colors(c
, c
->vert
[2], c
->vert
[0]);
191 brw_JMPI(p
, ip
, ip
, brw_imm_d(jmpi
*(nr
*4+1)));
193 copy_colors(c
, c
->vert
[0], c
->vert
[1]);
194 copy_colors(c
, c
->vert
[2], c
->vert
[1]);
195 brw_JMPI(p
, ip
, ip
, brw_imm_d(jmpi
*nr
*2));
197 copy_colors(c
, c
->vert
[0], c
->vert
[2]);
198 copy_colors(c
, c
->vert
[1], c
->vert
[2]);
200 brw_pop_insn_state(p
);
204 static void do_flatshade_line( struct brw_sf_compile
*c
)
206 struct brw_compile
*p
= &c
->func
;
207 struct intel_context
*intel
= &p
->brw
->intel
;
208 struct brw_reg ip
= brw_ip_reg();
209 GLuint nr
= _mesa_bitcount_64(c
->key
.attrs
& VERT_RESULT_COLOR_BITS
);
215 /* Already done in clip program:
217 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
223 brw_push_insn_state(p
);
225 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
+1)));
226 brw_JMPI(p
, ip
, ip
, c
->pv
);
227 copy_colors(c
, c
->vert
[1], c
->vert
[0]);
229 brw_JMPI(p
, ip
, ip
, brw_imm_ud(jmpi
*nr
));
230 copy_colors(c
, c
->vert
[0], c
->vert
[1]);
232 brw_pop_insn_state(p
);
237 /***********************************************************************
242 static void alloc_regs( struct brw_sf_compile
*c
)
246 /* Values computed by fixed function unit:
248 c
->pv
= retype(brw_vec1_grf(1, 1), BRW_REGISTER_TYPE_D
);
249 c
->det
= brw_vec1_grf(1, 2);
250 c
->dx0
= brw_vec1_grf(1, 3);
251 c
->dx2
= brw_vec1_grf(1, 4);
252 c
->dy0
= brw_vec1_grf(1, 5);
253 c
->dy2
= brw_vec1_grf(1, 6);
255 /* z and 1/w passed in seperately:
257 c
->z
[0] = brw_vec1_grf(2, 0);
258 c
->inv_w
[0] = brw_vec1_grf(2, 1);
259 c
->z
[1] = brw_vec1_grf(2, 2);
260 c
->inv_w
[1] = brw_vec1_grf(2, 3);
261 c
->z
[2] = brw_vec1_grf(2, 4);
262 c
->inv_w
[2] = brw_vec1_grf(2, 5);
267 for (i
= 0; i
< c
->nr_verts
; i
++) {
268 c
->vert
[i
] = brw_vec8_grf(reg
, 0);
269 reg
+= c
->nr_attr_regs
;
272 /* Temporaries, allocated after last vertex reg.
274 c
->inv_det
= brw_vec1_grf(reg
, 0); reg
++;
275 c
->a1_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
276 c
->a2_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
277 c
->tmp
= brw_vec8_grf(reg
, 0); reg
++;
279 /* Note grf allocation:
281 c
->prog_data
.total_grf
= reg
;
284 /* Outputs of this program - interpolation coefficients for
287 c
->m1Cx
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 1, 0);
288 c
->m2Cy
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 2, 0);
289 c
->m3C0
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 3, 0);
293 static void copy_z_inv_w( struct brw_sf_compile
*c
)
295 struct brw_compile
*p
= &c
->func
;
298 brw_push_insn_state(p
);
300 /* Copy both scalars with a single MOV:
302 for (i
= 0; i
< c
->nr_verts
; i
++)
303 brw_MOV(p
, vec2(suboffset(c
->vert
[i
], 2)), vec2(c
->z
[i
]));
305 brw_pop_insn_state(p
);
309 static void invert_det( struct brw_sf_compile
*c
)
311 /* Looks like we invert all 8 elements just to get 1/det in
316 BRW_MATH_FUNCTION_INV
,
317 BRW_MATH_SATURATE_NONE
,
320 BRW_MATH_DATA_SCALAR
,
321 BRW_MATH_PRECISION_FULL
);
327 calculate_masks(struct brw_sf_compile
*c
,
333 bool is_last_attr
= (reg
== c
->nr_setup_regs
- 1);
334 GLbitfield64 persp_mask
;
335 GLbitfield64 linear_mask
;
337 if (c
->key
.do_flat_shading
)
338 persp_mask
= c
->key
.attrs
& ~(BITFIELD64_BIT(VERT_RESULT_HPOS
) |
339 BITFIELD64_BIT(VERT_RESULT_COL0
) |
340 BITFIELD64_BIT(VERT_RESULT_COL1
));
342 persp_mask
= c
->key
.attrs
& ~(BITFIELD64_BIT(VERT_RESULT_HPOS
));
344 if (c
->key
.do_flat_shading
)
345 linear_mask
= c
->key
.attrs
& ~(BITFIELD64_BIT(VERT_RESULT_COL0
) |
346 BITFIELD64_BIT(VERT_RESULT_COL1
));
348 linear_mask
= c
->key
.attrs
;
354 if (persp_mask
& BITFIELD64_BIT(vert_reg_to_vert_result(c
, reg
, 0)))
357 if (linear_mask
& BITFIELD64_BIT(vert_reg_to_vert_result(c
, reg
, 0)))
360 /* Maybe only processs one attribute on the final round:
362 if (vert_reg_to_vert_result(c
, reg
, 1) != BRW_VERT_RESULT_MAX
) {
365 if (persp_mask
& BITFIELD64_BIT(vert_reg_to_vert_result(c
, reg
, 1)))
368 if (linear_mask
& BITFIELD64_BIT(vert_reg_to_vert_result(c
, reg
, 1)))
375 /* Calculates the predicate control for which channels of a reg
376 * (containing 2 attrs) to do point sprite coordinate replacement on.
379 calculate_point_sprite_mask(struct brw_sf_compile
*c
, GLuint reg
)
381 int vert_result1
, vert_result2
;
384 vert_result1
= vert_reg_to_vert_result(c
, reg
, 0);
385 if (vert_result1
>= VERT_RESULT_TEX0
&& vert_result1
<= VERT_RESULT_TEX7
) {
386 if (c
->key
.point_sprite_coord_replace
& (1 << (vert_result1
- VERT_RESULT_TEX0
)))
390 vert_result2
= vert_reg_to_vert_result(c
, reg
, 1);
391 if (vert_result2
>= VERT_RESULT_TEX0
&& vert_result2
<= VERT_RESULT_TEX7
) {
392 if (c
->key
.point_sprite_coord_replace
& (1 << (vert_result2
-
402 void brw_emit_tri_setup(struct brw_sf_compile
*c
, bool allocate
)
404 struct brw_compile
*p
= &c
->func
;
415 if (c
->key
.do_twoside_color
)
418 if (c
->key
.do_flat_shading
)
419 do_flatshade_triangle(c
);
422 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
424 /* Pair of incoming attributes:
426 struct brw_reg a0
= offset(c
->vert
[0], i
);
427 struct brw_reg a1
= offset(c
->vert
[1], i
);
428 struct brw_reg a2
= offset(c
->vert
[2], i
);
429 GLushort pc
, pc_persp
, pc_linear
;
430 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
434 brw_set_predicate_control_flag_value(p
, pc_persp
);
435 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
436 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
437 brw_MUL(p
, a2
, a2
, c
->inv_w
[2]);
441 /* Calculate coefficients for interpolated values:
445 brw_set_predicate_control_flag_value(p
, pc_linear
);
447 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
448 brw_ADD(p
, c
->a2_sub_a0
, a2
, negate(a0
));
452 brw_MUL(p
, brw_null_reg(), c
->a1_sub_a0
, c
->dy2
);
453 brw_MAC(p
, c
->tmp
, c
->a2_sub_a0
, negate(c
->dy0
));
454 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
458 brw_MUL(p
, brw_null_reg(), c
->a2_sub_a0
, c
->dx0
);
459 brw_MAC(p
, c
->tmp
, c
->a1_sub_a0
, negate(c
->dx2
));
460 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
464 brw_set_predicate_control_flag_value(p
, pc
);
465 /* start point for interpolation
467 brw_MOV(p
, c
->m3C0
, a0
);
469 /* Copy m0..m3 to URB. m0 is implicitly copied from r0 in
470 * the send instruction:
475 brw_vec8_grf(0, 0), /* r0, will be copied to m0 */
479 0, /* response len */
481 last
, /* writes complete */
483 BRW_URB_SWIZZLE_TRANSPOSE
); /* XXX: Swizzle control "SF to windower" */
490 void brw_emit_line_setup(struct brw_sf_compile
*c
, bool allocate
)
492 struct brw_compile
*p
= &c
->func
;
504 if (c
->key
.do_flat_shading
)
505 do_flatshade_line(c
);
507 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
509 /* Pair of incoming attributes:
511 struct brw_reg a0
= offset(c
->vert
[0], i
);
512 struct brw_reg a1
= offset(c
->vert
[1], i
);
513 GLushort pc
, pc_persp
, pc_linear
;
514 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
518 brw_set_predicate_control_flag_value(p
, pc_persp
);
519 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
520 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
523 /* Calculate coefficients for position, color:
526 brw_set_predicate_control_flag_value(p
, pc_linear
);
528 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
530 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dx0
);
531 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
533 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dy0
);
534 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
538 brw_set_predicate_control_flag_value(p
, pc
);
540 /* start point for interpolation
542 brw_MOV(p
, c
->m3C0
, a0
);
544 /* Copy m0..m3 to URB.
553 0, /* response len */
555 last
, /* writes complete */
556 i
*4, /* urb destination offset */
557 BRW_URB_SWIZZLE_TRANSPOSE
);
562 void brw_emit_point_sprite_setup(struct brw_sf_compile
*c
, bool allocate
)
564 struct brw_compile
*p
= &c
->func
;
573 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
575 struct brw_reg a0
= offset(c
->vert
[0], i
);
576 GLushort pc
, pc_persp
, pc_linear
, pc_coord_replace
;
577 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
579 pc_coord_replace
= calculate_point_sprite_mask(c
, i
);
580 pc_persp
&= ~pc_coord_replace
;
583 brw_set_predicate_control_flag_value(p
, pc_persp
);
584 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
587 /* Point sprite coordinate replacement: A texcoord with this
588 * enabled gets replaced with the value (x, y, 0, 1) where x and
589 * y vary from 0 to 1 across the horizontal and vertical of the
592 if (pc_coord_replace
) {
593 brw_set_predicate_control_flag_value(p
, pc_coord_replace
);
594 /* Caculate 1.0/PointWidth */
597 BRW_MATH_FUNCTION_INV
,
598 BRW_MATH_SATURATE_NONE
,
601 BRW_MATH_DATA_SCALAR
,
602 BRW_MATH_PRECISION_FULL
);
604 brw_set_access_mode(p
, BRW_ALIGN_16
);
607 brw_MOV(p
, c
->m1Cx
, brw_imm_f(0.0));
608 brw_MOV(p
, c
->m2Cy
, brw_imm_f(0.0));
609 brw_MOV(p
, brw_writemask(c
->m1Cx
, WRITEMASK_X
), c
->tmp
);
610 if (c
->key
.sprite_origin_lower_left
) {
611 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), negate(c
->tmp
));
613 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), c
->tmp
);
616 /* attribute constant offset */
617 brw_MOV(p
, c
->m3C0
, brw_imm_f(0.0));
618 if (c
->key
.sprite_origin_lower_left
) {
619 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_YW
), brw_imm_f(1.0));
621 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_W
), brw_imm_f(1.0));
624 brw_set_access_mode(p
, BRW_ALIGN_1
);
627 if (pc
& ~pc_coord_replace
) {
628 brw_set_predicate_control_flag_value(p
, pc
& ~pc_coord_replace
);
629 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0));
630 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0));
631 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
635 brw_set_predicate_control_flag_value(p
, pc
);
636 /* Copy m0..m3 to URB. */
644 0, /* response len */
646 last
, /* writes complete */
647 i
*4, /* urb destination offset */
648 BRW_URB_SWIZZLE_TRANSPOSE
);
652 /* Points setup - several simplifications as all attributes are
653 * constant across the face of the point (point sprites excluded!)
655 void brw_emit_point_setup(struct brw_sf_compile
*c
, bool allocate
)
657 struct brw_compile
*p
= &c
->func
;
667 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0)); /* zero - move out of loop */
668 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0)); /* zero - move out of loop */
670 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
672 struct brw_reg a0
= offset(c
->vert
[0], i
);
673 GLushort pc
, pc_persp
, pc_linear
;
674 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
678 /* This seems odd as the values are all constant, but the
679 * fragment shader will be expecting it:
681 brw_set_predicate_control_flag_value(p
, pc_persp
);
682 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
686 /* The delta values are always zero, just send the starting
687 * coordinate. Again, this is to fit in with the interpolation
688 * code in the fragment shader.
691 brw_set_predicate_control_flag_value(p
, pc
);
693 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
695 /* Copy m0..m3 to URB.
704 0, /* response len */
706 last
, /* writes complete */
707 i
*4, /* urb destination offset */
708 BRW_URB_SWIZZLE_TRANSPOSE
);
713 void brw_emit_anyprim_setup( struct brw_sf_compile
*c
)
715 struct brw_compile
*p
= &c
->func
;
716 struct brw_reg ip
= brw_ip_reg();
717 struct brw_reg payload_prim
= brw_uw1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0);
718 struct brw_reg payload_attr
= get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0), 0);
719 struct brw_reg primmask
;
721 struct brw_reg v1_null_ud
= vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD
));
728 primmask
= retype(get_element(c
->tmp
, 0), BRW_REGISTER_TYPE_UD
);
730 brw_MOV(p
, primmask
, brw_imm_ud(1));
731 brw_SHL(p
, primmask
, primmask
, payload_prim
);
733 brw_set_conditionalmod(p
, BRW_CONDITIONAL_Z
);
734 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_TRILIST
) |
735 (1<<_3DPRIM_TRISTRIP
) |
736 (1<<_3DPRIM_TRIFAN
) |
737 (1<<_3DPRIM_TRISTRIP_REVERSE
) |
738 (1<<_3DPRIM_POLYGON
) |
739 (1<<_3DPRIM_RECTLIST
) |
740 (1<<_3DPRIM_TRIFAN_NOSTIPPLE
)));
741 jmp
= brw_JMPI(p
, ip
, ip
, brw_imm_d(0)) - p
->store
;
743 saveflag
= p
->flag_value
;
744 brw_push_insn_state(p
);
745 brw_emit_tri_setup( c
, false );
746 brw_pop_insn_state(p
);
747 p
->flag_value
= saveflag
;
748 /* note - thread killed in subroutine, so must
749 * restore the flag which is changed when building
750 * the subroutine. fix #13240
753 brw_land_fwd_jump(p
, jmp
);
755 brw_set_conditionalmod(p
, BRW_CONDITIONAL_Z
);
756 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_LINELIST
) |
757 (1<<_3DPRIM_LINESTRIP
) |
758 (1<<_3DPRIM_LINELOOP
) |
759 (1<<_3DPRIM_LINESTRIP_CONT
) |
760 (1<<_3DPRIM_LINESTRIP_BF
) |
761 (1<<_3DPRIM_LINESTRIP_CONT_BF
)));
762 jmp
= brw_JMPI(p
, ip
, ip
, brw_imm_d(0)) - p
->store
;
764 saveflag
= p
->flag_value
;
765 brw_push_insn_state(p
);
766 brw_emit_line_setup( c
, false );
767 brw_pop_insn_state(p
);
768 p
->flag_value
= saveflag
;
769 /* note - thread killed in subroutine */
771 brw_land_fwd_jump(p
, jmp
);
773 brw_set_conditionalmod(p
, BRW_CONDITIONAL_Z
);
774 brw_AND(p
, v1_null_ud
, payload_attr
, brw_imm_ud(1<<BRW_SPRITE_POINT_ENABLE
));
775 jmp
= brw_JMPI(p
, ip
, ip
, brw_imm_d(0)) - p
->store
;
777 saveflag
= p
->flag_value
;
778 brw_push_insn_state(p
);
779 brw_emit_point_sprite_setup( c
, false );
780 brw_pop_insn_state(p
);
781 p
->flag_value
= saveflag
;
783 brw_land_fwd_jump(p
, jmp
);
785 brw_emit_point_setup( c
, false );