gallium/hud: use AA lines for graphs
authorMarek Olšák <marek.olsak@amd.com>
Wed, 17 Aug 2016 16:13:46 +0000 (18:13 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 22 Aug 2016 14:01:35 +0000 (16:01 +0200)
this looks a lot better (with the next patch)

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/hud/hud_context.c

index 0b292bcca614e447a5666978a9bb9d88190ecafe..fb9c8c65af321d845688d4715954833edfbd8175 100644 (file)
@@ -67,7 +67,7 @@ struct hud_context {
    struct pipe_blend_state no_blend, alpha_blend;
    struct pipe_depth_stencil_alpha_state dsa;
    void *fs_color, *fs_text;
-   struct pipe_rasterizer_state rasterizer;
+   struct pipe_rasterizer_state rasterizer, rasterizer_aa_lines;
    void *vs;
    struct pipe_vertex_element velems[2];
 
@@ -590,6 +590,7 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
    pipe_resource_reference(&hud->text.vbuf.buffer, NULL);
 
    /* draw the rest */
+   cso_set_rasterizer(cso, &hud->rasterizer_aa_lines);
    LIST_FOR_EACH_ENTRY(pane, &hud->pane_list, head) {
       if (pane)
          hud_pane_draw_colored_objects(hud, pane);
@@ -1227,6 +1228,9 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
    hud->rasterizer.line_width = 1;
    hud->rasterizer.line_last_pixel = 1;
 
+   hud->rasterizer_aa_lines = hud->rasterizer;
+   hud->rasterizer_aa_lines.line_smooth = 1;
+
    /* vertex shader */
    {
       static const char *vertex_shader_text = {