mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Added patch to ignore invalid render states in wined3d_device_set_render_state.
This commit is contained in:
parent
90dc2c0daa
commit
541375be89
@ -316,6 +316,7 @@ patch_enable_all ()
|
||||
enable_wined3d_CSMT_Main="$1"
|
||||
enable_wined3d_DXTn="$1"
|
||||
enable_wined3d_Geforce_425M="$1"
|
||||
enable_wined3d_Invalid_Render_States="$1"
|
||||
enable_wined3d_MESA_GPU_Info="$1"
|
||||
enable_wined3d_Multisampling="$1"
|
||||
enable_wined3d_Revert_PixelFormat="$1"
|
||||
@ -1071,6 +1072,9 @@ patch_enable ()
|
||||
wined3d-Geforce_425M)
|
||||
enable_wined3d_Geforce_425M="$2"
|
||||
;;
|
||||
wined3d-Invalid_Render_States)
|
||||
enable_wined3d_Invalid_Render_States="$2"
|
||||
;;
|
||||
wined3d-MESA_GPU_Info)
|
||||
enable_wined3d_MESA_GPU_Info="$2"
|
||||
;;
|
||||
@ -6038,6 +6042,21 @@ if test "$enable_wined3d_Geforce_425M" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-Invalid_Render_States
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#33988] Ignore invalid render states in wined3d_device_set_render_state
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/device.c
|
||||
# |
|
||||
if test "$enable_wined3d_Invalid_Render_States" -eq 1; then
|
||||
patch_apply wined3d-Invalid_Render_States/0001-wined3d-Ignore-invalid-render-states.patch
|
||||
(
|
||||
echo '+ { "Józef Kucia", "wined3d: Ignore invalid render states.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-MESA_GPU_Info
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
|
@ -2642,7 +2642,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
return;
|
||||
|
||||
wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT);
|
||||
@@ -2281,7 +2491,11 @@
|
||||
@@ -2288,7 +2498,11 @@
|
||||
return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx];
|
||||
}
|
||||
|
||||
@ -2654,7 +2654,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
{
|
||||
UINT i;
|
||||
|
||||
@@ -2314,8 +2528,12 @@
|
||||
@@ -2321,8 +2535,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2667,7 +2667,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2362,8 +2580,12 @@
|
||||
@@ -2369,8 +2587,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2680,7 +2680,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2414,8 +2636,13 @@
|
||||
@@ -2421,8 +2643,13 @@
|
||||
memset(device->recording->changed.vertexShaderConstantsF + start_register, 1,
|
||||
sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count);
|
||||
else
|
||||
@ -2694,7 +2694,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -2550,8 +2777,12 @@
|
||||
@@ -2557,8 +2784,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2707,7 +2707,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2598,8 +2829,12 @@
|
||||
@@ -2605,8 +2836,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2720,7 +2720,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2651,8 +2886,12 @@
|
||||
@@ -2658,8 +2893,12 @@
|
||||
memset(device->recording->changed.pixelShaderConstantsF + start_register, 1,
|
||||
sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count);
|
||||
else
|
||||
@ -2733,7 +2733,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -2812,6 +3051,7 @@
|
||||
@@ -2819,6 +3058,7 @@
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -2741,7 +2741,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (wined3d_settings.cs_multithreaded)
|
||||
{
|
||||
FIXME("Waiting for cs.\n");
|
||||
@@ -2819,6 +3059,7 @@
|
||||
@@ -2826,6 +3066,7 @@
|
||||
device->cs->ops->finish(device->cs);
|
||||
}
|
||||
|
||||
@ -2749,7 +2749,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat);
|
||||
wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat);
|
||||
wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat);
|
||||
@@ -3304,6 +3545,10 @@
|
||||
@@ -3311,6 +3552,10 @@
|
||||
|
||||
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
|
||||
{
|
||||
@ -2760,7 +2760,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
TRACE("device %p.\n", device);
|
||||
|
||||
if (!device->inScene)
|
||||
@@ -3312,6 +3557,15 @@
|
||||
@@ -3319,6 +3564,15 @@
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -2776,7 +2776,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
device->inScene = FALSE;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -3319,8 +3573,10 @@
|
||||
@@ -3326,8 +3580,10 @@
|
||||
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
|
||||
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
|
||||
{
|
||||
@ -2787,7 +2787,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n",
|
||||
device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil);
|
||||
|
||||
@@ -3329,12 +3585,19 @@
|
||||
@@ -3336,12 +3592,19 @@
|
||||
WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects);
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@ -2807,7 +2807,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (!ds)
|
||||
{
|
||||
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
|
||||
@@ -3343,8 +3606,13 @@
|
||||
@@ -3350,8 +3613,13 @@
|
||||
}
|
||||
else if (flags & WINED3DCLEAR_TARGET)
|
||||
{
|
||||
@ -2821,7 +2821,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
{
|
||||
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
|
||||
return WINED3D_OK;
|
||||
@@ -3390,6 +3658,9 @@
|
||||
@@ -3397,6 +3665,9 @@
|
||||
enum wined3d_primitive_type primitive_type)
|
||||
{
|
||||
GLenum gl_primitive_type, prev;
|
||||
@ -2831,7 +2831,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type));
|
||||
|
||||
gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
|
||||
@@ -3397,8 +3668,13 @@
|
||||
@@ -3404,8 +3675,13 @@
|
||||
device->update_state->gl_primitive_type = gl_primitive_type;
|
||||
if (device->recording)
|
||||
device->recording->changed.primitive_type = TRUE;
|
||||
@ -2845,7 +2845,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device,
|
||||
@@ -3421,6 +3697,14 @@
|
||||
@@ -3428,6 +3704,14 @@
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -2860,7 +2860,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -3437,6 +3721,10 @@
|
||||
@@ -3444,6 +3728,10 @@
|
||||
|
||||
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
|
||||
{
|
||||
@ -2871,7 +2871,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
|
||||
|
||||
if (!device->state.index_buffer)
|
||||
@@ -3455,6 +3743,15 @@
|
||||
@@ -3462,6 +3750,15 @@
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -2887,7 +2887,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -3470,6 +3767,7 @@
|
||||
@@ -3477,6 +3774,7 @@
|
||||
}
|
||||
|
||||
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
|
||||
@ -2895,7 +2895,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
static void device_update_volume(struct wined3d_context *context,
|
||||
struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume)
|
||||
{
|
||||
@@ -3506,6 +3804,88 @@
|
||||
@@ -3513,6 +3811,88 @@
|
||||
{
|
||||
enum wined3d_resource_type type = src_texture->resource.type;
|
||||
unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0;
|
||||
@ -2984,7 +2984,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
level_count = min(wined3d_texture_get_level_count(src_texture),
|
||||
wined3d_texture_get_level_count(dst_texture));
|
||||
@@ -3524,7 +3904,13 @@
|
||||
@@ -3531,7 +3911,13 @@
|
||||
}
|
||||
|
||||
/* Make sure that the destination texture is loaded. */
|
||||
@ -2998,7 +2998,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
/* Update every surface level of the texture. */
|
||||
switch (type)
|
||||
@@ -3539,7 +3925,16 @@
|
||||
@@ -3546,7 +3932,16 @@
|
||||
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture,
|
||||
i + src_skip_levels));
|
||||
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
|
||||
@ -3015,7 +3015,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3559,7 +3954,16 @@
|
||||
@@ -3566,7 +3961,16 @@
|
||||
i * src_levels + j + src_skip_levels));
|
||||
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture,
|
||||
i * dst_levels + j));
|
||||
@ -3032,7 +3032,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3569,6 +3973,7 @@
|
||||
@@ -3576,6 +3980,7 @@
|
||||
{
|
||||
for (i = 0; i < level_count; ++i)
|
||||
{
|
||||
@ -3040,7 +3040,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
device_update_volume(context,
|
||||
volume_from_resource(wined3d_texture_get_sub_resource(src_texture,
|
||||
i + src_skip_levels)),
|
||||
@@ -3622,6 +4027,25 @@
|
||||
@@ -3629,6 +4034,25 @@
|
||||
}
|
||||
|
||||
wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture);
|
||||
@ -3066,7 +3066,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -3671,8 +4095,13 @@
|
||||
@@ -3678,8 +4102,13 @@
|
||||
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|
||||
|| state->render_states[WINED3D_RS_STENCILENABLE])
|
||||
{
|
||||
@ -3080,7 +3080,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
|
||||
{
|
||||
@@ -3771,6 +4200,7 @@
|
||||
@@ -3778,6 +4207,7 @@
|
||||
struct wined3d_surface *src_surface, const RECT *src_rect,
|
||||
struct wined3d_surface *dst_surface, const POINT *dst_point)
|
||||
{
|
||||
@ -3088,7 +3088,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
const struct wined3d_format *src_format = src_surface->resource.format;
|
||||
const struct wined3d_format *dst_format = dst_surface->resource.format;
|
||||
UINT update_w, update_h;
|
||||
@@ -3778,6 +4208,7 @@
|
||||
@@ -3785,6 +4215,7 @@
|
||||
RECT r, dst_rect;
|
||||
POINT p;
|
||||
|
||||
@ -3096,7 +3096,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n",
|
||||
device, src_surface, wine_dbgstr_rect(src_rect),
|
||||
dst_surface, wine_dbgstr_point(dst_point));
|
||||
@@ -3789,6 +4220,7 @@
|
||||
@@ -3796,6 +4227,7 @@
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -3104,7 +3104,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (src_format->id != dst_format->id)
|
||||
{
|
||||
WARN("Source and destination surfaces should have the same format.\n");
|
||||
@@ -3853,6 +4285,9 @@
|
||||
@@ -3860,6 +4292,9 @@
|
||||
wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point);
|
||||
|
||||
return WINED3D_OK;
|
||||
@ -3114,7 +3114,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
|
||||
@@ -4007,7 +4442,17 @@
|
||||
@@ -4014,7 +4449,17 @@
|
||||
unsigned int depth_pitch)
|
||||
{
|
||||
struct wined3d_resource *sub_resource;
|
||||
@ -3132,7 +3132,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n",
|
||||
device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
|
||||
@@ -4041,7 +4486,14 @@
|
||||
@@ -4048,7 +4493,14 @@
|
||||
WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
|
||||
return;
|
||||
}
|
||||
@ -3147,7 +3147,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (box)
|
||||
{
|
||||
if (box->left >= box->right || box->right > sub_resource->width
|
||||
@@ -4051,9 +4503,47 @@
|
||||
@@ -4058,9 +4510,47 @@
|
||||
box->left, box->top, box->front, box->right, box->bottom, box->back);
|
||||
return;
|
||||
}
|
||||
@ -3195,7 +3195,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
|
||||
@@ -4084,8 +4574,14 @@
|
||||
@@ -4091,8 +4581,14 @@
|
||||
rect = &r;
|
||||
}
|
||||
|
||||
@ -3210,7 +3210,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
|
||||
@@ -4099,6 +4595,7 @@
|
||||
@@ -4106,6 +4602,7 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -3218,7 +3218,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
return device->state.fb.render_targets[view_idx];
|
||||
}
|
||||
|
||||
@@ -4114,6 +4611,22 @@
|
||||
@@ -4121,6 +4618,22 @@
|
||||
{
|
||||
struct wined3d_rendertarget_view *prev;
|
||||
struct wined3d_fb_state *fb = &device->state.fb;
|
||||
@ -3241,7 +3241,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
|
||||
device, view_idx, view, set_viewport);
|
||||
@@ -4153,6 +4666,7 @@
|
||||
@@ -4160,6 +4673,7 @@
|
||||
}
|
||||
|
||||
|
||||
@ -3249,7 +3249,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
prev = fb->render_targets[view_idx];
|
||||
if (view == prev)
|
||||
return WINED3D_OK;
|
||||
@@ -4160,6 +4674,15 @@
|
||||
@@ -4167,6 +4681,15 @@
|
||||
if (view)
|
||||
wined3d_rendertarget_view_incref(view);
|
||||
fb->render_targets[view_idx] = view;
|
||||
@ -3265,7 +3265,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
|
||||
/* Release after the assignment, to prevent device_resource_released()
|
||||
* from seeing the surface as still in use. */
|
||||
@@ -4171,6 +4694,7 @@
|
||||
@@ -4178,6 +4701,7 @@
|
||||
|
||||
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
|
||||
{
|
||||
@ -3273,7 +3273,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
struct wined3d_fb_state *fb = &device->state.fb;
|
||||
struct wined3d_rendertarget_view *prev;
|
||||
|
||||
@@ -4188,6 +4712,66 @@
|
||||
@@ -4195,6 +4719,66 @@
|
||||
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
|
||||
if (prev)
|
||||
wined3d_rendertarget_view_decref(prev);
|
||||
@ -3340,7 +3340,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device,
|
||||
@@ -4208,6 +4792,14 @@
|
||||
@@ -4215,6 +4799,14 @@
|
||||
|
||||
cursor_image = surface_from_resource(sub_resource);
|
||||
|
||||
@ -3355,7 +3355,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
|
||||
{
|
||||
WARN("Surface %p has an invalid format %s.\n",
|
||||
@@ -4235,6 +4827,13 @@
|
||||
@@ -4242,6 +4834,13 @@
|
||||
* release it after setting the cursor image. Windows doesn't
|
||||
* addref the set surface, so we can't do this either without
|
||||
* creating circular refcount dependencies. */
|
||||
@ -3369,7 +3369,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32)
|
||||
{
|
||||
@@ -4339,6 +4938,12 @@
|
||||
@@ -4346,6 +4945,12 @@
|
||||
else
|
||||
SetCursor(NULL);
|
||||
}
|
||||
@ -3382,7 +3382,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
return oldVisible;
|
||||
}
|
||||
@@ -4349,8 +4954,10 @@
|
||||
@@ -4356,8 +4961,10 @@
|
||||
|
||||
TRACE("device %p.\n", device);
|
||||
|
||||
@ -3393,7 +3393,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
|
||||
{
|
||||
TRACE("Checking resource %p for eviction.\n", resource);
|
||||
@@ -4358,6 +4965,7 @@
|
||||
@@ -4365,6 +4972,7 @@
|
||||
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
|
||||
{
|
||||
TRACE("Evicting %p.\n", resource);
|
||||
@ -3401,7 +3401,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_cs_emit_evict_resource(device->cs, resource);
|
||||
}
|
||||
}
|
||||
@@ -4376,6 +4984,37 @@
|
||||
@@ -4383,6 +4991,37 @@
|
||||
|
||||
context = context_acquire(device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
@ -3439,7 +3439,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
if (device->depth_blt_texture)
|
||||
{
|
||||
@@ -4397,6 +5036,7 @@
|
||||
@@ -4404,6 +5043,7 @@
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, swapchain->context);
|
||||
swapchain->context = NULL;
|
||||
@ -3447,7 +3447,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
swapchain->num_contexts = 0;
|
||||
}
|
||||
|
||||
@@ -4416,6 +5056,14 @@
|
||||
@@ -4423,6 +5063,14 @@
|
||||
|
||||
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
@ -3462,7 +3462,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
HRESULT hr;
|
||||
|
||||
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
|
||||
@@ -4432,6 +5080,7 @@
|
||||
@@ -4439,6 +5087,7 @@
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -3470,7 +3470,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
@@ -4442,6 +5091,35 @@
|
||||
@@ -4449,6 +5098,35 @@
|
||||
}
|
||||
|
||||
wined3d_cs_emit_create_dummy_textures(device->cs);
|
||||
@ -3506,7 +3506,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -4460,9 +5138,11 @@
|
||||
@@ -4467,9 +5145,11 @@
|
||||
TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n",
|
||||
device, swapchain_desc, mode, callback, reset_state);
|
||||
|
||||
@ -3518,7 +3518,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (!(swapchain = wined3d_device_get_swapchain(device, 0)))
|
||||
{
|
||||
ERR("Failed to get the first implicit swapchain.\n");
|
||||
@@ -4477,9 +5157,21 @@
|
||||
@@ -4484,9 +5164,21 @@
|
||||
wined3d_texture_decref(device->logo_texture);
|
||||
device->logo_texture = NULL;
|
||||
}
|
||||
@ -3540,7 +3540,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
{
|
||||
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
|
||||
{
|
||||
@@ -4488,6 +5180,7 @@
|
||||
@@ -4495,6 +5187,7 @@
|
||||
}
|
||||
wined3d_device_set_depth_stencil_view(device, NULL);
|
||||
|
||||
@ -3548,7 +3548,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (reset_state)
|
||||
{
|
||||
state_unbind_resources(&device->state);
|
||||
@@ -4497,6 +5190,12 @@
|
||||
@@ -4504,6 +5197,12 @@
|
||||
{
|
||||
wined3d_texture_decref(device->cs->onscreen_depth_stencil->container);
|
||||
device->cs->onscreen_depth_stencil = NULL;
|
||||
@ -3561,7 +3561,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
if (reset_state)
|
||||
@@ -4509,6 +5208,7 @@
|
||||
@@ -4516,6 +5215,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -3569,7 +3569,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
/* Free implicit resources and wait for the command stream before modifying
|
||||
* swapchain parameters. After modifying the swapchain parameters a new GL
|
||||
* context may be acquired by the worker thread. This causes problems in the
|
||||
@@ -4530,6 +5230,7 @@
|
||||
@@ -4537,6 +5237,7 @@
|
||||
}
|
||||
device->cs->ops->finish(device->cs);
|
||||
|
||||
@ -3577,7 +3577,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
TRACE("New params:\n");
|
||||
TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width);
|
||||
TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height);
|
||||
@@ -4656,6 +5357,13 @@
|
||||
@@ -4663,6 +5364,13 @@
|
||||
swapchain_desc->multisample_type, swapchain_desc->multisample_quality)))
|
||||
return hr;
|
||||
|
||||
@ -3591,7 +3591,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (swapchain->desc.enable_auto_depth_stencil)
|
||||
{
|
||||
struct wined3d_resource_desc texture_desc;
|
||||
@@ -4698,6 +5406,13 @@
|
||||
@@ -4705,6 +5413,13 @@
|
||||
wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view);
|
||||
}
|
||||
|
||||
@ -3605,7 +3605,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface(
|
||||
surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)),
|
||||
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
|
||||
@@ -4718,12 +5433,20 @@
|
||||
@@ -4725,12 +5440,20 @@
|
||||
}
|
||||
wined3d_cs_emit_reset_state(device->cs);
|
||||
state_cleanup(&device->state);
|
||||
@ -3626,7 +3626,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
|
||||
ERR("Failed to initialize device state, hr %#x.\n", hr);
|
||||
device->update_state = &device->state;
|
||||
@@ -4732,6 +5455,7 @@
|
||||
@@ -4739,6 +5462,7 @@
|
||||
}
|
||||
else if (device->back_buffer_view)
|
||||
{
|
||||
@ -3634,7 +3634,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
struct wined3d_state *state = &device->state;
|
||||
|
||||
wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE);
|
||||
@@ -4747,6 +5471,24 @@
|
||||
@@ -4754,6 +5478,24 @@
|
||||
state->scissor_rect.left = 0;
|
||||
state->scissor_rect.right = swapchain->desc.backbuffer_width;
|
||||
state->scissor_rect.bottom = swapchain->desc.backbuffer_height;
|
||||
@ -3659,7 +3659,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
|
||||
}
|
||||
|
||||
@@ -4822,6 +5564,10 @@
|
||||
@@ -4829,6 +5571,10 @@
|
||||
|
||||
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
|
||||
|
||||
@ -3670,7 +3670,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
switch (type)
|
||||
{
|
||||
case WINED3D_RTYPE_SURFACE:
|
||||
@@ -4832,6 +5578,7 @@
|
||||
@@ -4839,6 +5585,7 @@
|
||||
|
||||
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
|
||||
{
|
||||
@ -3678,7 +3678,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface)
|
||||
{
|
||||
ERR("Surface %p is still in use as render target %u.\n", surface, i);
|
||||
@@ -4843,6 +5590,19 @@
|
||||
@@ -4850,6 +5597,19 @@
|
||||
{
|
||||
ERR("Surface %p is still in use as depth/stencil buffer.\n", surface);
|
||||
device->state.fb.depth_stencil = NULL;
|
||||
@ -3698,7 +3698,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -5005,7 +5765,11 @@
|
||||
@@ -5012,7 +5772,11 @@
|
||||
|
||||
device->blitter = adapter->blitter;
|
||||
|
||||
@ -3710,7 +3710,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
|
||||
{
|
||||
ERR("Failed to initialize device state, hr %#x.\n", hr);
|
||||
@@ -5104,6 +5868,7 @@
|
||||
@@ -5111,6 +5875,7 @@
|
||||
else
|
||||
return CallWindowProcA(proc, window, message, wparam, lparam);
|
||||
}
|
||||
@ -3718,7 +3718,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
|
||||
/* Context activation is done by the caller */
|
||||
struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
|
||||
@@ -5157,3 +5922,4 @@
|
||||
@@ -5164,3 +5929,4 @@
|
||||
|
||||
wined3d_device_destroy_bo(device, context, bo);
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 7543fa04f189e57eb56c7d697920342e8f28b0de Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B3zef=20Kucia?= <jkucia@codeweavers.com>
|
||||
Date: Sun, 10 Jan 2016 17:59:00 +0100
|
||||
Subject: wined3d: Ignore invalid render states.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 7c5a4c2..b0f4bf4 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -2027,10 +2027,17 @@ static void resolve_depth_buffer(struct wined3d_state *state)
|
||||
void CDECL wined3d_device_set_render_state(struct wined3d_device *device,
|
||||
enum wined3d_render_state state, DWORD value)
|
||||
{
|
||||
- DWORD old_value = device->state.render_states[state];
|
||||
+ DWORD old_value;
|
||||
|
||||
TRACE("device %p, state %s (%#x), value %#x.\n", device, debug_d3drenderstate(state), state, value);
|
||||
|
||||
+ if (state > WINEHIGHEST_RENDER_STATE)
|
||||
+ {
|
||||
+ WARN("Ignoring unrecognized render state %#x, value %#x.\n", state, value);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ old_value = device->state.render_states[state];
|
||||
device->update_state->render_states[state] = value;
|
||||
|
||||
/* Handle recording of state blocks. */
|
||||
--
|
||||
2.6.4
|
||||
|
1
patches/wined3d-Invalid_Render_States/definition
Normal file
1
patches/wined3d-Invalid_Render_States/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: [33988] Ignore invalid render states in wined3d_device_set_render_state
|
Loading…
Reference in New Issue
Block a user