diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index b05d4848..815fb6b0 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -4,7 +4,7 @@ Subject: Autogenerated #ifdef patch for wined3d-CSMT_Main. 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 -@@ -5480,7 +5480,11 @@ +@@ -5480,7 +5480,11 @@ static void add_dirty_rect_test(void) fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); @@ -19,7 +19,7 @@ diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.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 -@@ -1339,7 +1339,11 @@ +@@ -1339,7 +1339,11 @@ static void color_fill_test(void) * result on Wine. * {D3DFMT_YUY2, "D3DFMT_YUY2", BLOCKS, 0}, * {D3DFMT_UYVY, "D3DFMT_UYVY", BLOCKS, 0}, */ @@ -31,7 +31,7 @@ diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c /* Vendor-specific formats like ATI2N are a non-issue here since they're not * supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET * when created as texture. */ -@@ -17618,7 +17622,11 @@ +@@ -17618,7 +17622,11 @@ static void add_dirty_rect_test(void) fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); @@ -46,7 +46,7 @@ diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c -@@ -704,7 +704,11 @@ +@@ -704,7 +704,11 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, { const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog; @@ -58,7 +58,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader /* Load DirectX 9 float constants for pixel shader */ priv->highest_dirty_ps_const = shader_arb_load_constants_f(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, -@@ -729,12 +733,14 @@ +@@ -729,12 +733,14 @@ static void shader_arb_update_float_vertex_constants(struct wined3d_device *devi { struct wined3d_context *context = context_get_current(); struct shader_arb_priv *priv = device->shader_priv; @@ -73,7 +73,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader /* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active * context. On a context switch the old context will be fully dirtified */ -@@ -748,12 +754,14 @@ +@@ -748,12 +754,14 @@ static void shader_arb_update_float_pixel_constants(struct wined3d_device *devic { struct wined3d_context *context = context_get_current(); struct shader_arb_priv *priv = device->shader_priv; @@ -88,7 +88,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader /* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active * context. On a context switch the old context will be fully dirtified */ -@@ -4732,7 +4740,11 @@ +@@ -4732,7 +4740,11 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context } else { @@ -100,7 +100,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader shader_arb_ps_local_constants(compiled, context, state, rt_height); } -@@ -8018,11 +8030,16 @@ +@@ -8018,11 +8030,16 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -120,7 +120,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -32,7 +32,11 @@ +@@ -32,7 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ #define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */ #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ @@ -132,7 +132,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ #define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ -@@ -41,7 +45,11 @@ +@@ -41,7 +45,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */ @@ -144,7 +144,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { if (!offset && (!size || size == buffer->resource.size)) goto invalidate_all; -@@ -122,7 +130,11 @@ +@@ -122,7 +130,11 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g } /* Context activation is done by the caller. */ @@ -156,7 +156,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { GLenum gl_usage = GL_STATIC_DRAW_ARB; GLenum error; -@@ -194,10 +206,14 @@ +@@ -194,10 +206,14 @@ void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_con if (This->flags & WINED3D_BUFFER_DOUBLEBUFFER) buffer_invalidate_bo_range(This, 0, 0); else @@ -171,7 +171,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c return; -@@ -461,8 +477,12 @@ +@@ -461,8 +477,12 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co data->buffer_object = buffer->buffer_object; if (!buffer->buffer_object) { @@ -184,7 +184,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { buffer_create_buffer_object(buffer, context); if (buffer->buffer_object) -@@ -500,7 +520,9 @@ +@@ -500,7 +520,9 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *c if (!wined3d_resource_allocate_sysmem(&buffer->resource)) ERR("Failed to allocate system memory.\n"); @@ -194,7 +194,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c buffer_bind(buffer, context); GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size, buffer->resource.heap_memory)); -@@ -561,6 +583,7 @@ +@@ -561,6 +583,7 @@ static void wined3d_buffer_drop_bo(struct wined3d_buffer *buffer) device_invalidate_state(device, STATE_STREAMSRC); } @@ -202,7 +202,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c static void wined3d_buffer_destroy_object(void *object) { struct wined3d_buffer *buffer = object; -@@ -594,6 +617,30 @@ +@@ -594,6 +617,30 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); wined3d_cs_emit_destroy_object(device->cs, wined3d_buffer_destroy_object, buffer); @@ -233,7 +233,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } return refcount; -@@ -678,6 +725,7 @@ +@@ -678,6 +725,7 @@ drop_query: /* The caller provides a GL context */ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) { @@ -241,7 +241,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c UINT start = 0, len = 0; /* This potentially invalidates the element array buffer binding, but the -@@ -701,6 +749,45 @@ +@@ -701,6 +749,45 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)); checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"); This->flags &= ~WINED3D_BUFFER_APPLESYNC; @@ -287,7 +287,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } while (This->modified_areas) -@@ -709,12 +796,33 @@ +@@ -709,12 +796,33 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined start = This->maps[This->modified_areas].offset; len = This->maps[This->modified_areas].size; @@ -321,7 +321,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); } -@@ -733,6 +841,14 @@ +@@ -733,6 +841,14 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte TRACE("buffer %p.\n", buffer); @@ -336,7 +336,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c buffer_mark_used(buffer); if (!buffer->buffer_object) -@@ -908,6 +1024,7 @@ +@@ -908,6 +1024,7 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) { @@ -344,7 +344,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c struct wined3d_device *device = buffer->resource.device; if (buffer->resource.map_count) -@@ -917,6 +1034,12 @@ +@@ -917,6 +1034,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) } wined3d_cs_emit_buffer_preload(device->cs, buffer); @@ -357,7 +357,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) -@@ -930,6 +1053,7 @@ +@@ -930,6 +1053,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN { LONG count; BYTE *base; @@ -365,7 +365,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c struct wined3d_device *device = buffer->resource.device; struct wined3d_context *context; -@@ -953,6 +1077,10 @@ +@@ -953,6 +1077,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN { wined3d_cs_emit_create_vbo(device->cs, buffer); } @@ -376,7 +376,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture -@@ -961,7 +1089,11 @@ +@@ -961,7 +1089,11 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN * previous contents of the buffer. The r600g driver only does this when * the buffer is currently in use, while the proprietary NVIDIA driver * appears to do this unconditionally. */ @@ -388,7 +388,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c flags &= ~WINED3D_MAP_DISCARD; count = ++buffer->resource.map_count; -@@ -972,6 +1104,7 @@ +@@ -972,6 +1104,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN * being uploaded in that case. Two such applications are Port Royale * and Darkstar One. */ if (flags & WINED3D_MAP_DISCARD) @@ -396,7 +396,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, 0, 0); else if (!(flags & WINED3D_MAP_READONLY)) wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, offset, size); -@@ -989,6 +1122,19 @@ +@@ -989,6 +1122,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN wined3d_cs_emit_glfinish(device->cs); device->cs->ops->finish(device->cs); } @@ -416,7 +416,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -1034,6 +1180,7 @@ +@@ -1034,6 +1180,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN buffer_get_sysmem(buffer, context); } TRACE("New pointer is %p.\n", buffer->resource.heap_memory); @@ -424,7 +424,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } context_release(context); } -@@ -1073,6 +1220,21 @@ +@@ -1073,6 +1220,21 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN } base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; @@ -446,7 +446,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c *data = base + offset; TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); -@@ -1135,6 +1297,7 @@ +@@ -1135,6 +1297,7 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) } GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); @@ -454,7 +454,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -1143,6 +1306,18 @@ +@@ -1143,6 +1306,18 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) buffer_clear_dirty_areas(buffer); buffer->map_ptr = NULL; @@ -473,7 +473,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } } -@@ -1335,7 +1510,9 @@ +@@ -1335,7 +1510,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device return hr; } buffer->buffer_type_hint = bind_hint; @@ -483,7 +483,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); -@@ -1371,6 +1548,7 @@ +@@ -1371,6 +1548,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device buffer->flags |= WINED3D_BUFFER_USE_BO; } @@ -491,7 +491,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (wined3d_settings.cs_multithreaded) buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; -@@ -1381,6 +1559,13 @@ +@@ -1381,6 +1559,13 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device resource_cleanup(&buffer->resource); if (wined3d_settings.cs_multithreaded) buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); @@ -505,7 +505,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c return E_OUTOFMEMORY; } buffer->maps_size = 1; -@@ -1391,8 +1576,10 @@ +@@ -1391,8 +1576,10 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device buffer_unload(&buffer->resource); resource_cleanup(&buffer->resource); HeapFree(GetProcessHeap(), 0, buffer->maps); @@ -516,7 +516,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c return hr; } -@@ -1503,6 +1690,7 @@ +@@ -1503,6 +1690,7 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, return WINED3D_OK; } @@ -524,7 +524,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) { -@@ -1510,3 +1698,4 @@ +@@ -1510,3 +1698,4 @@ void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) buffer->resource.heap_memory = mem; buffer->flags |= WINED3D_BUFFER_DISCARD; } @@ -532,7 +532,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1699,11 +1699,13 @@ +@@ -1699,11 +1699,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } @@ -546,7 +546,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -2009,7 +2011,9 @@ +@@ -2009,7 +2011,9 @@ out: if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -556,7 +556,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -2046,7 +2050,9 @@ +@@ -2046,7 +2050,9 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); HeapFree(GetProcessHeap(), 0, context->fbo_key); @@ -566,7 +566,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2462,6 +2468,9 @@ +@@ -2462,6 +2468,9 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, { /* Onscreen surfaces are always in a swapchain */ struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain; @@ -576,7 +576,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c if (context->render_offscreen || !depth_stencil) return; if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return; -@@ -2472,8 +2481,13 @@ +@@ -2472,8 +2481,13 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -590,7 +590,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); context_set_render_offscreen(context, TRUE); -@@ -2574,7 +2588,11 @@ +@@ -2574,7 +2588,11 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge } /* Context activation is done by the caller. */ @@ -602,7 +602,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c UINT rt_count, const struct wined3d_fb_state *fb) { struct wined3d_rendertarget_view **rts = fb->render_targets; -@@ -2583,7 +2601,11 @@ +@@ -2583,7 +2601,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, DWORD rt_mask = 0, *cur_mask; UINT i; @@ -614,7 +614,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c || rt_count != gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2628,8 +2650,10 @@ +@@ -2628,8 +2650,10 @@ BOOL context_apply_clear_state(struct wined3d_context *context, rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL); } @@ -625,7 +625,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2670,8 +2694,12 @@ +@@ -2670,8 +2694,12 @@ BOOL context_apply_clear_state(struct wined3d_context *context, gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST); if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB]) { @@ -638,7 +638,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB); else gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB); -@@ -2688,7 +2716,11 @@ +@@ -2688,7 +2716,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) { @@ -650,7 +650,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; DWORD rt_mask, rt_mask_bits; unsigned int i; -@@ -2718,7 +2750,11 @@ +@@ -2718,7 +2750,11 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD rt_mask = find_draw_buffers_mask(context, state); @@ -662,7 +662,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2749,8 +2785,10 @@ +@@ -2749,8 +2785,10 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -673,7 +673,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -3382,7 +3420,11 @@ +@@ -3382,7 +3420,11 @@ BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) { const struct StateEntry *state_table = context->state_table; @@ -685,7 +685,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c unsigned int i; WORD map; -@@ -3415,12 +3457,17 @@ +@@ -3415,12 +3457,17 @@ BOOL context_apply_draw_state(struct wined3d_context *context, for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -703,7 +703,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3539,9 +3586,11 @@ +@@ -3539,9 +3586,11 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str TRACE("device %p, target %p.\n", device, target); @@ -737,7 +737,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, WINED3D_CS_OP_DRAW, -@@ -54,6 +61,7 @@ +@@ -54,6 +61,7 @@ enum wined3d_cs_op WINED3D_CS_OP_SET_MATERIAL, WINED3D_CS_OP_RESET_STATE, WINED3D_CS_OP_DESTROY_OBJECT, @@ -745,7 +745,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_SET_VS_CONSTS_F, WINED3D_CS_OP_SET_VS_CONSTS_B, WINED3D_CS_OP_SET_VS_CONSTS_I, -@@ -99,6 +107,7 @@ +@@ -99,6 +107,7 @@ struct wined3d_cs_fence { enum wined3d_cs_op opcode; BOOL *signalled; @@ -753,7 +753,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_present -@@ -306,6 +315,7 @@ +@@ -306,6 +315,7 @@ struct wined3d_cs_destroy_object void *object; }; @@ -761,7 +761,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_set_consts_f { enum wined3d_cs_op opcode; -@@ -612,6 +622,23 @@ +@@ -612,6 +622,23 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw struct wined3d_cs_present *op; LONG pending; unsigned int i; @@ -785,7 +785,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_PRESENT; -@@ -621,6 +648,7 @@ +@@ -621,6 +648,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw op->dst_rect = *dst_rect; op->flags = flags; @@ -793,7 +793,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c wined3d_resource_inc_fence(&swapchain->front_buffer->resource); for (i = 0; i < swapchain->desc.backbuffer_count; i++) wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource); -@@ -678,6 +706,30 @@ +@@ -678,6 +706,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * unsigned int i; op = cs->ops->require_space(cs, size); @@ -824,7 +824,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; op->color = *color; -@@ -686,6 +738,7 @@ +@@ -686,6 +738,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * op->rect_count = rect_count; memcpy(op->rects, rects, sizeof(*rects) * rect_count); @@ -832,7 +832,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (flags & WINED3DCLEAR_TARGET) { for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) -@@ -744,6 +797,15 @@ +@@ -744,6 +797,15 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) cs->state.load_base_vertex_index = 0; device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); } @@ -848,7 +848,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (!cs->device->adapter->gl_info.supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && state->load_base_vertex_index != op->base_vertex_idx) -@@ -754,6 +816,7 @@ +@@ -754,6 +816,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) draw_primitive(cs->device, state, op->base_vertex_idx, op->start_idx, op->index_count, op->start_instance, op->instance_count, op->indexed); @@ -856,7 +856,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (op->indexed) wined3d_resource_dec_fence(&cs->state.index_buffer->resource); -@@ -784,6 +847,14 @@ +@@ -784,6 +847,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i struct wined3d_cs_draw *op; unsigned int i; const struct wined3d_state *state = &cs->device->state; @@ -871,7 +871,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_DRAW; -@@ -794,6 +865,7 @@ +@@ -794,6 +865,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i op->instance_count = instance_count; op->indexed = indexed; @@ -879,7 +879,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (indexed) { wined3d_resource_inc_fence(&state->index_buffer->resource); -@@ -831,6 +903,17 @@ +@@ -831,6 +903,17 @@ static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *d cs->state.predicate_value = op->value; return sizeof(*op); @@ -897,7 +897,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) -@@ -842,6 +925,7 @@ +@@ -842,6 +925,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query op->predicate = predicate; op->value = value; @@ -905,7 +905,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -853,6 +937,17 @@ +@@ -853,6 +937,17 @@ static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data device_invalidate_state(cs->device, STATE_VIEWPORT); return sizeof(*op); @@ -923,7 +923,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) -@@ -863,6 +958,7 @@ +@@ -863,6 +958,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi op->opcode = WINED3D_CS_OP_SET_VIEWPORT; op->viewport = *viewport; @@ -931,7 +931,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -874,6 +970,17 @@ +@@ -874,6 +970,17 @@ static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void * device_invalidate_state(cs->device, STATE_SCISSORRECT); return sizeof(*op); @@ -949,7 +949,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) -@@ -884,6 +991,7 @@ +@@ -884,6 +991,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; op->rect = *rect; @@ -957,7 +957,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -895,6 +1003,17 @@ +@@ -895,6 +1003,17 @@ static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v device_invalidate_state(cs->device, STATE_FRAMEBUFFER); return sizeof(*op); @@ -975,7 +975,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -907,6 +1026,7 @@ +@@ -907,6 +1026,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v op->view_idx = view_idx; op->view = view; @@ -983,7 +983,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -917,6 +1037,18 @@ +@@ -917,6 +1037,18 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const struct wined3d_rendertarget_view *prev; if ((prev = cs->state.fb.depth_stencil)) @@ -1002,7 +1002,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); -@@ -924,6 +1056,7 @@ +@@ -924,6 +1056,7 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const || prev_surface->container->flags & WINED3D_TEXTURE_DISCARD)) { surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height); @@ -1010,7 +1010,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (prev_surface == cs->onscreen_depth_stencil) { wined3d_texture_decref(cs->onscreen_depth_stencil->container); -@@ -933,6 +1066,17 @@ +@@ -933,6 +1066,17 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } cs->state.fb.depth_stencil = op->view; @@ -1028,7 +1028,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (!prev != !op->view) { -@@ -949,8 +1093,10 @@ +@@ -949,8 +1093,10 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -1039,7 +1039,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -@@ -961,6 +1107,7 @@ +@@ -961,6 +1107,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; op->view = view; @@ -1047,7 +1047,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -972,6 +1119,17 @@ +@@ -972,6 +1119,17 @@ static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const device_invalidate_state(cs->device, STATE_VDECL); return sizeof(*op); @@ -1065,7 +1065,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) -@@ -982,10 +1140,17 @@ +@@ -982,10 +1140,17 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; op->declaration = declaration; @@ -1083,7 +1083,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -1003,8 +1168,10 @@ +@@ -1003,8 +1168,10 @@ static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -1094,7 +1094,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -1019,10 +1186,17 @@ +@@ -1019,10 +1186,17 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, op->offset = offset; op->stride = stride; @@ -1112,7 +1112,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -1032,8 +1206,10 @@ +@@ -1032,8 +1206,10 @@ static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -1123,7 +1123,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) -@@ -1046,10 +1222,17 @@ +@@ -1046,10 +1222,17 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i op->frequency = frequency; op->flags = flags; @@ -1141,7 +1141,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -1064,8 +1247,10 @@ +@@ -1064,8 +1247,10 @@ static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedIncrement(&op->buffer->resource.bind_count); if (prev) InterlockedDecrement(&prev->resource.bind_count); @@ -1152,7 +1152,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -1079,10 +1264,17 @@ +@@ -1079,10 +1264,17 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, op->buffer = buffer; op->offset = offset; @@ -1170,7 +1170,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -1098,8 +1290,10 @@ +@@ -1098,8 +1290,10 @@ static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -1181,7 +1181,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -1113,10 +1307,17 @@ +@@ -1113,10 +1307,17 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff op->format_id = format_id; op->offset = offset; @@ -1199,7 +1199,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -1130,7 +1331,9 @@ +@@ -1130,7 +1331,9 @@ static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -1209,7 +1209,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1144,10 +1347,17 @@ +@@ -1144,10 +1347,17 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha op->cb_idx = cb_idx; op->buffer = buffer; @@ -1227,7 +1227,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -1224,8 +1434,10 @@ +@@ -1224,8 +1434,10 @@ static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -1238,7 +1238,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) -@@ -1236,6 +1448,7 @@ +@@ -1236,6 +1448,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined op->opcode = WINED3D_CS_OP_SET_TEXTURE; op->stage = stage; op->texture = texture; @@ -1246,7 +1246,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1247,6 +1460,18 @@ +@@ -1247,6 +1460,18 @@ static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); return sizeof(*op); @@ -1265,7 +1265,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1260,6 +1485,7 @@ +@@ -1260,6 +1485,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 op->view_idx = view_idx; op->view = view; @@ -1273,7 +1273,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1271,6 +1497,17 @@ +@@ -1271,6 +1497,17 @@ static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); return sizeof(*op); @@ -1291,7 +1291,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1284,6 +1521,7 @@ +@@ -1284,6 +1521,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type op->sampler_idx = sampler_idx; op->sampler = sampler; @@ -1299,7 +1299,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1296,6 +1534,18 @@ +@@ -1296,6 +1534,18 @@ static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); return sizeof(*op); @@ -1318,7 +1318,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) -@@ -1307,6 +1557,7 @@ +@@ -1307,6 +1557,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type op->type = type; op->shader = shader; @@ -1326,7 +1326,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1378,6 +1629,17 @@ +@@ -1378,6 +1629,17 @@ static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void * device_invalidate_state(cs->device, STATE_RENDER(op->state)); return sizeof(*op); @@ -1344,7 +1344,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) -@@ -1389,6 +1651,7 @@ +@@ -1389,6 +1651,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render op->state = state; op->value = value; @@ -1352,7 +1352,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1516,6 +1779,17 @@ +@@ -1516,6 +1779,17 @@ static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, op->state)); return sizeof(*op); @@ -1370,7 +1370,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -1529,6 +1803,7 @@ +@@ -1529,6 +1803,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, op->state = state; op->value = value; @@ -1378,7 +1378,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1540,6 +1815,17 @@ +@@ -1540,6 +1815,17 @@ static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx)); return sizeof(*op); @@ -1396,7 +1396,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -1553,6 +1839,7 @@ +@@ -1553,6 +1839,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, op->state = state; op->value = value; @@ -1404,7 +1404,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1565,6 +1852,18 @@ +@@ -1565,6 +1852,18 @@ static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *dat device_invalidate_state(cs->device, STATE_TRANSFORM(op->state)); return sizeof(*op); @@ -1423,7 +1423,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1577,6 +1876,7 @@ +@@ -1577,6 +1876,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform op->state = state; op->matrix = *matrix; @@ -1431,7 +1431,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1588,6 +1888,17 @@ +@@ -1588,6 +1888,17 @@ static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *da device_invalidate_state(cs->device, STATE_CLIPPLANE(op->plane_idx)); return sizeof(*op); @@ -1449,7 +1449,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) -@@ -1599,10 +1910,17 @@ +@@ -1599,10 +1910,17 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const op->plane_idx = plane_idx; op->plane = *plane; @@ -1467,7 +1467,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1663,8 +1981,10 @@ +@@ -1663,8 +1981,10 @@ static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -1478,7 +1478,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1684,6 +2004,7 @@ +@@ -1684,6 +2004,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -1486,7 +1486,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1695,6 +2016,17 @@ +@@ -1695,6 +2016,17 @@ static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data device_invalidate_state(cs->device, STATE_MATERIAL); return sizeof(*op); @@ -1504,7 +1504,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) -@@ -1705,6 +2037,7 @@ +@@ -1705,6 +2037,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; @@ -1512,7 +1512,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1720,6 +2053,19 @@ +@@ -1720,6 +2053,19 @@ static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) ERR("Failed to initialize CS state, hr %#x.\n", hr); return sizeof(struct wined3d_cs_reset_state); @@ -1532,7 +1532,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1729,6 +2075,7 @@ +@@ -1729,6 +2075,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_RESET_STATE; @@ -1540,7 +1540,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1739,6 +2086,16 @@ +@@ -1739,6 +2086,16 @@ static UINT wined3d_cs_exec_destroy_object(struct wined3d_cs *cs, const void *da op->callback(op->object); return sizeof(*op); @@ -1557,7 +1557,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) -@@ -1750,6 +2107,7 @@ +@@ -1750,6 +2107,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void op->callback = callback; op->object = object; @@ -1565,7 +1565,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -3027,5 +3385,152 @@ +@@ -3027,5 +3385,152 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) ERR("Closing event failed.\n"); } @@ -1721,7 +1721,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -198,6 +198,24 @@ +@@ -198,6 +198,24 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context device->contexts = new_array; } @@ -1746,7 +1746,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect) { unsigned int height = wined3d_texture_get_level_height(target->container, target->texture_level); -@@ -267,7 +285,11 @@ +@@ -267,7 +285,11 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context } /* Full load. */ @@ -1758,7 +1758,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(out_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); } -@@ -278,6 +300,9 @@ +@@ -278,6 +300,9 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL; struct wined3d_rendertarget_view *dsv = fb->depth_stencil; struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL; @@ -1768,7 +1768,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_gl_info *gl_info; UINT drawable_width, drawable_height; struct wined3d_color corrected_color; -@@ -307,6 +332,7 @@ +@@ -307,6 +332,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c for (i = 0; i < rt_count; ++i) { struct wined3d_rendertarget_view *rtv = fb->render_targets[i]; @@ -1776,7 +1776,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (rtv && rtv->format->id != WINED3DFMT_NULL) { -@@ -316,6 +342,16 @@ +@@ -316,6 +342,16 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c wined3d_texture_load_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding); else wined3d_texture_prepare_location(rt, rtv->sub_resource_idx, @@ -1793,7 +1793,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c context, rtv->resource->draw_binding); } } -@@ -342,6 +378,7 @@ +@@ -342,6 +378,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c { DWORD location = render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE; @@ -1801,7 +1801,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!render_offscreen && depth_stencil != device->cs->onscreen_depth_stencil) wined3d_cs_switch_onscreen_ds(device->cs, context, depth_stencil); prepare_ds_clear(depth_stencil, context, location, -@@ -349,6 +386,15 @@ +@@ -349,6 +386,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c } if (!context_apply_clear_state(context, rt_count, fb)) @@ -1817,7 +1817,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { context_release(context); WARN("Failed to apply clear state, skipping clear.\n"); -@@ -404,7 +450,11 @@ +@@ -404,7 +450,11 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c wined3d_texture_invalidate_location(texture, rtv->sub_resource_idx, ~rtv->resource->draw_binding); } @@ -1829,7 +1829,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { if (rt_count > 1) WARN("Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB " -@@ -664,6 +714,7 @@ +@@ -664,6 +714,7 @@ out: } /* Context activation is done by the caller. */ @@ -1837,7 +1837,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void create_default_samplers(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -698,6 +749,9 @@ +@@ -698,6 +749,9 @@ static void create_default_samplers(struct wined3d_device *device) /* Context activation is done by the caller. */ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) @@ -1847,7 +1847,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -789,8 +843,10 @@ +@@ -789,8 +843,10 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_ checkGLcall("glTexImage3D"); } } @@ -1858,7 +1858,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* Context activation is done by the caller. */ -@@ -833,6 +889,41 @@ +@@ -833,6 +889,41 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w } /* Context activation is done by the caller. */ @@ -1900,7 +1900,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void destroy_default_samplers(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -969,7 +1060,11 @@ +@@ -969,7 +1060,11 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil; unsigned int i; @@ -1912,7 +1912,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -987,7 +1082,13 @@ +@@ -987,7 +1082,13 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc) { static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -1926,7 +1926,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c DWORD clear_flags = 0; HRESULT hr; -@@ -998,6 +1099,11 @@ +@@ -998,6 +1099,11 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, if (device->wined3d->flags & WINED3D_NO3D) return WINED3DERR_INVALIDCALL; @@ -1938,7 +1938,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = device->shader_backend->shader_alloc_private(device, device->adapter->vertex_pipe, device->adapter->fragment_pipe))) { -@@ -1046,11 +1152,24 @@ +@@ -1046,11 +1152,24 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device->swapchains[0] = swapchain; device_init_swapchain_state(device, swapchain); @@ -1963,7 +1963,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) -@@ -1067,6 +1186,9 @@ +@@ -1067,6 +1186,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: @@ -1973,7 +1973,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1123,6 +1245,10 @@ +@@ -1123,6 +1245,10 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { struct wined3d_resource *resource, *cursor; @@ -1984,7 +1984,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_surface *surface; UINT i; -@@ -1131,6 +1257,7 @@ +@@ -1131,6 +1257,7 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (!device->d3d_initialized) return WINED3DERR_INVALIDCALL; @@ -1992,7 +1992,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) device->cs->ops->finish(device->cs); -@@ -1171,6 +1298,82 @@ +@@ -1171,6 +1298,82 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) /* FIXME: Is this in the right place??? */ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); @@ -2075,7 +2075,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1188,6 +1391,11 @@ +@@ -1188,6 +1391,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -2087,7 +2087,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1232,7 +1440,11 @@ +@@ -1232,7 +1440,11 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device /* We can not acquire the context unless there is a swapchain. */ if (device->swapchains && gl_info->supported[NVX_GPU_MEMORY_INFO] && @@ -2099,7 +2099,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { GLint vram_free_kb; UINT64 vram_free; -@@ -1573,6 +1785,16 @@ +@@ -1573,6 +1785,16 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, light->direction.x, light->direction.y, light->direction.z, light->range, light->falloff, light->theta, light->phi); @@ -2116,7 +2116,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1652,9 +1874,11 @@ +@@ -1652,9 +1874,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, FIXME("Unrecognized light type %#x.\n", light->type); } @@ -2128,7 +2128,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1727,6 +1951,14 @@ +@@ -1727,6 +1951,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN { if (light_info->glIndex != -1) { @@ -2143,7 +2143,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1768,11 +2000,23 @@ +@@ -1768,11 +2000,23 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -2167,7 +2167,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1944,9 +2188,11 @@ +@@ -1944,9 +2188,11 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -2179,7 +2179,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -1992,7 +2238,11 @@ +@@ -1992,7 +2238,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; @@ -2191,7 +2191,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; if (src_view->resource->type == WINED3D_RTYPE_BUFFER) { -@@ -2327,6 +2577,7 @@ +@@ -2327,6 +2577,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -2199,7 +2199,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) { UINT i; -@@ -2337,6 +2588,7 @@ +@@ -2337,6 +2588,7 @@ void device_invalidate_shader_constants(const struct wined3d_device *device, DWO } } @@ -2207,7 +2207,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const BOOL *constants) { -@@ -2364,8 +2616,12 @@ +@@ -2364,8 +2616,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { @@ -2220,7 +2220,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2414,8 +2670,12 @@ +@@ -2414,8 +2670,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -2233,7 +2233,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2460,8 +2720,12 @@ +@@ -2460,8 +2720,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, memset(&device->recording->changed.vs_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.vs_consts_f)); else @@ -2246,7 +2246,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2600,8 +2864,12 @@ +@@ -2600,8 +2864,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { @@ -2259,7 +2259,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2650,8 +2918,12 @@ +@@ -2650,8 +2918,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -2272,7 +2272,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2697,8 +2969,12 @@ +@@ -2697,8 +2969,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, memset(&device->recording->changed.ps_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.ps_consts_f)); else @@ -2285,7 +2285,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2858,6 +3134,7 @@ +@@ -2858,6 +3134,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO return hr; } @@ -2293,7 +2293,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2865,6 +3142,7 @@ +@@ -2865,6 +3142,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO device->cs->ops->finish(device->cs); } @@ -2301,7 +2301,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); -@@ -3350,6 +3628,10 @@ +@@ -3350,6 +3628,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -2312,7 +2312,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3358,6 +3640,15 @@ +@@ -3358,6 +3640,15 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) return WINED3DERR_INVALIDCALL; } @@ -2328,7 +2328,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3365,8 +3656,10 @@ +@@ -3365,8 +3656,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) 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) { @@ -2339,7 +2339,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, debug_color(color), depth, stencil); -@@ -3378,7 +3671,11 @@ +@@ -3378,7 +3671,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -2351,7 +2351,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"); -@@ -3387,8 +3684,13 @@ +@@ -3387,8 +3684,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -2365,7 +2365,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; -@@ -3434,6 +3736,9 @@ +@@ -3434,6 +3736,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -2375,7 +2375,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); -@@ -3441,8 +3746,13 @@ +@@ -3441,8 +3746,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -2389,7 +2389,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, -@@ -3502,6 +3812,7 @@ +@@ -3502,6 +3812,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -2397,7 +2397,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller. */ static void wined3d_device_update_texture_3d(struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_level, -@@ -3512,6 +3823,36 @@ +@@ -3512,6 +3823,36 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, TRACE("context %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", context, src_texture, src_level, dst_texture, level_count); @@ -2434,7 +2434,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3519,6 +3860,7 @@ +@@ -3519,6 +3860,7 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, for (i = 0; i < level_count; ++i) { @@ -2442,7 +2442,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_texture_get_memory(src_texture, src_level + i, &data, src_texture->resource.map_binding, FALSE); -@@ -3596,6 +3938,34 @@ +@@ -3596,6 +3938,34 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, unsigned int src_size, dst_size, src_skip_levels = 0; unsigned int layer_count; enum wined3d_resource_type type; @@ -2477,7 +2477,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3632,6 +4002,7 @@ +@@ -3632,6 +4002,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -2485,7 +2485,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* FIXME: This isn't necessary for 2D textures, but currently surface_upload_from_surface * rejects mismatching formats, and we can't report the error back after dispatching the * call. */ -@@ -3674,6 +4045,65 @@ +@@ -3674,6 +4045,65 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); return WINED3D_OK; @@ -2551,7 +2551,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) -@@ -3721,8 +4151,13 @@ +@@ -3721,8 +4151,13 @@ 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]) { @@ -2565,7 +2565,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3911,7 +4346,9 @@ +@@ -3911,7 +4346,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; HRESULT hr; @@ -2575,7 +2575,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", -@@ -3999,6 +4436,7 @@ +@@ -3999,6 +4436,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev if (src_box) { @@ -2583,7 +2583,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if ((src_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !wined3d_texture_check_block_align(src_texture, src_sub_resource_idx % src_texture->level_count, src_box)) -@@ -4007,6 +4445,7 @@ +@@ -4007,6 +4445,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev return WINED3DERR_INVALIDCALL; } @@ -2591,7 +2591,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else -@@ -4020,6 +4459,7 @@ +@@ -4020,6 +4459,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), dst_y + (src_rect.bottom - src_rect.top)); @@ -2599,7 +2599,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) { dst_box.left = dst_rect.left; -@@ -4037,6 +4477,7 @@ +@@ -4037,6 +4477,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev } } @@ -2607,7 +2607,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) WARN("Failed to blit, hr %#x.\n", hr); -@@ -4049,7 +4490,18 @@ +@@ -4049,7 +4490,18 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str unsigned int depth_pitch) { struct wined3d_texture_sub_resource *sub_resource; @@ -2626,7 +2626,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); -@@ -4083,6 +4535,7 @@ +@@ -4083,6 +4535,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); return; } @@ -2634,7 +2634,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (box) { -@@ -4092,6 +4545,18 @@ +@@ -4092,6 +4545,18 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str width = wined3d_texture_get_level_width(texture, level); height = wined3d_texture_get_level_height(texture, level); @@ -2653,7 +2653,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (box->left >= box->right || box->right > width || box->top >= box->bottom || box->bottom > height || box->front >= box->back) -@@ -4099,9 +4564,46 @@ +@@ -4099,9 +4564,46 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str WARN("Invalid box %s specified.\n", debug_box(box)); return; } @@ -2700,7 +2700,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4110,8 +4612,13 @@ +@@ -4110,8 +4612,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi { const struct blit_shader *blitter; struct wined3d_resource *resource; @@ -2714,7 +2714,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil); -@@ -4150,8 +4657,15 @@ +@@ -4150,8 +4657,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } @@ -2730,7 +2730,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, -@@ -4165,6 +4679,7 @@ +@@ -4165,6 +4679,7 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -2738,7 +2738,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -4180,6 +4695,22 @@ +@@ -4180,6 +4695,22 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -2761,7 +2761,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); -@@ -4219,6 +4750,7 @@ +@@ -4219,6 +4750,7 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -2769,7 +2769,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; -@@ -4226,6 +4758,15 @@ +@@ -4226,6 +4758,15 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -2785,7 +2785,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. */ -@@ -4237,6 +4778,7 @@ +@@ -4237,6 +4778,7 @@ 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) { @@ -2793,7 +2793,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; -@@ -4250,6 +4792,20 @@ +@@ -4250,6 +4792,20 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, } if ((fb->depth_stencil = view)) @@ -2814,7 +2814,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4471,8 +5027,10 @@ +@@ -4471,8 +5027,10 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) TRACE("device %p.\n", device); @@ -2825,7 +2825,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); -@@ -4480,6 +5038,7 @@ +@@ -4480,6 +5038,7 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -2833,7 +2833,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4498,6 +5057,36 @@ +@@ -4498,6 +5057,36 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -2870,7 +2870,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4519,6 +5108,7 @@ +@@ -4519,6 +5108,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -2878,7 +2878,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4537,6 +5127,14 @@ +@@ -4537,6 +5127,14 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -2893,7 +2893,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, -@@ -4553,6 +5151,7 @@ +@@ -4553,6 +5151,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru return hr; } @@ -2901,7 +2901,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)) { -@@ -4563,6 +5162,33 @@ +@@ -4563,6 +5162,33 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -2935,7 +2935,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4582,12 +5208,14 @@ +@@ -4582,12 +5208,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -2950,7 +2950,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"); -@@ -4607,9 +5235,16 @@ +@@ -4607,9 +5235,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -2967,7 +2967,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4618,6 +5253,7 @@ +@@ -4618,6 +5253,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -2975,7 +2975,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4627,6 +5263,12 @@ +@@ -4627,6 +5263,12 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { wined3d_texture_decref(device->cs->onscreen_depth_stencil->container); device->cs->onscreen_depth_stencil = NULL; @@ -2988,7 +2988,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4848,6 +5490,7 @@ +@@ -4848,6 +5490,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -2996,7 +2996,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = state_init(&device->state, &device->adapter->gl_info, &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -4872,6 +5515,32 @@ +@@ -4872,6 +5515,32 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -3029,7 +3029,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4879,7 +5548,11 @@ +@@ -4879,7 +5548,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { if (reset_state) hr = create_primary_opengl_context(device, swapchain); @@ -3041,7 +3041,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* All done. There is no need to reload resources or shaders, this will happen automatically on the -@@ -4959,6 +5632,7 @@ +@@ -4959,6 +5632,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -3049,7 +3049,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { if ((rtv = device->state.fb.render_targets[i]) && rtv->resource == resource) -@@ -4966,6 +5640,17 @@ +@@ -4966,6 +5640,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso } if ((rtv = device->state.fb.depth_stencil) && rtv->resource == resource) @@ -3067,7 +3067,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); switch (type) -@@ -5101,12 +5786,17 @@ +@@ -5101,12 +5786,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -3085,7 +3085,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state = &device->state; if (!(device->cs = wined3d_cs_create(device))) -@@ -5200,6 +5890,7 @@ +@@ -5200,6 +5890,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -3093,7 +3093,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, -@@ -5253,3 +5944,4 @@ +@@ -5253,3 +5944,4 @@ void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_ wined3d_device_destroy_bo(device, context, bo); } @@ -3101,7 +3101,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c -@@ -412,7 +412,11 @@ +@@ -412,7 +412,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed) { @@ -3113,7 +3113,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c const struct wined3d_stream_info *stream_info; struct wined3d_event_query *ib_query = NULL; struct wined3d_stream_info si_emulated; -@@ -438,6 +442,7 @@ +@@ -438,6 +442,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s for (i = 0; i < gl_info->limits.buffers; ++i) { struct wined3d_rendertarget_view *rtv = fb->render_targets[i]; @@ -3121,7 +3121,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c if (rtv && rtv->format->id != WINED3DFMT_NULL) { -@@ -451,6 +456,21 @@ +@@ -451,6 +456,21 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s else { wined3d_texture_prepare_location(target, rtv->sub_resource_idx, @@ -3143,7 +3143,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c context, rtv->resource->draw_binding); } } -@@ -470,8 +490,13 @@ +@@ -470,8 +490,13 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s { RECT current_rect, draw_rect, r; @@ -3157,7 +3157,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c if (surface_get_sub_resource(ds)->locations & location) SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); -@@ -482,7 +507,11 @@ +@@ -482,7 +507,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s IntersectRect(&r, &draw_rect, ¤t_rect); if (!EqualRect(&r, &draw_rect)) @@ -3172,7 +3172,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1475,7 +1475,11 @@ +@@ -1475,7 +1475,11 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context const struct wined3d_vec4 correction_params = { /* Position is relative to the framebuffer, not the viewport. */ @@ -3184,7 +3184,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c context->render_offscreen ? 1.0f : -1.0f, 0.0f, 0.0f, -@@ -1581,11 +1585,13 @@ +@@ -1581,11 +1585,13 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev { update_heap_entry(heap, i, priv->next_constant_version); } @@ -3198,7 +3198,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c } static void shader_glsl_update_float_pixel_constants(struct wined3d_device *device, UINT start, UINT count) -@@ -1598,11 +1604,13 @@ +@@ -1598,11 +1604,13 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi { update_heap_entry(heap, i, priv->next_constant_version); } @@ -3215,7 +3215,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -237,9 +237,11 @@ +@@ -237,9 +237,11 @@ static void wined3d_query_destroy_object(void *object) { struct wined3d_query *query = object; @@ -3227,7 +3227,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c /* Queries are specific to the GL context that created them. Not * deleting the query will obviously leak it, but that's still better * than potentially deleting a different query with the same id in this -@@ -300,6 +302,7 @@ +@@ -300,6 +302,7 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); @@ -3235,7 +3235,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (flags & WINED3DISSUE_END) query->counter_main++; -@@ -311,6 +314,9 @@ +@@ -311,6 +314,9 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) query->state = QUERY_SIGNALLED; return WINED3D_OK; @@ -3245,7 +3245,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) -@@ -321,10 +327,25 @@ +@@ -321,10 +327,25 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, void *data, DWORD size, DWORD flags) { @@ -3271,7 +3271,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (query->state == QUERY_CREATED) { -@@ -335,8 +356,10 @@ +@@ -335,8 +356,10 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -3282,7 +3282,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (query->state == QUERY_BUILDING) { /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ -@@ -352,6 +375,7 @@ +@@ -352,6 +375,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -3290,7 +3290,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (!wined3d_settings.cs_multithreaded) { if (!query->query_ops->query_poll(query)) -@@ -383,6 +407,14 @@ +@@ -383,6 +407,14 @@ static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) FIXME("%p Wrong thread, returning 1.\n", query); oq->samples = 1; return TRUE; @@ -3305,7 +3305,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } context = context_acquire(device, context_get_rt_surface(oq->context)); -@@ -393,6 +425,7 @@ +@@ -393,6 +425,7 @@ static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) if (available) { @@ -3313,7 +3313,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); TRACE("Returning %d samples.\n", samples); -@@ -464,6 +497,69 @@ +@@ -464,6 +497,69 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, if (data) fill_query_data(data, dwSize, &ret, sizeof(ret)); @@ -3383,7 +3383,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c return S_OK; } -@@ -482,7 +578,11 @@ +@@ -482,7 +578,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } @@ -3395,7 +3395,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { TRACE("query %p, flags %#x.\n", query, flags); -@@ -492,6 +592,7 @@ +@@ -492,6 +592,7 @@ static BOOL wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla struct wined3d_event_query *event_query = query->extendedData; /* Faked event query support */ @@ -3403,7 +3403,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (!event_query) return FALSE; wined3d_event_query_issue(event_query, query->device); -@@ -510,6 +611,30 @@ +@@ -510,6 +611,30 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; BOOL poll = FALSE; @@ -3434,7 +3434,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c TRACE("query %p, flags %#x.\n", query, flags); -@@ -521,7 +646,11 @@ +@@ -521,7 +646,11 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD /* This is allowed according to msdn and our tests. Reset the query and restart */ if (flags & WINED3DISSUE_BEGIN) { @@ -3446,7 +3446,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { if (oq->context->tid != GetCurrentThreadId()) { -@@ -550,7 +679,9 @@ +@@ -550,7 +679,9 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glBeginQuery()"); context_release(context); @@ -3456,7 +3456,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } if (flags & WINED3DISSUE_END) { -@@ -558,7 +689,11 @@ +@@ -558,7 +689,11 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD * our tests show that it returns OK. But OpenGL doesn't like it, so avoid * generating an error */ @@ -3468,7 +3468,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { if (oq->context->tid != GetCurrentThreadId()) { -@@ -572,10 +707,15 @@ +@@ -572,10 +707,15 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glEndQuery()"); context_release(context); @@ -3484,7 +3484,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } } else -@@ -583,6 +723,7 @@ +@@ -583,6 +723,7 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD FIXME("%p Occlusion queries not supported.\n", query); } @@ -3492,7 +3492,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c return poll; } -@@ -641,6 +782,47 @@ +@@ -641,6 +782,47 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) FIXME("%p Wrong thread, returning 1.\n", query); tq->timestamp = 1; return TRUE; @@ -3540,7 +3540,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } context = context_acquire(device, context_get_rt_surface(tq->context)); -@@ -651,6 +833,7 @@ +@@ -651,6 +833,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) if (available) { @@ -3548,7 +3548,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); -@@ -668,6 +851,28 @@ +@@ -668,6 +851,28 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) } static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) @@ -3577,7 +3577,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -700,6 +905,7 @@ +@@ -700,6 +905,7 @@ static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD } if (flags & WINED3DISSUE_END) @@ -3585,7 +3585,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c return TRUE; return FALSE; } -@@ -708,6 +914,18 @@ +@@ -708,6 +914,18 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer void *data, DWORD size, DWORD flags) { TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); @@ -3604,7 +3604,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) { static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -729,6 +947,7 @@ +@@ -729,6 +947,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer return S_OK; } @@ -3612,7 +3612,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) { return TRUE; -@@ -738,6 +957,18 @@ +@@ -738,6 +957,18 @@ static BOOL wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *que { TRACE("query %p, flags %#x.\n", query, flags); return FALSE; @@ -3631,7 +3631,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -752,6 +983,7 @@ +@@ -752,6 +983,7 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query return S_OK; } @@ -3639,7 +3639,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) { return TRUE; -@@ -761,6 +993,12 @@ +@@ -761,6 +993,12 @@ static BOOL wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWOR { FIXME("query %p, flags %#x.\n", query, flags); return FALSE; @@ -3652,7 +3652,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -775,6 +1013,7 @@ +@@ -775,6 +1013,7 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -3660,7 +3660,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query) { return TRUE; -@@ -825,6 +1064,47 @@ +@@ -825,6 +1064,47 @@ static const struct wined3d_query_ops overflow_query_ops = { wined3d_overflow_query_ops_get_data, wined3d_overflow_query_ops_poll, @@ -3708,7 +3708,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c wined3d_overflow_query_ops_issue }; -@@ -846,6 +1126,7 @@ +@@ -846,6 +1126,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de } query->query_ops = &occlusion_query_ops; query->data_size = sizeof(DWORD); @@ -3716,7 +3716,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c query->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct wined3d_occlusion_query)); if (!query->extendedData) -@@ -853,6 +1134,15 @@ +@@ -853,6 +1134,15 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de ERR("Failed to allocate occlusion query extended data.\n"); return E_OUTOFMEMORY; } @@ -3732,7 +3732,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c break; case WINED3D_QUERY_TYPE_EVENT: -@@ -939,7 +1229,9 @@ +@@ -939,7 +1229,9 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de query->state = QUERY_CREATED; query->device = device; query->ref = 1; @@ -3745,7 +3745,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -213,7 +213,9 @@ +@@ -213,7 +213,9 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * ERR("Failed to allocate system memory.\n"); return E_OUTOFMEMORY; } @@ -3755,7 +3755,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c } else { -@@ -237,6 +239,7 @@ +@@ -237,6 +239,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * return WINED3D_OK; } @@ -3763,7 +3763,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) { wined3d_resource_free_sysmem(resource); -@@ -244,6 +247,7 @@ +@@ -244,6 +247,7 @@ void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) context_resource_released(resource->device, resource, resource->type); } @@ -3771,7 +3771,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; -@@ -256,8 +260,14 @@ +@@ -256,8 +260,14 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -3786,7 +3786,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c } void resource_unload(struct wined3d_resource *resource) -@@ -340,7 +350,11 @@ +@@ -340,7 +350,11 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; *p = mem; @@ -3801,7 +3801,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c --- a/dlls/wined3d/sampler.c +++ b/dlls/wined3d/sampler.c -@@ -66,6 +66,7 @@ +@@ -66,6 +66,7 @@ void * CDECL wined3d_sampler_get_parent(const struct wined3d_sampler *sampler) return sampler->parent; } @@ -3809,7 +3809,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c void wined3d_sampler_init(struct wined3d_sampler *sampler) { const struct wined3d_gl_info *gl_info; -@@ -97,6 +98,45 @@ +@@ -97,6 +98,45 @@ void wined3d_sampler_init(struct wined3d_sampler *sampler) wined3d_gl_compare_func(sampler->desc.comparison_func))); if ((context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) && gl_info->supported[EXT_TEXTURE_SRGB_DECODE] && !sampler->desc.srgb_decode) @@ -3855,7 +3855,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT)); checkGLcall("sampler creation"); -@@ -108,12 +148,14 @@ +@@ -108,12 +148,14 @@ void wined3d_sampler_init(struct wined3d_sampler *sampler) HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct wined3d_sampler_desc *desc, void *parent, struct wined3d_sampler **sampler) { @@ -3870,7 +3870,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c struct wined3d_sampler *object; TRACE("device %p, desc %p, parent %p, sampler %p.\n", device, desc, parent, sampler); -@@ -134,6 +176,7 @@ +@@ -134,6 +176,7 @@ HRESULT wined3d_sampler_create_from_cs(struct wined3d_device *device, const stru if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; @@ -3878,7 +3878,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c object->refcount = 1; object->device = device; object->parent = parent; -@@ -142,6 +185,9 @@ +@@ -142,6 +185,9 @@ HRESULT wined3d_sampler_create_from_cs(struct wined3d_device *device, const stru wined3d_sampler_init(object); else wined3d_cs_emit_sampler_init(device->cs, object); @@ -3891,7 +3891,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -3018,7 +3018,11 @@ +@@ -3018,7 +3018,11 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 UINT i; memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ @@ -3906,7 +3906,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -105,7 +105,11 @@ +@@ -105,7 +105,11 @@ 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 */ @@ -3918,7 +3918,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; -@@ -382,6 +386,7 @@ +@@ -382,6 +386,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st GLenum srcBlend, dstBlend; unsigned int rt_fmt_flags; @@ -3926,7 +3926,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c if (!state->fb.render_targets[0]) { gl_info->gl_ops.gl.p_glDisable(GL_BLEND); -@@ -390,6 +395,16 @@ +@@ -390,6 +395,16 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st rt_format = state->fb.render_targets[0]->format; rt_fmt_flags = state->fb.render_targets[0]->format_flags; @@ -3943,7 +3943,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c /* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific * blending parameters to work. */ -@@ -823,7 +838,11 @@ +@@ -823,7 +838,11 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ GLint depthFail_ccw; /* No stencil test without a stencil buffer. */ @@ -3955,7 +3955,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"); -@@ -919,7 +938,11 @@ +@@ -919,7 +938,11 @@ 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) { @@ -3967,7 +3967,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)); -@@ -933,7 +956,11 @@ +@@ -933,7 +956,11 @@ 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) { @@ -3979,7 +3979,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); -@@ -1671,7 +1698,11 @@ +@@ -1671,7 +1698,11 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] || state->render_states[WINED3D_RS_DEPTHBIAS]) { @@ -3991,7 +3991,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c float scale; union -@@ -3604,7 +3635,11 @@ +@@ -3604,7 +3635,11 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state } else { @@ -4003,7 +4003,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c { ERR("Failed to create sampler.\n"); sampler = NULL; -@@ -4580,8 +4615,13 @@ +@@ -4580,8 +4615,13 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -4017,7 +4017,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; unsigned int width, height; -@@ -4767,7 +4807,11 @@ +@@ -4767,7 +4807,11 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st } else { @@ -4029,7 +4029,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c UINT height; UINT width; -@@ -4835,7 +4879,11 @@ +@@ -4835,7 +4879,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); @@ -4044,7 +4044,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c -@@ -430,7 +430,9 @@ +@@ -430,7 +430,9 @@ void state_unbind_resources(struct wined3d_state *state) struct wined3d_texture *texture; struct wined3d_buffer *buffer; struct wined3d_shader *shader; @@ -4054,7 +4054,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c unsigned int i, j; if ((decl = state->vertex_declaration)) -@@ -507,6 +509,7 @@ +@@ -507,6 +509,7 @@ void state_unbind_resources(struct wined3d_state *state) } } } @@ -4062,7 +4062,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c if (state->fb.depth_stencil) { -@@ -532,6 +535,7 @@ +@@ -532,6 +535,7 @@ void state_unbind_resources(struct wined3d_state *state) } } } @@ -4070,7 +4070,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c } void state_cleanup(struct wined3d_state *state) -@@ -556,8 +560,10 @@ +@@ -556,8 +560,10 @@ void state_cleanup(struct wined3d_state *state) HeapFree(GetProcessHeap(), 0, light); } } @@ -4081,7 +4081,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c } ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock) -@@ -1009,8 +1015,13 @@ +@@ -1009,8 +1015,13 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) gl_primitive_type = stateblock->state.gl_primitive_type; prev = device->update_state->gl_primitive_type; device->update_state->gl_primitive_type = gl_primitive_type; @@ -4095,7 +4095,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c } if (stateblock->changed.indices) -@@ -1269,6 +1280,7 @@ +@@ -1269,6 +1280,7 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0; /* TODO: Vertex offset in the presampled displacement map. */ state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; @@ -4103,7 +4103,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c state->textures[i] = NULL; } -@@ -1315,6 +1327,37 @@ +@@ -1315,6 +1327,37 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, if (FAILED(hr = state_init(&stateblock->state, gl_info, d3d_info, 0))) return hr; @@ -4144,7 +4144,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -36,11 +36,13 @@ +@@ -36,11 +36,13 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER; @@ -4158,7 +4158,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) { -@@ -324,7 +326,11 @@ +@@ -324,7 +326,11 @@ void wined3d_surface_destroy_dc(struct wined3d_surface *surface) gl_info = context->gl_info; } @@ -4170,7 +4170,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_unmap_bo_address(&data, gl_info, GL_PIXEL_UNPACK_BUFFER); if (context) -@@ -360,7 +366,11 @@ +@@ -360,7 +366,11 @@ HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) gl_info = context->gl_info; } @@ -4182,7 +4182,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c desc.pMemory = wined3d_texture_map_bo_address(&data, texture->sub_resources[sub_resource_idx].size, gl_info, GL_PIXEL_UNPACK_BUFFER, 0); -@@ -455,11 +465,17 @@ +@@ -455,11 +465,17 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, /* Make sure the locations are up-to-date. Loading the destination * surface isn't required if the entire surface is overwritten. */ @@ -4200,7 +4200,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c else wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location); -@@ -553,11 +569,17 @@ +@@ -553,11 +569,17 @@ static void surface_blt_fbo(const struct wined3d_device *device, * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with * the purpose of loading the destination surface.) */ @@ -4218,7 +4218,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c else wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, old_ctx, dst_location); -@@ -628,8 +650,12 @@ +@@ -628,8 +650,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); checkGLcall("glBlitFramebuffer()"); @@ -4231,7 +4231,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && dst_texture->swapchain->front_buffer == dst_texture)) gl_info->gl_ops.gl.p_glFlush(); -@@ -718,7 +744,12 @@ +@@ -718,7 +744,12 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const { struct wined3d_resource *resource = &surface->container->resource; struct wined3d_device *device = resource->device; @@ -4244,7 +4244,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct blit_shader *blitter; HRESULT hr; -@@ -729,6 +760,7 @@ +@@ -729,6 +760,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const return WINED3DERR_INVALIDCALL; } @@ -4252,7 +4252,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c view.resource = resource; view.parent = NULL; view.parent_ops = &wined3d_null_parent_ops; -@@ -740,6 +772,21 @@ +@@ -740,6 +772,21 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const view.sub_resource_idx = surface->texture_layer * surface->container->level_count + surface->texture_level; hr = blitter->depth_fill(device, &view, rect, WINED3DCLEAR_ZBUFFER, depth, 0); @@ -4274,7 +4274,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -804,7 +851,11 @@ +@@ -804,7 +851,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct } } @@ -4286,7 +4286,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) { -@@ -1182,6 +1233,7 @@ +@@ -1182,6 +1233,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P return WINED3DERR_INVALIDCALL; } @@ -4294,7 +4294,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Use surface_cpu_blt() instead of uploading directly if we need * conversion. Avoid calling wined3d_surface_blt() since that goes * through the CS. */ -@@ -1192,6 +1244,11 @@ +@@ -1192,6 +1244,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P return surface_cpu_blt(dst_texture, dst_sub_resource_idx, &dst_box, src_texture, src_sub_resource_idx, &src_box, 0, NULL, WINED3D_TEXF_POINT); } @@ -4306,7 +4306,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_texture->resource.device, NULL); gl_info = context->gl_info; -@@ -1202,11 +1259,19 @@ +@@ -1202,11 +1259,19 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_texture, context, FALSE); else @@ -4326,7 +4326,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_get_pitch(src_texture, src_surface->texture_level, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1707,6 +1772,7 @@ +@@ -1707,6 +1772,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr { unsigned int texture_level = sub_resource_idx % src_texture->level_count; const struct wined3d_format *src_format = src_texture->resource.format; @@ -4334,7 +4334,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -1715,6 +1781,13 @@ +@@ -1715,6 +1781,13 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr struct wined3d_context *context = NULL; struct wined3d_device *device = src_texture->resource.device; struct wined3d_bo_address src_bo_addr; @@ -4348,7 +4348,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(conv = find_converter(src_format->id, dst_format->id)) && (!device->d3d_initialized || !is_identity_fixup(src_format->color_fixup) || src_format->convert -@@ -1744,6 +1817,7 @@ +@@ -1744,6 +1817,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr return NULL; } @@ -4356,7 +4356,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_get_pitch(src_texture, sub_resource_idx & src_texture->level_count, &src_row_pitch, &src_slice_pitch); wined3d_texture_get_pitch(dst_texture, 0, &dst_row_pitch, &dst_slice_pitch); -@@ -1783,6 +1857,36 @@ +@@ -1783,6 +1857,36 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr /* FIXME: This seems weird, considering that we got a wined3d_bo_address from the source * surface above. Though not sure if the upload_data would work properly with a PBO src. */ struct wined3d_bo_address data = {0, src_data}; @@ -4393,7 +4393,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c RECT src_rect = {0, 0, desc.width, desc.height}; const struct wined3d_gl_info *gl_info; struct wined3d_context *context; -@@ -1795,6 +1899,7 @@ +@@ -1795,6 +1899,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr wined3d_texture_prepare_texture(dst_texture, context, FALSE); wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_surface_upload_data(dst_texture->sub_resources[0].u.surface, gl_info, src_format, @@ -4401,7 +4401,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &src_rect, src_row_pitch, &dst_point, FALSE, wined3d_const_bo_address(&data)); context_release(context); -@@ -1819,6 +1924,18 @@ +@@ -1819,6 +1924,18 @@ error: if (context) context_release(context); return NULL; @@ -4420,7 +4420,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -1896,7 +2013,11 @@ +@@ -1896,7 +2013,11 @@ static void read_from_framebuffer(struct wined3d_surface *surface, BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -4432,7 +4432,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c restore_rt = context_get_rt_surface(old_ctx); if (restore_rt != surface) -@@ -2423,9 +2544,13 @@ +@@ -2423,9 +2544,13 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glDeleteTextures(1, &backup)"); } @@ -4446,7 +4446,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ context_release(context); -@@ -2490,9 +2615,15 @@ +@@ -2490,9 +2615,15 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; @@ -4462,7 +4462,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_texture, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -2535,11 +2666,16 @@ +@@ -2535,11 +2666,16 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -4479,7 +4479,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ if (restore_rt) -@@ -2550,7 +2686,12 @@ +@@ -2550,7 +2686,12 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st { struct wined3d_resource *resource = &s->container->resource; struct wined3d_device *device = resource->device; @@ -4492,7 +4492,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct blit_shader *blitter; HRESULT hr; -@@ -2561,6 +2702,7 @@ +@@ -2561,6 +2702,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st return WINED3DERR_INVALIDCALL; } @@ -4500,7 +4500,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c view.resource = resource; view.parent = NULL; view.parent_ops = &wined3d_null_parent_ops; -@@ -2572,6 +2714,21 @@ +@@ -2572,6 +2714,21 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st view.sub_resource_idx = s->texture_layer * s->container->level_count + s->texture_level; hr = blitter->color_fill(device, &view, rect, color); @@ -4522,7 +4522,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -2582,7 +2739,11 @@ +@@ -2582,7 +2739,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE { struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; @@ -4534,7 +4534,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_texture *src_texture; -@@ -2883,9 +3044,13 @@ +@@ -2883,9 +3044,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -4548,7 +4548,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -2902,9 +3067,13 @@ +@@ -2902,9 +3067,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -4562,7 +4562,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -2913,6 +3082,69 @@ +@@ -2913,6 +3082,69 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win } } @@ -4632,7 +4632,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_load_sysmem(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location) -@@ -2925,9 +3157,20 @@ +@@ -2925,9 +3157,20 @@ static void surface_load_sysmem(struct wined3d_surface *surface, wined3d_texture_prepare_location(texture, sub_resource_idx, context, dst_location); sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -4653,7 +4653,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Download the surface to system memory. */ if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -2965,8 +3208,12 @@ +@@ -2965,8 +3208,12 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -4666,7 +4666,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_blt_to_drawable(texture->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3043,8 +3290,12 @@ +@@ -3043,8 +3290,12 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, == WINED3D_LOCATION_TEXTURE_RGB) { FIXME_(d3d_perf)("Downloading RGB surface %p to reload it as sRGB.\n", surface); @@ -4679,7 +4679,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -3053,8 +3304,12 @@ +@@ -3053,8 +3304,12 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, == WINED3D_LOCATION_TEXTURE_SRGB) { FIXME_(d3d_perf)("Downloading sRGB surface %p to reload it as RGB.\n", surface); @@ -4692,7 +4692,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } -@@ -3062,7 +3317,11 @@ +@@ -3062,7 +3317,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ @@ -4704,7 +4704,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -3076,6 +3335,7 @@ +@@ -3076,6 +3335,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -4712,7 +4712,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((format.convert || conversion) && texture->sub_resources[sub_resource_idx].buffer) { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3085,6 +3345,17 @@ +@@ -3085,6 +3345,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } wined3d_texture_get_memory(texture, sub_resource_idx, &data, sub_resource->locations, FALSE); @@ -4730,7 +4730,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3167,6 +3438,7 @@ +@@ -3167,6 +3438,7 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ @@ -4738,7 +4738,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) { unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); -@@ -3177,6 +3449,52 @@ +@@ -3177,6 +3449,52 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -4791,7 +4791,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { -@@ -3189,7 +3507,11 @@ +@@ -3189,7 +3507,11 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location)); @@ -4803,7 +4803,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3202,7 +3524,11 @@ +@@ -3202,7 +3524,11 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -4815,7 +4815,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3214,7 +3540,11 @@ +@@ -3214,7 +3540,11 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -4827,7 +4827,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3223,7 +3553,19 @@ +@@ -3223,7 +3553,19 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte } done: @@ -4847,7 +4847,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -3555,6 +3897,7 @@ +@@ -3555,6 +3897,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int const BYTE *sbuf; BYTE *dbuf; int x, y; @@ -4855,7 +4855,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_device *device = dst_texture->resource.device; struct wined3d_context *context = NULL; struct wined3d_bo_address src_bo_addr, dst_bo_addr; -@@ -3582,6 +3925,18 @@ +@@ -3582,6 +3925,18 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int wined3d_texture_get_pitch(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_map.row_pitch, &dst_map.slice_pitch); @@ -4874,7 +4874,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_map = dst_map; src_format = dst_texture->resource.format; dst_format = src_format; -@@ -3606,6 +3961,7 @@ +@@ -3606,6 +3961,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_texture = converted_texture; src_sub_resource_idx = 0; } @@ -4882,7 +4882,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load_location(src_texture, src_sub_resource_idx, context, src_texture->resource.map_binding); wined3d_texture_get_pitch(src_texture, src_sub_resource_idx % src_texture->level_count, -@@ -3616,6 +3972,9 @@ +@@ -3616,6 +3972,9 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_texture->sub_resources[src_sub_resource_idx].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); @@ -4892,7 +4892,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_texture->resource.format; src_fmt_flags = src_texture->resource.format_flags; } -@@ -3625,6 +3984,7 @@ +@@ -3625,6 +3984,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_fmt_flags = dst_fmt_flags; } @@ -4900,7 +4900,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_bo_addr, dst_texture->resource.map_binding, FALSE); dst_map.data = wined3d_texture_map_bo_address(&dst_bo_addr, -@@ -3632,6 +3992,9 @@ +@@ -3632,6 +3992,9 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); wined3d_texture_get_pitch(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_map.row_pitch, &dst_map.slice_pitch); @@ -4910,7 +4910,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_format->byte_count; -@@ -3645,9 +4008,18 @@ +@@ -3645,9 +4008,18 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int sbase = (BYTE *)src_map.data + ((src_box->top / src_format->block_height) * src_map.row_pitch) + ((src_box->left / src_format->block_width) * src_format->block_byte_count); @@ -4929,7 +4929,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4040,6 +4412,7 @@ +@@ -4040,6 +4412,7 @@ do { \ } } @@ -4937,7 +4937,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.map_binding); -@@ -4066,6 +4439,18 @@ +@@ -4066,6 +4439,18 @@ release: wined3d_texture_decref(converted_texture); if (context) context_release(context); @@ -4956,7 +4956,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4110,7 +4495,11 @@ +@@ -4110,7 +4495,11 @@ const struct blit_shader cpu_blit = { cpu_blit_blit_surface, }; @@ -4968,7 +4968,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { -@@ -4120,8 +4509,14 @@ +@@ -4120,8 +4509,14 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; struct wined3d_swapchain *src_swapchain, *dst_swapchain; @@ -4983,7 +4983,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD src_ds_flags, dst_ds_flags; BOOL scale, convert; -@@ -4134,6 +4529,7 @@ +@@ -4134,6 +4529,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, | WINED3D_BLT_DO_NOT_WAIT | WINED3D_BLT_ALPHA_TEST; @@ -4991,7 +4991,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_surface) { src_texture = src_surface->container; -@@ -4145,6 +4541,86 @@ +@@ -4145,6 +4541,86 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, src_texture = NULL; src_sub_resource_idx = 0; src_swapchain = NULL; @@ -5078,7 +5078,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (!device->d3d_initialized) -@@ -4169,6 +4645,13 @@ +@@ -4169,6 +4645,13 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, goto fallback; } @@ -5092,7 +5092,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dst_swapchain = dst_texture->swapchain; /* This isn't strictly needed. FBO blits for example could deal with -@@ -4204,6 +4687,7 @@ +@@ -4204,6 +4687,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth)) @@ -5100,7 +5100,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -4214,6 +4698,24 @@ +@@ -4214,6 +4698,24 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_texture->resource.draw_binding, src_rect, dst_surface, dst_texture->resource.draw_binding, dst_rect))) return; @@ -5125,7 +5125,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4249,7 +4751,11 @@ +@@ -4249,7 +4751,11 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) @@ -5137,7 +5137,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4288,11 +4794,18 @@ +@@ -4288,11 +4794,18 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, if (!wined3d_resource_is_offscreen(&dst_texture->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -5156,7 +5156,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4316,7 +4829,11 @@ +@@ -4316,7 +4829,11 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -5168,7 +5168,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -@@ -4337,7 +4854,11 @@ +@@ -4337,7 +4854,11 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding); @@ -5180,7 +5180,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -@@ -4347,7 +4868,11 @@ +@@ -4347,7 +4868,11 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, { blitter->blit_surface(device, blit_op, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); @@ -5192,7 +5192,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4355,6 +4880,7 @@ +@@ -4355,6 +4880,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, fallback: /* Special cases for render targets. */ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) @@ -5200,7 +5200,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; cpu: -@@ -4499,4 +5025,11 @@ +@@ -4499,4 +5025,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst flags, fx, filter); return WINED3D_OK; @@ -5215,7 +5215,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -105,11 +105,13 @@ +@@ -105,11 +105,13 @@ ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain) if (!refcount) { @@ -5229,7 +5229,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c swapchain_cleanup(swapchain); swapchain->parent_ops->wined3d_object_destroyed(swapchain->parent); HeapFree(GetProcessHeap(), 0, swapchain); -@@ -332,7 +334,11 @@ +@@ -332,7 +334,11 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, if (texture->resource.multisample_type) { location = WINED3D_LOCATION_RB_RESOLVED; @@ -5241,7 +5241,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, back_buffer, NULL, location); -@@ -462,7 +468,11 @@ +@@ -462,7 +468,11 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct sub_resource = &texture->sub_resources[0]; if (!(sub_resource->locations & supported_locations)) @@ -5253,7 +5253,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c texture_prev->texture_rgb = texture->texture_rgb; texture_prev->rb_multisample = texture->rb_multisample; -@@ -483,10 +493,17 @@ +@@ -483,10 +493,17 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct } static void swapchain_gl_present(struct wined3d_swapchain *swapchain, @@ -5271,7 +5271,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c const struct wined3d_gl_info *gl_info; struct wined3d_texture *logo_texture; struct wined3d_context *context; -@@ -507,8 +524,12 @@ +@@ -507,8 +524,12 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, RECT rect = {0, 0, logo_texture->resource.width, logo_texture->resource.height}; /* Blit the logo into the upper left corner of the drawable. */ @@ -5284,7 +5284,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT); } -@@ -537,8 +558,13 @@ +@@ -537,8 +558,13 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, if (swapchain->desc.windowed) MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&dst_rect, 2); if (wined3d_clip_blit(&clip_rect, &dst_rect, &src_rect)) @@ -5298,7 +5298,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT); } -@@ -562,6 +588,7 @@ +@@ -562,6 +588,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, */ if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { @@ -5306,7 +5306,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c wined3d_texture_load_location(back_buffer->container, 0, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(back_buffer->container, 0, WINED3D_LOCATION_DRAWABLE); swapchain->render_to_fbo = TRUE; -@@ -571,6 +598,16 @@ +@@ -571,6 +598,16 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, { wined3d_texture_load_location(swapchain->back_buffers[0], 0, context, swapchain->back_buffers[0]->resource.draw_binding); @@ -5323,7 +5323,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } if (swapchain->render_to_fbo) -@@ -583,8 +620,13 @@ +@@ -583,8 +620,13 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, swapchain_blit(swapchain, context, src_rect, dst_rect); } @@ -5337,7 +5337,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); -@@ -621,6 +663,7 @@ +@@ -621,6 +663,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1], 0, WINED3D_LOCATION_DISCARDED); @@ -5345,7 +5345,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c if (depth_stencil) { struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(depth_stencil); -@@ -634,6 +677,21 @@ +@@ -634,6 +677,21 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, { wined3d_texture_decref(swapchain->device->cs->onscreen_depth_stencil->container); swapchain->device->cs->onscreen_depth_stencil = NULL; @@ -5367,7 +5367,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } } } -@@ -643,12 +701,21 @@ +@@ -643,12 +701,21 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, static void swapchain_gl_frontbuffer_updated(struct wined3d_swapchain *swapchain) { @@ -5389,7 +5389,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c context_release(context); SetRectEmpty(&swapchain->front_buffer_update); } -@@ -704,8 +771,12 @@ +@@ -704,8 +771,12 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai } static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, @@ -5402,7 +5402,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c { struct wined3d_surface *front, *back; HBITMAP bitmap; -@@ -816,6 +887,7 @@ +@@ -816,6 +887,7 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s *quality = 0; } @@ -5410,7 +5410,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { const struct wined3d_adapter *adapter = device->adapter; -@@ -879,6 +951,7 @@ +@@ -879,6 +951,7 @@ HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3 return WINED3D_OK; } @@ -5418,7 +5418,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) { -@@ -996,9 +1069,67 @@ +@@ -996,9 +1069,67 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 if (!(device->wined3d->flags & WINED3D_NO3D)) { @@ -5486,7 +5486,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } if (swapchain->desc.backbuffer_count > 0) -@@ -1324,7 +1455,9 @@ +@@ -1324,7 +1455,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha enum wined3d_multisample_type multisample_type, unsigned int multisample_quality) { BOOL update_desc = FALSE; @@ -5496,7 +5496,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c TRACE("swapchain %p, buffer_count %u, width %u, height %u, format %s, " "multisample_type %#x, multisample_quality %#x.\n", -@@ -1336,9 +1469,11 @@ +@@ -1336,9 +1469,11 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha if (buffer_count && buffer_count != swapchain->desc.backbuffer_count) FIXME("Cannot change the back buffer count yet.\n"); @@ -5511,7 +5511,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -104,7 +104,9 @@ +@@ -104,7 +104,9 @@ static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture) sub_resource->locations &= ~WINED3D_LOCATION_SYSMEM; } wined3d_resource_free_sysmem(&texture->resource); @@ -5521,7 +5521,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } void wined3d_texture_validate_location(struct wined3d_texture *texture, -@@ -196,7 +198,11 @@ +@@ -196,7 +198,11 @@ void wined3d_texture_unmap_bo_address(const struct wined3d_bo_address *data, } void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, @@ -5533,7 +5533,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c { struct wined3d_texture_sub_resource *sub_resource; -@@ -207,10 +213,14 @@ +@@ -207,10 +213,14 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su if (locations & WINED3D_LOCATION_BUFFER) { data->addr = NULL; @@ -5548,7 +5548,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return; } if (locations & WINED3D_LOCATION_USER_MEMORY) -@@ -221,10 +231,14 @@ +@@ -221,10 +231,14 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su } if (locations & WINED3D_LOCATION_SYSMEM) { @@ -5563,7 +5563,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c data->addr += sub_resource->offset; data->buffer_object = 0; return; -@@ -310,6 +324,7 @@ +@@ -310,6 +324,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc /* Context activation is done by the caller. */ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture, @@ -5571,7 +5571,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c unsigned int sub_resource_idx, struct wined3d_context *context) { struct wined3d_gl_bo *buffer = texture->sub_resources[sub_resource_idx].buffer; -@@ -326,6 +341,20 @@ +@@ -326,6 +341,20 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture TRACE("Deleted buffer object %u for texture %p, sub-resource %u.\n", name, texture, sub_resource_idx); @@ -5592,7 +5592,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void wined3d_texture_update_map_binding(struct wined3d_texture *texture) -@@ -342,10 +371,17 @@ +@@ -342,10 +371,17 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture) for (i = 0; i < sub_count; ++i) { if (texture->sub_resources[i].locations == texture->resource.map_binding @@ -5610,7 +5610,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } if (context) -@@ -479,6 +515,7 @@ +@@ -479,6 +515,7 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture) resource_unload(&texture->resource); } @@ -5618,7 +5618,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void wined3d_texture_destroy_object(void *object) { struct wined3d_texture *texture = object; -@@ -516,6 +553,42 @@ +@@ -516,6 +553,42 @@ static void wined3d_texture_destroy_object(void *object) texture->texture_ops->texture_cleanup_sub_resources(texture); wined3d_texture_unload_gl_texture(texture); HeapFree(GetProcessHeap(), 0, texture); @@ -5661,7 +5661,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) -@@ -809,6 +882,7 @@ +@@ -809,6 +882,7 @@ ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture) return refcount; } @@ -5669,7 +5669,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void wined3d_texture_cleanup_main(struct wined3d_texture *texture) { struct wined3d_device *device = texture->resource.device; -@@ -832,6 +906,7 @@ +@@ -832,6 +906,7 @@ static void wined3d_texture_cleanup_main(struct wined3d_texture *texture) wined3d_cs_emit_destroy_object(device->cs, wined3d_texture_destroy_object, texture); } @@ -5677,7 +5677,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) { ULONG refcount; -@@ -846,8 +921,14 @@ +@@ -846,8 +921,14 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) if (!refcount) { @@ -5692,7 +5692,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } return refcount; -@@ -897,7 +978,11 @@ +@@ -897,7 +978,11 @@ void wined3d_texture_load(struct wined3d_texture *texture, TRACE("Reloading because of color key value change.\n"); for (i = 0; i < sub_count; i++) { @@ -5704,7 +5704,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding)); else wined3d_texture_invalidate_location(texture, i, ~texture->resource.map_binding); -@@ -915,7 +1000,11 @@ +@@ -915,7 +1000,11 @@ void wined3d_texture_load(struct wined3d_texture *texture, /* Reload the surfaces if the texture is marked dirty. */ for (i = 0; i < sub_count; ++i) { @@ -5716,7 +5716,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB)) ERR("Failed to load location (srgb %#x).\n", srgb); } -@@ -924,8 +1013,15 @@ +@@ -924,8 +1013,15 @@ void wined3d_texture_load(struct wined3d_texture *texture, void CDECL wined3d_texture_preload(struct wined3d_texture *texture) { @@ -5732,7 +5732,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture) -@@ -988,6 +1084,7 @@ +@@ -988,6 +1084,7 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) if (texture->lod != lod) { @@ -5740,7 +5740,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (wined3d_settings.cs_multithreaded) { struct wined3d_device *device = texture->resource.device; -@@ -995,6 +1092,7 @@ +@@ -995,6 +1092,7 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) device->cs->ops->finish(device->cs); } @@ -5748,7 +5748,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->lod = lod; texture->texture_rgb.base_level = ~0u; -@@ -1115,10 +1213,14 @@ +@@ -1115,10 +1213,14 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT } if (device->d3d_initialized) @@ -5763,7 +5763,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c sub_resource = &texture->sub_resources[0]; surface = sub_resource->u.surface; -@@ -1129,7 +1231,9 @@ +@@ -1129,7 +1231,9 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT } wined3d_resource_free_sysmem(&texture->resource); @@ -5773,7 +5773,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if ((texture->row_pitch = pitch)) texture->slice_pitch = height * pitch; -@@ -1186,6 +1290,7 @@ +@@ -1186,6 +1290,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT wined3d_texture_invalidate_location(texture, 0, ~valid_location); if (create_dib) @@ -5781,7 +5781,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c { HDC dc; wined3d_texture_get_dc(texture, 0, &dc); -@@ -1219,6 +1324,31 @@ +@@ -1219,6 +1324,31 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur * message. Freeing the actual memory and setting the read pointer to 0 is * the task of the worker thread. */ texture->resource.map_heap_memory = NULL; @@ -5813,7 +5813,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void wined3d_texture_force_reload(struct wined3d_texture *texture) -@@ -1336,7 +1466,9 @@ +@@ -1336,7 +1466,9 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned ERR("Failed to allocate system memory.\n"); return FALSE; } @@ -5823,7 +5823,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return TRUE; case WINED3D_LOCATION_USER_MEMORY: -@@ -1345,7 +1477,11 @@ +@@ -1345,7 +1477,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned return TRUE; case WINED3D_LOCATION_BUFFER: @@ -5835,7 +5835,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return TRUE; case WINED3D_LOCATION_TEXTURE_RGB: -@@ -1416,7 +1552,11 @@ +@@ -1416,7 +1552,11 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); context = context_acquire(texture->resource.device, NULL); @@ -5847,7 +5847,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c context, texture->resource.map_binding)) { ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding)); -@@ -1462,7 +1602,9 @@ +@@ -1462,7 +1602,9 @@ static HRESULT wined3d_texture_upload_data(struct wined3d_texture *texture, return WINED3D_OK; } @@ -5857,7 +5857,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_sub_resource_data *data) { -@@ -1485,8 +1627,12 @@ +@@ -1485,8 +1627,12 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) { @@ -5870,7 +5870,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } /* Context activation is done by the caller. */ -@@ -1576,6 +1722,10 @@ +@@ -1576,6 +1722,10 @@ static void texture2d_cleanup_sub_resources(struct wined3d_texture *texture) list_remove(&overlay->overlay_entry); overlay->overlay_dest = NULL; } @@ -5881,7 +5881,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } if (context) context_release(context); -@@ -1624,7 +1774,11 @@ +@@ -1624,7 +1774,11 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[i]; if (resource->pool != WINED3D_POOL_DEFAULT @@ -5893,7 +5893,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c { wined3d_texture_invalidate_location(texture, i, ~resource->map_binding); } -@@ -1639,8 +1793,13 @@ +@@ -1639,8 +1793,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED); } @@ -5907,7 +5907,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (resource->type == WINED3D_RTYPE_TEXTURE_2D) { -@@ -1665,6 +1824,7 @@ +@@ -1665,6 +1824,7 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_unload_gl_texture(texture); } @@ -5915,7 +5915,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD flags) { struct wined3d_device *device = texture->resource.device; -@@ -1746,6 +1906,7 @@ +@@ -1746,6 +1906,7 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int return data; } @@ -5923,7 +5923,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -1753,9 +1914,19 @@ +@@ -1753,9 +1914,19 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour struct wined3d_texture_sub_resource *sub_resource; struct wined3d_device *device = resource->device; unsigned int fmt_flags = resource->format_flags; @@ -5943,7 +5943,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", resource, sub_resource_idx, map_desc, debug_box(box), flags); -@@ -1802,6 +1973,7 @@ +@@ -1802,6 +1973,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour flags = wined3d_resource_sanitize_map_flags(resource, flags); @@ -5951,7 +5951,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (flags & WINED3D_MAP_NOOVERWRITE) FIXME("WINED3D_MAP_NOOVERWRITE is not implemented yet.\n"); -@@ -1823,6 +1995,47 @@ +@@ -1823,6 +1995,47 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour wined3d_resource_wait_fence(&texture->resource); base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags); @@ -5999,7 +5999,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) { -@@ -1858,6 +2071,19 @@ +@@ -1858,6 +2071,19 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour } } @@ -6019,7 +6019,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c ++resource->map_count; ++sub_resource->map_count; -@@ -1867,6 +2093,7 @@ +@@ -1867,6 +2093,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3D_OK; } @@ -6027,7 +6027,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx) { struct wined3d_context *context = NULL; -@@ -1922,6 +2149,16 @@ +@@ -1922,6 +2149,16 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso struct wined3d_texture_sub_resource *sub_resource; struct wined3d_texture *texture; struct wined3d_device *device = resource->device; @@ -6044,7 +6044,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); -@@ -1937,6 +2174,7 @@ +@@ -1937,6 +2174,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso return WINEDDERR_NOTLOCKED; } @@ -6052,7 +6052,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_cs_emit_texture_unmap(device->cs, texture, sub_resource_idx); if (sub_resource->unmap_dirtify) -@@ -1944,6 +2182,28 @@ +@@ -1944,6 +2182,28 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso wined3d_cs_emit_texture_changed(device->cs, texture, sub_resource_idx, sub_resource->map_buffer, resource->map_heap_memory); sub_resource->unmap_dirtify = FALSE; @@ -6081,7 +6081,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } --sub_resource->map_count; -@@ -1977,7 +2237,9 @@ +@@ -1977,7 +2237,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 && !gl_info->supported[EXT_TEXTURE_ARRAY]) { WARN("OpenGL implementation does not support array textures.\n"); @@ -6091,7 +6091,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1986,7 +2248,9 @@ +@@ -1986,7 +2248,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6101,7 +6101,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -2009,7 +2273,9 @@ +@@ -2009,7 +2273,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if (desc->pool != WINED3D_POOL_SCRATCH) { WARN("Attempted to create a mipmapped/cube/array NPOT texture without unconditional NPOT support.\n"); @@ -6111,7 +6111,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -2027,7 +2293,9 @@ +@@ -2027,7 +2293,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 { FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", desc->width, desc->height); @@ -6121,7 +6121,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_NOTAVAILABLE; } -@@ -2059,7 +2327,9 @@ +@@ -2059,7 +2327,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if (desc->pool == WINED3D_POOL_DEFAULT || desc->pool == WINED3D_POOL_MANAGED) { WARN("Dimensions (%ux%u) exceed the maximum texture size.\n", pow2_width, pow2_height); @@ -6131,7 +6131,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_NOTAVAILABLE; } -@@ -2073,6 +2343,7 @@ +@@ -2073,6 +2343,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -6139,7 +6139,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -2081,6 +2352,14 @@ +@@ -2081,6 +2352,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6154,7 +6154,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -2089,7 +2368,9 @@ +@@ -2089,7 +2368,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6164,7 +6164,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -2131,7 +2412,11 @@ +@@ -2131,7 +2412,11 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if (level_count > ~(SIZE_T)0 / layer_count || !(surfaces = wined3d_calloc(level_count * layer_count, sizeof(*surfaces)))) { @@ -6176,7 +6176,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return E_OUTOFMEMORY; } -@@ -2174,7 +2459,11 @@ +@@ -2174,7 +2459,11 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 texture, idx, &sub_resource->parent, &sub_resource->parent_ops))) { WARN("Failed to create surface parent, hr %#x.\n", hr); @@ -6188,7 +6188,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -2182,6 +2471,7 @@ +@@ -2182,6 +2471,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 TRACE("Created surface level %u, layer %u @ %p.\n", i, j, surface); @@ -6196,7 +6196,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D)) { HDC dc; -@@ -2191,6 +2481,13 @@ +@@ -2191,6 +2481,13 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 return hr; } wined3d_texture_release_dc(texture, idx, dc); @@ -6210,7 +6210,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } } } -@@ -2198,7 +2495,9 @@ +@@ -2198,7 +2495,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 return WINED3D_OK; } @@ -6220,7 +6220,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void texture3d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_sub_resource_data *data) { -@@ -2257,6 +2556,23 @@ +@@ -2257,6 +2556,23 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi static void texture3d_cleanup_sub_resources(struct wined3d_texture *texture) { @@ -6244,7 +6244,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture->sub_resources[0].u.volume); } -@@ -2310,7 +2626,9 @@ +@@ -2310,7 +2626,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (layer_count != 1) { ERR("Invalid layer count for volume texture.\n"); @@ -6254,7 +6254,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return E_INVALIDARG; } -@@ -2319,6 +2637,7 @@ +@@ -2319,6 +2637,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6262,7 +6262,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -2327,6 +2646,14 @@ +@@ -2327,6 +2646,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6277,7 +6277,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -2336,6 +2663,7 @@ +@@ -2336,6 +2663,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6285,7 +6285,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -2344,6 +2672,14 @@ +@@ -2344,6 +2672,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6300,7 +6300,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -2352,7 +2688,9 @@ +@@ -2352,7 +2688,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct || desc->pool == WINED3D_POOL_SCRATCH)) { WARN("Attempted to create a DYNAMIC texture in pool %s.\n", debug_d3dpool(desc->pool)); @@ -6310,7 +6310,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -2379,7 +2717,9 @@ +@@ -2379,7 +2717,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6320,7 +6320,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -2389,7 +2729,9 @@ +@@ -2389,7 +2729,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct 0, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6330,7 +6330,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -2402,6 +2744,7 @@ +@@ -2402,6 +2744,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (wined3d_texture_use_pbo(texture, gl_info)) { wined3d_resource_free_sysmem(&texture->resource); @@ -6338,7 +6338,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.map_heap_memory = NULL; texture->resource.map_binding = WINED3D_LOCATION_BUFFER; } -@@ -2409,6 +2752,14 @@ +@@ -2409,6 +2752,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (!(volumes = wined3d_calloc(level_count, sizeof(*volumes)))) { wined3d_texture_cleanup_main(texture); @@ -6353,7 +6353,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return E_OUTOFMEMORY; } -@@ -2430,7 +2781,11 @@ +@@ -2430,7 +2781,11 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct texture, i, &sub_resource->parent, &sub_resource->parent_ops))) { WARN("Failed to create volume parent, hr %#x.\n", hr); @@ -6365,7 +6365,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -2727,6 +3082,9 @@ +@@ -2727,6 +3082,9 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6375,7 +6375,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -2734,7 +3092,12 @@ +@@ -2734,7 +3092,12 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct * in this case. */ if (data && FAILED(hr = wined3d_texture_upload_data(object, data))) { @@ -6388,7 +6388,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -2744,6 +3107,7 @@ +@@ -2744,6 +3107,7 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct return WINED3D_OK; } @@ -6396,7 +6396,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c void wined3d_texture_get_dc_cs(struct wined3d_texture *texture, unsigned int sub_resource_idx) { struct wined3d_device *device = texture->resource.device; -@@ -2777,6 +3141,15 @@ +@@ -2777,6 +3141,15 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i struct wined3d_device *device = texture->resource.device; struct wined3d_texture_sub_resource *sub_resource; struct wined3d_surface *surface; @@ -6412,7 +6412,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); -@@ -2794,6 +3167,7 @@ +@@ -2794,6 +3167,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) return WINED3DERR_INVALIDCALL; @@ -6420,7 +6420,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_cs_emit_get_dc(device->cs, texture, sub_resource_idx); if (FAILED(texture->dc_hr)) return texture->dc_hr; -@@ -2818,6 +3192,30 @@ +@@ -2818,6 +3192,30 @@ void wined3d_texture_release_dc_cs(struct wined3d_texture *texture, unsigned int wined3d_texture_update_map_binding(texture); if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE; @@ -6451,7 +6451,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) -@@ -2848,6 +3246,7 @@ +@@ -2848,6 +3246,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign return WINED3DERR_INVALIDCALL; } @@ -6459,7 +6459,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_cs_emit_release_dc(device->cs, texture, sub_resource_idx); return WINED3D_OK; -@@ -2981,4 +3380,16 @@ +@@ -2981,4 +3380,16 @@ BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int } } return ret; @@ -6479,7 +6479,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4466,7 +4466,11 @@ +@@ -4466,7 +4466,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w float y_offset = context->render_offscreen ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -6491,7 +6491,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? 2.0f : 0.0f; float z_offset = zenable ? -1.0f : 0.0f; -@@ -5263,7 +5267,11 @@ +@@ -5263,7 +5267,11 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d break; } } @@ -6506,7 +6506,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -119,6 +119,29 @@ +@@ -119,6 +119,29 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, } @@ -6536,7 +6536,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume, struct wined3d_context *context, BOOL dest_is_srgb) -@@ -149,6 +172,9 @@ +@@ -149,6 +172,9 @@ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume, BOOL wined3d_volume_load_location(struct wined3d_volume *volume, struct wined3d_context *context, DWORD location) { @@ -6546,7 +6546,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c unsigned int sub_resource_idx = volume->texture_level; struct wined3d_texture *texture = volume->container; struct wined3d_texture_sub_resource *sub_resource; -@@ -157,8 +183,34 @@ +@@ -157,8 +183,34 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume, TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), wined3d_debug_location(sub_resource->locations)); @@ -6581,7 +6581,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c switch (location) { -@@ -174,7 +226,11 @@ +@@ -174,7 +226,11 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume, } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -6593,7 +6593,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(texture, sub_resource_idx, context, &data); -@@ -219,7 +275,11 @@ +@@ -219,7 +275,11 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume, case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -6605,7 +6605,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); -@@ -242,6 +302,9 @@ +@@ -242,6 +302,9 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume, return FALSE; } @@ -6618,7 +6618,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c -@@ -91,7 +91,9 @@ +@@ -91,7 +91,9 @@ struct wined3d_settings wined3d_settings = ~0U, /* No PS shader model limit by default. */ ~0u, /* No CS shader model limit by default. */ FALSE, /* 3D support enabled by default. */ @@ -6628,7 +6628,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c }; struct wined3d * CDECL wined3d_create(DWORD flags) -@@ -335,6 +337,7 @@ +@@ -335,6 +337,7 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) TRACE("Disabling 3D support.\n"); wined3d_settings.no_3d = TRUE; } @@ -6636,7 +6636,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c if (!get_config_key(hkey, appkey, "CSMT", buffer, size) && !strcmp(buffer,"disabled")) { -@@ -345,6 +348,9 @@ +@@ -345,6 +348,9 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) FIXME_(winediag)("Experimental wined3d CSMT feature is currently %s.\n", wined3d_settings.cs_multithreaded ? "enabled" : "disabled"); @@ -6659,7 +6659,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #include #include #include -@@ -311,7 +313,9 @@ +@@ -311,7 +313,9 @@ struct wined3d_settings unsigned int max_sm_ps; unsigned int max_sm_cs; BOOL no_3d; @@ -6669,7 +6669,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1358,8 +1362,10 @@ +@@ -1358,8 +1362,10 @@ struct wined3d_occlusion_query struct list entry; GLuint id; struct wined3d_context *context; @@ -6680,7 +6680,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1395,6 +1401,7 @@ +@@ -1395,6 +1401,7 @@ struct wined3d_timestamp_query struct list entry; GLuint id; struct wined3d_context *context; @@ -6688,7 +6688,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT64 timestamp; }; -@@ -1430,6 +1437,12 @@ +@@ -1430,6 +1437,12 @@ static inline void wined3d_fb_copy(struct wined3d_fb_state *dst, const struct wi for (i = 0; i < min(dst->rt_size, src->rt_size); i++) dst->render_targets[i] = src->render_targets[i]; } @@ -6701,7 +6701,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context { -@@ -1445,7 +1458,9 @@ +@@ -1445,7 +1458,9 @@ 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 */ @@ -6711,7 +6711,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_swapchain *swapchain; struct -@@ -1553,6 +1568,14 @@ +@@ -1553,6 +1568,14 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -6726,7 +6726,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); struct StateEntry -@@ -1691,7 +1714,11 @@ +@@ -1691,7 +1714,11 @@ void context_alloc_event_query(struct wined3d_context *context, void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; @@ -6738,7 +6738,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2314,7 +2341,11 @@ +@@ -2314,7 +2341,11 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -6750,7 +6750,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2360,6 +2391,7 @@ +@@ -2360,6 +2391,7 @@ struct wined3d_state DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -6758,7 +6758,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_gl_bo { GLuint name; -@@ -2368,6 +2400,7 @@ +@@ -2368,6 +2400,7 @@ struct wined3d_gl_bo UINT size; }; @@ -6766,7 +6766,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2420,11 +2453,23 @@ +@@ -2420,11 +2453,23 @@ struct wined3d_device struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -6790,7 +6790,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2472,6 +2517,7 @@ +@@ -2472,6 +2517,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -6798,7 +6798,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -@@ -2483,6 +2529,11 @@ +@@ -2483,6 +2529,11 @@ void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -6810,7 +6810,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2526,9 +2577,14 @@ +@@ -2526,9 +2577,14 @@ struct wined3d_resource UINT depth; UINT size; DWORD priority; @@ -6825,7 +6825,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2554,7 +2610,9 @@ +@@ -2554,7 +2610,9 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -6835,7 +6835,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; -@@ -2562,6 +2620,7 @@ +@@ -2562,6 +2620,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -6843,7 +6843,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h static inline void wined3d_resource_inc_fence(struct wined3d_resource *resource) { InterlockedIncrement(&resource->access_fence); -@@ -2577,6 +2636,7 @@ +@@ -2577,6 +2636,7 @@ static inline void wined3d_resource_wait_fence(struct wined3d_resource *resource while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -6851,7 +6851,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2634,7 +2694,9 @@ +@@ -2634,7 +2694,9 @@ struct wined3d_texture DWORD flags; GLenum target; DWORD update_map_binding; @@ -6861,7 +6861,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; -@@ -2672,8 +2734,12 @@ +@@ -2672,8 +2734,12 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -6874,7 +6874,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -2724,6 +2790,7 @@ +@@ -2724,6 +2790,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; @@ -6882,7 +6882,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; -@@ -2733,6 +2800,13 @@ +@@ -2733,6 +2800,13 @@ void wined3d_texture_get_dc_cs(struct wined3d_texture *texture, unsigned int sub GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, DWORD locations, BOOL map) DECLSPEC_HIDDEN; @@ -6896,7 +6896,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_texture_invalidate_location(struct wined3d_texture *texture, -@@ -2743,6 +2817,7 @@ +@@ -2743,6 +2817,7 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -6904,7 +6904,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location); void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx, -@@ -2758,6 +2833,15 @@ +@@ -2758,6 +2833,15 @@ void wined3d_texture_unmap_bo_address(const struct wined3d_bo_address *data, const struct wined3d_gl_info *gl_info, GLenum binding) DECLSPEC_HIDDEN; void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; @@ -6920,7 +6920,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; -@@ -2875,7 +2959,11 @@ +@@ -2875,7 +2959,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -6932,7 +6932,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, -@@ -2886,9 +2974,11 @@ +@@ -2886,9 +2974,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -6944,7 +6944,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2903,10 +2993,12 @@ +@@ -2903,10 +2993,12 @@ struct wined3d_sampler GLuint name; }; @@ -6957,7 +6957,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration_element { const struct wined3d_format *format; -@@ -3002,6 +3094,7 @@ +@@ -3002,6 +3094,7 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -6965,7 +6965,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -3052,6 +3145,44 @@ +@@ -3052,6 +3145,44 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -7010,7 +7010,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -3102,6 +3233,7 @@ +@@ -3102,6 +3233,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -7018,7 +7018,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, -@@ -3159,6 +3291,14 @@ +@@ -3159,6 +3291,14 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -7033,7 +7033,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -3173,8 +3313,12 @@ +@@ -3173,8 +3313,12 @@ enum query_state { struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -7046,7 +7046,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -3188,9 +3332,11 @@ +@@ -3188,9 +3332,11 @@ struct wined3d_query enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -7058,7 +7058,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other -@@ -3218,7 +3364,9 @@ +@@ -3218,7 +3364,9 @@ struct wined3d_buffer GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -7068,7 +7068,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -3243,6 +3391,7 @@ +@@ -3243,6 +3391,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -7076,7 +7076,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset, struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size) DECLSPEC_HIDDEN; HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, -@@ -3251,6 +3400,13 @@ +@@ -3251,6 +3400,13 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned int offs void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -7090,7 +7090,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3312,8 +3468,12 @@ +@@ -3312,8 +3468,12 @@ struct wined3d_unordered_access_view struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -7103,7 +7103,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3349,8 +3509,10 @@ +@@ -3349,8 +3509,10 @@ struct wined3d_swapchain void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN; struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -7117,7 +7117,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c -@@ -2011,7 +2011,9 @@ +@@ -2011,7 +2011,9 @@ static void wglFinish(void) escape.code = X11DRV_FLUSH_GL_DRAWABLE; escape.gl_drawable = 0; @@ -7127,7 +7127,7 @@ diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) { switch (gl->type) -@@ -2037,7 +2039,9 @@ +@@ -2037,7 +2039,9 @@ static void wglFlush(void) escape.code = X11DRV_FLUSH_GL_DRAWABLE; escape.gl_drawable = 0; diff --git a/staging/patchutils.py b/staging/patchutils.py index aeb744bc..48adf4c4 100644 --- a/staging/patchutils.py +++ b/staging/patchutils.py @@ -639,7 +639,7 @@ def generate_ifdef_patch(original, patched, ifdef): # Now we can finally compute the diff between the patched file and our intermediate file diff = tempfile.NamedTemporaryFile(mode='w+') - exitcode = subprocess.call(["diff", "-u", patched.name, intermediate.name], + exitcode = subprocess.call(["git", "diff", "--no-index", patched.name, intermediate.name], stdout=diff, stderr=_devnull) if exitcode != 1: # exitcode 0 cannot (=shouldn't) happen in this situation raise PatchDiffError("Failed to compute diff (exitcode %d)." % exitcode) @@ -647,7 +647,11 @@ def generate_ifdef_patch(original, patched, ifdef): diff.flush() diff.seek(0) - # We expect this output format from 'diff', if this is not the case things might go wrong. + # We expect this output format from 'git diff', if this is not the case things might go wrong. + line = diff.readline() + assert line.startswith("diff --git ") + line = diff.readline() + assert line.startswith("index ") line = diff.readline() assert line.startswith("--- ") line = diff.readline()