diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 67817257..796f721f 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,13 +52,13 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "8a92dd9a5720c4b6b334e4f13629c0b0f5a72e94" + echo "6372cd8e49a662942a80d2decd1f7eae3541c45b" } # Show version information version() { - echo "Wine Staging 1.9.20" + echo "Wine Staging 1.9.21 (unreleased)" echo "Copyright (C) 2014-2016 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" diff --git a/patches/wined3d-1DTextures/0001-wined3d-Create-dummy-1d-textures.patch b/patches/wined3d-1DTextures/0001-wined3d-Create-dummy-1d-textures.patch index b2c1387b..3ffc15e1 100644 --- a/patches/wined3d-1DTextures/0001-wined3d-Create-dummy-1d-textures.patch +++ b/patches/wined3d-1DTextures/0001-wined3d-Create-dummy-1d-textures.patch @@ -1,130 +1,128 @@ -From 880bec01dc7a6eac676233e4c3817371f6145f56 Mon Sep 17 00:00:00 2001 +From 761d9fa421777e8cdec4d1f2f01cab3ef47589bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 23 Aug 2016 22:54:14 +0200 Subject: wined3d: Create dummy 1d textures. --- - dlls/wined3d/context.c | 14 ++++++++++++++ - dlls/wined3d/device.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/context.c | 12 ++++++++++++ + dlls/wined3d/device.c | 26 ++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 44 insertions(+) + 3 files changed, 40 insertions(+) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index f5311af..74c3a49 100644 +index a362247..924ce844 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1521,6 +1521,9 @@ static void bind_dummy_textures(const struct wined3d_device *device, const struc +@@ -1521,6 +1521,7 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + i)); checkGLcall("glActiveTexture"); -+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_texture_1d[i]); -+ checkGLcall("glBindTexture"); -+ - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_texture_2d[i]); - checkGLcall("glBindTexture"); ++ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_textures.tex_1d); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d); -@@ -1544,6 +1547,9 @@ static void bind_dummy_textures(const struct wined3d_device *device, const struc + if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) +@@ -1533,7 +1534,10 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, device->dummy_textures.tex_cube); if (gl_info->supported[EXT_TEXTURE_ARRAY]) - { -+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_texture_1d_array[i]); -+ checkGLcall("glBindTexture"); -+ - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_texture_2d_array[i]); - checkGLcall("glBindTexture"); - } -@@ -2392,6 +2398,14 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint ++ { ++ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_textures.tex_1d_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array); ++ } + + checkGLcall("Bind dummy textures"); + } +@@ -2381,6 +2385,14 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint case GL_NONE: /* nothing to do */ break; + case GL_TEXTURE_1D: -+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_texture_1d[unit]); ++ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_textures.tex_1d); + checkGLcall("glBindTexture"); + break; + case GL_TEXTURE_1D_ARRAY: -+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_texture_1d_array[unit]); ++ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_textures.tex_1d_array); + checkGLcall("glBindTexture"); + break; case GL_TEXTURE_2D: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_texture_2d[unit]); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d); checkGLcall("glBindTexture"); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c2a8c55..1445399 100644 +index b8ac88a..1ee707e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -702,6 +702,17 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ - /* Make appropriate texture active */ - context_active_texture(context, gl_info, i); +@@ -698,6 +698,17 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ + * to each texture stage when the currently set D3D texture is NULL. */ + context_active_texture(context, gl_info, 0); -+ gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_texture_1d[i]); -+ checkGLcall("glGenTextures"); -+ TRACE("Dummy 1D texture %u given name %u.\n", i, device->dummy_texture_1d[i]); ++ gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_1d); ++ checkGLcall("glGenTextures"); ++ TRACE("Dummy 1D texture given name %u.\n", device->dummy_textures.tex_1d); + -+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_texture_1d[i]); ++ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, device->dummy_textures.tex_1d); ++ checkGLcall("glBindTexture"); ++ ++ gl_info->gl_ops.gl.p_glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 1, 0, ++ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color); ++ checkGLcall("glTexImage1D"); ++ + gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d); + checkGLcall("glGenTextures"); + TRACE("Dummy 2D texture given name %u.\n", device->dummy_textures.tex_2d); +@@ -756,6 +767,17 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ + + if (gl_info->supported[EXT_TEXTURE_ARRAY]) + { ++ gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_1d_array); ++ checkGLcall("glGenTextures"); ++ TRACE("Dummy 1D array texture given name %u.\n", device->dummy_textures.tex_1d_array); ++ ++ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_textures.tex_1d_array); + checkGLcall("glBindTexture"); + -+ gl_info->gl_ops.gl.p_glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 1, 0, ++ gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_1D_ARRAY, 0, GL_RGBA8, 1, 1, 0, + GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color); -+ checkGLcall("glTexImage1D"); ++ checkGLcall("glTexImage2D"); + - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_texture_2d[i]); + gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_array); checkGLcall("glGenTextures"); - TRACE("Dummy 2D texture %u given name %u.\n", i, device->dummy_texture_2d[i]); -@@ -760,6 +771,17 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ - - if (gl_info->supported[EXT_TEXTURE_ARRAY]) - { -+ gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_texture_1d_array[i]); -+ checkGLcall("glGenTextures"); -+ TRACE("Dummy 1D array texture %u given name %u.\n", i, device->dummy_texture_1d_array[i]); -+ -+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, device->dummy_texture_1d_array[i]); -+ checkGLcall("glBindTexture"); -+ -+ gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_1D_ARRAY, 0, GL_RGBA8, 1, 1, 0, -+ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color); -+ checkGLcall("glTexImage2D"); -+ - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_texture_2d_array[i]); - checkGLcall("glGenTextures"); - TRACE("Dummy 2D array texture %u given name %u.\n", i, device->dummy_texture_2d_array[i]); -@@ -783,6 +805,9 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w - { - gl_info->gl_ops.gl.p_glDeleteTextures(count, device->dummy_texture_2d_array); - checkGLcall("glDeleteTextures(count, device->dummy_texture_2d_array)"); -+ -+ gl_info->gl_ops.gl.p_glDeleteTextures(count, device->dummy_texture_1d_array); -+ checkGLcall("glDeleteTextures(count, device->dummy_texture_1d_array)"); - } + TRACE("Dummy 2D array texture given name %u.\n", device->dummy_textures.tex_2d_array); +@@ -775,7 +797,10 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ + static void destroy_dummy_textures(struct wined3d_device *device, const struct wined3d_gl_info *gl_info) + { + if (gl_info->supported[EXT_TEXTURE_ARRAY]) ++ { + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_array); ++ gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_1d_array); ++ } if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) -@@ -806,6 +831,9 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w - gl_info->gl_ops.gl.p_glDeleteTextures(count, device->dummy_texture_2d); - checkGLcall("glDeleteTextures(count, device->dummy_texture_2d)"); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_cube); +@@ -787,6 +812,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_rect); + + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d); ++ gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_1d); + + checkGLcall("Delete dummy textures"); -+ gl_info->gl_ops.gl.p_glDeleteTextures(count, device->dummy_texture_1d); -+ checkGLcall("glDeleteTextures(count, device->dummy_texture_1d)"); -+ - memset(device->dummy_texture_2d_array, 0, count * sizeof(*device->dummy_texture_2d_array)); - memset(device->dummy_texture_cube, 0, count * sizeof(*device->dummy_texture_cube)); - memset(device->dummy_texture_3d, 0, count * sizeof(*device->dummy_texture_3d)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index e329962..dbb0a47 100644 +index a968bda..8b0def5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2481,10 +2481,12 @@ struct wined3d_device - struct wined3d_texture *logo_texture; - +@@ -2488,10 +2488,12 @@ struct wined3d_device /* Textures for when no other textures are mapped */ -+ GLuint dummy_texture_1d[MAX_COMBINED_SAMPLERS]; - GLuint dummy_texture_2d[MAX_COMBINED_SAMPLERS]; - GLuint dummy_texture_rect[MAX_COMBINED_SAMPLERS]; - GLuint dummy_texture_3d[MAX_COMBINED_SAMPLERS]; - GLuint dummy_texture_cube[MAX_COMBINED_SAMPLERS]; -+ GLuint dummy_texture_1d_array[MAX_COMBINED_SAMPLERS]; - GLuint dummy_texture_2d_array[MAX_COMBINED_SAMPLERS]; + struct + { ++ GLuint tex_1d; + GLuint tex_2d; + GLuint tex_rect; + GLuint tex_3d; + GLuint tex_cube; ++ GLuint tex_1d_array; + GLuint tex_2d_array; + } dummy_textures; - /* Default sampler used to emulate the direct resource access without using wined3d_sampler */ -- -2.8.1 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0097-wined3d-Create-dummy-textures-through-the-CS.patch b/patches/wined3d-CSMT_Main/0097-wined3d-Create-dummy-textures-through-the-CS.patch index bdd1b08a..13b90850 100644 --- a/patches/wined3d-CSMT_Main/0097-wined3d-Create-dummy-textures-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0097-wined3d-Create-dummy-textures-through-the-CS.patch @@ -1,4 +1,4 @@ -From 73ba4bb84fd27c19ee2b538d36c315130a2eed4e Mon Sep 17 00:00:00 2001 +From 32adb7bac2cba5547deea47ee576f6f4fa8fb5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 10 Oct 2013 16:29:42 +0200 Subject: wined3d: Create dummy textures through the CS. @@ -12,10 +12,10 @@ crash. 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 0089911..2aa43d6 100644 +index 92170c3..52263e2 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -82,6 +82,7 @@ enum wined3d_cs_op +@@ -81,6 +81,7 @@ enum wined3d_cs_op WINED3D_CS_OP_CREATE_VBO, WINED3D_CS_OP_GET_DC, WINED3D_CS_OP_RELEASE_DC, @@ -23,7 +23,7 @@ index 0089911..2aa43d6 100644 WINED3D_CS_OP_STOP, }; -@@ -483,6 +484,11 @@ struct wined3d_cs_get_release_dc +@@ -476,6 +477,11 @@ struct wined3d_cs_get_release_dc unsigned int sub_resource_idx; }; @@ -35,7 +35,7 @@ index 0089911..2aa43d6 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2533,6 +2539,28 @@ void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *t +@@ -2490,6 +2496,28 @@ void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *t cs->ops->finish(cs); } @@ -64,7 +64,7 @@ index 0089911..2aa43d6 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2593,6 +2621,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2549,6 +2577,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, /* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc, /* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc, @@ -73,7 +73,7 @@ index 0089911..2aa43d6 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2b5c063..2dfed0a 100644 +index b3c6280..0fbf381 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -663,7 +663,7 @@ out: @@ -85,7 +85,7 @@ index 2b5c063..2dfed0a 100644 { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -1054,17 +1054,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1060,17 +1060,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device->swapchains[0] = swapchain; device_init_swapchain_state(device, swapchain); @@ -93,7 +93,7 @@ index 2b5c063..2dfed0a 100644 context = context_acquire(device, NULL); - - create_dummy_textures(device, context); - create_default_samplers(device); + create_default_samplers(device, context); + context_release(context); device->contexts[0]->last_was_rhw = 0; @@ -105,20 +105,20 @@ index 2b5c063..2dfed0a 100644 /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) clear_flags |= WINED3DCLEAR_TARGET; -@@ -4639,7 +4637,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4648,7 +4646,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru swapchain->context[0] = context; swapchain->num_contexts = 1; - create_dummy_textures(device, context); + device_create_dummy_textures(device, context); - create_default_samplers(device); + create_default_samplers(device, context); context_release(context); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a524314..b8b597d 100644 +index f60d01e..6bbf0d6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2550,7 +2550,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT +@@ -2563,7 +2563,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, const struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -127,7 +127,7 @@ index a524314..b8b597d 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -3121,6 +3121,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -3135,6 +3135,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil, const struct blit_shader *blitter) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0099-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch b/patches/wined3d-CSMT_Main/0099-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch index 273bd508..14237c75 100644 --- a/patches/wined3d-CSMT_Main/0099-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch +++ b/patches/wined3d-CSMT_Main/0099-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch @@ -1,4 +1,4 @@ -From 9cf15a571fd8e6eb8ae5cbb7769827a09f6f7ff6 Mon Sep 17 00:00:00 2001 +From da044c1554c39e435d4fa62d036a1b3e8b3d051e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 10 Oct 2013 18:40:04 +0200 Subject: wined3d: Recreate ctx and dummy textures through the CS after resets. @@ -8,10 +8,10 @@ Subject: wined3d: Recreate ctx and dummy textures through the CS after resets. 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2c93215..ed1bba1 100644 +index 0fbf381..2b30135 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4561,7 +4561,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4607,7 +4607,6 @@ 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) { struct wined3d_context *context; @@ -19,7 +19,7 @@ index 2c93215..ed1bba1 100644 HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4578,29 +4577,17 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4624,29 +4623,17 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru return hr; } @@ -51,9 +51,9 @@ index 2c93215..ed1bba1 100644 - device_create_dummy_textures(device, context); + wined3d_cs_emit_create_dummy_textures(device->cs); + context = context_acquire(device, NULL); - create_default_samplers(device); + create_default_samplers(device, context); context_release(context); -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Call-create_default_sampler-from-create_dumm.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Call-create_default_sampler-from-create_dumm.patch index 54127e76..e0efbdb0 100644 --- a/patches/wined3d-CSMT_Main/0100-wined3d-Call-create_default_sampler-from-create_dumm.patch +++ b/patches/wined3d-CSMT_Main/0100-wined3d-Call-create_default_sampler-from-create_dumm.patch @@ -1,24 +1,24 @@ -From e55823e0bef6e6d5d9ff1bce222bc5b7853f18a1 Mon Sep 17 00:00:00 2001 +From fc4e50699e4494de94a941c52799e987d6702e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 7 May 2016 21:16:47 +0100 Subject: wined3d: Call create_default_sampler from create_dummy_textures. I should really rename it, don't feel like it now. --- - dlls/wined3d/device.c | 76 ++++++++++++++++++++++++--------------------------- - 1 file changed, 35 insertions(+), 41 deletions(-) + dlls/wined3d/device.c | 75 +++++++++++++++++++++++---------------------------- + 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ed1bba1..2449d77 100644 +index 2b30135..32946e8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -664,6 +664,39 @@ out: +@@ -663,6 +663,39 @@ out: } /* Context activation is done by the caller. */ -+static void create_default_samplers(struct wined3d_device *device) ++static void create_default_samplers(struct wined3d_device *device, struct wined3d_context *context) +{ -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; ++ const struct wined3d_gl_info *gl_info = context->gl_info; + + if (gl_info->supported[ARB_SAMPLER_OBJECTS]) + { @@ -52,22 +52,21 @@ index ed1bba1..2449d77 100644 void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; -@@ -756,6 +789,8 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_ - checkGLcall("glTexImage3D"); - } +@@ -774,6 +807,7 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_ } -+ -+ create_default_samplers(device); + + context_bind_dummy_textures(device, context); ++ create_default_samplers(device, context); } /* Context activation is done by the caller. */ -@@ -798,39 +833,6 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w +@@ -803,39 +837,6 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w } /* Context activation is done by the caller. */ --static void create_default_samplers(struct wined3d_device *device) +-static void create_default_samplers(struct wined3d_device *device, struct wined3d_context *context) -{ -- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +- const struct wined3d_gl_info *gl_info = context->gl_info; - - if (gl_info->supported[ARB_SAMPLER_OBJECTS]) - { @@ -101,7 +100,7 @@ index ed1bba1..2449d77 100644 static void destroy_default_samplers(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -986,7 +988,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1001,7 +1002,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, { static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; struct wined3d_swapchain *swapchain = NULL; @@ -109,17 +108,17 @@ index ed1bba1..2449d77 100644 DWORD clear_flags = 0; HRESULT hr; -@@ -1045,9 +1046,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1061,9 +1061,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device_init_swapchain_state(device, swapchain); wined3d_cs_emit_create_dummy_textures(device->cs); - context = context_acquire(device, NULL); -- create_default_samplers(device); +- create_default_samplers(device, context); - context_release(context); device->contexts[0]->last_was_rhw = 0; -@@ -4560,7 +4558,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4606,7 +4603,6 @@ 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) { @@ -127,16 +126,16 @@ index ed1bba1..2449d77 100644 HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4587,9 +4584,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4633,9 +4629,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru } wined3d_cs_emit_create_dummy_textures(device->cs); - context = context_acquire(device, NULL); -- create_default_samplers(device); +- create_default_samplers(device, context); - context_release(context); return WINED3D_OK; } -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 01ceb94a..f6a17d7c 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -467,7 +467,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 -@@ -1711,6 +1711,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, +@@ -1698,6 +1698,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } @@ -481,7 +481,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) { -@@ -2016,6 +2023,9 @@ out: +@@ -2003,6 +2010,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); @@ -491,7 +491,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); -@@ -2052,6 +2062,9 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont +@@ -2039,6 +2049,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); @@ -501,7 +501,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); -@@ -2588,7 +2601,11 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge +@@ -2575,7 +2588,11 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge } /* Context activation is done by the caller. */ @@ -513,7 +513,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; -@@ -2597,7 +2614,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2584,7 +2601,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win DWORD rt_mask = 0, *cur_mask; UINT i; @@ -525,7 +525,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)) -@@ -2642,6 +2663,10 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2629,6 +2650,10 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL); } @@ -536,7 +536,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))) -@@ -2682,7 +2707,12 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2669,7 +2694,12 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST); if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB]) { @@ -549,7 +549,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); -@@ -2699,7 +2729,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2686,7 +2716,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) { @@ -561,7 +561,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; -@@ -2729,7 +2763,11 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const +@@ -2716,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); @@ -573,7 +573,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2760,6 +2798,10 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat +@@ -2747,6 +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; } @@ -584,7 +584,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) -@@ -3391,7 +3433,11 @@ BOOL context_apply_draw_state(struct wined3d_context *context, +@@ -3378,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; @@ -596,7 +596,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c unsigned int i; WORD map; -@@ -3424,8 +3470,17 @@ BOOL context_apply_draw_state(struct wined3d_context *context, +@@ -3411,8 +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) @@ -614,7 +614,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3544,6 +3599,11 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str +@@ -3531,6 +3586,11 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str TRACE("device %p, target %p.\n", device, target); @@ -3565,9 +3565,9 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +#if !defined(STAGING_CSMT) static void create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) +#else /* STAGING_CSMT */ -+static void create_default_samplers(struct wined3d_device *device) ++static void create_default_samplers(struct wined3d_device *device, struct wined3d_context *context) +{ -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; ++ const struct wined3d_gl_info *gl_info = context->gl_info; + + if (gl_info->supported[ARB_SAMPLER_OBJECTS]) + { @@ -3603,26 +3603,25 @@ 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; -@@ -794,6 +852,10 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ - checkGLcall("glTexImage3D"); - } +@@ -791,6 +849,9 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ } + + context_bind_dummy_textures(device, context); +#if defined(STAGING_CSMT) -+ -+ create_default_samplers(device); ++ create_default_samplers(device, context); +#endif /* STAGING_CSMT */ } /* Context activation is done by the caller. */ -@@ -842,6 +904,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w +@@ -820,6 +881,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w } /* Context activation is done by the caller. */ +#if !defined(STAGING_CSMT) - static void create_default_samplers(struct wined3d_device *device) + static void create_default_samplers(struct wined3d_device *device, struct wined3d_context *context) { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -875,6 +938,7 @@ static void create_default_samplers(struct wined3d_device *device) + const struct wined3d_gl_info *gl_info = context->gl_info; +@@ -853,6 +915,7 @@ static void create_default_samplers(struct wined3d_device *device, struct wined3 } /* Context activation is done by the caller. */ @@ -3630,7 +3629,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; -@@ -1021,7 +1085,11 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi +@@ -999,7 +1062,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; @@ -3642,7 +3641,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -1039,9 +1107,13 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1017,9 +1084,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}; @@ -3656,7 +3655,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c DWORD clear_flags = 0; HRESULT hr; -@@ -1052,9 +1124,11 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1030,9 +1101,11 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, if (device->wined3d->flags & WINED3D_NO3D) return WINED3DERR_INVALIDCALL; @@ -3668,7 +3667,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))) { -@@ -1103,17 +1177,23 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1081,17 +1154,23 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device->swapchains[0] = swapchain; device_init_swapchain_state(device, swapchain); @@ -3676,7 +3675,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c context = context_acquire(device, NULL); create_dummy_textures(device, context); - create_default_samplers(device); + create_default_samplers(device, context); +#else /* STAGING_CSMT */ + wined3d_cs_emit_create_dummy_textures(device->cs); +#endif /* STAGING_CSMT */ @@ -3692,7 +3691,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) clear_flags |= WINED3DCLEAR_TARGET; -@@ -1129,7 +1209,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1107,7 +1186,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: @@ -3702,7 +3701,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) -@@ -1186,8 +1268,10 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) +@@ -1164,8 +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; @@ -3713,7 +3712,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_surface *surface; UINT i; -@@ -1196,17 +1280,23 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1174,17 +1257,23 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (!device->d3d_initialized) return WINED3DERR_INVALIDCALL; @@ -3737,7 +3736,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c state_unbind_resources(&device->state); /* Unload resources */ -@@ -1244,9 +1334,21 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1222,9 +1311,21 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { surface = device->onscreen_depth_stencil; device->onscreen_depth_stencil = NULL; @@ -3759,7 +3758,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->fb.depth_stencil) { struct wined3d_rendertarget_view *view = device->fb.depth_stencil; -@@ -1256,9 +1358,13 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1234,9 +1335,13 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->fb.depth_stencil = NULL; wined3d_rendertarget_view_decref(view); } @@ -3773,7 +3772,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_rendertarget_view *view = device->auto_depth_stencil_view; device->auto_depth_stencil_view = NULL; -@@ -1270,6 +1376,24 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1248,6 +1353,24 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { wined3d_device_set_rendertarget_view(device, i, NULL, FALSE); } @@ -3798,7 +3797,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); -@@ -1287,9 +1411,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1265,9 +1388,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -3810,7 +3809,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1334,7 +1460,11 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device +@@ -1312,7 +1437,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] && @@ -3822,7 +3821,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { GLint vram_free_kb; UINT64 vram_free; -@@ -1675,6 +1805,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1653,6 +1782,7 @@ 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); @@ -3830,7 +3829,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update the live definitions if the light is currently assigned a glIndex. */ if (object->glIndex != -1 && !device->recording) { -@@ -1683,6 +1814,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1661,6 +1791,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); } @@ -3838,7 +3837,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1762,6 +1894,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1740,6 +1871,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, FIXME("Unrecognized light type %#x.\n", light->type); } @@ -3850,7 +3849,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1834,12 +1971,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1812,12 +1948,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN { if (light_info->glIndex != -1) { @@ -3865,7 +3864,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; } -@@ -1881,6 +2020,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1859,6 +1997,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -3873,7 +3872,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* i == light_info->glIndex */ if (!device->recording) -@@ -1888,9 +2028,15 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1866,9 +2005,15 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN device_invalidate_state(device, STATE_LIGHT_TYPE); device_invalidate_state(device, STATE_ACTIVELIGHT(i)); } @@ -3889,7 +3888,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2061,6 +2207,11 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I +@@ -2039,6 +2184,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; @@ -3901,7 +3900,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) -@@ -2106,7 +2257,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -2084,7 +2234,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; @@ -3913,7 +3912,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; if (src_view->resource->type == WINED3D_RTYPE_BUFFER) { -@@ -2467,6 +2622,18 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 +@@ -2445,6 +2599,18 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -3932,7 +3931,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) { -@@ -2494,7 +2661,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, +@@ -2472,7 +2638,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { @@ -3945,7 +3944,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2543,7 +2715,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, +@@ -2521,7 +2692,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -3958,7 +3957,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2588,7 +2765,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, +@@ -2566,7 +2742,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 @@ -3971,7 +3970,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2727,7 +2909,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, +@@ -2705,7 +2886,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { @@ -3984,7 +3983,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2776,7 +2963,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, +@@ -2754,7 +2940,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -3997,7 +3996,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2822,7 +3014,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, +@@ -2800,7 +2991,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 @@ -4010,7 +4009,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2987,6 +3184,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO +@@ -2965,6 +3161,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO } dest_ptr = map_desc.data; @@ -4026,7 +4025,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); -@@ -3548,8 +3754,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) +@@ -3526,8 +3731,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -4037,7 +4036,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3558,6 +3766,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3536,6 +3743,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) return WINED3DERR_INVALIDCALL; } @@ -4045,7 +4044,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c context = context_acquire(device, NULL); /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ context->gl_info->gl_ops.gl.p_glFlush(); -@@ -3565,6 +3774,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3543,6 +3751,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) * fails. */ context_release(context); @@ -4053,7 +4052,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3572,6 +3782,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3550,6 +3759,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) { @@ -4064,7 +4063,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); -@@ -3583,7 +3797,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3561,7 +3774,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -4076,7 +4075,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"); -@@ -3592,8 +3810,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3570,8 +3787,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -4090,7 +4089,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; -@@ -3639,7 +3862,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3617,7 +3839,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -4100,7 +4099,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); -@@ -3647,8 +3872,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3625,8 +3849,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; @@ -4114,7 +4113,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, -@@ -3708,10 +3938,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3686,10 +3915,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -4131,7 +4130,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_const_bo_address data; struct wined3d_context *context; struct wined3d_map_desc src; -@@ -3736,6 +3972,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3714,6 +3949,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, } context = context_acquire(device, NULL); @@ -4146,7 +4145,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); -@@ -3743,6 +3987,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3721,6 +3964,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -4154,7 +4153,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_resource_map(&src_texture->resource, src_level + i, &src, NULL, WINED3D_MAP_READONLY))) goto done; -@@ -3759,16 +4004,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3737,16 +3981,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, done: context_release(context); return hr; @@ -4249,7 +4248,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); -@@ -3805,6 +4128,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3783,6 +4105,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -4257,7 +4256,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3827,9 +4151,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3805,9 +4128,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, context_release(context); /* Update every surface level of the texture. */ @@ -4279,7 +4278,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { unsigned int src_levels = src_texture->level_count; unsigned int dst_levels = dst_texture->level_count; -@@ -3862,6 +4198,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3840,6 +4175,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, FIXME("Unsupported texture type %#x.\n", type); return WINED3DERR_INVALIDCALL; } @@ -4318,7 +4317,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) -@@ -3909,8 +4277,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3887,8 +4254,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]) { @@ -4332,7 +4331,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -4099,6 +4472,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4077,6 +4449,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; @@ -4342,7 +4341,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", -@@ -4186,6 +4562,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4164,6 +4539,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev if (src_box) { @@ -4359,7 +4358,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 -@@ -4199,6 +4585,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4177,6 +4562,25 @@ 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)); @@ -4385,7 +4384,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); -@@ -4211,6 +4616,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4189,6 +4593,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str unsigned int depth_pitch) { struct wined3d_texture_sub_resource *sub_resource; @@ -4393,7 +4392,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_gl_info *gl_info; struct wined3d_const_bo_address addr; unsigned int width, height, level; -@@ -4219,6 +4625,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4197,6 +4602,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str struct wined3d_surface *surface; POINT dst_point; RECT src_rect; @@ -4403,7 +4402,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); -@@ -4252,6 +4661,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4230,6 +4638,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); return; } @@ -4411,7 +4410,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c surface = sub_resource->u.surface; level = sub_resource_idx % texture->level_count; -@@ -4262,6 +4672,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4240,6 +4649,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str src_rect.top = 0; if (box) { @@ -4429,7 +4428,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) -@@ -4269,6 +4690,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4247,6 +4667,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str WARN("Invalid box %s specified.\n", debug_box(box)); return; } @@ -4437,7 +4436,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c src_rect.right = box->right - box->left; src_rect.bottom = box->bottom - box->top; -@@ -4303,6 +4725,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4281,6 +4702,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -4449,7 +4448,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4311,8 +4738,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4289,8 +4715,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi { const struct blit_shader *blitter; struct wined3d_resource *resource; @@ -4463,7 +4462,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); -@@ -4351,10 +4783,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4329,10 +4760,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } @@ -4479,7 +4478,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, -@@ -4368,20 +4805,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -4346,20 +4782,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -4511,7 +4510,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); -@@ -4418,13 +4866,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4396,13 +4843,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -4533,7 +4532,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. */ -@@ -4436,18 +4892,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4414,18 +4869,29 @@ 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) { @@ -4563,7 +4562,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) -@@ -4681,19 +5148,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) +@@ -4659,19 +5125,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) } } @@ -4590,7 +4589,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) { device->shader_backend->shader_destroy(shader); -@@ -4722,12 +5196,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4700,12 +5173,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4621,7 +4620,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, -@@ -4744,6 +5236,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4722,6 +5213,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru return hr; } @@ -4629,7 +4628,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Recreate the primary swapchain's context */ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); if (!swapchain->context) -@@ -4756,10 +5249,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4734,10 +5226,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer; if (!(context = context_create(swapchain, target, swapchain->ds_format))) @@ -4645,9 +4644,9 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, swapchain->context); return E_FAIL; } -@@ -4769,6 +5267,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4747,6 +5244,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru create_dummy_textures(device, context); - create_default_samplers(device); + create_default_samplers(device, context); context_release(context); +#else /* STAGING_CSMT */ + return hr; @@ -4658,7 +4657,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4787,6 +5291,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4765,6 +5268,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); @@ -4673,7 +4672,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"); -@@ -4805,10 +5317,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4783,10 +5294,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -4690,7 +4689,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4817,10 +5335,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4795,10 +5312,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4713,7 +4712,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4985,27 +5515,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4963,27 +5492,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -4762,7 +4761,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -5013,7 +5564,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4991,7 +5541,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { if (reset_state) hr = create_primary_opengl_context(device, swapchain); @@ -4774,7 +4773,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 -@@ -5095,11 +5650,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -5073,11 +5627,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4794,7 +4793,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) -@@ -5224,8 +5787,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5202,8 +5764,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -4812,7 +4811,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))) -@@ -5319,3 +5891,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5297,3 +5868,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -8173,7 +8172,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; -@@ -2359,7 +2417,11 @@ struct wined3d_stream_state +@@ -2361,7 +2419,11 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -8185,7 +8184,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]; -@@ -2406,6 +2468,16 @@ struct wined3d_state +@@ -2408,6 +2470,16 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; }; @@ -8202,7 +8201,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 -@@ -2458,16 +2530,21 @@ struct wined3d_device +@@ -2460,16 +2532,21 @@ struct wined3d_device struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -8224,7 +8223,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; -@@ -2516,9 +2593,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2521,9 +2598,23 @@ 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; @@ -8248,7 +8247,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) { -@@ -2563,7 +2654,11 @@ struct wined3d_resource +@@ -2568,7 +2659,11 @@ struct wined3d_resource UINT depth; UINT size; DWORD priority; @@ -8260,7 +8259,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct list resource_list_entry; LONG access_count; -@@ -2610,6 +2705,9 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI +@@ -2615,6 +2710,9 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -8270,7 +8269,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; /* Tests show that the start address of resources is 32 byte aligned */ -@@ -2671,6 +2769,9 @@ struct wined3d_texture +@@ -2676,6 +2774,9 @@ struct wined3d_texture DWORD flags; GLenum target; DWORD update_map_binding; @@ -8280,7 +8279,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; -@@ -2707,7 +2808,12 @@ struct wined3d_texture +@@ -2712,7 +2813,12 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -8293,7 +8292,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -2758,11 +2864,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture, +@@ -2763,11 +2869,23 @@ 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; @@ -8317,7 +8316,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, -@@ -2775,13 +2893,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size +@@ -2780,13 +2898,26 @@ 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; @@ -8344,7 +8343,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; -@@ -2890,7 +3021,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru +@@ -2895,7 +3026,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; @@ -8356,7 +8355,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, -@@ -2901,6 +3036,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -2906,6 +3041,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; @@ -8368,7 +8367,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; -@@ -2915,6 +3055,12 @@ struct wined3d_sampler +@@ -2920,6 +3060,12 @@ struct wined3d_sampler GLuint name; }; @@ -8381,7 +8380,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; -@@ -3010,6 +3156,7 @@ struct wined3d_stateblock +@@ -3015,6 +3161,7 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -8389,7 +8388,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; -@@ -3023,54 +3170,150 @@ enum wined3d_push_constants +@@ -3028,54 +3175,150 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_I, WINED3D_PUSH_CONSTANTS_VS_B, WINED3D_PUSH_CONSTANTS_PS_B, @@ -8540,7 +8539,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, -@@ -3100,6 +3343,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -3105,6 +3348,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; @@ -8548,7 +8547,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN; -@@ -3111,6 +3355,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d +@@ -3116,6 +3360,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d { cs->ops->push_constants(cs, p, start_idx, count, constants); } @@ -8573,7 +8572,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 * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -3137,6 +3399,9 @@ struct wined3d_buffer +@@ -3142,6 +3404,9 @@ struct wined3d_buffer GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -8583,7 +8582,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -3161,11 +3426,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -3166,11 +3431,19 @@ 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; @@ -8603,7 +8602,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3227,7 +3500,12 @@ struct wined3d_unordered_access_view +@@ -3232,7 +3505,12 @@ struct wined3d_unordered_access_view struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -8616,7 +8615,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3264,6 +3542,10 @@ struct wined3d_swapchain +@@ -3269,6 +3547,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; diff --git a/staging/VERSION b/staging/VERSION index 0048ff8b..cd5d5af2 100644 --- a/staging/VERSION +++ b/staging/VERSION @@ -1 +1 @@ -Wine Staging 1.9.20 +Wine Staging 1.9.21 (unreleased)