Commit 28343db2 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Don't use the builtin FFP uniforms for the lights.

While at it, use D3D-like uniforms for the light parameters and (consequently) implement range and proper D3D spotlights support.
parent e226e759
......@@ -74,7 +74,7 @@ static void state_fillmode(struct wined3d_context *context, const struct wined3d
}
}
void state_lighting(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void state_lighting(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
......@@ -257,7 +257,7 @@ static void state_zfunc(struct wined3d_context *context, const struct wined3d_st
checkGLcall("glDepthFunc");
}
void state_ambient(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void state_ambient(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
float col[4];
......@@ -624,7 +624,7 @@ void state_clipping(struct wined3d_context *context, const struct wined3d_state
checkGLcall("clip plane disable");
}
void state_specularenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void state_specularenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
......@@ -1393,7 +1393,7 @@ static void state_linepattern(struct wined3d_context *context, const struct wine
}
}
void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
......@@ -4700,7 +4700,7 @@ static void viewport_vertexpart(struct wined3d_context *context, const struct wi
context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POS_FIXUP;
}
void light(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void light(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
UINT Index = state_id - STATE_ACTIVELIGHT(0);
......
......@@ -310,8 +310,9 @@ enum wined3d_shader_resource_type
#define WINED3D_SHADER_CONST_FFP_PROJ 0x00000800
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX 0x00001000
#define WINED3D_SHADER_CONST_FFP_MATERIAL 0x00002000
#define WINED3D_SHADER_CONST_FFP_PS 0x00004000
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY 0x00008000
#define WINED3D_SHADER_CONST_FFP_LIGHTS 0x00004000
#define WINED3D_SHADER_CONST_FFP_PS 0x00008000
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY 0x00010000
enum wined3d_shader_register_type
{
......@@ -2830,14 +2831,8 @@ void state_nop(struct wined3d_context *context,
void state_srgbwrite(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_specularenable(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_ambient(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_clipping(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void light(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void clipplane(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_psizemin_w(struct wined3d_context *context,
......@@ -2852,10 +2847,6 @@ void state_pointsprite(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_pscale(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_lighting(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void state_normalize(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
BOOL getColorBits(const struct wined3d_format *format,
BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) DECLSPEC_HIDDEN;
......
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