diff options
| -rw-r--r-- | src/mesa/drivers/dri/unichrome/via_context.c | 3 | ||||
| -rw-r--r-- | src/mesa/drivers/dri/unichrome/via_context.h | 1 | ||||
| -rw-r--r-- | src/mesa/drivers/dri/unichrome/via_tris.c | 2 | 
3 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index b3cc66f087..4c70af60c8 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -356,6 +356,7 @@ viaCreateContext(const __GLcontextModes *mesaVis,         vmesa->depth_max = (GLfloat)0xffff;         vmesa->depth_clear_mask = 0xf << 28;         vmesa->ClearDepth = 0xffff; +       vmesa->polygon_offset_scale = 1.0 / vmesa->depth_max;         break;      case 24:         vmesa->hasDepth = GL_TRUE; @@ -370,6 +371,7 @@ viaCreateContext(const __GLcontextModes *mesaVis,         vmesa->have_hw_stencil = GL_TRUE;         vmesa->stencilBits = mesaVis->stencilBits;         vmesa->stencil_clear_mask = 0x1 << 28; +       vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max;         break;      case 32:         vmesa->hasDepth = GL_TRUE; @@ -380,6 +382,7 @@ viaCreateContext(const __GLcontextModes *mesaVis,         vmesa->depth_clear_mask = 0;         vmesa->ClearDepth = 0xffffffff;         vmesa->depth_clear_mask = 0xf << 28; +       vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max;         break;      default:         assert(0);  diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index 25def2e075..a409b8c6b7 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -103,6 +103,7 @@ struct via_context_t {     GLuint depth_clear_mask;     GLuint stencil_clear_mask;     GLfloat depth_max; +   GLfloat polygon_offset_scale;      GLubyte    *dma;      viaRegion tex; diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c index 6dbbfe0343..8c16d01000 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.c +++ b/src/mesa/drivers/dri/unichrome/via_tris.c @@ -222,7 +222,7 @@ static struct {      } while (0) -#define DEPTH_SCALE (1.0 / 0xffff) +#define DEPTH_SCALE vmesa->polygon_offset_scale  #define UNFILLED_TRI unfilled_tri  #define UNFILLED_QUAD unfilled_quad  #define VERT_X(_v) _v->v.x  | 
