2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics 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 <keithw@vmware.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 vue slot corresponding to the given half of the given register.
49 static inline int vert_reg_to_vue_slot(struct brw_sf_compile
*c
, GLuint reg
,
52 return (reg
+ c
->urb_entry_read_offset
) * 2 + half
;
56 * Determine the varying corresponding to the given half of the given
57 * register. half=0 means the first half of a register, half=1 means the
60 static inline int vert_reg_to_varying(struct brw_sf_compile
*c
, GLuint reg
,
63 int vue_slot
= vert_reg_to_vue_slot(c
, reg
, half
);
64 return c
->vue_map
.slot_to_varying
[vue_slot
];
68 * Determine the register corresponding to the given vue slot
70 static struct brw_reg
get_vue_slot(struct brw_sf_compile
*c
,
74 GLuint off
= vue_slot
/ 2 - c
->urb_entry_read_offset
;
75 GLuint sub
= vue_slot
% 2;
77 return brw_vec4_grf(vert
.nr
+ off
, sub
* 4);
81 * Determine the register corresponding to the given varying.
83 static struct brw_reg
get_varying(struct brw_sf_compile
*c
,
87 int vue_slot
= c
->vue_map
.varying_to_slot
[varying
];
88 assert (vue_slot
>= c
->urb_entry_read_offset
);
89 return get_vue_slot(c
, vert
, vue_slot
);
93 have_attr(struct brw_sf_compile
*c
, GLuint attr
)
95 return (c
->key
.attrs
& BITFIELD64_BIT(attr
)) ? 1 : 0;
98 /***********************************************************************
101 static void copy_bfc( struct brw_sf_compile
*c
,
102 struct brw_reg vert
)
104 struct brw_codegen
*p
= &c
->func
;
107 for (i
= 0; i
< 2; i
++) {
108 if (have_attr(c
, VARYING_SLOT_COL0
+i
) &&
109 have_attr(c
, VARYING_SLOT_BFC0
+i
))
111 get_varying(c
, vert
, VARYING_SLOT_COL0
+i
),
112 get_varying(c
, vert
, VARYING_SLOT_BFC0
+i
));
117 static void do_twoside_color( struct brw_sf_compile
*c
)
119 struct brw_codegen
*p
= &c
->func
;
120 GLuint backface_conditional
= c
->key
.frontface_ccw
? BRW_CONDITIONAL_G
: BRW_CONDITIONAL_L
;
122 /* Already done in clip program:
124 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
127 /* If the vertex shader provides backface color, do the selection. The VS
128 * promises to set up the front color if the backface color is provided, but
129 * it may contain junk if never written to.
131 if (!(have_attr(c
, VARYING_SLOT_COL0
) && have_attr(c
, VARYING_SLOT_BFC0
)) &&
132 !(have_attr(c
, VARYING_SLOT_COL1
) && have_attr(c
, VARYING_SLOT_BFC1
)))
135 /* Need to use BRW_EXECUTE_4 and also do an 4-wide compare in order
136 * to get all channels active inside the IF. In the clipping code
137 * we run with NoMask, so it's not an option and we can use
138 * BRW_EXECUTE_1 for all comparisions.
140 brw_CMP(p
, vec4(brw_null_reg()), backface_conditional
, c
->det
, brw_imm_f(0));
141 brw_IF(p
, BRW_EXECUTE_4
);
143 switch (c
->nr_verts
) {
144 case 3: copy_bfc(c
, c
->vert
[2]);
145 case 2: copy_bfc(c
, c
->vert
[1]);
146 case 1: copy_bfc(c
, c
->vert
[0]);
154 /***********************************************************************
158 static void copy_flatshaded_attributes(struct brw_sf_compile
*c
,
162 struct brw_codegen
*p
= &c
->func
;
165 for (i
= 0; i
< c
->vue_map
.num_slots
; i
++) {
166 if (c
->key
.interpolation_mode
.mode
[i
] == INTERP_QUALIFIER_FLAT
) {
168 get_vue_slot(c
, dst
, i
),
169 get_vue_slot(c
, src
, i
));
174 static int count_flatshaded_attributes(struct brw_sf_compile
*c
)
179 for (i
= 0; i
< c
->vue_map
.num_slots
; i
++)
180 if (c
->key
.interpolation_mode
.mode
[i
] == INTERP_QUALIFIER_FLAT
)
188 /* Need to use a computed jump to copy flatshaded attributes as the
189 * vertices are ordered according to y-coordinate before reaching this
190 * point, so the PV could be anywhere.
192 static void do_flatshade_triangle( struct brw_sf_compile
*c
)
194 struct brw_codegen
*p
= &c
->func
;
198 /* Already done in clip program:
200 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
203 if (p
->devinfo
->gen
== 5)
206 nr
= count_flatshaded_attributes(c
);
208 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
*2+1)));
209 brw_JMPI(p
, c
->pv
, BRW_PREDICATE_NONE
);
211 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[0]);
212 copy_flatshaded_attributes(c
, c
->vert
[2], c
->vert
[0]);
213 brw_JMPI(p
, brw_imm_d(jmpi
*(nr
*4+1)), BRW_PREDICATE_NONE
);
215 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[1]);
216 copy_flatshaded_attributes(c
, c
->vert
[2], c
->vert
[1]);
217 brw_JMPI(p
, brw_imm_d(jmpi
*nr
*2), BRW_PREDICATE_NONE
);
219 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[2]);
220 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[2]);
224 static void do_flatshade_line( struct brw_sf_compile
*c
)
226 struct brw_codegen
*p
= &c
->func
;
230 /* Already done in clip program:
232 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
235 if (p
->devinfo
->gen
== 5)
238 nr
= count_flatshaded_attributes(c
);
240 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
+1)));
241 brw_JMPI(p
, c
->pv
, BRW_PREDICATE_NONE
);
242 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[0]);
244 brw_JMPI(p
, brw_imm_ud(jmpi
*nr
), BRW_PREDICATE_NONE
);
245 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[1]);
250 /***********************************************************************
255 static void alloc_regs( struct brw_sf_compile
*c
)
259 /* Values computed by fixed function unit:
261 c
->pv
= retype(brw_vec1_grf(1, 1), BRW_REGISTER_TYPE_D
);
262 c
->det
= brw_vec1_grf(1, 2);
263 c
->dx0
= brw_vec1_grf(1, 3);
264 c
->dx2
= brw_vec1_grf(1, 4);
265 c
->dy0
= brw_vec1_grf(1, 5);
266 c
->dy2
= brw_vec1_grf(1, 6);
268 /* z and 1/w passed in seperately:
270 c
->z
[0] = brw_vec1_grf(2, 0);
271 c
->inv_w
[0] = brw_vec1_grf(2, 1);
272 c
->z
[1] = brw_vec1_grf(2, 2);
273 c
->inv_w
[1] = brw_vec1_grf(2, 3);
274 c
->z
[2] = brw_vec1_grf(2, 4);
275 c
->inv_w
[2] = brw_vec1_grf(2, 5);
280 for (i
= 0; i
< c
->nr_verts
; i
++) {
281 c
->vert
[i
] = brw_vec8_grf(reg
, 0);
282 reg
+= c
->nr_attr_regs
;
285 /* Temporaries, allocated after last vertex reg.
287 c
->inv_det
= brw_vec1_grf(reg
, 0); reg
++;
288 c
->a1_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
289 c
->a2_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
290 c
->tmp
= brw_vec8_grf(reg
, 0); reg
++;
292 /* Note grf allocation:
294 c
->prog_data
.total_grf
= reg
;
297 /* Outputs of this program - interpolation coefficients for
300 c
->m1Cx
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 1, 0);
301 c
->m2Cy
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 2, 0);
302 c
->m3C0
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 3, 0);
306 static void copy_z_inv_w( struct brw_sf_compile
*c
)
308 struct brw_codegen
*p
= &c
->func
;
311 /* Copy both scalars with a single MOV:
313 for (i
= 0; i
< c
->nr_verts
; i
++)
314 brw_MOV(p
, vec2(suboffset(c
->vert
[i
], 2)), vec2(c
->z
[i
]));
318 static void invert_det( struct brw_sf_compile
*c
)
320 /* Looks like we invert all 8 elements just to get 1/det in
325 BRW_MATH_FUNCTION_INV
,
328 BRW_MATH_PRECISION_FULL
);
334 calculate_masks(struct brw_sf_compile
*c
,
340 bool is_last_attr
= (reg
== c
->nr_setup_regs
- 1);
341 enum glsl_interp_qualifier interp
;
347 interp
= c
->key
.interpolation_mode
.mode
[vert_reg_to_vue_slot(c
, reg
, 0)];
348 if (interp
== INTERP_QUALIFIER_SMOOTH
) {
351 } else if (interp
== INTERP_QUALIFIER_NOPERSPECTIVE
)
354 /* Maybe only processs one attribute on the final round:
356 if (vert_reg_to_varying(c
, reg
, 1) != BRW_VARYING_SLOT_COUNT
) {
359 interp
= c
->key
.interpolation_mode
.mode
[vert_reg_to_vue_slot(c
, reg
, 1)];
360 if (interp
== INTERP_QUALIFIER_SMOOTH
) {
363 } else if (interp
== INTERP_QUALIFIER_NOPERSPECTIVE
)
370 /* Calculates the predicate control for which channels of a reg
371 * (containing 2 attrs) to do point sprite coordinate replacement on.
374 calculate_point_sprite_mask(struct brw_sf_compile
*c
, GLuint reg
)
376 int varying1
, varying2
;
379 varying1
= vert_reg_to_varying(c
, reg
, 0);
380 if (varying1
>= VARYING_SLOT_TEX0
&& varying1
<= VARYING_SLOT_TEX7
) {
381 if (c
->key
.point_sprite_coord_replace
& (1 << (varying1
- VARYING_SLOT_TEX0
)))
384 if (varying1
== BRW_VARYING_SLOT_PNTC
)
387 varying2
= vert_reg_to_varying(c
, reg
, 1);
388 if (varying2
>= VARYING_SLOT_TEX0
&& varying2
<= VARYING_SLOT_TEX7
) {
389 if (c
->key
.point_sprite_coord_replace
& (1 << (varying2
-
393 if (varying2
== BRW_VARYING_SLOT_PNTC
)
400 set_predicate_control_flag_value(struct brw_codegen
*p
,
401 struct brw_sf_compile
*c
,
404 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
407 if (value
!= c
->flag_value
) {
408 brw_MOV(p
, brw_flag_reg(0, 0), brw_imm_uw(value
));
409 c
->flag_value
= value
;
412 brw_set_default_predicate_control(p
, BRW_PREDICATE_NORMAL
);
416 void brw_emit_tri_setup(struct brw_sf_compile
*c
, bool allocate
)
418 struct brw_codegen
*p
= &c
->func
;
421 c
->flag_value
= 0xff;
430 if (c
->key
.do_twoside_color
)
433 if (c
->has_flat_shading
)
434 do_flatshade_triangle(c
);
437 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
439 /* Pair of incoming attributes:
441 struct brw_reg a0
= offset(c
->vert
[0], i
);
442 struct brw_reg a1
= offset(c
->vert
[1], i
);
443 struct brw_reg a2
= offset(c
->vert
[2], i
);
444 GLushort pc
, pc_persp
, pc_linear
;
445 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
449 set_predicate_control_flag_value(p
, c
, pc_persp
);
450 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
451 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
452 brw_MUL(p
, a2
, a2
, c
->inv_w
[2]);
456 /* Calculate coefficients for interpolated values:
460 set_predicate_control_flag_value(p
, c
, pc_linear
);
462 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
463 brw_ADD(p
, c
->a2_sub_a0
, a2
, negate(a0
));
467 brw_MUL(p
, brw_null_reg(), c
->a1_sub_a0
, c
->dy2
);
468 brw_MAC(p
, c
->tmp
, c
->a2_sub_a0
, negate(c
->dy0
));
469 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
473 brw_MUL(p
, brw_null_reg(), c
->a2_sub_a0
, c
->dx0
);
474 brw_MAC(p
, c
->tmp
, c
->a1_sub_a0
, negate(c
->dx2
));
475 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
479 set_predicate_control_flag_value(p
, c
, pc
);
480 /* start point for interpolation
482 brw_MOV(p
, c
->m3C0
, a0
);
484 /* Copy m0..m3 to URB. m0 is implicitly copied from r0 in
485 * the send instruction:
490 brw_vec8_grf(0, 0), /* r0, will be copied to m0 */
491 last
? BRW_URB_WRITE_EOT_COMPLETE
492 : BRW_URB_WRITE_NO_FLAGS
,
494 0, /* response len */
496 BRW_URB_SWIZZLE_TRANSPOSE
); /* XXX: Swizzle control "SF to windower" */
500 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
505 void brw_emit_line_setup(struct brw_sf_compile
*c
, bool allocate
)
507 struct brw_codegen
*p
= &c
->func
;
510 c
->flag_value
= 0xff;
519 if (c
->has_flat_shading
)
520 do_flatshade_line(c
);
522 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
524 /* Pair of incoming attributes:
526 struct brw_reg a0
= offset(c
->vert
[0], i
);
527 struct brw_reg a1
= offset(c
->vert
[1], i
);
528 GLushort pc
, pc_persp
, pc_linear
;
529 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
533 set_predicate_control_flag_value(p
, c
, pc_persp
);
534 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
535 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
538 /* Calculate coefficients for position, color:
541 set_predicate_control_flag_value(p
, c
, pc_linear
);
543 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
545 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dx0
);
546 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
548 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dy0
);
549 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
553 set_predicate_control_flag_value(p
, c
, pc
);
555 /* start point for interpolation
557 brw_MOV(p
, c
->m3C0
, a0
);
559 /* Copy m0..m3 to URB.
565 last
? BRW_URB_WRITE_EOT_COMPLETE
566 : BRW_URB_WRITE_NO_FLAGS
,
568 0, /* response len */
569 i
*4, /* urb destination offset */
570 BRW_URB_SWIZZLE_TRANSPOSE
);
574 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
577 void brw_emit_point_sprite_setup(struct brw_sf_compile
*c
, bool allocate
)
579 struct brw_codegen
*p
= &c
->func
;
582 c
->flag_value
= 0xff;
589 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
591 struct brw_reg a0
= offset(c
->vert
[0], i
);
592 GLushort pc
, pc_persp
, pc_linear
, pc_coord_replace
;
593 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
595 pc_coord_replace
= calculate_point_sprite_mask(c
, i
);
596 pc_persp
&= ~pc_coord_replace
;
599 set_predicate_control_flag_value(p
, c
, pc_persp
);
600 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
603 /* Point sprite coordinate replacement: A texcoord with this
604 * enabled gets replaced with the value (x, y, 0, 1) where x and
605 * y vary from 0 to 1 across the horizontal and vertical of the
608 if (pc_coord_replace
) {
609 set_predicate_control_flag_value(p
, c
, pc_coord_replace
);
610 /* Caculate 1.0/PointWidth */
613 BRW_MATH_FUNCTION_INV
,
616 BRW_MATH_PRECISION_FULL
);
618 brw_set_default_access_mode(p
, BRW_ALIGN_16
);
621 brw_MOV(p
, c
->m1Cx
, brw_imm_f(0.0));
622 brw_MOV(p
, c
->m2Cy
, brw_imm_f(0.0));
623 brw_MOV(p
, brw_writemask(c
->m1Cx
, WRITEMASK_X
), c
->tmp
);
624 if (c
->key
.sprite_origin_lower_left
) {
625 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), negate(c
->tmp
));
627 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), c
->tmp
);
630 /* attribute constant offset */
631 brw_MOV(p
, c
->m3C0
, brw_imm_f(0.0));
632 if (c
->key
.sprite_origin_lower_left
) {
633 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_YW
), brw_imm_f(1.0));
635 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_W
), brw_imm_f(1.0));
638 brw_set_default_access_mode(p
, BRW_ALIGN_1
);
641 if (pc
& ~pc_coord_replace
) {
642 set_predicate_control_flag_value(p
, c
, pc
& ~pc_coord_replace
);
643 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0));
644 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0));
645 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
649 set_predicate_control_flag_value(p
, c
, pc
);
650 /* Copy m0..m3 to URB. */
655 last
? BRW_URB_WRITE_EOT_COMPLETE
656 : BRW_URB_WRITE_NO_FLAGS
,
658 0, /* response len */
659 i
*4, /* urb destination offset */
660 BRW_URB_SWIZZLE_TRANSPOSE
);
663 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
666 /* Points setup - several simplifications as all attributes are
667 * constant across the face of the point (point sprites excluded!)
669 void brw_emit_point_setup(struct brw_sf_compile
*c
, bool allocate
)
671 struct brw_codegen
*p
= &c
->func
;
674 c
->flag_value
= 0xff;
682 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0)); /* zero - move out of loop */
683 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0)); /* zero - move out of loop */
685 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
687 struct brw_reg a0
= offset(c
->vert
[0], i
);
688 GLushort pc
, pc_persp
, pc_linear
;
689 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
693 /* This seems odd as the values are all constant, but the
694 * fragment shader will be expecting it:
696 set_predicate_control_flag_value(p
, c
, pc_persp
);
697 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
701 /* The delta values are always zero, just send the starting
702 * coordinate. Again, this is to fit in with the interpolation
703 * code in the fragment shader.
706 set_predicate_control_flag_value(p
, c
, pc
);
708 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
710 /* Copy m0..m3 to URB.
716 last
? BRW_URB_WRITE_EOT_COMPLETE
717 : BRW_URB_WRITE_NO_FLAGS
,
719 0, /* response len */
720 i
*4, /* urb destination offset */
721 BRW_URB_SWIZZLE_TRANSPOSE
);
725 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
728 void brw_emit_anyprim_setup( struct brw_sf_compile
*c
)
730 struct brw_codegen
*p
= &c
->func
;
731 struct brw_reg payload_prim
= brw_uw1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0);
732 struct brw_reg payload_attr
= get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0), 0);
733 struct brw_reg primmask
;
735 struct brw_reg v1_null_ud
= vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD
));
740 primmask
= retype(get_element(c
->tmp
, 0), BRW_REGISTER_TYPE_UD
);
742 brw_MOV(p
, primmask
, brw_imm_ud(1));
743 brw_SHL(p
, primmask
, primmask
, payload_prim
);
745 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_TRILIST
) |
746 (1<<_3DPRIM_TRISTRIP
) |
747 (1<<_3DPRIM_TRIFAN
) |
748 (1<<_3DPRIM_TRISTRIP_REVERSE
) |
749 (1<<_3DPRIM_POLYGON
) |
750 (1<<_3DPRIM_RECTLIST
) |
751 (1<<_3DPRIM_TRIFAN_NOSTIPPLE
)));
752 brw_inst_set_cond_modifier(p
->devinfo
, brw_last_inst
, BRW_CONDITIONAL_Z
);
753 jmp
= brw_JMPI(p
, brw_imm_d(0), BRW_PREDICATE_NORMAL
) - p
->store
;
754 brw_emit_tri_setup(c
, false);
755 brw_land_fwd_jump(p
, jmp
);
757 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_LINELIST
) |
758 (1<<_3DPRIM_LINESTRIP
) |
759 (1<<_3DPRIM_LINELOOP
) |
760 (1<<_3DPRIM_LINESTRIP_CONT
) |
761 (1<<_3DPRIM_LINESTRIP_BF
) |
762 (1<<_3DPRIM_LINESTRIP_CONT_BF
)));
763 brw_inst_set_cond_modifier(p
->devinfo
, brw_last_inst
, BRW_CONDITIONAL_Z
);
764 jmp
= brw_JMPI(p
, brw_imm_d(0), BRW_PREDICATE_NORMAL
) - p
->store
;
765 brw_emit_line_setup(c
, false);
766 brw_land_fwd_jump(p
, jmp
);
768 brw_AND(p
, v1_null_ud
, payload_attr
, brw_imm_ud(1<<BRW_SPRITE_POINT_ENABLE
));
769 brw_inst_set_cond_modifier(p
->devinfo
, brw_last_inst
, BRW_CONDITIONAL_Z
);
770 jmp
= brw_JMPI(p
, brw_imm_d(0), BRW_PREDICATE_NORMAL
) - p
->store
;
771 brw_emit_point_sprite_setup(c
, false);
772 brw_land_fwd_jump(p
, jmp
);
774 brw_emit_point_setup( c
, false );