int num_written_clipdistance =
draw_current_shader_num_written_clipdistances(pvs->draw);
- cd[0] = draw_current_shader_clipdistance_output(pvs->draw, 0);
- cd[1] = draw_current_shader_clipdistance_output(pvs->draw, 1);
+ cd[0] = draw_current_shader_ccdistance_output(pvs->draw, 0);
+ cd[1] = draw_current_shader_ccdistance_output(pvs->draw, 1);
if (cd[0] != pos || cd[1] != pos)
have_cd = true;
}
uint
-draw_current_shader_clipdistance_output(const struct draw_context *draw, int index)
+draw_current_shader_ccdistance_output(const struct draw_context *draw, int index)
{
debug_assert(index < PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
if (draw->gs.geometry_shader)
- return draw->gs.geometry_shader->clipdistance_output[index];
- return draw->vs.clipdistance_output[index];
+ return draw->gs.geometry_shader->ccdistance_output[index];
+ return draw->vs.ccdistance_output[index];
}
return draw->vs.vertex_shader->info.num_written_clipdistance;
}
-
-uint
-draw_current_shader_culldistance_output(const struct draw_context *draw, int index)
-{
- debug_assert(index < PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- if (draw->gs.geometry_shader)
- return draw->gs.geometry_shader->culldistance_output[index];
- return draw->vs.vertex_shader->culldistance_output[index];
-}
-
uint
draw_current_shader_num_written_culldistances(const struct draw_context *draw)
{
if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) {
debug_assert(gs->info.output_semantic_index[i] <
PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- gs->clipdistance_output[gs->info.output_semantic_index[i]] = i;
- }
- if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_CULLDIST) {
- debug_assert(gs->info.output_semantic_index[i] <
- PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- gs->culldistance_output[gs->info.output_semantic_index[i]] = i;
+ gs->ccdistance_output[gs->info.output_semantic_index[i]] = i;
}
}
struct tgsi_shader_info info;
unsigned position_output;
unsigned viewport_index_output;
- unsigned clipdistance_output[PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT];
- unsigned culldistance_output[PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT];
+ unsigned ccdistance_output[PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT];
unsigned max_output_vertices;
unsigned primitive_boundary;
unsigned ucp_enable = key->ucp_enable;
unsigned cd[2];
- cd[0] = llvm->draw->vs.clipdistance_output[0];
- cd[1] = llvm->draw->vs.clipdistance_output[1];
+ cd[0] = llvm->draw->vs.ccdistance_output[0];
+ cd[1] = llvm->draw->vs.ccdistance_output[1];
if (cd[0] != pos || cd[1] != pos)
have_cd = true;
int _idx = plane_idx - 6;
int cdi = _idx >= 4;
int vidx = cdi ? _idx - 4 : _idx;
- dp = vert->data[draw_current_shader_clipdistance_output(clipper->stage.draw, cdi)][vidx];
+ dp = vert->data[draw_current_shader_ccdistance_output(clipper->stage.draw, cdi)][vidx];
} else {
/*
* legacy user clip planes or gl_ClipVertex
{
const unsigned num_written_culldistances =
draw_current_shader_num_written_culldistances(stage->draw);
+ const unsigned num_written_clipdistances =
+ draw_current_shader_num_written_clipdistances(stage->draw);
unsigned i;
debug_assert(num_written_culldistances);
for (i = 0; i < num_written_culldistances; ++i) {
- unsigned cull_idx = i / 4;
+ unsigned cull_idx = (num_written_clipdistances + i) / 4;
unsigned out_idx =
- draw_current_shader_culldistance_output(stage->draw, cull_idx);
- unsigned idx = i % 4;
+ draw_current_shader_ccdistance_output(stage->draw, cull_idx);
+ unsigned idx = (num_written_clipdistances + i) % 4;
float cull1 = header->v[0]->data[out_idx][idx];
boolean vert1_out = cull_distance_is_out(cull1);
if (vert1_out)
{
const unsigned num_written_culldistances =
draw_current_shader_num_written_culldistances(stage->draw);
+ const unsigned num_written_clipdistances =
+ draw_current_shader_num_written_clipdistances(stage->draw);
unsigned i;
debug_assert(num_written_culldistances);
for (i = 0; i < num_written_culldistances; ++i) {
- unsigned cull_idx = i / 4;
+ unsigned cull_idx = (num_written_clipdistances + i) / 4;
unsigned out_idx =
- draw_current_shader_culldistance_output(stage->draw, cull_idx);
- unsigned idx = i % 4;
+ draw_current_shader_ccdistance_output(stage->draw, cull_idx);
+ unsigned idx = (num_written_clipdistances + i) % 4;
float cull1 = header->v[0]->data[out_idx][idx];
float cull2 = header->v[1]->data[out_idx][idx];
boolean vert1_out = cull_distance_is_out(cull1);
{
const unsigned num_written_culldistances =
draw_current_shader_num_written_culldistances(stage->draw);
-
+ const unsigned num_written_clipdistances =
+ draw_current_shader_num_written_clipdistances(stage->draw);
/* Do the distance culling */
if (num_written_culldistances) {
unsigned i;
for (i = 0; i < num_written_culldistances; ++i) {
- unsigned cull_idx = i / 4;
+ unsigned cull_idx = (num_written_clipdistances + i) / 4;
unsigned out_idx =
- draw_current_shader_culldistance_output(stage->draw, cull_idx);
- unsigned idx = i % 4;
+ draw_current_shader_ccdistance_output(stage->draw, cull_idx);
+ unsigned idx = (num_written_clipdistances + i) % 4;
float cull1 = header->v[0]->data[out_idx][idx];
float cull2 = header->v[1]->data[out_idx][idx];
float cull3 = header->v[2]->data[out_idx][idx];
uint position_output;
uint edgeflag_output;
uint clipvertex_output;
- uint clipdistance_output[2];
+ uint ccdistance_output[2];
/** Fields for TGSI interpreter / execution */
struct {
uint draw_current_shader_position_output(const struct draw_context *draw);
uint draw_current_shader_viewport_index_output(const struct draw_context *draw);
uint draw_current_shader_clipvertex_output(const struct draw_context *draw);
-uint draw_current_shader_clipdistance_output(const struct draw_context *draw, int index);
+uint draw_current_shader_ccdistance_output(const struct draw_context *draw, int index);
uint draw_current_shader_num_written_clipdistances(const struct draw_context *draw);
-uint draw_current_shader_culldistance_output(const struct draw_context *draw, int index);
uint draw_current_shader_num_written_culldistances(const struct draw_context *draw);
int draw_alloc_extra_vertex_attrib(struct draw_context *draw,
uint semantic_name, uint semantic_index);
else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) {
debug_assert(vs->info.output_semantic_index[i] <
PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- vs->clipdistance_output[vs->info.output_semantic_index[i]] = i;
- } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CULLDIST) {
- debug_assert(vs->info.output_semantic_index[i] <
- PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- vs->culldistance_output[vs->info.output_semantic_index[i]] = i;
+ vs->ccdistance_output[vs->info.output_semantic_index[i]] = i;
}
}
if (!found_clipvertex)
draw->vs.position_output = dvs->position_output;
draw->vs.edgeflag_output = dvs->edgeflag_output;
draw->vs.clipvertex_output = dvs->clipvertex_output;
- draw->vs.clipdistance_output[0] = dvs->clipdistance_output[0];
- draw->vs.clipdistance_output[1] = dvs->clipdistance_output[1];
+ draw->vs.ccdistance_output[0] = dvs->ccdistance_output[0];
+ draw->vs.ccdistance_output[1] = dvs->ccdistance_output[1];
dvs->prepare( dvs, draw );
draw_update_clip_flags(draw);
draw_update_viewport_flags(draw);
unsigned viewport_index_output;
unsigned edgeflag_output;
unsigned clipvertex_output;
- unsigned clipdistance_output[PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT];
- unsigned culldistance_output[PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT];
+ unsigned ccdistance_output[PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT];
/* Extracted from shader:
*/
const float (*immediates)[4];
semName == TGSI_SEMANTIC_COLOR ||
semName == TGSI_SEMANTIC_BCOLOR ||
semName == TGSI_SEMANTIC_FOG ||
- semName == TGSI_SEMANTIC_CLIPDIST ||
- semName == TGSI_SEMANTIC_CULLDIST) {
+ semName == TGSI_SEMANTIC_CLIPDIST) {
switch (fulldecl->Interp.Interpolate) {
case TGSI_INTERPOLATE_COLOR:
case TGSI_INTERPOLATE_PERSPECTIVE: