struct twoside_stage {
struct draw_stage stage;
float sign; /**< +1 or -1 */
- const unsigned *lookup;
+ const unsigned *lookup; /**< vertex attribute positions */
};
float oneoverarea;
+ const unsigned *lookup; /**< vertex attribute positions */
+
struct tgsi_interp_coef coef[TGSI_ATTRIB_MAX];
struct quad_header quad;
setup_point(struct draw_stage *stage, struct prim_header *prim)
{
struct setup_stage *setup = setup_stage( stage );
- /*XXX this should be a vertex attrib! */
- const float halfSize = 0.5f * setup->softpipe->setup.point_size;
- const boolean round = setup->softpipe->setup.point_smooth;
const struct vertex_header *v0 = prim->v[0];
+
+ const int sizeAttr = setup->lookup[TGSI_ATTRIB_POINTSIZE];
+ const float halfSize
+ = sizeAttr ? (0.5f * v0->data[sizeAttr][0])
+ : (0.5f * setup->softpipe->setup.point_size);
+ const boolean round = setup->softpipe->setup.point_smooth;
const float x = v0->data[TGSI_ATTRIB_POS][0];
const float y = v0->data[TGSI_ATTRIB_POS][1];
unsigned slot, j;
setup->quad.coef = setup->coef;
+ setup->lookup = softpipe->draw->vertex_info.attrib_to_slot;
+
return &setup->stage;
}
emit_vertex_attr(vinfo, TGSI_ATTRIB_FOG, FORMAT_1F, INTERP_PERSPECTIVE);
}
+ /* point size */
+#if 0
+ /* XXX only emit if drawing points or front/back polygon mode is point mode */
+ emit_vertex_attr(vinfo, TGSI_ATTRIB_POINTSIZE, FORMAT_4F, INTERP_CONSTANT);
+#endif
+
/* texcoords and varying vars */
for (i = TGSI_ATTRIB_TEX0; i < TGSI_ATTRIB_VAR7; i++) {
if (inputsRead & (1 << i)) {
release_temp(p, ut);
}
+/**
+ * Emit constant point size.
+ */
+static void constant_pointsize( struct tnl_program *p )
+{
+ struct ureg state_size = register_param1(p, STATE_POINT_SIZE);
+ struct ureg out = register_output(p, VERT_RESULT_PSIZ);
+ emit_op1(p, OPCODE_MOV, out, WRITEMASK_X, state_size);
+}
+
static void build_tnl_program( struct tnl_program *p )
{ /* Emit the program, starting with modelviewproject:
*/
if (p->state->point_attenuated)
build_pointsize(p);
+#if 0
+ else
+ constant_pointsize(p);
+#endif
/* Finish up:
*/