From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/context_gl.c | 13 +++++++++++++ dlls/wined3d/ffp_gl.c | 29 ----------------------------- dlls/wined3d/glsl_shader.c | 13 ------------- dlls/wined3d/wined3d_private.h | 4 ---- 4 files changed, 13 insertions(+), 46 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index b91c8168dd7..8443952cff8 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2223,6 +2223,19 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
if (gl_info->supported[ARB_POINT_SPRITE]) { + /* The actual effect of D3DRS_POINTSPRITEENABLE is more accurately + * congruent to GL_COORD_REPLACE_ARB. GL_POINT_SPRITE_ARB, when + * disabled, affects point rasterization (which we do not want), + * implicitly disables GL_COORD_REPLACE_ARB, and causes gl_PointCoord + * to return an undefined value. + * + * We implement D3DRS_POINTSPRITEENABLE by altering the shader to read + * from gl_PointCoord or from the actual texcoord, so we do not need + * GL_COORD_REPLACE_ARB, nor do we need to dynamically toggle + * GL_POINT_SPRITE_ARB. */ + + gl_info->gl_ops.gl.p_glEnable(GL_POINT_SPRITE_ARB); + for (i = 0; i < gl_info->limits.ffp_textures; ++i) { wined3d_context_gl_active_texture(context_gl, gl_info, i); diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index 98363dcac14..61b4244c15f 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -834,35 +834,6 @@ static void state_linepattern_w(struct wined3d_context *context, const struct wi FIXME("Setting line patterns is not supported in OpenGL core contexts.\n"); }
-void state_pointsprite_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - static BOOL warned; - - /* TODO: NV_POINT_SPRITE */ - if (!warned && state->render_states[WINED3D_RS_POINTSPRITEENABLE]) - { - /* A FIXME, not a WARN because point sprites should be software emulated if not supported by HW */ - FIXME("Point sprites not supported\n"); - warned = TRUE; - } -} - -void state_pointsprite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; - - if (state->render_states[WINED3D_RS_POINTSPRITEENABLE]) - { - gl_info->gl_ops.gl.p_glEnable(GL_POINT_SPRITE_ARB); - checkGLcall("glEnable(GL_POINT_SPRITE_ARB)"); - } - else - { - gl_info->gl_ops.gl.p_glDisable(GL_POINT_SPRITE_ARB); - checkGLcall("glDisable(GL_POINT_SPRITE_ARB)"); - } -} - static void state_msaa_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { if (state->render_states[WINED3D_RS_MULTISAMPLEANTIALIAS]) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index af25e3db538..d5696c7d390 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11890,16 +11890,6 @@ static void glsl_vertex_pipe_pointsize(struct wined3d_context *context, context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POINTSIZE; }
-static void glsl_vertex_pointsprite_core(struct wined3d_context *context, - const struct wined3d_state *state, DWORD state_id) -{ - static unsigned int once; - - if (state->primitive_type == WINED3D_PT_POINTLIST - && !state->render_states[WINED3D_RS_POINTSPRITEENABLE] && !once++) - FIXME("Non-point sprite points not supported in core profile.\n"); -} - static void glsl_vertex_pipe_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -11964,9 +11954,6 @@ static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] = {STATE_RENDER(WINED3D_RS_CLIPPLANEENABLE), {STATE_RENDER(WINED3D_RS_CLIPPING), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSIZE), {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), glsl_vertex_pipe_pointsize}, WINED3D_GL_EXT_NONE }, - {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite }, ARB_POINT_SPRITE }, - {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite_w }, WINED3D_GL_LEGACY_CONTEXT }, - {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), glsl_vertex_pointsprite_core}, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSIZE_MAX), {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), glsl_vertex_pipe_shademode}, WINED3D_GLSL_130 }, {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), glsl_vertex_pipe_nop }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 710d3ce32fd..beff7c216c4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4125,10 +4125,6 @@ void state_clipping(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id); void clipplane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id); -void state_pointsprite_w(struct wined3d_context *context, - const struct wined3d_state *state, DWORD state_id); -void state_pointsprite(struct wined3d_context *context, - const struct wined3d_state *state, DWORD state_id); void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id);