fix GL_LINE_LOOP with drivers using own render pipeline stage (#12410, #13527)
[mesa.git] / src / mesa / drivers / dri / mga / mgatris.c
index bf415a15a636b72a6a1f229c7da72dd091437f61..91b413ae760872b8adc108dbdd6a3ce23cf6e61c 100644 (file)
@@ -104,8 +104,10 @@ static void __inline__ mga_draw_quad( mgaContextPtr mmesa,
 static __inline__ void mga_draw_point( mgaContextPtr mmesa,
                                        mgaVertexPtr tmp )
 {
-   GLfloat sz = mmesa->glCtx->Point._Size * .5;
-   int vertex_size = mmesa->vertex_size;
+   const GLfloat sz = 0.5 * CLAMP(mmesa->glCtx->Point.Size,
+                                  mmesa->glCtx->Const.MinPointSize,
+                                  mmesa->glCtx->Const.MaxPointSize);
+   const int vertex_size = mmesa->vertex_size;
    GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
    int j;
    
@@ -165,7 +167,9 @@ static __inline__ void mga_draw_line( mgaContextPtr mmesa,
    GLuint vertex_size = mmesa->vertex_size;
    GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
    GLfloat dx, dy, ix, iy;
-   GLfloat width = mmesa->glCtx->Line._Width;
+   const GLfloat width = CLAMP(mmesa->glCtx->Line.Width,
+                               mmesa->glCtx->Const.MinLineWidth,
+                               mmesa->glCtx->Const.MaxLineWidth);
    GLint j;
 
 #if 0
@@ -328,10 +332,10 @@ mga_fallback_point( mgaContextPtr mmesa,
 #define MGA_MAX_TRIFUNC     0x20
 
 static struct {
-   points_func         points;
-   line_func           line;
-   triangle_func       triangle;
-   quad_func           quad;
+   tnl_points_func             points;
+   tnl_line_func               line;
+   tnl_triangle_func   triangle;
+   tnl_quad_func               quad;
 } rast_tab[MGA_MAX_TRIFUNC];
 
 #define DO_FALLBACK (IND & MGA_FALLBACK_BIT)
@@ -839,7 +843,8 @@ static const char * const fallbackStrings[] = {
    "glRenderMode(selection or feedback)",
    "No hardware stencil",
    "glDepthFunc( GL_NEVER )",
-   "Mixing GL_CLAMP_TO_EDGE and GL_CLAMP"
+   "Mixing GL_CLAMP_TO_EDGE and GL_CLAMP",
+   "rasterization fallback option"
 };
 
 static const char *getFallbackString(GLuint bit)