Commit 36520c3e authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Introduce a get_pointsize_minmax() function.

parent b551da8e
......@@ -1419,67 +1419,39 @@ static void state_normalize(struct wined3d_context *context, const struct wined3
void state_psizemin_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
union {
DWORD d;
float f;
} tmpvalue;
float min, max;
tmpvalue.d = state->render_states[WINED3D_RS_POINTSIZE_MIN];
if (tmpvalue.f != 1.0f)
{
FIXME("WINED3D_RS_POINTSIZE_MIN not supported on this opengl, value is %f\n", tmpvalue.f);
}
tmpvalue.d = state->render_states[WINED3D_RS_POINTSIZE_MAX];
if (tmpvalue.f != 64.0f)
{
FIXME("WINED3D_RS_POINTSIZE_MAX not supported on this opengl, value is %f\n", tmpvalue.f);
}
get_pointsize_minmax(context, state, &min, &max);
if (min != 1.0f)
FIXME("WINED3D_RS_POINTSIZE_MIN value %.8e not supported on this OpenGL implementation.\n", min);
if (max != 64.0f)
FIXME("WINED3D_RS_POINTSIZE_MAX value %.8e not supported on this OpenGL implementation.\n", max);
}
void state_psizemin_ext(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
union
{
DWORD d;
float f;
} min, max;
float min, max;
min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN];
max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX];
get_pointsize_minmax(context, state, &min, &max);
/* Max point size trumps min point size */
if(min.f > max.f) {
min.f = max.f;
}
GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, min.f);
GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, min);
checkGLcall("glPointParameterfEXT(...)");
GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, max.f);
GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, max);
checkGLcall("glPointParameterfEXT(...)");
}
void state_psizemin_arb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
union
{
DWORD d;
float f;
} min, max;
float min, max;
min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN];
max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX];
/* Max point size trumps min point size */
if(min.f > max.f) {
min.f = max.f;
}
get_pointsize_minmax(context, state, &min, &max);
GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MIN_ARB, min.f);
GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MIN_ARB, min);
checkGLcall("glPointParameterfARB(...)");
GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MAX_ARB, max.f);
GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MAX_ARB, max);
checkGLcall("glPointParameterfARB(...)");
}
......
......@@ -3603,6 +3603,25 @@ void get_texture_matrix(const struct wined3d_context *context, const struct wine
}
}
void get_pointsize_minmax(const struct wined3d_context *context, const struct wined3d_state *state,
float *out_min, float *out_max)
{
union
{
DWORD d;
float f;
} min, max;
min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN];
max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX];
if (min.f > max.f)
min.f = max.f;
*out_min = min.f;
*out_max = max.f;
}
/* This small helper function is used to convert a bitmask into the number of masked bits */
unsigned int count_bits(unsigned int mask)
{
......
......@@ -3070,6 +3070,8 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
void get_texture_matrix(const struct wined3d_context *context, const struct wined3d_state *state,
unsigned int tex, struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
void get_pointsize_minmax(const struct wined3d_context *context, const struct wined3d_state *state,
float *out_min, float *out_max) DECLSPEC_HIDDEN;
/* Using additional shader constants (uniforms in GLSL / program environment
* or local parameters in ARB) is costly:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment