Lines Matching refs:clipper
126 const struct clip_stage *clipper = clip_stage(stage);
128 for (i = 0; i < clipper->num_const_attribs; i++) {
129 const uint attr = clipper->const_attribs[i];
251 const struct clip_stage *clipper = clip_stage(stage);
291 tri_null = is_tri_null(clipper, &header);
321 if (clipper->cv_attr >= 0) {
323 header.v[j]->data[clipper->cv_attr][0],
324 header.v[j]->data[clipper->cv_attr][1],
325 header.v[j]->data[clipper->cv_attr][2],
326 header.v[j]->data[clipper->cv_attr][3]);
356 static inline float getclipdist(const struct clip_stage *clipper,
364 plane = clipper->plane[plane_idx];
367 else if (clipper->have_clipdist) {
372 dp = vert->data[draw_current_shader_ccdistance_output(clipper->stage.draw, cdi)][vidx];
377 plane = clipper->plane[plane_idx];
378 if (clipper->cv_attr >= 0) {
379 dp = dot4(vert->data[clipper->cv_attr], plane);
395 struct clip_stage *clipper = clip_stage( stage );
427 viewport_index = draw_viewport_index(clipper->stage.draw, prov_vertex);
437 if (clipper->cv_attr >= 0) {
438 const float *v0 = header->v[0]->data[clipper->cv_attr];
439 const float *v1 = header->v[1]->data[clipper->cv_attr];
440 const float *v2 = header->v[2]->data[clipper->cv_attr];
468 dp_prev = getclipdist(clipper, vert_prev, plane_idx);
484 float dp = getclipdist(clipper, vert, plane_idx);
504 new_vert = clipper->stage.tmp[tmpnr++];
518 interp( clipper, new_vert, t, vert, vert_prev, viewport_index );
539 interp( clipper, new_vert, t, vert_prev, vert, viewport_index );
571 if (clipper->num_const_attribs) {
606 const struct clip_stage *clipper = clip_stage(stage);
623 viewport_index = draw_viewport_index(clipper->stage.draw, prov_vertex);
627 const float dp0 = getclipdist(clipper, v0, plane_idx);
628 const float dp1 = getclipdist(clipper, v1, plane_idx);
650 interp( clipper, stage->tmp[0], t0, v0, v1, viewport_index );
664 interp( clipper, stage->tmp[1], t1, v1, v0, viewport_index );
814 struct clip_stage *clipper = clip_stage(stage);
821 clipper->pos_attr = draw_current_shader_position_output(draw);
822 clipper->have_clipdist = draw_current_shader_num_written_clipdistances(draw) > 0;
823 if (draw_current_shader_clipvertex_output(draw) != clipper->pos_attr) {
824 clipper->cv_attr = (int)draw_current_shader_clipvertex_output(draw);
827 clipper->cv_attr = -1;
863 clipper->num_const_attribs = 0;
864 clipper->num_linear_attribs = 0;
865 clipper->num_perspect_attribs = 0;
873 clipper->const_attribs[clipper->num_const_attribs] = i;
874 clipper->num_const_attribs++;
877 clipper->linear_attribs[clipper->num_linear_attribs] = i;
878 clipper->num_linear_attribs++;
881 clipper->perspect_attribs[clipper->num_perspect_attribs] = i;
882 clipper->num_perspect_attribs++;
897 clipper->const_attribs[clipper->num_const_attribs] = i + j;
898 clipper->num_const_attribs++;
901 clipper->linear_attribs[clipper->num_linear_attribs] = i + j;
902 clipper->num_linear_attribs++;
905 clipper->perspect_attribs[clipper->num_perspect_attribs] = i + j;
906 clipper->num_perspect_attribs++;
957 * Allocate a new clipper stage.
962 struct clip_stage *clipper = CALLOC_STRUCT(clip_stage);
963 if (!clipper)
966 clipper->stage.draw = draw;
967 clipper->stage.name = "clipper";
968 clipper->stage.point = clip_first_point;
969 clipper->stage.line = clip_first_line;
970 clipper->stage.tri = clip_first_tri;
971 clipper->stage.flush = clip_flush;
972 clipper->stage.reset_stipple_counter = clip_reset_stipple_counter;
973 clipper->stage.destroy = clip_destroy;
975 clipper->plane = draw->plane;
977 if (!draw_alloc_temp_verts( &clipper->stage, MAX_CLIPPED_VERTICES+1 ))
980 return &clipper->stage;
983 if (clipper)
984 clipper->stage.destroy( &clipper->stage );