diff --git a/hw/xbox/nv2a/pgraph/gl/draw.c b/hw/xbox/nv2a/pgraph/gl/draw.c index 94e9beb50b0..8b1002e70d9 100644 --- a/hw/xbox/nv2a/pgraph/gl/draw.c +++ b/hw/xbox/nv2a/pgraph/gl/draw.c @@ -321,8 +321,10 @@ void pgraph_gl_draw_begin(NV2AState *d) if (!anti_aliasing && pgraph_reg_r(pg, NV_PGRAPH_SETUPRASTER) & NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) { glEnable(GL_LINE_SMOOTH); + glLineWidth(MIN(r->supportedSmoothLineWidthRange[1], pg->surface_scale_factor)); } else { glDisable(GL_LINE_SMOOTH); + glLineWidth(MIN(r->supportedAliasedLineWidthRange[1], pg->surface_scale_factor)); } if (!anti_aliasing && pgraph_reg_r(pg, NV_PGRAPH_SETUPRASTER) & NV_PGRAPH_SETUPRASTER_POLYSMOOTHENABLE) { diff --git a/hw/xbox/nv2a/pgraph/gl/renderer.c b/hw/xbox/nv2a/pgraph/gl/renderer.c index 9e22a80f6d5..0e557c2dc8e 100644 --- a/hw/xbox/nv2a/pgraph/gl/renderer.c +++ b/hw/xbox/nv2a/pgraph/gl/renderer.c @@ -38,6 +38,7 @@ static void pgraph_gl_init(NV2AState *d, Error **errp) PGRAPHState *pg = &d->pgraph; pg->gl_renderer_state = g_malloc0(sizeof(*pg->gl_renderer_state)); + PGRAPHGLState *r = pg->gl_renderer_state; /* fire up opengl */ glo_set_current(g_nv2a_context_render); @@ -51,6 +52,9 @@ static void pgraph_gl_init(NV2AState *d, Error **errp) /* Internal RGB565 texture format */ assert(glo_check_extension("GL_ARB_ES2_compatibility")); + glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, r->supportedSmoothLineWidthRange); + glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, r->supportedAliasedLineWidthRange); + pgraph_gl_init_surfaces(pg); pgraph_gl_init_reports(d); pgraph_gl_init_textures(d); diff --git a/hw/xbox/nv2a/pgraph/gl/renderer.h b/hw/xbox/nv2a/pgraph/gl/renderer.h index 14160b21b79..0ca124c3fce 100644 --- a/hw/xbox/nv2a/pgraph/gl/renderer.h +++ b/hw/xbox/nv2a/pgraph/gl/renderer.h @@ -229,6 +229,9 @@ typedef struct PGRAPHGLState { GLint pvideo_color_key_loc; GLint palette_loc[256]; } disp_rndr; + + GLfloat supportedAliasedLineWidthRange[2]; + GLfloat supportedSmoothLineWidthRange[2]; } PGRAPHGLState; extern GloContext *g_nv2a_context_render;