From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/device.c | 12 ++++++++---- dlls/wined3d/stateblock.c | 19 ++++++++----------- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d06ac9c5ee6..63398e50de7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1926,10 +1926,7 @@ void CDECL wined3d_device_set_viewports(struct wined3d_device *device, unsigned }
if (viewport_count) - memcpy(device->update_state->viewports, viewports, viewport_count * sizeof(*viewports)); - else - memset(device->update_state->viewports, 0, sizeof(device->update_state->viewports)); - device->update_state->viewport_count = viewport_count; + device->update_stateblock_state->viewport = viewports[0];
/* Handle recording of state blocks */ if (device->recording) @@ -1939,6 +1936,12 @@ void CDECL wined3d_device_set_viewports(struct wined3d_device *device, unsigned return; }
+ if (viewport_count) + memcpy(device->state.viewports, viewports, viewport_count * sizeof(*viewports)); + else + memset(device->state.viewports, 0, sizeof(device->state.viewports)); + device->state.viewport_count = viewport_count; + wined3d_cs_emit_set_viewports(device->cs, viewport_count, viewports); }
@@ -4523,6 +4526,7 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device state->viewports[0].max_z = 1.0f; state->viewport_count = 1; wined3d_cs_emit_set_viewports(device->cs, 1, state->viewports); + device->stateblock_state.viewport = state->viewports[0];
SetRect(&state->scissor_rects[0], 0, 0, view->width, view->height); state->scissor_rect_count = 1; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index cf4f7d1fc00..84f56c959ba 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -830,19 +830,12 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) stateblock->stateblock_state.material = state->material; }
- assert(src_state->viewport_count <= 1); - if (stateblock->changed.viewport - && (src_state->viewport_count != stateblock->state.viewport_count - || memcmp(src_state->viewports, stateblock->state.viewports, - src_state->viewport_count * sizeof(*stateblock->state.viewports)))) + && memcmp(&state->viewport, &stateblock->stateblock_state.viewport, sizeof(state->viewport))) { - TRACE("Updating viewports.\n"); + TRACE("Updating viewport.\n");
- if ((stateblock->state.viewport_count = src_state->viewport_count)) - memcpy(stateblock->state.viewports, src_state->viewports, sizeof(src_state->viewports)); - else - memset(stateblock->state.viewports, 0, sizeof(*stateblock->state.viewports)); + stateblock->stateblock_state.viewport = state->viewport; }
if (stateblock->changed.scissorRect @@ -1134,7 +1127,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) }
if (stateblock->changed.viewport) - wined3d_device_set_viewports(device, stateblock->state.viewport_count, stateblock->state.viewports); + { + state->viewport = stateblock->stateblock_state.viewport; + + wined3d_device_set_viewports(device, 1, &stateblock->stateblock_state.viewport); + }
if (stateblock->changed.scissorRect) wined3d_device_set_scissor_rects(device, stateblock->state.scissor_rect_count, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6091d211c13..9dd880c7a8c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2989,6 +2989,7 @@ struct wined3d_stateblock_state struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1]; struct wined3d_vec4 clip_planes[MAX_CLIP_DISTANCES]; struct wined3d_material material; + struct wined3d_viewport viewport; };
struct wined3d_device
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47219
Your paranoid android.
=== debian9 (build log) ===
error: patch failed: dlls/wined3d/stateblock.c:830 error: patch failed: dlls/wined3d/wined3d_private.h:2989 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: dlls/wined3d/stateblock.c:830 error: patch failed: dlls/wined3d/wined3d_private.h:2989 Task: Patch failed to apply