Lines Matching full:setup

54    float dx;		/**< X(v1) - X(v0), used only during setup */
55 float dy; /**< Y(v1) - Y(v0), used only during setup */
71 * Triangle setup info.
125 * Clip setup->quad against the scissor/surface bounds.
128 quad_clip(struct setup_context *setup, struct quad_header *quad) in quad_clip() argument
131 const struct pipe_scissor_state *cliprect = &setup->softpipe->cliprect[viewport_index]; in quad_clip()
160 clip_emit_quad(struct setup_context *setup, struct quad_header *quad) in clip_emit_quad() argument
162 quad_clip(setup, quad); in clip_emit_quad()
165 struct softpipe_context *sp = setup->softpipe; in clip_emit_quad()
168 setup->numFragsEmitted += util_bitcount(quad->inout.mask); in clip_emit_quad()
199 flush_spans(struct setup_context *setup) in flush_spans() argument
202 const int xleft0 = setup->span.left[0]; in flush_spans()
203 const int xleft1 = setup->span.left[1]; in flush_spans()
204 const int xright0 = setup->span.right[0]; in flush_spans()
205 const int xright1 = setup->span.right[1]; in flush_spans()
206 struct quad_stage *pipe = setup->softpipe->quad.first; in flush_spans()
236 setup->quad[q].input.x0 = lx; in flush_spans()
237 setup->quad[q].input.y0 = setup->span.y; in flush_spans()
238 setup->quad[q].input.facing = setup->facing; in flush_spans()
239 setup->quad[q].inout.mask = quadmask; in flush_spans()
240 setup->quad_ptrs[q] = &setup->quad[q]; in flush_spans()
243 setup->numFragsEmitted += util_bitcount(quadmask); in flush_spans()
251 pipe->run( pipe, setup->quad_ptrs, q ); in flush_spans()
256 setup->span.y = 0; in flush_spans()
257 setup->span.right[0] = 0; in flush_spans()
258 setup->span.right[1] = 0; in flush_spans()
259 setup->span.left[0] = 1000000; /* greater than right[0] */ in flush_spans()
260 setup->span.left[1] = 1000000; /* greater than right[1] */ in flush_spans()
266 print_vertex(const struct setup_context *setup, in print_vertex() argument
271 for (i = 0; i < setup->nr_vertex_attrs; i++) { in print_vertex()
288 setup_sort_vertices(struct setup_context *setup, in setup_sort_vertices() argument
294 if (setup->softpipe->rasterizer->flatshade_first) in setup_sort_vertices()
295 setup->vprovoke = v0; in setup_sort_vertices()
297 setup->vprovoke = v2; in setup_sort_vertices()
307 setup->vmin = v0; in setup_sort_vertices()
308 setup->vmid = v1; in setup_sort_vertices()
309 setup->vmax = v2; in setup_sort_vertices()
313 setup->vmin = v2; in setup_sort_vertices()
314 setup->vmid = v0; in setup_sort_vertices()
315 setup->vmax = v1; in setup_sort_vertices()
319 setup->vmin = v0; in setup_sort_vertices()
320 setup->vmid = v2; in setup_sort_vertices()
321 setup->vmax = v1; in setup_sort_vertices()
327 setup->vmin = v1; in setup_sort_vertices()
328 setup->vmid = v0; in setup_sort_vertices()
329 setup->vmax = v2; in setup_sort_vertices()
333 setup->vmin = v2; in setup_sort_vertices()
334 setup->vmid = v1; in setup_sort_vertices()
335 setup->vmax = v0; in setup_sort_vertices()
339 setup->vmin = v1; in setup_sort_vertices()
340 setup->vmid = v2; in setup_sort_vertices()
341 setup->vmax = v0; in setup_sort_vertices()
346 setup->ebot.dx = setup->vmid[0][0] - setup->vmin[0][0]; in setup_sort_vertices()
347 setup->ebot.dy = setup->vmid[0][1] - setup->vmin[0][1]; in setup_sort_vertices()
348 setup->emaj.dx = setup->vmax[0][0] - setup->vmin[0][0]; in setup_sort_vertices()
349 setup->emaj.dy = setup->vmax[0][1] - setup->vmin[0][1]; in setup_sort_vertices()
350 setup->etop.dx = setup->vmax[0][0] - setup->vmid[0][0]; in setup_sort_vertices()
351 setup->etop.dy = setup->vmax[0][1] - setup->vmid[0][1]; in setup_sort_vertices()
364 const float area = (setup->emaj.dx * setup->ebot.dy - in setup_sort_vertices()
365 setup->ebot.dx * setup->emaj.dy); in setup_sort_vertices()
367 setup->oneoverarea = 1.0f / area; in setup_sort_vertices()
371 __FUNCTION__, setup->oneoverarea, area, det ); in setup_sort_vertices()
373 if (util_is_inf_or_nan(setup->oneoverarea)) in setup_sort_vertices()
382 setup->facing = in setup_sort_vertices()
384 (setup->softpipe->rasterizer->front_ccw)); in setup_sort_vertices()
387 unsigned face = setup->facing == 0 ? PIPE_FACE_FRONT : PIPE_FACE_BACK; in setup_sort_vertices()
389 if (face & setup->cull_face) in setup_sort_vertices()
398 if (setup->softpipe->rasterizer->half_pixel_center) { in setup_sort_vertices()
399 setup->pixel_offset = 0.5f; in setup_sort_vertices()
401 setup->pixel_offset = 0.0f; in setup_sort_vertices()
457 * The result will be put into setup->coef[slot].a0[i].
462 const_coeff(struct setup_context *setup, in const_coeff() argument
473 coef->a0[i] = setup->vprovoke[vertSlot][i]; in const_coeff()
483 tri_linear_coeff(struct setup_context *setup, in tri_linear_coeff() argument
490 float a = setup->ebot.dy * majda - botda * setup->emaj.dy; in tri_linear_coeff()
491 float b = setup->emaj.dx * botda - majda * setup->ebot.dx; in tri_linear_coeff()
492 float dadx = a * setup->oneoverarea; in tri_linear_coeff()
493 float dady = b * setup->oneoverarea; in tri_linear_coeff()
513 (dadx * (setup->vmin[0][0] - setup->pixel_offset) + in tri_linear_coeff()
514 dady * (setup->vmin[0][1] - setup->pixel_offset))); in tri_linear_coeff()
528 tri_persp_coeff(struct setup_context *setup, in tri_persp_coeff() argument
535 float mina = v[0] * setup->vmin[0][3]; in tri_persp_coeff()
536 float mida = v[1] * setup->vmid[0][3]; in tri_persp_coeff()
537 float maxa = v[2] * setup->vmax[0][3]; in tri_persp_coeff()
540 float a = setup->ebot.dy * majda - botda * setup->emaj.dy; in tri_persp_coeff()
541 float b = setup->emaj.dx * botda - majda * setup->ebot.dx; in tri_persp_coeff()
542 float dadx = a * setup->oneoverarea; in tri_persp_coeff()
543 float dady = b * setup->oneoverarea; in tri_persp_coeff()
550 (dadx * (setup->vmin[0][0] - setup->pixel_offset) + in tri_persp_coeff()
551 dady * (setup->vmin[0][1] - setup->pixel_offset))); in tri_persp_coeff()
556 * Special coefficient setup for gl_FragCoord.
562 setup_fragcoord_coeff(struct setup_context *setup, uint slot) in setup_fragcoord_coeff() argument
564 const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info; in setup_fragcoord_coeff()
571 setup->coef[slot].a0[0] = pixel_center_integer ? 0.0f : 0.5f; in setup_fragcoord_coeff()
572 setup->coef[slot].dadx[0] = 1.0f; in setup_fragcoord_coeff()
573 setup->coef[slot].dady[0] = 0.0f; in setup_fragcoord_coeff()
575 setup->coef[slot].a0[1] = in setup_fragcoord_coeff()
576 (origin_lower_left ? setup->softpipe->framebuffer.height-1 : 0) in setup_fragcoord_coeff()
578 setup->coef[slot].dadx[1] = 0.0f; in setup_fragcoord_coeff()
579 setup->coef[slot].dady[1] = origin_lower_left ? -1.0f : 1.0f; in setup_fragcoord_coeff()
581 setup->coef[slot].a0[2] = setup->posCoef.a0[2]; in setup_fragcoord_coeff()
582 setup->coef[slot].dadx[2] = setup->posCoef.dadx[2]; in setup_fragcoord_coeff()
583 setup->coef[slot].dady[2] = setup->posCoef.dady[2]; in setup_fragcoord_coeff()
585 setup->coef[slot].a0[3] = setup->posCoef.a0[3]; in setup_fragcoord_coeff()
586 setup->coef[slot].dadx[3] = setup->posCoef.dadx[3]; in setup_fragcoord_coeff()
587 setup->coef[slot].dady[3] = setup->posCoef.dady[3]; in setup_fragcoord_coeff()
593 * Compute the setup->coef[] array dadx, dady, a0 values.
594 * Must be called after setup->vmin,vmid,vmax,vprovoke are initialized.
597 setup_tri_coefficients(struct setup_context *setup) in setup_tri_coefficients() argument
599 struct softpipe_context *softpipe = setup->softpipe; in setup_tri_coefficients()
600 const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info; in setup_tri_coefficients()
609 v[0] = setup->vmin[0][2]; in setup_tri_coefficients()
610 v[1] = setup->vmid[0][2]; in setup_tri_coefficients()
611 v[2] = setup->vmax[0][2]; in setup_tri_coefficients()
612 tri_linear_coeff(setup, &setup->posCoef, 2, v); in setup_tri_coefficients()
614 v[0] = setup->vmin[0][3]; in setup_tri_coefficients()
615 v[1] = setup->vmid[0][3]; in setup_tri_coefficients()
616 v[2] = setup->vmax[0][3]; in setup_tri_coefficients()
617 tri_linear_coeff(setup, &setup->posCoef, 3, v); in setup_tri_coefficients()
619 /* setup interpolation for all the remaining attributes: in setup_tri_coefficients()
628 const_coeff(setup, &setup->coef[fragSlot], vertSlot, j); in setup_tri_coefficients()
633 tri_apply_cylindrical_wrap(setup->vmin[vertSlot][j], in setup_tri_coefficients()
634 setup->vmid[vertSlot][j], in setup_tri_coefficients()
635 setup->vmax[vertSlot][j], in setup_tri_coefficients()
638 tri_linear_coeff(setup, &setup->coef[fragSlot], j, v); in setup_tri_coefficients()
643 tri_apply_cylindrical_wrap(setup->vmin[vertSlot][j], in setup_tri_coefficients()
644 setup->vmid[vertSlot][j], in setup_tri_coefficients()
645 setup->vmax[vertSlot][j], in setup_tri_coefficients()
648 tri_persp_coeff(setup, &setup->coef[fragSlot], j, v); in setup_tri_coefficients()
652 setup_fragcoord_coeff(setup, fragSlot); in setup_tri_coefficients()
660 setup->coef[fragSlot].a0[0] = setup->facing * -2.0f + 1.0f; in setup_tri_coefficients()
661 setup->coef[fragSlot].dadx[0] = 0.0; in setup_tri_coefficients()
662 setup->coef[fragSlot].dady[0] = 0.0; in setup_tri_coefficients()
669 setup->coef[fragSlot].a0[j], in setup_tri_coefficients()
670 setup->coef[fragSlot].dadx[j], in setup_tri_coefficients()
671 setup->coef[fragSlot].dady[j]); in setup_tri_coefficients()
679 setup_tri_edges(struct setup_context *setup) in setup_tri_edges() argument
681 float vmin_x = setup->vmin[0][0] + setup->pixel_offset; in setup_tri_edges()
682 float vmid_x = setup->vmid[0][0] + setup->pixel_offset; in setup_tri_edges()
684 float vmin_y = setup->vmin[0][1] - setup->pixel_offset; in setup_tri_edges()
685 float vmid_y = setup->vmid[0][1] - setup->pixel_offset; in setup_tri_edges()
686 float vmax_y = setup->vmax[0][1] - setup->pixel_offset; in setup_tri_edges()
688 setup->emaj.sy = ceilf(vmin_y); in setup_tri_edges()
689 setup->emaj.lines = (int) ceilf(vmax_y - setup->emaj.sy); in setup_tri_edges()
690 setup->emaj.dxdy = setup->emaj.dy ? setup->emaj.dx / setup->emaj.dy : .0f; in setup_tri_edges()
691 setup->emaj.sx = vmin_x + (setup->emaj.sy - vmin_y) * setup->emaj.dxdy; in setup_tri_edges()
693 setup->etop.sy = ceilf(vmid_y); in setup_tri_edges()
694 setup->etop.lines = (int) ceilf(vmax_y - setup->etop.sy); in setup_tri_edges()
695 setup->etop.dxdy = setup->etop.dy ? setup->etop.dx / setup->etop.dy : .0f; in setup_tri_edges()
696 setup->etop.sx = vmid_x + (setup->etop.sy - vmid_y) * setup->etop.dxdy; in setup_tri_edges()
698 setup->ebot.sy = ceilf(vmin_y); in setup_tri_edges()
699 setup->ebot.lines = (int) ceilf(vmid_y - setup->ebot.sy); in setup_tri_edges()
700 setup->ebot.dxdy = setup->ebot.dy ? setup->ebot.dx / setup->ebot.dy : .0f; in setup_tri_edges()
701 setup->ebot.sx = vmin_x + (setup->ebot.sy - vmin_y) * setup->ebot.dxdy; in setup_tri_edges()
710 subtriangle(struct setup_context *setup, in subtriangle() argument
716 const struct pipe_scissor_state *cliprect = &setup->softpipe->cliprect[viewport_index]; in subtriangle()
762 if (block(_y) != setup->span.y) { in subtriangle()
763 flush_spans(setup); in subtriangle()
764 setup->span.y = block(_y); in subtriangle()
767 setup->span.left[_y&1] = left; in subtriangle()
768 setup->span.right[_y&1] = right; in subtriangle()
804 * Do setup for triangle rasterization, then render the triangle.
807 sp_setup_tri(struct setup_context *setup, in sp_setup_tri() argument
816 debug_printf("Setup triangle:\n"); in sp_setup_tri()
817 print_vertex(setup, v0); in sp_setup_tri()
818 print_vertex(setup, v1); in sp_setup_tri()
819 print_vertex(setup, v2); in sp_setup_tri()
822 if (setup->softpipe->no_rast || setup->softpipe->rasterizer->rasterizer_discard) in sp_setup_tri()
831 setup->numFragsEmitted = 0; in sp_setup_tri()
832 setup->numFragsWritten = 0; in sp_setup_tri()
835 if (!setup_sort_vertices( setup, det, v0, v1, v2 )) in sp_setup_tri()
838 setup_tri_coefficients( setup ); in sp_setup_tri()
839 setup_tri_edges( setup ); in sp_setup_tri()
841 assert(setup->softpipe->reduced_prim == PIPE_PRIM_TRIANGLES); in sp_setup_tri()
843 setup->span.y = 0; in sp_setup_tri()
844 setup->span.right[0] = 0; in sp_setup_tri()
845 setup->span.right[1] = 0; in sp_setup_tri()
846 /* setup->span.z_mode = tri_z_mode( setup->ctx ); */ in sp_setup_tri()
847 if (setup->softpipe->layer_slot > 0) { in sp_setup_tri()
848 layer = *(unsigned *)setup->vprovoke[setup->softpipe->layer_slot]; in sp_setup_tri()
849 layer = MIN2(layer, setup->max_layer); in sp_setup_tri()
851 setup->quad[0].input.layer = layer; in sp_setup_tri()
853 if (setup->softpipe->viewport_index_slot > 0) { in sp_setup_tri()
854 unsigned *udata = (unsigned*)v0[setup->softpipe->viewport_index_slot]; in sp_setup_tri()
857 setup->quad[0].input.viewport_index = viewport_index; in sp_setup_tri()
859 /* init_constant_attribs( setup ); */ in sp_setup_tri()
861 if (setup->oneoverarea < 0.0) { in sp_setup_tri()
864 subtriangle(setup, &setup->emaj, &setup->ebot, setup->ebot.lines, viewport_index); in sp_setup_tri()
865 subtriangle(setup, &setup->emaj, &setup->etop, setup->etop.lines, viewport_index); in sp_setup_tri()
870 subtriangle(setup, &setup->ebot, &setup->emaj, setup->ebot.lines, viewport_index); in sp_setup_tri()
871 subtriangle(setup, &setup->etop, &setup->emaj, setup->etop.lines, viewport_index); in sp_setup_tri()
874 flush_spans( setup ); in sp_setup_tri()
876 if (setup->softpipe->active_statistics_queries) { in sp_setup_tri()
877 setup->softpipe->pipeline_statistics.c_primitives++; in sp_setup_tri()
882 setup->numFragsEmitted, in sp_setup_tri()
883 setup->numFragsWritten); in sp_setup_tri()
920 line_linear_coeff(const struct setup_context *setup, in line_linear_coeff() argument
926 const float dadx = da * setup->emaj.dx * setup->oneoverarea; in line_linear_coeff()
927 const float dady = da * setup->emaj.dy * setup->oneoverarea; in line_linear_coeff()
931 (dadx * (setup->vmin[0][0] - setup->pixel_offset) + in line_linear_coeff()
932 dady * (setup->vmin[0][1] - setup->pixel_offset))); in line_linear_coeff()
942 line_persp_coeff(const struct setup_context *setup, in line_persp_coeff() argument
947 const float a0 = v[0] * setup->vmin[0][3]; in line_persp_coeff()
948 const float a1 = v[1] * setup->vmax[0][3]; in line_persp_coeff()
950 const float dadx = da * setup->emaj.dx * setup->oneoverarea; in line_persp_coeff()
951 const float dady = da * setup->emaj.dy * setup->oneoverarea; in line_persp_coeff()
955 (dadx * (setup->vmin[0][0] - setup->pixel_offset) + in line_persp_coeff()
956 dady * (setup->vmin[0][1] - setup->pixel_offset))); in line_persp_coeff()
961 * Compute the setup->coef[] array dadx, dady, a0 values.
962 * Must be called after setup->vmin,vmax are initialized.
965 setup_line_coefficients(struct setup_context *setup, in setup_line_coefficients() argument
969 struct softpipe_context *softpipe = setup->softpipe; in setup_line_coefficients()
970 const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info; in setup_line_coefficients()
978 /* use setup->vmin, vmax to point to vertices */ in setup_line_coefficients()
980 setup->vprovoke = v0; in setup_line_coefficients()
982 setup->vprovoke = v1; in setup_line_coefficients()
983 setup->vmin = v0; in setup_line_coefficients()
984 setup->vmax = v1; in setup_line_coefficients()
986 setup->emaj.dx = setup->vmax[0][0] - setup->vmin[0][0]; in setup_line_coefficients()
987 setup->emaj.dy = setup->vmax[0][1] - setup->vmin[0][1]; in setup_line_coefficients()
990 area = setup->emaj.dx * setup->emaj.dx + setup->emaj.dy * setup->emaj.dy; in setup_line_coefficients()
993 setup->oneoverarea = 1.0f / area; in setup_line_coefficients()
997 v[0] = setup->vmin[0][2]; in setup_line_coefficients()
998 v[1] = setup->vmax[0][2]; in setup_line_coefficients()
999 line_linear_coeff(setup, &setup->posCoef, 2, v); in setup_line_coefficients()
1001 v[0] = setup->vmin[0][3]; in setup_line_coefficients()
1002 v[1] = setup->vmax[0][3]; in setup_line_coefficients()
1003 line_linear_coeff(setup, &setup->posCoef, 3, v); in setup_line_coefficients()
1005 /* setup interpolation for all the remaining attributes: in setup_line_coefficients()
1014 const_coeff(setup, &setup->coef[fragSlot], vertSlot, j); in setup_line_coefficients()
1018 line_apply_cylindrical_wrap(setup->vmin[vertSlot][j], in setup_line_coefficients()
1019 setup->vmax[vertSlot][j], in setup_line_coefficients()
1022 line_linear_coeff(setup, &setup->coef[fragSlot], j, v); in setup_line_coefficients()
1027 line_apply_cylindrical_wrap(setup->vmin[vertSlot][j], in setup_line_coefficients()
1028 setup->vmax[vertSlot][j], in setup_line_coefficients()
1031 line_persp_coeff(setup, &setup->coef[fragSlot], j, v); in setup_line_coefficients()
1035 setup_fragcoord_coeff(setup, fragSlot); in setup_line_coefficients()
1043 setup->coef[fragSlot].a0[0] = setup->facing * -2.0f + 1.0f; in setup_line_coefficients()
1044 setup->coef[fragSlot].dadx[0] = 0.0; in setup_line_coefficients()
1045 setup->coef[fragSlot].dady[0] = 0.0; in setup_line_coefficients()
1056 plot(struct setup_context *setup, int x, int y) in plot() argument
1064 if (quadX != setup->quad[0].input.x0 || in plot()
1065 quadY != setup->quad[0].input.y0) in plot()
1069 if (setup->quad[0].input.x0 != -1) in plot()
1070 clip_emit_quad(setup, &setup->quad[0]); in plot()
1072 setup->quad[0].input.x0 = quadX; in plot()
1073 setup->quad[0].input.y0 = quadY; in plot()
1074 setup->quad[0].inout.mask = 0x0; in plot()
1077 setup->quad[0].inout.mask |= mask; in plot()
1082 * Do setup for line rasterization, then render the line.
1087 sp_setup_line(struct setup_context *setup, in sp_setup_line() argument
1102 debug_printf("Setup line:\n"); in sp_setup_line()
1103 print_vertex(setup, v0); in sp_setup_line()
1104 print_vertex(setup, v1); in sp_setup_line()
1107 if (setup->softpipe->no_rast || setup->softpipe->rasterizer->rasterizer_discard) in sp_setup_line()
1113 if (!setup_line_coefficients(setup, v0, v1)) in sp_setup_line()
1139 assert(setup->softpipe->reduced_prim == PIPE_PRIM_LINES); in sp_setup_line()
1141 setup->quad[0].input.x0 = setup->quad[0].input.y0 = -1; in sp_setup_line()
1142 setup->quad[0].inout.mask = 0x0; in sp_setup_line()
1143 if (setup->softpipe->layer_slot > 0) { in sp_setup_line()
1144 layer = *(unsigned *)setup->vprovoke[setup->softpipe->layer_slot]; in sp_setup_line()
1145 layer = MIN2(layer, setup->max_layer); in sp_setup_line()
1147 setup->quad[0].input.layer = layer; in sp_setup_line()
1149 if (setup->softpipe->viewport_index_slot > 0) { in sp_setup_line()
1150 unsigned *udata = (unsigned*)setup->vprovoke[setup->softpipe->viewport_index_slot]; in sp_setup_line()
1153 setup->quad[0].input.viewport_index = viewport_index; in sp_setup_line()
1158 setup->quad[0].input.coverage[0] = in sp_setup_line()
1159 setup->quad[0].input.coverage[1] = in sp_setup_line()
1160 setup->quad[0].input.coverage[2] = in sp_setup_line()
1161 setup->quad[0].input.coverage[3] = 1.0; in sp_setup_line()
1171 plot(setup, x0, y0); in sp_setup_line()
1191 plot(setup, x0, y0); in sp_setup_line()
1205 if (setup->quad[0].inout.mask) { in sp_setup_line()
1206 clip_emit_quad(setup, &setup->quad[0]); in sp_setup_line()
1212 point_persp_coeff(const struct setup_context *setup, in point_persp_coeff() argument
1225 * Do setup for point rasterization, then render the point.
1230 sp_setup_point(struct setup_context *setup, in sp_setup_point() argument
1233 struct softpipe_context *softpipe = setup->softpipe; in sp_setup_point()
1234 const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info; in sp_setup_point()
1235 const int sizeAttr = setup->softpipe->psize_slot; in sp_setup_point()
1238 : setup->softpipe->rasterizer->point_size; in sp_setup_point()
1240 const boolean round = (boolean) setup->softpipe->rasterizer->point_smooth; in sp_setup_point()
1248 debug_printf("Setup point:\n"); in sp_setup_point()
1249 print_vertex(setup, v0); in sp_setup_point()
1254 if (setup->softpipe->no_rast || setup->softpipe->rasterizer->rasterizer_discard) in sp_setup_point()
1257 assert(setup->softpipe->reduced_prim == PIPE_PRIM_POINTS); in sp_setup_point()
1259 if (setup->softpipe->layer_slot > 0) { in sp_setup_point()
1260 layer = *(unsigned *)v0[setup->softpipe->layer_slot]; in sp_setup_point()
1261 layer = MIN2(layer, setup->max_layer); in sp_setup_point()
1263 setup->quad[0].input.layer = layer; in sp_setup_point()
1265 if (setup->softpipe->viewport_index_slot > 0) { in sp_setup_point()
1266 unsigned *udata = (unsigned*)v0[setup->softpipe->viewport_index_slot]; in sp_setup_point()
1269 setup->quad[0].input.viewport_index = viewport_index; in sp_setup_point()
1272 * However, for point sprites, we'll need to setup texcoords appropriately. in sp_setup_point()
1287 setup->vprovoke = v0; in sp_setup_point()
1289 /* setup Z, W */ in sp_setup_point()
1290 const_coeff(setup, &setup->posCoef, 0, 2); in sp_setup_point()
1291 const_coeff(setup, &setup->posCoef, 0, 3); in sp_setup_point()
1302 const_coeff(setup, &setup->coef[fragSlot], vertSlot, j); in sp_setup_point()
1306 point_persp_coeff(setup, setup->vprovoke, in sp_setup_point()
1307 &setup->coef[fragSlot], vertSlot, j); in sp_setup_point()
1310 setup_fragcoord_coeff(setup, fragSlot); in sp_setup_point()
1318 setup->coef[fragSlot].a0[0] = setup->facing * -2.0f + 1.0f; in sp_setup_point()
1319 setup->coef[fragSlot].dadx[0] = 0.0; in sp_setup_point()
1320 setup->coef[fragSlot].dady[0] = 0.0; in sp_setup_point()
1329 setup->quad[0].input.x0 = (int) x - ix; in sp_setup_point()
1330 setup->quad[0].input.y0 = (int) y - iy; in sp_setup_point()
1331 setup->quad[0].inout.mask = (1 << ix) << (2 * iy); in sp_setup_point()
1332 clip_emit_quad(setup, &setup->quad[0]); in sp_setup_point()
1352 setup->quad[0].inout.mask = 0x0; in sp_setup_point()
1359 setup->quad[0].input.coverage[QUAD_TOP_LEFT] = MIN2(cover, 1.0f); in sp_setup_point()
1360 setup->quad[0].inout.mask |= MASK_TOP_LEFT; in sp_setup_point()
1368 setup->quad[0].input.coverage[QUAD_TOP_RIGHT] = MIN2(cover, 1.0f); in sp_setup_point()
1369 setup->quad[0].inout.mask |= MASK_TOP_RIGHT; in sp_setup_point()
1377 setup->quad[0].input.coverage[QUAD_BOTTOM_LEFT] = MIN2(cover, 1.0f); in sp_setup_point()
1378 setup->quad[0].inout.mask |= MASK_BOTTOM_LEFT; in sp_setup_point()
1386 setup->quad[0].input.coverage[QUAD_BOTTOM_RIGHT] = MIN2(cover, 1.0f); in sp_setup_point()
1387 setup->quad[0].inout.mask |= MASK_BOTTOM_RIGHT; in sp_setup_point()
1390 if (setup->quad[0].inout.mask) { in sp_setup_point()
1391 setup->quad[0].input.x0 = ix; in sp_setup_point()
1392 setup->quad[0].input.y0 = iy; in sp_setup_point()
1393 clip_emit_quad(setup, &setup->quad[0]); in sp_setup_point()
1437 setup->quad[0].inout.mask = mask; in sp_setup_point()
1438 setup->quad[0].input.x0 = ix; in sp_setup_point()
1439 setup->quad[0].input.y0 = iy; in sp_setup_point()
1440 clip_emit_quad(setup, &setup->quad[0]); in sp_setup_point()
1452 sp_setup_prepare(struct setup_context *setup) in sp_setup_prepare() argument
1454 struct softpipe_context *sp = setup->softpipe; in sp_setup_prepare()
1462 setup->nr_vertex_attrs = draw_num_shader_outputs(sp->draw); in sp_setup_prepare()
1470 for (i = 0; i < setup->softpipe->framebuffer.nr_cbufs; i++) { in sp_setup_prepare()
1471 struct pipe_surface *cbuf = setup->softpipe->framebuffer.cbufs[i]; in sp_setup_prepare()
1479 setup->max_layer = max_layer; in sp_setup_prepare()
1487 setup->cull_face = sp->rasterizer->cull_face; in sp_setup_prepare()
1491 setup->cull_face = PIPE_FACE_NONE; in sp_setup_prepare()
1497 sp_setup_destroy_context(struct setup_context *setup) in sp_setup_destroy_context() argument
1499 FREE( setup ); in sp_setup_destroy_context()
1504 * Create a new primitive setup/render stage.
1509 struct setup_context *setup = CALLOC_STRUCT(setup_context); in sp_setup_create_context() local
1512 setup->softpipe = softpipe; in sp_setup_create_context()
1515 setup->quad[i].coef = setup->coef; in sp_setup_create_context()
1516 setup->quad[i].posCoef = &setup->posCoef; in sp_setup_create_context()
1519 setup->span.left[0] = 1000000; /* greater than right[0] */ in sp_setup_create_context()
1520 setup->span.left[1] = 1000000; /* greater than right[1] */ in sp_setup_create_context()
1522 return setup; in sp_setup_create_context()