Commit a27adc47 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Update the vertex shader when the clipplanes are changed.

parent 67320c44
......@@ -484,13 +484,33 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru
}
}
static void shaderconstant(DWORD state_id, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
const struct wined3d_state *state = &stateblock->state;
struct wined3d_device *device = stateblock->device;
/* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them
* has an update pending
*/
if(isStateDirty(context, STATE_VDECL) ||
isStateDirty(context, STATE_PIXELSHADER)) {
return;
}
device->shader_backend->shader_load_constants(context, use_ps(state), use_vs(state));
}
static void state_clipping(DWORD state_id, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
const struct wined3d_state *state = &stateblock->state;
DWORD enable = 0xFFFFFFFF;
DWORD disable = 0x00000000;
if (!stateblock->device->vs_clipping && use_vs(state))
if (use_vs(state))
{
const struct wined3d_device *device = stateblock->device;
if (!device->vs_clipping)
{
/* The spec says that opengl clipping planes are disabled when using shaders. Direct3D planes aren't,
* so that is an issue. The MacOS ATI driver keeps clipping planes activated with shaders in some
......@@ -508,6 +528,17 @@ static void state_clipping(DWORD state_id, struct wined3d_stateblock *stateblock
return;
}
/* glEnable(GL_CLIP_PLANEx) doesn't apply to vertex shaders. The enabled / disabled planes are
* hardcoded into the shader. Update the shader to update the enabled clipplanes */
if (!isStateDirty(context, device->StateTable[STATE_VSHADER].representative))
{
device->shader_backend->shader_select(context, use_ps(state), TRUE);
if (!isStateDirty(context, STATE_VERTEXSHADERCONSTANT)) {
shaderconstant(STATE_VERTEXSHADERCONSTANT, stateblock, context);
}
}
}
/* TODO: Keep track of previously enabled clipplanes to avoid unnecessary resetting
* of already set values
*/
......@@ -3460,22 +3491,6 @@ static void tex_coordindex(DWORD state, struct wined3d_stateblock *stateblock, s
}
}
static void shaderconstant(DWORD state_id, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
const struct wined3d_state *state = &stateblock->state;
struct wined3d_device *device = stateblock->device;
/* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them
* has an update pending
*/
if(isStateDirty(context, STATE_VDECL) ||
isStateDirty(context, STATE_PIXELSHADER)) {
return;
}
device->shader_backend->shader_load_constants(context, use_ps(state), use_vs(state));
}
static void tex_bumpenvlscale(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
......
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