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 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_compile
*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_compile
*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_push_insn_state(p
);
141 brw_CMP(p
, vec4(brw_null_reg()), backface_conditional
, c
->det
, brw_imm_f(0));
142 brw_IF(p
, BRW_EXECUTE_4
);
144 switch (c
->nr_verts
) {
145 case 3: copy_bfc(c
, c
->vert
[2]);
146 case 2: copy_bfc(c
, c
->vert
[1]);
147 case 1: copy_bfc(c
, c
->vert
[0]);
151 brw_pop_insn_state(p
);
156 /***********************************************************************
160 static void copy_flatshaded_attributes(struct brw_sf_compile
*c
,
164 struct brw_compile
*p
= &c
->func
;
167 for (i
= 0; i
< c
->vue_map
.num_slots
; i
++) {
168 if (c
->key
.interpolation_mode
.mode
[i
] == INTERP_QUALIFIER_FLAT
) {
170 get_vue_slot(c
, dst
, i
),
171 get_vue_slot(c
, src
, i
));
176 static int count_flatshaded_attributes(struct brw_sf_compile
*c
)
181 for (i
= 0; i
< c
->vue_map
.num_slots
; i
++)
182 if (c
->key
.interpolation_mode
.mode
[i
] == INTERP_QUALIFIER_FLAT
)
190 /* Need to use a computed jump to copy flatshaded attributes as the
191 * vertices are ordered according to y-coordinate before reaching this
192 * point, so the PV could be anywhere.
194 static void do_flatshade_triangle( struct brw_sf_compile
*c
)
196 struct brw_compile
*p
= &c
->func
;
197 struct brw_context
*brw
= p
->brw
;
198 struct brw_reg ip
= brw_ip_reg();
202 /* Already done in clip program:
204 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
210 nr
= count_flatshaded_attributes(c
);
212 brw_push_insn_state(p
);
214 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
*2+1)));
215 brw_JMPI(p
, ip
, ip
, c
->pv
);
217 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[0]);
218 copy_flatshaded_attributes(c
, c
->vert
[2], c
->vert
[0]);
219 brw_JMPI(p
, ip
, ip
, brw_imm_d(jmpi
*(nr
*4+1)));
221 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[1]);
222 copy_flatshaded_attributes(c
, c
->vert
[2], c
->vert
[1]);
223 brw_JMPI(p
, ip
, ip
, brw_imm_d(jmpi
*nr
*2));
225 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[2]);
226 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[2]);
228 brw_pop_insn_state(p
);
232 static void do_flatshade_line( struct brw_sf_compile
*c
)
234 struct brw_compile
*p
= &c
->func
;
235 struct brw_context
*brw
= p
->brw
;
236 struct brw_reg ip
= brw_ip_reg();
240 /* Already done in clip program:
242 if (c
->key
.primitive
== SF_UNFILLED_TRIS
)
248 nr
= count_flatshaded_attributes(c
);
250 brw_push_insn_state(p
);
252 brw_MUL(p
, c
->pv
, c
->pv
, brw_imm_d(jmpi
*(nr
+1)));
253 brw_JMPI(p
, ip
, ip
, c
->pv
);
254 copy_flatshaded_attributes(c
, c
->vert
[1], c
->vert
[0]);
256 brw_JMPI(p
, ip
, ip
, brw_imm_ud(jmpi
*nr
));
257 copy_flatshaded_attributes(c
, c
->vert
[0], c
->vert
[1]);
259 brw_pop_insn_state(p
);
264 /***********************************************************************
269 static void alloc_regs( struct brw_sf_compile
*c
)
273 /* Values computed by fixed function unit:
275 c
->pv
= retype(brw_vec1_grf(1, 1), BRW_REGISTER_TYPE_D
);
276 c
->det
= brw_vec1_grf(1, 2);
277 c
->dx0
= brw_vec1_grf(1, 3);
278 c
->dx2
= brw_vec1_grf(1, 4);
279 c
->dy0
= brw_vec1_grf(1, 5);
280 c
->dy2
= brw_vec1_grf(1, 6);
282 /* z and 1/w passed in seperately:
284 c
->z
[0] = brw_vec1_grf(2, 0);
285 c
->inv_w
[0] = brw_vec1_grf(2, 1);
286 c
->z
[1] = brw_vec1_grf(2, 2);
287 c
->inv_w
[1] = brw_vec1_grf(2, 3);
288 c
->z
[2] = brw_vec1_grf(2, 4);
289 c
->inv_w
[2] = brw_vec1_grf(2, 5);
294 for (i
= 0; i
< c
->nr_verts
; i
++) {
295 c
->vert
[i
] = brw_vec8_grf(reg
, 0);
296 reg
+= c
->nr_attr_regs
;
299 /* Temporaries, allocated after last vertex reg.
301 c
->inv_det
= brw_vec1_grf(reg
, 0); reg
++;
302 c
->a1_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
303 c
->a2_sub_a0
= brw_vec8_grf(reg
, 0); reg
++;
304 c
->tmp
= brw_vec8_grf(reg
, 0); reg
++;
306 /* Note grf allocation:
308 c
->prog_data
.total_grf
= reg
;
311 /* Outputs of this program - interpolation coefficients for
314 c
->m1Cx
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 1, 0);
315 c
->m2Cy
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 2, 0);
316 c
->m3C0
= brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE
, 3, 0);
320 static void copy_z_inv_w( struct brw_sf_compile
*c
)
322 struct brw_compile
*p
= &c
->func
;
325 brw_push_insn_state(p
);
327 /* Copy both scalars with a single MOV:
329 for (i
= 0; i
< c
->nr_verts
; i
++)
330 brw_MOV(p
, vec2(suboffset(c
->vert
[i
], 2)), vec2(c
->z
[i
]));
332 brw_pop_insn_state(p
);
336 static void invert_det( struct brw_sf_compile
*c
)
338 /* Looks like we invert all 8 elements just to get 1/det in
343 BRW_MATH_FUNCTION_INV
,
346 BRW_MATH_DATA_SCALAR
,
347 BRW_MATH_PRECISION_FULL
);
353 calculate_masks(struct brw_sf_compile
*c
,
359 bool is_last_attr
= (reg
== c
->nr_setup_regs
- 1);
360 enum glsl_interp_qualifier interp
;
366 interp
= c
->key
.interpolation_mode
.mode
[vert_reg_to_vue_slot(c
, reg
, 0)];
367 if (interp
== INTERP_QUALIFIER_SMOOTH
) {
370 } else if (interp
== INTERP_QUALIFIER_NOPERSPECTIVE
)
373 /* Maybe only processs one attribute on the final round:
375 if (vert_reg_to_varying(c
, reg
, 1) != BRW_VARYING_SLOT_COUNT
) {
378 interp
= c
->key
.interpolation_mode
.mode
[vert_reg_to_vue_slot(c
, reg
, 1)];
379 if (interp
== INTERP_QUALIFIER_SMOOTH
) {
382 } else if (interp
== INTERP_QUALIFIER_NOPERSPECTIVE
)
389 /* Calculates the predicate control for which channels of a reg
390 * (containing 2 attrs) to do point sprite coordinate replacement on.
393 calculate_point_sprite_mask(struct brw_sf_compile
*c
, GLuint reg
)
395 int varying1
, varying2
;
398 varying1
= vert_reg_to_varying(c
, reg
, 0);
399 if (varying1
>= VARYING_SLOT_TEX0
&& varying1
<= VARYING_SLOT_TEX7
) {
400 if (c
->key
.point_sprite_coord_replace
& (1 << (varying1
- VARYING_SLOT_TEX0
)))
403 if (varying1
== BRW_VARYING_SLOT_PNTC
)
406 varying2
= vert_reg_to_varying(c
, reg
, 1);
407 if (varying2
>= VARYING_SLOT_TEX0
&& varying2
<= VARYING_SLOT_TEX7
) {
408 if (c
->key
.point_sprite_coord_replace
& (1 << (varying2
-
412 if (varying2
== BRW_VARYING_SLOT_PNTC
)
420 void brw_emit_tri_setup(struct brw_sf_compile
*c
, bool allocate
)
422 struct brw_compile
*p
= &c
->func
;
433 if (c
->key
.do_twoside_color
)
436 if (c
->has_flat_shading
)
437 do_flatshade_triangle(c
);
440 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
442 /* Pair of incoming attributes:
444 struct brw_reg a0
= offset(c
->vert
[0], i
);
445 struct brw_reg a1
= offset(c
->vert
[1], i
);
446 struct brw_reg a2
= offset(c
->vert
[2], i
);
447 GLushort pc
, pc_persp
, pc_linear
;
448 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
452 brw_set_predicate_control_flag_value(p
, pc_persp
);
453 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
454 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
455 brw_MUL(p
, a2
, a2
, c
->inv_w
[2]);
459 /* Calculate coefficients for interpolated values:
463 brw_set_predicate_control_flag_value(p
, pc_linear
);
465 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
466 brw_ADD(p
, c
->a2_sub_a0
, a2
, negate(a0
));
470 brw_MUL(p
, brw_null_reg(), c
->a1_sub_a0
, c
->dy2
);
471 brw_MAC(p
, c
->tmp
, c
->a2_sub_a0
, negate(c
->dy0
));
472 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
476 brw_MUL(p
, brw_null_reg(), c
->a2_sub_a0
, c
->dx0
);
477 brw_MAC(p
, c
->tmp
, c
->a1_sub_a0
, negate(c
->dx2
));
478 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
482 brw_set_predicate_control_flag_value(p
, pc
);
483 /* start point for interpolation
485 brw_MOV(p
, c
->m3C0
, a0
);
487 /* Copy m0..m3 to URB. m0 is implicitly copied from r0 in
488 * the send instruction:
493 brw_vec8_grf(0, 0), /* r0, will be copied to m0 */
497 0, /* response len */
499 last
, /* writes complete */
501 BRW_URB_SWIZZLE_TRANSPOSE
); /* XXX: Swizzle control "SF to windower" */
508 void brw_emit_line_setup(struct brw_sf_compile
*c
, bool allocate
)
510 struct brw_compile
*p
= &c
->func
;
522 if (c
->has_flat_shading
)
523 do_flatshade_line(c
);
525 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
527 /* Pair of incoming attributes:
529 struct brw_reg a0
= offset(c
->vert
[0], i
);
530 struct brw_reg a1
= offset(c
->vert
[1], i
);
531 GLushort pc
, pc_persp
, pc_linear
;
532 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
536 brw_set_predicate_control_flag_value(p
, pc_persp
);
537 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
538 brw_MUL(p
, a1
, a1
, c
->inv_w
[1]);
541 /* Calculate coefficients for position, color:
544 brw_set_predicate_control_flag_value(p
, pc_linear
);
546 brw_ADD(p
, c
->a1_sub_a0
, a1
, negate(a0
));
548 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dx0
);
549 brw_MUL(p
, c
->m1Cx
, c
->tmp
, c
->inv_det
);
551 brw_MUL(p
, c
->tmp
, c
->a1_sub_a0
, c
->dy0
);
552 brw_MUL(p
, c
->m2Cy
, c
->tmp
, c
->inv_det
);
556 brw_set_predicate_control_flag_value(p
, pc
);
558 /* start point for interpolation
560 brw_MOV(p
, c
->m3C0
, a0
);
562 /* Copy m0..m3 to URB.
571 0, /* response len */
573 last
, /* writes complete */
574 i
*4, /* urb destination offset */
575 BRW_URB_SWIZZLE_TRANSPOSE
);
580 void brw_emit_point_sprite_setup(struct brw_sf_compile
*c
, bool allocate
)
582 struct brw_compile
*p
= &c
->func
;
591 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
593 struct brw_reg a0
= offset(c
->vert
[0], i
);
594 GLushort pc
, pc_persp
, pc_linear
, pc_coord_replace
;
595 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
597 pc_coord_replace
= calculate_point_sprite_mask(c
, i
);
598 pc_persp
&= ~pc_coord_replace
;
601 brw_set_predicate_control_flag_value(p
, pc_persp
);
602 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
605 /* Point sprite coordinate replacement: A texcoord with this
606 * enabled gets replaced with the value (x, y, 0, 1) where x and
607 * y vary from 0 to 1 across the horizontal and vertical of the
610 if (pc_coord_replace
) {
611 brw_set_predicate_control_flag_value(p
, pc_coord_replace
);
612 /* Caculate 1.0/PointWidth */
615 BRW_MATH_FUNCTION_INV
,
618 BRW_MATH_DATA_SCALAR
,
619 BRW_MATH_PRECISION_FULL
);
621 brw_set_access_mode(p
, BRW_ALIGN_16
);
624 brw_MOV(p
, c
->m1Cx
, brw_imm_f(0.0));
625 brw_MOV(p
, c
->m2Cy
, brw_imm_f(0.0));
626 brw_MOV(p
, brw_writemask(c
->m1Cx
, WRITEMASK_X
), c
->tmp
);
627 if (c
->key
.sprite_origin_lower_left
) {
628 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), negate(c
->tmp
));
630 brw_MOV(p
, brw_writemask(c
->m2Cy
, WRITEMASK_Y
), c
->tmp
);
633 /* attribute constant offset */
634 brw_MOV(p
, c
->m3C0
, brw_imm_f(0.0));
635 if (c
->key
.sprite_origin_lower_left
) {
636 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_YW
), brw_imm_f(1.0));
638 brw_MOV(p
, brw_writemask(c
->m3C0
, WRITEMASK_W
), brw_imm_f(1.0));
641 brw_set_access_mode(p
, BRW_ALIGN_1
);
644 if (pc
& ~pc_coord_replace
) {
645 brw_set_predicate_control_flag_value(p
, pc
& ~pc_coord_replace
);
646 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0));
647 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0));
648 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
652 brw_set_predicate_control_flag_value(p
, pc
);
653 /* Copy m0..m3 to URB. */
661 0, /* response len */
663 last
, /* writes complete */
664 i
*4, /* urb destination offset */
665 BRW_URB_SWIZZLE_TRANSPOSE
);
669 /* Points setup - several simplifications as all attributes are
670 * constant across the face of the point (point sprites excluded!)
672 void brw_emit_point_setup(struct brw_sf_compile
*c
, bool allocate
)
674 struct brw_compile
*p
= &c
->func
;
684 brw_MOV(p
, c
->m1Cx
, brw_imm_ud(0)); /* zero - move out of loop */
685 brw_MOV(p
, c
->m2Cy
, brw_imm_ud(0)); /* zero - move out of loop */
687 for (i
= 0; i
< c
->nr_setup_regs
; i
++)
689 struct brw_reg a0
= offset(c
->vert
[0], i
);
690 GLushort pc
, pc_persp
, pc_linear
;
691 bool last
= calculate_masks(c
, i
, &pc
, &pc_persp
, &pc_linear
);
695 /* This seems odd as the values are all constant, but the
696 * fragment shader will be expecting it:
698 brw_set_predicate_control_flag_value(p
, pc_persp
);
699 brw_MUL(p
, a0
, a0
, c
->inv_w
[0]);
703 /* The delta values are always zero, just send the starting
704 * coordinate. Again, this is to fit in with the interpolation
705 * code in the fragment shader.
708 brw_set_predicate_control_flag_value(p
, pc
);
710 brw_MOV(p
, c
->m3C0
, a0
); /* constant value */
712 /* Copy m0..m3 to URB.
721 0, /* response len */
723 last
, /* writes complete */
724 i
*4, /* urb destination offset */
725 BRW_URB_SWIZZLE_TRANSPOSE
);
730 void brw_emit_anyprim_setup( struct brw_sf_compile
*c
)
732 struct brw_compile
*p
= &c
->func
;
733 struct brw_reg ip
= brw_ip_reg();
734 struct brw_reg payload_prim
= brw_uw1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0);
735 struct brw_reg payload_attr
= get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE
, 1, 0), 0);
736 struct brw_reg primmask
;
738 struct brw_reg v1_null_ud
= vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD
));
745 primmask
= retype(get_element(c
->tmp
, 0), BRW_REGISTER_TYPE_UD
);
747 brw_MOV(p
, primmask
, brw_imm_ud(1));
748 brw_SHL(p
, primmask
, primmask
, payload_prim
);
750 brw_set_conditionalmod(p
, BRW_CONDITIONAL_Z
);
751 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_TRILIST
) |
752 (1<<_3DPRIM_TRISTRIP
) |
753 (1<<_3DPRIM_TRIFAN
) |
754 (1<<_3DPRIM_TRISTRIP_REVERSE
) |
755 (1<<_3DPRIM_POLYGON
) |
756 (1<<_3DPRIM_RECTLIST
) |
757 (1<<_3DPRIM_TRIFAN_NOSTIPPLE
)));
758 jmp
= brw_JMPI(p
, ip
, ip
, brw_imm_d(0)) - p
->store
;
760 saveflag
= p
->flag_value
;
761 brw_push_insn_state(p
);
762 brw_emit_tri_setup( c
, false );
763 brw_pop_insn_state(p
);
764 p
->flag_value
= saveflag
;
765 /* note - thread killed in subroutine, so must
766 * restore the flag which is changed when building
767 * the subroutine. fix #13240
770 brw_land_fwd_jump(p
, jmp
);
772 brw_set_conditionalmod(p
, BRW_CONDITIONAL_Z
);
773 brw_AND(p
, v1_null_ud
, primmask
, brw_imm_ud((1<<_3DPRIM_LINELIST
) |
774 (1<<_3DPRIM_LINESTRIP
) |
775 (1<<_3DPRIM_LINELOOP
) |
776 (1<<_3DPRIM_LINESTRIP_CONT
) |
777 (1<<_3DPRIM_LINESTRIP_BF
) |
778 (1<<_3DPRIM_LINESTRIP_CONT_BF
)));
779 jmp
= brw_JMPI(p
, ip
, ip
, brw_imm_d(0)) - p
->store
;
781 saveflag
= p
->flag_value
;
782 brw_push_insn_state(p
);
783 brw_emit_line_setup( c
, false );
784 brw_pop_insn_state(p
);
785 p
->flag_value
= saveflag
;
786 /* note - thread killed in subroutine */
788 brw_land_fwd_jump(p
, jmp
);
790 brw_set_conditionalmod(p
, BRW_CONDITIONAL_Z
);
791 brw_AND(p
, v1_null_ud
, payload_attr
, brw_imm_ud(1<<BRW_SPRITE_POINT_ENABLE
));
792 jmp
= brw_JMPI(p
, ip
, ip
, brw_imm_d(0)) - p
->store
;
794 saveflag
= p
->flag_value
;
795 brw_push_insn_state(p
);
796 brw_emit_point_sprite_setup( c
, false );
797 brw_pop_insn_state(p
);
798 p
->flag_value
= saveflag
;
800 brw_land_fwd_jump(p
, jmp
);
802 brw_emit_point_setup( c
, false );