Skip to content

Commit

Permalink
Merge branch 'xemu-project:master' into Master2
Browse files Browse the repository at this point in the history
  • Loading branch information
backgamon authored Nov 23, 2024
2 parents 5637052 + 7944150 commit dd99409
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hw/xbox/nv2a/pgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ static const SurfaceFormatInfo kelvin_surface_zeta_fixed_format_map[] = {
{4, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH_STENCIL_ATTACHMENT},
};

static GLfloat supportedAliasedLineWidthRange[2] = { 0.0f, 0.0f };
static GLfloat supportedSmoothLineWidthRange[2] = { 0.0f, 0.0f };

// static void pgraph_set_context_user(NV2AState *d, uint32_t val);
static void pgraph_gl_fence(void);
Expand Down Expand Up @@ -3053,7 +3055,6 @@ DEF_METHOD(NV097, SET_BEGIN_END)
glDisable(GL_DITHER);
}

glLineWidth(pg->surface_scale_factor);
glEnable(GL_PROGRAM_POINT_SIZE);

bool anti_aliasing = GET_MASK(pg->regs[NV_PGRAPH_ANTIALIASING], NV_PGRAPH_ANTIALIASING_ENABLE);
Expand All @@ -3062,8 +3063,10 @@ DEF_METHOD(NV097, SET_BEGIN_END)
if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] &
NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) {
glEnable(GL_LINE_SMOOTH);
glLineWidth(MIN(supportedSmoothLineWidthRange[1], pg->surface_scale_factor));
} else {
glDisable(GL_LINE_SMOOTH);
glLineWidth(MIN(supportedAliasedLineWidthRange[1], pg->surface_scale_factor));
}
if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] &
NV_PGRAPH_SETUPRASTER_POLYSMOOTHENABLE) {
Expand Down Expand Up @@ -3910,6 +3913,9 @@ void nv2a_gl_context_init(void)
{
g_nv2a_context_render = glo_context_create();
g_nv2a_context_display = glo_context_create();

glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, supportedSmoothLineWidthRange);
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, supportedAliasedLineWidthRange);
}

void nv2a_set_surface_scale_factor(unsigned int scale)
Expand Down

0 comments on commit dd99409

Please sign in to comment.