Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/device.c | 10 ++-------- dlls/wined3d/stateblock.c | 2 +- dlls/wined3d/wined3d_private.h | 4 +--- 3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7340488d7c89..d57758d32abd 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1757,7 +1757,7 @@ HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device, { TRACE("device %p, plane_idx %u, plane %p.\n", device, plane_idx, plane);
- if (plane_idx >= WINED3D_MAX_USER_CLIP_PLANES) + if (plane_idx >= device->adapter->gl_info.limits.user_clip_distances) { TRACE("Application has requested clipplane this device doesn't support.\n"); return WINED3DERR_INVALIDCALL; @@ -1774,12 +1774,6 @@ HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device,
device->update_state->clip_planes[plane_idx] = *plane;
- if (plane_idx >= device->adapter->gl_info.limits.user_clip_distances) - { - WARN("Clip plane %u is not supported.\n", plane_idx); - return WINED3D_OK; - } - if (!device->recording) wined3d_cs_emit_set_clip_plane(device->cs, plane_idx, plane);
@@ -1791,7 +1785,7 @@ HRESULT CDECL wined3d_device_get_clip_plane(const struct wined3d_device *device, { TRACE("device %p, plane_idx %u, plane %p.\n", device, plane_idx, plane);
- if (plane_idx >= WINED3D_MAX_USER_CLIP_PLANES) + if (plane_idx >= device->adapter->gl_info.limits.user_clip_distances) { TRACE("Application has requested clipplane this device doesn't support.\n"); return WINED3DERR_INVALIDCALL; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index f80b8750b4f8..9d613605b980 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -218,7 +218,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states, stateblock_set_bits(states->renderState, WINEHIGHEST_RENDER_STATE + 1); for (i = 0; i < MAX_TEXTURES; ++i) states->textureState[i] = 0x3ffff; for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = 0x3ffe; - states->clipplane = 0xffffffff; + states->clipplane = (1u << MAX_CLIP_DISTANCES) - 1; states->pixelShaderConstantsB = 0xffff; states->pixelShaderConstantsI = 0xffff; states->vertexShaderConstantsB = 0xffff; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6f1328084b84..5b75c6f95ce4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -259,8 +259,6 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup return complex_fixup; }
-#define WINED3D_MAX_USER_CLIP_PLANES 32 - /* Device caps */ #define MAX_STREAMS 16 #define MAX_TEXTURES 8 @@ -2829,7 +2827,7 @@ struct wined3d_state DWORD texture_states[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1]; - struct wined3d_vec4 clip_planes[WINED3D_MAX_USER_CLIP_PLANES]; + struct wined3d_vec4 clip_planes[MAX_CLIP_DISTANCES]; struct wined3d_material material; struct wined3d_viewport viewport; RECT scissor_rect;