diff --git a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch b/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch index 8127747b..8dd9c81f 100644 --- a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch +++ b/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch @@ -1,4 +1,4 @@ -From 449bdd36396ceefa6340fb06d462c26b05ee6d9d Mon Sep 17 00:00:00 2001 +From eb0dad546308d183c995eb43200e6eacd10e0980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 20 Dec 2012 13:09:17 +0100 Subject: wined3d: Move the framebuffer into wined3d_state @@ -11,16 +11,16 @@ Subject: wined3d: Move the framebuffer into wined3d_state dlls/wined3d/drawprim.c | 14 ++--- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 2 +- - dlls/wined3d/state.c | 18 +++--- + dlls/wined3d/state.c | 20 +++---- dlls/wined3d/stateblock.c | 45 +++++++++++++-- dlls/wined3d/surface.c | 2 +- dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/utils.c | 2 +- dlls/wined3d/wined3d_private.h | 46 +++++++++++---- - 13 files changed, 170 insertions(+), 125 deletions(-) + 13 files changed, 171 insertions(+), 126 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index f7bea42..9f29aa4 100644 +index 4bc4d3b..0f95f28 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -706,7 +706,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, @@ -42,7 +42,7 @@ index f7bea42..9f29aa4 100644 } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 39f7d8c..9e2adfc 100644 +index c08e0ce..ba546f5 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1448,6 +1448,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, @@ -119,7 +119,7 @@ index 39f7d8c..9e2adfc 100644 } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -2962,7 +2974,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de +@@ -3030,7 +3042,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de { const struct wined3d_state *state = &device->state; const struct StateEntry *state_table = context->state_table; @@ -129,7 +129,7 @@ index 39f7d8c..9e2adfc 100644 WORD map; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b8a32e5..7bebe80 100644 +index 4a04b00..408e9b5 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -280,7 +280,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) @@ -168,7 +168,7 @@ index b8a32e5..7bebe80 100644 if (!prev != !op->view) { -@@ -893,7 +893,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -896,7 +896,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) state_cleanup(&cs->state); memset(&cs->state, 0, sizeof(cs->state)); @@ -177,7 +177,7 @@ index b8a32e5..7bebe80 100644 WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize CS state, hr %#x.\n", hr); } -@@ -975,17 +975,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -978,17 +978,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) return NULL; @@ -196,7 +196,7 @@ index b8a32e5..7bebe80 100644 HeapFree(GetProcessHeap(), 0, cs); return NULL; } -@@ -1006,7 +998,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1009,7 +1001,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) void wined3d_cs_destroy(struct wined3d_cs *cs) { state_cleanup(&cs->state); @@ -205,7 +205,7 @@ index b8a32e5..7bebe80 100644 HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 9f09736..1e4eb0f 100644 +index 22cf4b5..c3eedbd 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -860,7 +860,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi @@ -243,7 +243,7 @@ index 9f09736..1e4eb0f 100644 HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1061,8 +1056,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1060,8 +1055,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (device->cursor_texture) wined3d_texture_decref(device->cursor_texture); @@ -269,7 +269,7 @@ index 9f09736..1e4eb0f 100644 /* Unload resources */ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { -@@ -1087,37 +1099,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1086,37 +1098,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->shader_backend->shader_free_private(device); destroy_dummy_textures(device, gl_info); @@ -307,7 +307,7 @@ index 9f09736..1e4eb0f 100644 if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1137,9 +1118,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1136,9 +1117,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -317,7 +317,7 @@ index 9f09736..1e4eb0f 100644 device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1929,7 +1907,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -1928,7 +1906,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(texture->resource.format->flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -326,7 +326,7 @@ index 9f09736..1e4eb0f 100644 return; wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -3318,6 +3296,8 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const +@@ -3317,6 +3295,8 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const 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) { @@ -335,7 +335,7 @@ index 9f09736..1e4eb0f 100644 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,7 +3309,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3328,7 +3308,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -344,7 +344,7 @@ index 9f09736..1e4eb0f 100644 if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3338,8 +3318,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3337,8 +3317,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -355,7 +355,7 @@ index 9f09736..1e4eb0f 100644 { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3687,8 +3667,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3686,8 +3666,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -366,7 +366,7 @@ index 9f09736..1e4eb0f 100644 if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3914,20 +3894,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -3913,20 +3893,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -390,7 +390,7 @@ index 9f09736..1e4eb0f 100644 TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -3967,13 +3948,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -3966,13 +3947,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -406,7 +406,7 @@ index 9f09736..1e4eb0f 100644 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. */ -@@ -3985,18 +3966,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -3984,18 +3965,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -428,7 +428,7 @@ index 9f09736..1e4eb0f 100644 wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4352,10 +4334,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4351,10 +4333,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -440,7 +440,7 @@ index 9f09736..1e4eb0f 100644 { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4364,6 +4345,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4363,6 +4344,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -452,7 +452,7 @@ index 9f09736..1e4eb0f 100644 if (device->onscreen_depth_stencil) { wined3d_surface_decref(device->onscreen_depth_stencil); -@@ -4646,7 +4632,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4647,7 +4633,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -461,7 +461,7 @@ index 9f09736..1e4eb0f 100644 &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4655,22 +4641,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4656,22 +4642,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } else if (device->back_buffer_view) { @@ -489,7 +489,7 @@ index 9f09736..1e4eb0f 100644 wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4763,17 +4748,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -4762,17 +4747,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -511,7 +511,7 @@ index 9f09736..1e4eb0f 100644 } } break; -@@ -4936,7 +4921,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -4935,7 +4920,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -521,7 +521,7 @@ index 9f09736..1e4eb0f 100644 { ERR("Failed to initialize device state, hr %#x.\n", hr); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 62b7032..98261f9 100644 +index 31f346d..f0f3ef2 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -608,7 +608,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co @@ -577,10 +577,10 @@ index 62b7032..98261f9 100644 surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index a829651..5239aa7 100644 +index 0017e45..5ec156a 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -952,7 +952,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont +@@ -953,7 +953,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont const struct wined3d_state *state = &shader->device->state; const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -590,10 +590,10 @@ index a829651..5239aa7 100644 const struct wined3d_shader_lconst *lconst; const char *prefix; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 6531803..cc969b8 100644 +index 28f3b17..ca38d53 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -2184,7 +2184,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 +@@ -2245,7 +2245,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) { @@ -603,11 +603,11 @@ index 6531803..cc969b8 100644 { static unsigned int warned = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 3c672db..da2976d 100644 +index 961f651..01c77ae 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -106,7 +106,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ - static UINT once; +@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ + const struct wined3d_gl_info *gl_info = context->gl_info; /* No z test without depth stencil buffers */ - if (!state->fb->depth_stencil) @@ -615,7 +615,7 @@ index 3c672db..da2976d 100644 { TRACE("No Z buffer - disabling depth test\n"); zenable = WINED3D_ZB_FALSE; -@@ -381,7 +381,7 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo +@@ -367,7 +367,7 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -624,7 +624,7 @@ index 3c672db..da2976d 100644 const struct wined3d_gl_info *gl_info = context->gl_info; GLenum srcBlend, dstBlend; enum wined3d_blend d3d_blend; -@@ -826,7 +826,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ +@@ -812,7 +812,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ GLint depthFail_ccw; /* No stencil test without a stencil buffer. */ @@ -633,7 +633,7 @@ index 3c672db..da2976d 100644 { gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST); checkGLcall("glDisable GL_STENCIL_TEST"); -@@ -912,7 +912,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ +@@ -908,7 +908,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -642,7 +642,7 @@ index 3c672db..da2976d 100644 const struct wined3d_gl_info *gl_info = context->gl_info; GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK)); -@@ -926,7 +926,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w +@@ -922,7 +922,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -651,7 +651,7 @@ index 3c672db..da2976d 100644 const struct wined3d_gl_info *gl_info = context->gl_info; gl_info->gl_ops.gl.p_glStencilMask(mask); -@@ -1766,7 +1766,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 +@@ -1762,7 +1762,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] || state->render_states[WINED3D_RS_DEPTHBIAS]) { @@ -660,7 +660,16 @@ index 3c672db..da2976d 100644 float scale; union -@@ -4772,7 +4772,7 @@ void vertexdeclaration(struct wined3d_context *context, const struct wined3d_sta +@@ -4091,7 +4091,7 @@ void transform_projection(struct wined3d_context *context, const struct wined3d_ + double y_offset = context->render_offscreen + ? ((63.0 / 64.0) - (2.0 * y) - h) / h + : ((63.0 / 64.0) - (2.0 * y) - h) / -h; +- enum wined3d_depth_buffer_type zenable = state->fb->depth_stencil ? ++ enum wined3d_depth_buffer_type zenable = state->fb.depth_stencil ? + state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; + double z_scale = zenable ? 2.0f : 0.0f; + double z_offset = zenable ? -1.0f : 0.0f; +@@ -4769,7 +4769,7 @@ void vertexdeclaration(struct wined3d_context *context, const struct wined3d_sta static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -669,7 +678,7 @@ index 3c672db..da2976d 100644 const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; -@@ -4952,7 +4952,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st +@@ -4949,7 +4949,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st } else { @@ -678,7 +687,7 @@ index 3c672db..da2976d 100644 UINT height; UINT width; -@@ -5019,7 +5019,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state +@@ -5013,7 +5013,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -788,10 +797,10 @@ index dc146fc..141e539 100644 if (FAILED(hr = stateblock_allocate_shader_constants(stateblock))) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f7ea41f..7469a15 100644 +index 9b9f489..994f6e3 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -3484,9 +3484,9 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3486,9 +3486,9 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -816,10 +825,10 @@ index dd7d2c7..ed2964e 100644 struct wined3d_context *context; struct wined3d_surface *front; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 6ce07b8..8ff4e3e 100644 +index 9e9fc49..87f3858 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -3428,7 +3428,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d +@@ -3430,7 +3430,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d unsigned int i; DWORD ttff; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; @@ -829,10 +838,10 @@ index 6ce07b8..8ff4e3e 100644 const struct wined3d_d3d_info *d3d_info = context->d3d_info; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 511e924..1cf3dc7 100644 +index c68f28e..32e27f6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1098,6 +1098,36 @@ struct wined3d_timestamp_query +@@ -1118,6 +1118,36 @@ struct wined3d_timestamp_query void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; @@ -869,7 +878,7 @@ index 511e924..1cf3dc7 100644 struct wined3d_context { const struct wined3d_gl_info *gl_info; -@@ -1112,6 +1142,7 @@ struct wined3d_context +@@ -1132,6 +1162,7 @@ struct wined3d_context DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ @@ -877,7 +886,7 @@ index 511e924..1cf3dc7 100644 struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1211,12 +1242,6 @@ struct wined3d_context +@@ -1232,12 +1263,6 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -890,7 +899,7 @@ index 511e924..1cf3dc7 100644 typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); struct StateEntry -@@ -1891,7 +1916,7 @@ struct wined3d_stream_state +@@ -1912,7 +1937,7 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -899,7 +908,7 @@ index 511e924..1cf3dc7 100644 struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -1997,7 +2022,6 @@ struct wined3d_device +@@ -2018,7 +2043,6 @@ struct wined3d_device struct wine_rb_tree samplers; /* Render Target Support */ @@ -907,7 +916,7 @@ index 511e924..1cf3dc7 100644 struct wined3d_surface *onscreen_depth_stencil; struct wined3d_rendertarget_view *auto_depth_stencil_view; -@@ -2500,9 +2524,8 @@ struct wined3d_stateblock +@@ -2521,9 +2545,8 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -919,7 +928,7 @@ index 511e924..1cf3dc7 100644 void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; struct wined3d_cs_ops -@@ -2515,7 +2538,6 @@ struct wined3d_cs +@@ -2536,7 +2559,6 @@ struct wined3d_cs { const struct wined3d_cs_ops *ops; struct wined3d_device *device; @@ -928,5 +937,5 @@ index 511e924..1cf3dc7 100644 size_t data_size; -- -2.2.1 +2.2.2 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index f6b719f4..93bf1768 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -316,8 +316,8 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -106,7 +106,11 @@ - static UINT once; +@@ -105,7 +105,11 @@ + const struct wined3d_gl_info *gl_info = context->gl_info; /* No z test without depth stencil buffers */ +#if defined(STAGING_CSMT) @@ -328,7 +328,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c { TRACE("No Z buffer - disabling depth test\n"); zenable = WINED3D_ZB_FALSE; -@@ -381,7 +385,11 @@ +@@ -367,7 +371,11 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -340,7 +340,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; GLenum srcBlend, dstBlend; enum wined3d_blend d3d_blend; -@@ -826,7 +834,11 @@ +@@ -812,7 +820,11 @@ GLint depthFail_ccw; /* No stencil test without a stencil buffer. */ @@ -352,7 +352,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c { gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST); checkGLcall("glDisable GL_STENCIL_TEST"); -@@ -922,7 +934,11 @@ +@@ -908,7 +920,11 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -364,7 +364,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK)); -@@ -936,7 +952,11 @@ +@@ -922,7 +938,11 @@ static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -376,7 +376,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; gl_info->gl_ops.gl.p_glStencilMask(mask); -@@ -1177,10 +1197,17 @@ +@@ -1163,10 +1183,17 @@ /* drop through */ case WINED3D_FOG_NONE: @@ -394,7 +394,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c new_source = FOGSOURCE_COORD; gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)"); -@@ -1776,7 +1803,11 @@ +@@ -1762,7 +1789,11 @@ if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] || state->render_states[WINED3D_RS_DEPTHBIAS]) { @@ -406,7 +406,19 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c float scale; union -@@ -4425,9 +4456,15 @@ +@@ -4091,7 +4122,11 @@ + double y_offset = context->render_offscreen + ? ((63.0 / 64.0) - (2.0 * y) - h) / h + : ((63.0 / 64.0) - (2.0 * y) - h) / -h; ++#if defined(STAGING_CSMT) + enum wined3d_depth_buffer_type zenable = state->fb.depth_stencil ? ++#else /* STAGING_CSMT */ ++ enum wined3d_depth_buffer_type zenable = state->fb->depth_stencil ? ++#endif /* STAGING_CSMT */ + state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; + double z_scale = zenable ? 2.0f : 0.0f; + double z_offset = zenable ? -1.0f : 0.0f; +@@ -4415,9 +4450,15 @@ } } } else { @@ -422,7 +434,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c WARN("unsupported blending in openGl\n"); } } -@@ -4782,7 +4819,11 @@ +@@ -4769,7 +4810,11 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -434,7 +446,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; -@@ -4962,7 +5003,11 @@ +@@ -4949,7 +4994,11 @@ } else { @@ -446,7 +458,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c UINT height; UINT width; -@@ -5026,7 +5071,11 @@ +@@ -5013,7 +5062,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -461,7 +473,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c -@@ -4998,7 +4998,11 @@ +@@ -5034,7 +5034,11 @@ fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); @@ -1666,7 +1678,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c -@@ -16455,7 +16455,11 @@ +@@ -16489,7 +16489,11 @@ fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); @@ -9532,7 +9544,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -5347,9 +5347,15 @@ +@@ -5340,9 +5340,15 @@ DebugBreak(); }