- raster.point_size = ctx->Point.Size;
- raster.point_smooth = ctx->Point.SmoothFlag;
- raster.point_sprite = ctx->Point.PointSprite;
- for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
- if (ctx->Point.CoordReplace[i]) {
- if (ctx->Point.SpriteOrigin == GL_UPPER_LEFT)
- raster.sprite_coord_mode[i] = PIPE_SPRITE_COORD_UPPER_LEFT;
- else
- raster.sprite_coord_mode[i] = PIPE_SPRITE_COORD_LOWER_LEFT;
+ if (ctx->Point.PointSprite) {
+ /* origin */
+ if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
+ (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
+ raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
+ else
+ raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT;
+
+ /* Coord replacement flags. If bit 'k' is set that means
+ * that we need to replace GENERIC[k] attrib with an automatically
+ * computed texture coord.
+ */
+ for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
+ if (ctx->Point.CoordReplace[i]) {
+ raster->sprite_coord_enable |= 1 << i;
+ }