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/macros.h"
34 #include "main/enums.h"
36 #include "intel_batchbuffer.h"
38 #include "brw_defines.h"
39 #include "brw_context.h"
45 * Determine the vue slot corresponding to the given half of the given register.
47 static inline int vert_reg_to_vue_slot(struct brw_sf_compile
*c
, GLuint reg
,
50 return (reg
+ c
->urb_entry_read_offset
) * 2 + half
;
54 * Determine the varying corresponding to the given half of the given
55 * register. half=0 means the first half of a register, half=1 means the
58 static inline int vert_reg_to_varying(struct brw_sf_compile
*c
, GLuint reg
,
61 int vue_slot
= vert_reg_to_vue_slot(c
, reg
, half
);
62 return c
->vue_map
.slot_to_varying
[vue_slot
];
66 * Determine the register corresponding to the given vue slot
68 static struct brw_reg
get_vue_slot(struct brw_sf_compile
*c
,
72 GLuint off
= vue_slot
/ 2 - c
->urb_entry_read_offset
;
73 GLuint sub
= vue_slot
% 2;
75 return brw_vec4_grf(vert
.nr
+ off
, sub
* 4);
79 * Determine the register corresponding to the given varying.
81 static struct brw_reg
get_varying(struct brw_sf_compile
*c
,
85 int vue_slot
= c
->vue_map
.varying_to_slot
[varying
];
86 assert (vue_slot
>= c
->urb_entry_read_offset
);
87 return get_vue_slot(c
, vert
, vue_slot
);
91 have_attr(struct brw_sf_compile
*c
, GLuint attr
)
93 return (c
->key
.attrs
& BITFIELD64_BIT(attr
)) ? 1 : 0;
96 /***********************************************************************
99 static void copy_bfc( struct brw_sf_compile
*c
,
100 struct brw_reg vert
)
102 struct brw_codegen
*p
= &c
->func
;
105 for (i
= 0; i
< 2; i
++) {
106 if (have_attr(c
, VARYING_SLOT_COL0
+i
) &&
107 have_attr(c
, VARYING_SLOT_BFC0
+i
))
109 get_varying(c
, vert
, VARYING_SLOT_COL0
+i
),
110 get_varying(c
, vert
, VARYING_SLOT_BFC0
+i
));
115 static void do_twoside_color( struct brw_sf_compile
*c
)
117 struct brw_codegen
*p
= &c
->func
;
118 GLuint backface_conditional
= c
->key
.frontface_ccw
? BRW_CONDITIONAL_G
: BRW_CONDITIONAL_L
;
120 /* Already done in clip program:
122 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
125 /* If the vertex shader provides backface color, do the selection. The VS
126 * promises to set up the front color if the backface color is provided, but
127 * it may contain junk if never written to.
129 if (!(have_attr(c
, VARYING_SLOT_COL0
) && have_attr(c
, VARYING_SLOT_BFC0
)) &&
130 !(have_attr(c
, VARYING_SLOT_COL1
) && have_attr(c
, VARYING_SLOT_BFC1
)))
133 /* Need to use BRW_EXECUTE_4 and also do an 4-wide compare in order
134 * to get all channels active inside the IF. In the clipping code
135 * we run with NoMask, so it's not an option and we can use
136 * BRW_EXECUTE_1 for all comparisions.
138 brw_CMP(p
, vec4(brw_null_reg()), backface_conditional
, c
->det
, brw_imm_f(0));
139 brw_IF(p
, BRW_EXECUTE_4
);
141 switch (c
->nr_verts
) {
142 case 3: copy_bfc(c
, c
->vert
[2]);
143 case 2: copy_bfc(c
, c
->vert
[1]);
144 case 1: copy_bfc(c
, c
->vert
[0]);
152 /***********************************************************************
156 static void copy_flatshaded_attributes(struct brw_sf_compile
*c
,
160 struct brw_codegen
*p
= &c
->func
;
163 for (i
= 0; i
< c
->vue_map
.num_slots
; i
++) {
164 if (c
->key
.interp_mode
[i
] == INTERP_MODE_FLAT
) {
166 get_vue_slot(c
, dst
, i
),
167 get_vue_slot(c
, src
, i
));
172 static int count_flatshaded_attributes(struct brw_sf_compile
*c
)
177 for (i
= 0; i
< c
->vue_map
.num_slots
; i
++)
178 if (c
->key
.interp_mode
[i
] == INTERP_MODE_FLAT
)
186 /* Need to use a computed jump to copy flatshaded attributes as the
187 * vertices are ordered according to y-coordinate before reaching this
188 * point, so the PV could be anywhere.
190 static void do_flatshade_triangle( struct brw_sf_compile
*c
)
192 struct brw_codegen
*p
= &c
->func
;
196 /* Already done in clip program:
198 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
201 if (p
->devinfo
->gen
== 5)
204 nr
= count_flatshaded_attributes(c
);
206 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
*2+1)));
207 brw_JMPI(p
, c
->pv
, BRW_PREDICATE_NONE
);
209 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[0]);
210 copy_flatshaded_attributes(c
, c
->vert
[2], c
->vert
[0]);
211 brw_JMPI(p
, brw_imm_d(jmpi
*(nr
*4+1)), BRW_PREDICATE_NONE
);
213 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[1]);
214 copy_flatshaded_attributes(c
, c
->vert
[2], c
->vert
[1]);
215 brw_JMPI(p
, brw_imm_d(jmpi
*nr
*2), BRW_PREDICATE_NONE
);
217 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[2]);
218 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[2]);
222 static void do_flatshade_line( struct brw_sf_compile
*c
)
224 struct brw_codegen
*p
= &c
->func
;
228 /* Already done in clip program:
230 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
233 if (p
->devinfo
->gen
== 5)
236 nr
= count_flatshaded_attributes(c
);
238 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
+1)));
239 brw_JMPI(p
, c
->pv
, BRW_PREDICATE_NONE
);
240 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[0]);
242 brw_JMPI(p
, brw_imm_ud(jmpi
*nr
), BRW_PREDICATE_NONE
);
243 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[1]);
247 /***********************************************************************
252 static void alloc_regs( struct brw_sf_compile
*c
)
256 /* Values computed by fixed function unit:
258 c
->pv
= retype(brw_vec1_grf(1, 1), BRW_REGISTER_TYPE_D
);
259 c
->det
= brw_vec1_grf(1, 2);
260 c
->dx0
= brw_vec1_grf(1, 3);
261 c
->dx2
= brw_vec1_grf(1, 4);
262 c
->dy0
= brw_vec1_grf(1, 5);
263 c
->dy2
= brw_vec1_grf(1, 6);
265 /* z and 1/w passed in seperately:
267 c
->z
[0] = brw_vec1_grf(2, 0);
268 c
->inv_w
[0] = brw_vec1_grf(2, 1);
269 c
->z
[1] = brw_vec1_grf(2, 2);
270 c
->inv_w
[1] = brw_vec1_grf(2, 3);
271 c
->z
[2] = brw_vec1_grf(2, 4);
272 c
->inv_w
[2] = brw_vec1_grf(2, 5);
277 for (i
= 0; i
< c
->nr_verts
; i
++) {
278 c
->vert
[i
] = brw_vec8_grf(reg
, 0);
279 reg
+= c
->nr_attr_regs
;
282 /* Temporaries, allocated after last vertex reg.
284 c
->inv_det
= brw_vec1_grf(reg
, 0); reg
++;
285 c
->a1_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
286 c
->a2_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
287 c
->tmp
= brw_vec8_grf(reg
, 0); reg
++;
289 /* Note grf allocation:
291 c
->prog_data
.total_grf
= reg
;
294 /* Outputs of this program - interpolation coefficients for
297 c
->m1Cx
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 1, 0);
298 c
->m2Cy
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 2, 0);
299 c
->m3C0
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 3, 0);
303 static void copy_z_inv_w( struct brw_sf_compile
*c
)
305 struct brw_codegen
*p
= &c
->func
;
308 /* Copy both scalars with a single MOV:
310 for (i
= 0; i
< c
->nr_verts
; i
++)
311 brw_MOV(p
, vec2(suboffset(c
->vert
[i
], 2)), vec2(c
->z
[i
]));
315 static void invert_det( struct brw_sf_compile
*c
)
317 /* Looks like we invert all 8 elements just to get 1/det in
322 BRW_MATH_FUNCTION_INV
,
325 BRW_MATH_PRECISION_FULL
);
331 calculate_masks(struct brw_sf_compile
*c
,
337 bool is_last_attr
= (reg
== c
->nr_setup_regs
- 1);
338 enum glsl_interp_mode interp
;
344 interp
= c
->key
.interp_mode
[vert_reg_to_vue_slot(c
, reg
, 0)];
345 if (interp
== INTERP_MODE_SMOOTH
) {
348 } else if (interp
== INTERP_MODE_NOPERSPECTIVE
)
351 /* Maybe only processs one attribute on the final round:
353 if (vert_reg_to_varying(c
, reg
, 1) != BRW_VARYING_SLOT_COUNT
) {
356 interp
= c
->key
.interp_mode
[vert_reg_to_vue_slot(c
, reg
, 1)];
357 if (interp
== INTERP_MODE_SMOOTH
) {
360 } else if (interp
== INTERP_MODE_NOPERSPECTIVE
)
367 /* Calculates the predicate control for which channels of a reg
368 * (containing 2 attrs) to do point sprite coordinate replacement on.
371 calculate_point_sprite_mask(struct brw_sf_compile
*c
, GLuint reg
)
373 int varying1
, varying2
;
376 varying1
= vert_reg_to_varying(c
, reg
, 0);
377 if (varying1
>= VARYING_SLOT_TEX0
&& varying1
<= VARYING_SLOT_TEX7
) {
378 if (c
->key
.point_sprite_coord_replace
& (1 << (varying1
- VARYING_SLOT_TEX0
)))
381 if (varying1
== BRW_VARYING_SLOT_PNTC
)
384 varying2
= vert_reg_to_varying(c
, reg
, 1);
385 if (varying2
>= VARYING_SLOT_TEX0
&& varying2
<= VARYING_SLOT_TEX7
) {
386 if (c
->key
.point_sprite_coord_replace
& (1 << (varying2
-
390 if (varying2
== BRW_VARYING_SLOT_PNTC
)
397 set_predicate_control_flag_value(struct brw_codegen
*p
,
398 struct brw_sf_compile
*c
,
401 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
404 if (value
!= c
->flag_value
) {
405 brw_MOV(p
, brw_flag_reg(0, 0), brw_imm_uw(value
));
406 c
->flag_value
= value
;
409 brw_set_default_predicate_control(p
, BRW_PREDICATE_NORMAL
);
413 void brw_emit_tri_setup(struct brw_sf_compile
*c
, bool allocate
)
415 struct brw_codegen
*p
= &c
->func
;
418 c
->flag_value
= 0xff;
427 if (c
->key
.do_twoside_color
)
430 if (c
->key
.contains_flat_varying
)
431 do_flatshade_triangle(c
);
434 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
436 /* Pair of incoming attributes:
438 struct brw_reg a0
= offset(c
->vert
[0], i
);
439 struct brw_reg a1
= offset(c
->vert
[1], i
);
440 struct brw_reg a2
= offset(c
->vert
[2], i
);
441 GLushort pc
, pc_persp
, pc_linear
;
442 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
446 set_predicate_control_flag_value(p
, c
, pc_persp
);
447 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
448 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
449 brw_MUL(p
, a2
, a2
, c
->inv_w
[2]);
453 /* Calculate coefficients for interpolated values:
457 set_predicate_control_flag_value(p
, c
, pc_linear
);
459 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
460 brw_ADD(p
, c
->a2_sub_a0
, a2
, negate(a0
));
464 brw_MUL(p
, brw_null_reg(), c
->a1_sub_a0
, c
->dy2
);
465 brw_MAC(p
, c
->tmp
, c
->a2_sub_a0
, negate(c
->dy0
));
466 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
470 brw_MUL(p
, brw_null_reg(), c
->a2_sub_a0
, c
->dx0
);
471 brw_MAC(p
, c
->tmp
, c
->a1_sub_a0
, negate(c
->dx2
));
472 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
476 set_predicate_control_flag_value(p
, c
, pc
);
477 /* start point for interpolation
479 brw_MOV(p
, c
->m3C0
, a0
);
481 /* Copy m0..m3 to URB. m0 is implicitly copied from r0 in
482 * the send instruction:
487 brw_vec8_grf(0, 0), /* r0, will be copied to m0 */
488 last
? BRW_URB_WRITE_EOT_COMPLETE
489 : BRW_URB_WRITE_NO_FLAGS
,
491 0, /* response len */
493 BRW_URB_SWIZZLE_TRANSPOSE
); /* XXX: Swizzle control "SF to windower" */
497 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
502 void brw_emit_line_setup(struct brw_sf_compile
*c
, bool allocate
)
504 struct brw_codegen
*p
= &c
->func
;
507 c
->flag_value
= 0xff;
516 if (c
->key
.contains_flat_varying
)
517 do_flatshade_line(c
);
519 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
521 /* Pair of incoming attributes:
523 struct brw_reg a0
= offset(c
->vert
[0], i
);
524 struct brw_reg a1
= offset(c
->vert
[1], i
);
525 GLushort pc
, pc_persp
, pc_linear
;
526 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
530 set_predicate_control_flag_value(p
, c
, pc_persp
);
531 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
532 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
535 /* Calculate coefficients for position, color:
538 set_predicate_control_flag_value(p
, c
, pc_linear
);
540 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
542 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dx0
);
543 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
545 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dy0
);
546 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
550 set_predicate_control_flag_value(p
, c
, pc
);
552 /* start point for interpolation
554 brw_MOV(p
, c
->m3C0
, a0
);
556 /* Copy m0..m3 to URB.
562 last
? BRW_URB_WRITE_EOT_COMPLETE
563 : BRW_URB_WRITE_NO_FLAGS
,
565 0, /* response len */
566 i
*4, /* urb destination offset */
567 BRW_URB_SWIZZLE_TRANSPOSE
);
571 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
574 void brw_emit_point_sprite_setup(struct brw_sf_compile
*c
, bool allocate
)
576 struct brw_codegen
*p
= &c
->func
;
579 c
->flag_value
= 0xff;
586 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
588 struct brw_reg a0
= offset(c
->vert
[0], i
);
589 GLushort pc
, pc_persp
, pc_linear
, pc_coord_replace
;
590 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
592 pc_coord_replace
= calculate_point_sprite_mask(c
, i
);
593 pc_persp
&= ~pc_coord_replace
;
596 set_predicate_control_flag_value(p
, c
, pc_persp
);
597 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
600 /* Point sprite coordinate replacement: A texcoord with this
601 * enabled gets replaced with the value (x, y, 0, 1) where x and
602 * y vary from 0 to 1 across the horizontal and vertical of the
605 if (pc_coord_replace
) {
606 set_predicate_control_flag_value(p
, c
, pc_coord_replace
);
607 /* Caculate 1.0/PointWidth */
610 BRW_MATH_FUNCTION_INV
,
613 BRW_MATH_PRECISION_FULL
);
615 brw_set_default_access_mode(p
, BRW_ALIGN_16
);
618 brw_MOV(p
, c
->m1Cx
, brw_imm_f(0.0));
619 brw_MOV(p
, c
->m2Cy
, brw_imm_f(0.0));
620 brw_MOV(p
, brw_writemask(c
->m1Cx
, WRITEMASK_X
), c
->tmp
);
621 if (c
->key
.sprite_origin_lower_left
) {
622 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), negate(c
->tmp
));
624 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), c
->tmp
);
627 /* attribute constant offset */
628 brw_MOV(p
, c
->m3C0
, brw_imm_f(0.0));
629 if (c
->key
.sprite_origin_lower_left
) {
630 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_YW
), brw_imm_f(1.0));
632 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_W
), brw_imm_f(1.0));
635 brw_set_default_access_mode(p
, BRW_ALIGN_1
);
638 if (pc
& ~pc_coord_replace
) {
639 set_predicate_control_flag_value(p
, c
, pc
& ~pc_coord_replace
);
640 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0));
641 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0));
642 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
646 set_predicate_control_flag_value(p
, c
, pc
);
647 /* Copy m0..m3 to URB. */
652 last
? BRW_URB_WRITE_EOT_COMPLETE
653 : BRW_URB_WRITE_NO_FLAGS
,
655 0, /* response len */
656 i
*4, /* urb destination offset */
657 BRW_URB_SWIZZLE_TRANSPOSE
);
660 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
663 /* Points setup - several simplifications as all attributes are
664 * constant across the face of the point (point sprites excluded!)
666 void brw_emit_point_setup(struct brw_sf_compile
*c
, bool allocate
)
668 struct brw_codegen
*p
= &c
->func
;
671 c
->flag_value
= 0xff;
679 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0)); /* zero - move out of loop */
680 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0)); /* zero - move out of loop */
682 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
684 struct brw_reg a0
= offset(c
->vert
[0], i
);
685 GLushort pc
, pc_persp
, pc_linear
;
686 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
690 /* This seems odd as the values are all constant, but the
691 * fragment shader will be expecting it:
693 set_predicate_control_flag_value(p
, c
, pc_persp
);
694 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
698 /* The delta values are always zero, just send the starting
699 * coordinate. Again, this is to fit in with the interpolation
700 * code in the fragment shader.
703 set_predicate_control_flag_value(p
, c
, pc
);
705 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
707 /* Copy m0..m3 to URB.
713 last
? BRW_URB_WRITE_EOT_COMPLETE
714 : BRW_URB_WRITE_NO_FLAGS
,
716 0, /* response len */
717 i
*4, /* urb destination offset */
718 BRW_URB_SWIZZLE_TRANSPOSE
);
722 brw_set_default_predicate_control(p
, BRW_PREDICATE_NONE
);
725 void brw_emit_anyprim_setup( struct brw_sf_compile
*c
)
727 struct brw_codegen
*p
= &c
->func
;
728 struct brw_reg payload_prim
= brw_uw1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0);
729 struct brw_reg payload_attr
= get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0), 0);
730 struct brw_reg primmask
;
732 struct brw_reg v1_null_ud
= vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD
));
737 primmask
= retype(get_element(c
->tmp
, 0), BRW_REGISTER_TYPE_UD
);
739 brw_MOV(p
, primmask
, brw_imm_ud(1));
740 brw_SHL(p
, primmask
, primmask
, payload_prim
);
742 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_TRILIST
) |
743 (1<<_3DPRIM_TRISTRIP
) |
744 (1<<_3DPRIM_TRIFAN
) |
745 (1<<_3DPRIM_TRISTRIP_REVERSE
) |
746 (1<<_3DPRIM_POLYGON
) |
747 (1<<_3DPRIM_RECTLIST
) |
748 (1<<_3DPRIM_TRIFAN_NOSTIPPLE
)));
749 brw_inst_set_cond_modifier(p
->devinfo
, brw_last_inst
, BRW_CONDITIONAL_Z
);
750 jmp
= brw_JMPI(p
, brw_imm_d(0), BRW_PREDICATE_NORMAL
) - p
->store
;
751 brw_emit_tri_setup(c
, false);
752 brw_land_fwd_jump(p
, jmp
);
754 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_LINELIST
) |
755 (1<<_3DPRIM_LINESTRIP
) |
756 (1<<_3DPRIM_LINELOOP
) |
757 (1<<_3DPRIM_LINESTRIP_CONT
) |
758 (1<<_3DPRIM_LINESTRIP_BF
) |
759 (1<<_3DPRIM_LINESTRIP_CONT_BF
)));
760 brw_inst_set_cond_modifier(p
->devinfo
, brw_last_inst
, BRW_CONDITIONAL_Z
);
761 jmp
= brw_JMPI(p
, brw_imm_d(0), BRW_PREDICATE_NORMAL
) - p
->store
;
762 brw_emit_line_setup(c
, false);
763 brw_land_fwd_jump(p
, jmp
);
765 brw_AND(p
, v1_null_ud
, payload_attr
, brw_imm_ud(1<<BRW_SPRITE_POINT_ENABLE
));
766 brw_inst_set_cond_modifier(p
->devinfo
, brw_last_inst
, BRW_CONDITIONAL_Z
);
767 jmp
= brw_JMPI(p
, brw_imm_d(0), BRW_PREDICATE_NORMAL
) - p
->store
;
768 brw_emit_point_sprite_setup(c
, false);
769 brw_land_fwd_jump(p
, jmp
);
771 brw_emit_point_setup( c
, false );