From 7f28f3b56d078007e955b4be131f0510c241deef Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 3 Sep 2015 14:40:25 +0200 Subject: [PATCH] Rebase against 76c43d817746bb9c81b36e0d0bec4bb0b2ffbdbb. --- patches/patchinstall.sh | 2 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 114 +++++++++--------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a861fa09..1d2c1bcb 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "99ecebe90de9ca502c43fbf62d0fbdd09c416b6b" + echo "76c43d817746bb9c81b36e0d0bec4bb0b2ffbdbb" } # Show version information diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index e68a7df7..669be747 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3671,7 +3671,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); -@@ -3238,6 +3486,10 @@ +@@ -3222,6 +3470,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -3682,7 +3682,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3246,6 +3498,15 @@ +@@ -3230,6 +3482,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3698,7 +3698,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3271,8 +3532,10 @@ +@@ -3255,8 +3516,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) { @@ -3709,7 +3709,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); -@@ -3281,12 +3544,19 @@ +@@ -3265,12 +3528,19 @@ WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); return WINED3D_OK; } @@ -3729,7 +3729,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"); -@@ -3295,8 +3565,13 @@ +@@ -3279,8 +3549,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -3743,7 +3743,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; -@@ -3342,6 +3617,9 @@ +@@ -3326,6 +3601,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -3753,7 +3753,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); -@@ -3349,8 +3627,13 @@ +@@ -3333,8 +3611,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -3767,7 +3767,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, -@@ -3373,6 +3656,14 @@ +@@ -3357,6 +3640,14 @@ return WINED3DERR_INVALIDCALL; } @@ -3782,7 +3782,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; -@@ -3389,6 +3680,10 @@ +@@ -3373,6 +3664,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -3793,7 +3793,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) -@@ -3407,6 +3702,15 @@ +@@ -3391,6 +3686,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3809,7 +3809,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; -@@ -3422,6 +3726,7 @@ +@@ -3406,6 +3710,7 @@ } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -3817,7 +3817,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) { -@@ -3457,6 +3762,88 @@ +@@ -3441,6 +3746,88 @@ { enum wined3d_resource_type type = src_texture->resource.type; unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; @@ -3906,7 +3906,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)); -@@ -3475,7 +3862,13 @@ +@@ -3459,7 +3846,13 @@ } /* Make sure that the destination texture is loaded. */ @@ -3920,7 +3920,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update every surface level of the texture. */ switch (type) -@@ -3490,7 +3883,16 @@ +@@ -3474,7 +3867,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)); @@ -3937,7 +3937,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3510,7 +3912,16 @@ +@@ -3494,7 +3896,16 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); @@ -3954,7 +3954,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -3520,6 +3931,7 @@ +@@ -3504,6 +3915,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3962,7 +3962,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)), -@@ -3568,6 +3980,25 @@ +@@ -3552,6 +3964,25 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3988,7 +3988,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -3630,8 +4061,13 @@ +@@ -3614,8 +4045,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -4002,7 +4002,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3730,6 +4166,7 @@ +@@ -3714,6 +4150,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -4010,7 +4010,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; -@@ -3737,6 +4174,7 @@ +@@ -3721,6 +4158,7 @@ RECT r, dst_rect; POINT p; @@ -4018,7 +4018,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)); -@@ -3748,6 +4186,7 @@ +@@ -3732,6 +4170,7 @@ return WINED3DERR_INVALIDCALL; } @@ -4026,7 +4026,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"); -@@ -3810,6 +4249,9 @@ +@@ -3794,6 +4233,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -4036,7 +4036,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -4023,7 +4465,11 @@ +@@ -4007,7 +4449,11 @@ && src_rect.bottom == sub_resource->height) wined3d_texture_prepare_texture(texture, context, FALSE); else @@ -4048,7 +4048,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_texture_bind_and_dirtify(texture, context, FALSE); wined3d_surface_upload_data(surface, gl_info, resource->format, -@@ -4031,8 +4477,13 @@ +@@ -4015,8 +4461,13 @@ context_release(context); @@ -4062,7 +4062,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4063,8 +4514,14 @@ +@@ -4047,8 +4498,14 @@ rect = &r; } @@ -4077,7 +4077,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, -@@ -4078,6 +4535,7 @@ +@@ -4062,6 +4519,7 @@ return NULL; } @@ -4085,7 +4085,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -4093,6 +4551,22 @@ +@@ -4077,6 +4535,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4108,7 +4108,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); -@@ -4132,6 +4606,7 @@ +@@ -4116,6 +4590,7 @@ } @@ -4116,7 +4116,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; -@@ -4139,6 +4614,15 @@ +@@ -4123,6 +4598,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4132,7 +4132,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. */ -@@ -4150,6 +4634,7 @@ +@@ -4134,6 +4618,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4140,7 +4140,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; -@@ -4174,6 +4659,79 @@ +@@ -4158,6 +4643,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4220,7 +4220,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -4209,8 +4767,16 @@ +@@ -4193,8 +4751,16 @@ * 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. */ @@ -4237,7 +4237,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4310,6 +4876,12 @@ +@@ -4294,6 +4860,12 @@ else SetCursor(NULL); } @@ -4250,7 +4250,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4320,8 +4892,10 @@ +@@ -4304,8 +4876,10 @@ TRACE("device %p.\n", device); @@ -4261,7 +4261,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); -@@ -4329,6 +4903,7 @@ +@@ -4313,6 +4887,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4269,7 +4269,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4349,6 +4924,37 @@ +@@ -4333,6 +4908,37 @@ gl_info = context->gl_info; wine_rb_clear(&device->samplers, device_free_sampler, NULL); @@ -4307,7 +4307,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4369,6 +4975,7 @@ +@@ -4353,6 +4959,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4315,7 +4315,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4388,6 +4995,14 @@ +@@ -4372,6 +4979,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4330,7 +4330,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, -@@ -4404,6 +5019,7 @@ +@@ -4388,6 +5003,7 @@ return hr; } @@ -4338,7 +4338,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)) { -@@ -4414,6 +5030,34 @@ +@@ -4398,6 +5014,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4373,7 +4373,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4430,8 +5074,10 @@ +@@ -4414,8 +5058,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4384,7 +4384,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4447,9 +5093,21 @@ +@@ -4431,9 +5077,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4406,7 +4406,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4458,6 +5116,7 @@ +@@ -4442,6 +5100,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4414,7 +4414,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4467,6 +5126,12 @@ +@@ -4451,6 +5110,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4427,7 +4427,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4479,6 +5144,7 @@ +@@ -4463,6 +5128,7 @@ } } @@ -4435,7 +4435,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 -@@ -4500,6 +5166,7 @@ +@@ -4484,6 +5150,7 @@ } device->cs->ops->finish(device->cs); @@ -4443,7 +4443,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); -@@ -4626,6 +5293,13 @@ +@@ -4610,6 +5277,13 @@ swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) return hr; @@ -4457,7 +4457,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4663,6 +5337,13 @@ +@@ -4647,6 +5321,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4471,7 +4471,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))) -@@ -4683,12 +5364,20 @@ +@@ -4667,12 +5348,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4492,7 +4492,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; -@@ -4697,6 +5386,7 @@ +@@ -4681,6 +5370,7 @@ } else if (device->back_buffer_view) { @@ -4500,7 +4500,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); -@@ -4712,6 +5402,24 @@ +@@ -4696,6 +5386,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4525,7 +4525,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4787,6 +5495,10 @@ +@@ -4771,6 +5479,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4536,7 +4536,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4797,6 +5509,7 @@ +@@ -4781,6 +5493,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4544,7 +4544,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); -@@ -4808,6 +5521,19 @@ +@@ -4792,6 +5505,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4564,7 +4564,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4970,7 +5696,11 @@ +@@ -4954,7 +5680,11 @@ device->blitter = adapter->blitter; @@ -4576,7 +4576,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); -@@ -5069,6 +5799,7 @@ +@@ -5053,6 +5783,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4584,7 +4584,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, -@@ -5122,3 +5853,4 @@ +@@ -5106,3 +5837,4 @@ wined3d_device_destroy_bo(device, context, bo); }