/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
-#include "pipe/p_util.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
#include "draw_vs.h"
uint num_texcoords;
int psize_slot;
+
+ int point_coord_fs_input; /**< input for pointcoord (and fog) */
};
v->data[j][3] = tc[3];
}
}
+
+ if (wide->point_coord_fs_input >= 0) {
+ /* put gl_PointCoord into extra vertex output's zw components */
+ uint k = wide->stage.draw->extra_vp_outputs.slot;
+ v->data[k][2] = tc[0];
+ v->data[k][3] = tc[1];
+ }
}
struct prim_header *header )
{
const struct widepoint_stage *wide = widepoint_stage(stage);
+ const unsigned pos = stage->draw->vs.position_output;
const boolean sprite = (boolean) stage->draw->rasterizer->point_sprite;
float half_size;
float left_adj, right_adj, bot_adj, top_adj;
struct vertex_header *v2 = dup_vert(stage, header->v[0], 2);
struct vertex_header *v3 = dup_vert(stage, header->v[0], 3);
- float *pos0 = v0->data[0];
- float *pos1 = v1->data[0];
- float *pos2 = v2->data[0];
- float *pos3 = v3->data[0];
+ float *pos0 = v0->data[pos];
+ float *pos1 = v1->data[pos];
+ float *pos2 = v2->data[pos];
+ float *pos3 = v3->data[pos];
/* point size is either per-vertex or fixed size */
if (wide->psize_slot >= 0) {
}
}
wide->num_texcoords = j;
+
+ /* find fragment shader PointCoord/Fog input */
+ wide->point_coord_fs_input = 0; /* XXX fix this! */
+
+ /* setup extra vp output (point coord implemented as a texcoord) */
+ draw->extra_vp_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
+ draw->extra_vp_outputs.semantic_index = 0;
+ draw->extra_vp_outputs.slot = draw->vs.num_vs_outputs;
+ }
+ else {
+ wide->point_coord_fs_input = -1;
+ draw->extra_vp_outputs.slot = 0;
}
wide->psize_slot = -1;
goto fail;
wide->stage.draw = draw;
+ wide->stage.name = "wide-point";
wide->stage.next = NULL;
wide->stage.point = widepoint_first_point;
wide->stage.line = draw_pipe_passthrough_line;