Rebase against 9af3a79b96318471818e0abacfc1a6f8ecc91463.

This commit is contained in:
Alistair Leslie-Hughes 2022-07-07 10:03:41 +10:00
parent 8699d2c2f6
commit 0acaed0ae5
5 changed files with 128 additions and 122 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b2bf7b6b899dc18d092deebb0356a909db656ba8"
echo "9af3a79b96318471818e0abacfc1a6f8ecc91463"
}
# Show version information

View File

@ -1,4 +1,4 @@
From 44d72553191650080c21e56815ac7bb91ba0d02d Mon Sep 17 00:00:00 2001
From 900a4d6309b753df0ca09a604d6f317462c9edca Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 15:05:12 +0300
Subject: [PATCH] wined3d: Support SWVP vertex shader constants limit in state
@ -15,56 +15,56 @@ Subject: [PATCH] wined3d: Support SWVP vertex shader constants limit in state
7 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 7abf9ea3df2..32ccb290df5 100644
index a939b18a5e1..037a58ea8c8 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -6973,13 +6973,10 @@ static void test_vertex_shader_constant(void)
ok(consts_swvp == 8192, "Unexpected consts_swvp %u.\n", consts_swvp);
@@ -6964,13 +6964,10 @@ static void test_vertex_shader_constant(void)
ok(consts_swvp == 8192, "Unexpected consts_swvp %lu.\n", consts_swvp);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts + 0, c, 1);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts + 1, c, 1);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts - 1, d, 4);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts_swvp - 1, c, 1);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
@@ -7004,7 +7001,6 @@ static void test_vertex_shader_constant(void)
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
@@ -6995,7 +6992,6 @@ static void test_vertex_shader_constant(void)
IDirect3DDevice9_SetSoftwareVertexProcessing(device, 0);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts + 0, c, 1);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts_swvp - 1, c, 1);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
@@ -7012,7 +7008,6 @@ static void test_vertex_shader_constant(void)
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
@@ -7003,7 +6999,6 @@ static void test_vertex_shader_constant(void)
IDirect3DDevice9_SetSoftwareVertexProcessing(device, 1);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts + 0, c, 1);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts_swvp - 1, c, 1);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 89f9e9cf2c6..2ff33b667f0 100644
index 034cfeef55c..c03e8a84820 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -24908,7 +24908,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24973,7 +24973,6 @@ static void test_mvp_software_vertex_shaders(void)
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, c_index, 1);
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, (unsigned int)c_index[0], c_color, 1);
- todo_wine
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_BeginScene(device);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 14771da0947..4f529d9dcb3 100644
index f5e9aebd44b..69174308a48 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3759,7 +3759,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3919,7 +3919,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
const struct wined3d_saved_states *changed = &stateblock->changed;
const unsigned int word_bit_count = sizeof(DWORD) * CHAR_BIT;
struct wined3d_device_context *context = &device->cs->c;
@ -73,7 +73,7 @@ index 14771da0947..4f529d9dcb3 100644
struct wined3d_range range;
uint32_t map;
@@ -3770,9 +3770,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3930,9 +3930,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
if (changed->pixelShader)
wined3d_device_context_set_shader(context, WINED3D_SHADER_TYPE_PIXEL, state->ps);
@ -87,10 +87,10 @@ index 14771da0947..4f529d9dcb3 100644
wined3d_device_set_vs_consts_f(device, range.offset, range.size, &state->vs_consts_f[range.offset]);
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 707d9521445..22cfe881f41 100644
index 5ad0c132933..55e68d21c23 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1907,7 +1907,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
@@ -1905,7 +1905,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
if (priv->consts_ubo)
return;
@ -100,10 +100,10 @@ index 707d9521445..22cfe881f41 100644
update_heap_entry(heap, i, priv->next_constant_version);
}
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index c5ca5990009..5372e415ba6 100644
index 1b82d387de8..27fb57e2465 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -732,8 +732,8 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
@@ -731,8 +731,8 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
const struct wined3d_stateblock *device_state)
{
const struct wined3d_stateblock_state *state = &device_state->stateblock_state;
@ -113,7 +113,7 @@ index c5ca5990009..5372e415ba6 100644
DWORD map;
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
@@ -749,9 +749,11 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
@@ -748,9 +748,11 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
stateblock->stateblock_state.vs = state->vs;
}
@ -126,7 +126,7 @@ index c5ca5990009..5372e415ba6 100644
break;
memcpy(&stateblock->stateblock_state.vs_consts_f[range.offset], &state->vs_consts_f[range.offset],
@@ -995,8 +997,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
@@ -994,8 +996,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
struct wined3d_stateblock *device_state)
{
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
@ -136,7 +136,7 @@ index c5ca5990009..5372e415ba6 100644
DWORD map;
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
@@ -1006,9 +1008,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
@@ -1005,9 +1007,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
if (stateblock->changed.pixelShader)
wined3d_stateblock_set_pixel_shader(device_state, state->ps);
@ -149,7 +149,7 @@ index c5ca5990009..5372e415ba6 100644
break;
wined3d_stateblock_set_vs_consts_f(device_state, range.offset, range.size, &state->vs_consts_f[range.offset]);
}
@@ -1200,12 +1204,14 @@ static void wined3d_bitmap_set_bits(uint32_t *bitmap, unsigned int start, unsign
@@ -1199,12 +1203,14 @@ static void wined3d_bitmap_set_bits(uint32_t *bitmap, unsigned int start, unsign
HRESULT CDECL wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *stateblock,
unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
{
@ -166,7 +166,7 @@ index c5ca5990009..5372e415ba6 100644
return WINED3DERR_INVALIDCALL;
memcpy(&stateblock->stateblock_state.vs_consts_f[start_idx], constants, count * sizeof(*constants));
@@ -2018,7 +2024,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
@@ -2017,7 +2023,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
stateblock_init_lights(stateblock->stateblock_state.light_state->light_map,
device_state->stateblock_state.light_state->light_map);
stateblock_savedstates_set_all(&stateblock->changed,
@ -175,7 +175,7 @@ index c5ca5990009..5372e415ba6 100644
break;
case WINED3D_SBT_PIXEL_STATE:
@@ -2030,7 +2036,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
@@ -2029,7 +2035,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
stateblock_init_lights(stateblock->stateblock_state.light_state->light_map,
device_state->stateblock_state.light_state->light_map);
stateblock_savedstates_set_vertex(&stateblock->changed,
@ -185,10 +185,10 @@ index c5ca5990009..5372e415ba6 100644
default:
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4c88f43713c..650aa2e2f63 100644
index 5a6adc4f404..08485076c02 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3803,7 +3803,7 @@ struct wined3d_state
@@ -3854,7 +3854,7 @@ struct wined3d_state
struct wined3d_shader_resource_view *shader_resource_view[WINED3D_SHADER_TYPE_COUNT][MAX_SHADER_RESOURCE_VIEWS];
struct wined3d_unordered_access_view *unordered_access_view[WINED3D_PIPELINE_COUNT][MAX_UNORDERED_ACCESS_VIEWS];
@ -197,7 +197,7 @@ index 4c88f43713c..650aa2e2f63 100644
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
@@ -3985,6 +3985,15 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
@@ -4039,6 +4039,15 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
LeaveCriticalSection(&device->bo_map_lock);
}
@ -213,7 +213,7 @@ index 4c88f43713c..650aa2e2f63 100644
struct wined3d_device_no3d
{
struct wined3d_device d;
@@ -4835,7 +4844,7 @@ struct wined3d_vertex_declaration
@@ -4921,7 +4930,7 @@ struct wined3d_vertex_declaration
struct wined3d_saved_states
{
@ -223,10 +223,10 @@ index 4c88f43713c..650aa2e2f63 100644
WORD vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */
uint32_t ps_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_PS_CONSTS_F)];
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 55c9cd3fc45..10198ad8278 100644
index 72f12551c3c..faa696855d6 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2191,7 +2191,7 @@ struct wined3d_stateblock_state
@@ -2205,7 +2205,7 @@ struct wined3d_stateblock_state
int base_vertex_index;
struct wined3d_shader *vs;
@ -236,5 +236,5 @@ index 55c9cd3fc45..10198ad8278 100644
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
--
2.34.1
2.35.1

View File

@ -1,4 +1,4 @@
From 3672fa47e729c45fa34182f6ba9eaab1d77bd2ef Mon Sep 17 00:00:00 2001
From 8885f74f77c1db6a4d4776bf4d0186a84dcb74ad Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 15:23:33 +0300
Subject: [PATCH] wined3d: Support SWVP mode vertex shaders.
@ -14,44 +14,44 @@ Subject: [PATCH] wined3d: Support SWVP mode vertex shaders.
7 files changed, 104 insertions(+), 49 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 32ccb290df5..397885f12d7 100644
index 037a58ea8c8..2d63044e291 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -7462,15 +7462,11 @@ float4 main(const float4 color : COLOR) : SV_TARGET
@@ -7453,15 +7453,11 @@ float4 main(const float4 color : COLOR) : SV_TARGET
vs = NULL;
hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_256, &vs);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- if (vs)
- IDirect3DVertexShader9_Release(vs);
+ IDirect3DVertexShader9_Release(vs);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_3_256, &vs);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- if (vs)
- IDirect3DVertexShader9_Release(vs);
+ IDirect3DVertexShader9_Release(vs);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
@@ -7487,20 +7483,16 @@ float4 main(const float4 color : COLOR) : SV_TARGET
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(!refcount, "Device has %lu references left.\n", refcount);
@@ -7478,20 +7474,16 @@ float4 main(const float4 color : COLOR) : SV_TARGET
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_256, &vs);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, vs);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- if (vs)
- IDirect3DVertexShader9_Release(vs);
+ IDirect3DVertexShader9_Release(vs);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_3_256, &vs);
- todo_wine
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, vs);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- if (vs)
- IDirect3DVertexShader9_Release(vs);
+ IDirect3DVertexShader9_Release(vs);
@ -59,18 +59,18 @@ index 32ccb290df5..397885f12d7 100644
cleanup:
refcount = IDirect3DDevice9_Release(device);
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 2ff33b667f0..6c4f0b759e4 100644
index c03e8a84820..34210dd7c88 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -24834,7 +24834,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24899,7 +24899,6 @@ static void test_mvp_software_vertex_shaders(void)
hr = IDirect3DDevice9_CreateVertexShader(device, reladdr_shader_code, &reladdr_shader);
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, pure_sw_shader_code, &pure_sw_shader);
- todo_wine
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration);
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
@@ -24872,7 +24871,7 @@ static void test_mvp_software_vertex_shaders(void)
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
@@ -24937,7 +24936,7 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x00ff0000; /* Color from vertex data and not from the shader. */
color = getPixelColor(device, 5, 5);
@ -79,7 +79,7 @@ index 2ff33b667f0..6c4f0b759e4 100644
expected_color, color);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
@@ -24891,7 +24890,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24956,7 +24955,6 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x00ffffff;
color = getPixelColor(device, 5, 5);
@ -87,7 +87,7 @@ index 2ff33b667f0..6c4f0b759e4 100644
ok(color == expected_color, "Expected color 0x%08x, got 0x%08x (sw shader in sw mode).\n",
expected_color, color);
@@ -24941,7 +24939,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -25006,7 +25004,6 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x0000ffff; /* c[256] is c_color for SW shader. */
color = getPixelColor(device, 5, 5);
@ -96,10 +96,10 @@ index 2ff33b667f0..6c4f0b759e4 100644
expected_color, color);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4f529d9dcb3..4809da60fc9 100644
index 69174308a48..4f7192d1d59 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4518,6 +4518,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
@@ -4699,6 +4699,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
warned = TRUE;
}
@ -115,10 +115,10 @@ index 4f529d9dcb3..4809da60fc9 100644
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 22cfe881f41..c91128f41e8 100644
index 55e68d21c23..f3123f69fc9 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -136,7 +136,9 @@ struct shader_glsl_priv
@@ -134,7 +134,9 @@ struct shader_glsl_priv
BOOL consts_ubo;
GLuint ubo_vs_c;
@ -129,7 +129,7 @@ index 22cfe881f41..c91128f41e8 100644
const struct wined3d_vertex_pipe_ops *vertex_pipe;
const struct wined3d_fragment_pipe_ops *fragment_pipe;
@@ -151,7 +153,7 @@ struct glsl_vs_program
@@ -149,7 +151,7 @@ struct glsl_vs_program
struct list shader_entry;
GLuint id;
GLenum vertex_color_clamp;
@ -138,7 +138,7 @@ index 22cfe881f41..c91128f41e8 100644
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I];
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B];
GLint pos_fixup_location;
@@ -1191,7 +1193,7 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
@@ -1189,7 +1191,7 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
{
GL_EXTCALL(glBindBuffer(GL_UNIFORM_BUFFER, priv->ubo_vs_c));
checkGLcall("glBindBuffer");
@ -147,7 +147,7 @@ index 22cfe881f41..c91128f41e8 100644
NULL, GL_STREAM_DRAW));
checkGLcall("glBufferData");
}
@@ -1199,14 +1201,16 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
@@ -1197,14 +1199,16 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
/* Context activation is done by the caller. */
static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info,
const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap,
@ -165,7 +165,7 @@ index 22cfe881f41..c91128f41e8 100644
unsigned max_const_used;
if (priv->ubo_vs_c == -1)
@@ -1216,22 +1220,32 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
@@ -1214,22 +1218,32 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
}
bind_and_orphan_consts_ubo(gl_info, priv);
@ -204,7 +204,7 @@ index 22cfe881f41..c91128f41e8 100644
checkGLcall("glBufferSubData");
return;
}
@@ -1597,7 +1611,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1595,7 +1609,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
GL_EXTCALL(glGenBuffers(1, &priv->ubo_vs_c));
GL_EXTCALL(glBindBuffer(GL_UNIFORM_BUFFER, priv->ubo_vs_c));
checkGLcall("glBindBuffer (UBO)");
@ -213,7 +213,7 @@ index 22cfe881f41..c91128f41e8 100644
NULL, GL_STREAM_DRAW));
checkGLcall("glBufferData");
}
@@ -1609,7 +1623,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1607,7 +1621,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_VS_F)
shader_glsl_load_constants_f(vshader, gl_info, state->vs_consts_f,
@ -223,7 +223,7 @@ index 22cfe881f41..c91128f41e8 100644
if (update_mask & WINED3D_SHADER_CONST_VS_I)
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
@@ -1762,7 +1777,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1760,7 +1775,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_PS_F)
shader_glsl_load_constants_f(pshader, gl_info, state->ps_consts_f,
@ -233,7 +233,7 @@ index 22cfe881f41..c91128f41e8 100644
if (update_mask & WINED3D_SHADER_CONST_PS_I)
shader_glsl_load_constants_i(pshader, gl_info, state->ps_consts_i,
@@ -1907,7 +1923,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
@@ -1905,7 +1921,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
if (priv->consts_ubo)
return;
@ -242,7 +242,7 @@ index 22cfe881f41..c91128f41e8 100644
{
update_heap_entry(heap, i, priv->next_constant_version);
}
@@ -2279,7 +2295,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
@@ -2277,7 +2293,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
shader_addline(buffer,"layout(std140) uniform vs_c_ubo\n"
"{ \n"
" vec4 %s_c[%u];\n"
@ -251,7 +251,7 @@ index 22cfe881f41..c91128f41e8 100644
}
else if (shader->limits->constant_float > 0)
{
@@ -10057,12 +10073,13 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
@@ -10055,12 +10071,13 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
}
else if (!priv->consts_ubo)
{
@ -267,7 +267,7 @@ index 22cfe881f41..c91128f41e8 100644
}
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
@@ -10380,6 +10397,10 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
@@ -10378,6 +10395,10 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
vs_list = &ffp_shader->linked_programs;
}
@ -278,7 +278,7 @@ index 22cfe881f41..c91128f41e8 100644
hshader = state->shader[WINED3D_SHADER_TYPE_HULL];
if (!(context_gl->c.shader_update_mask & (1u << WINED3D_SHADER_TYPE_HULL)) && ctx_data->glsl_program)
hs_id = ctx_data->glsl_program->hs.id;
@@ -11134,7 +11155,7 @@ static void constant_heap_free(struct constant_heap *heap)
@@ -11132,7 +11153,7 @@ static void constant_heap_free(struct constant_heap *heap)
static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe,
const struct wined3d_fragment_pipe_ops *fragment_pipe)
{
@ -287,7 +287,7 @@ index 22cfe881f41..c91128f41e8 100644
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv;
@@ -11145,6 +11166,18 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -11143,6 +11164,18 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
priv->consts_ubo = (device->adapter->d3d_info.wined3d_creation_flags & WINED3D_LEGACY_SHADER_CONSTANTS)
&& gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT];
@ -306,7 +306,7 @@ index 22cfe881f41..c91128f41e8 100644
string_buffer_list_init(&priv->string_buffers);
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
@@ -11174,7 +11207,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -11172,7 +11205,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
goto fail;
}
@ -316,10 +316,10 @@ index 22cfe881f41..c91128f41e8 100644
ERR("Failed to initialize vertex shader constant heap\n");
goto fail;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index fed3cf97126..15fb532b04d 100644
index 3c22e01094e..7c63c472803 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -591,7 +591,7 @@ static void shader_delete_constant_list(struct list *clist)
@@ -590,7 +590,7 @@ static void shader_delete_constant_list(struct list *clist)
list_init(clist);
}
@ -328,7 +328,7 @@ index fed3cf97126..15fb532b04d 100644
{
static const struct limits_entry
{
@@ -614,6 +614,19 @@ static void shader_set_limits(struct wined3d_shader *shader)
@@ -613,6 +613,19 @@ static void shader_set_limits(struct wined3d_shader *shader)
{WINED3D_SHADER_VERSION(4, 1), WINED3D_SHADER_VERSION(5, 0), {16, 0, 0, 0, 32, 0}},
{0}
},
@ -348,7 +348,7 @@ index fed3cf97126..15fb532b04d 100644
hs_limits[] =
{
/* min_version, max_version, sampler, constant_int, constant_float, constant_bool, packed_output, packet_input */
@@ -658,7 +671,7 @@ static void shader_set_limits(struct wined3d_shader *shader)
@@ -657,7 +670,7 @@ static void shader_set_limits(struct wined3d_shader *shader)
FIXME("Unexpected shader type %u found.\n", shader->reg_maps.shader_version.type);
/* Fall-through. */
case WINED3D_SHADER_TYPE_VERTEX:
@ -357,7 +357,7 @@ index fed3cf97126..15fb532b04d 100644
break;
case WINED3D_SHADER_TYPE_HULL:
limits_array = hs_limits;
@@ -1026,7 +1039,7 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader)
@@ -1025,7 +1038,7 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader)
}
/* Note that this does not count the loop register as an address register. */
@ -366,7 +366,7 @@ index fed3cf97126..15fb532b04d 100644
{
struct wined3d_shader_signature_element input_signature_elements[max(MAX_ATTRIBS, MAX_REG_INPUT)];
struct wined3d_shader_signature_element output_signature_elements[MAX_REG_OUTPUT];
@@ -1052,7 +1065,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
@@ -1051,7 +1064,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
prev_ins = current_ins = ptr;
reg_maps->shader_version = shader_version;
@ -375,7 +375,7 @@ index fed3cf97126..15fb532b04d 100644
if (!(reg_maps->constf = heap_calloc(((min(shader->limits->constant_float, constf_size) + 31) / 32),
sizeof(*reg_maps->constf))))
@@ -3329,7 +3342,7 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
@@ -3328,7 +3341,7 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
}
static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d_device *device,
@ -384,7 +384,7 @@ index fed3cf97126..15fb532b04d 100644
{
const struct wined3d_d3d_info *d3d_info = &shader->device->adapter->d3d_info;
struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
@@ -3354,7 +3367,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d
@@ -3353,7 +3366,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d
shader_trace_init(fe, shader->frontend_data);
/* Second pass: figure out which registers are used, what the semantics are, etc. */
@ -393,7 +393,7 @@ index fed3cf97126..15fb532b04d 100644
return hr;
if (version->type != type)
@@ -3700,14 +3713,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
@@ -3699,14 +3712,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
@ -414,7 +414,7 @@ index fed3cf97126..15fb532b04d 100644
{
shader_cleanup(shader);
return hr;
@@ -3865,7 +3883,7 @@ static HRESULT geometry_shader_init_stream_output(struct wined3d_shader *shader,
@@ -3864,7 +3882,7 @@ static HRESULT geometry_shader_init_stream_output(struct wined3d_shader *shader,
{
shader->reg_maps.shader_version = shader_version;
shader->reg_maps.shader_version.type = WINED3D_SHADER_TYPE_GEOMETRY;
@ -423,7 +423,7 @@ index fed3cf97126..15fb532b04d 100644
if (FAILED(hr = shader_scan_output_signature(shader)))
return hr;
}
@@ -3915,7 +3933,7 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
@@ -3914,7 +3932,7 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
goto fail;
if (shader->function
@ -432,7 +432,7 @@ index fed3cf97126..15fb532b04d 100644
goto fail;
return WINED3D_OK;
@@ -4247,7 +4265,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
@@ -4246,7 +4264,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
return hr;
if (FAILED(hr = shader_set_function(shader, device,
@ -441,7 +441,7 @@ index fed3cf97126..15fb532b04d 100644
{
shader_cleanup(shader);
return hr;
@@ -4339,7 +4357,7 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
@@ -4338,7 +4356,7 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
return hr;
}
@ -450,7 +450,7 @@ index fed3cf97126..15fb532b04d 100644
{
shader_cleanup(object);
heap_free(object);
@@ -4373,7 +4391,7 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
@@ -4372,7 +4390,7 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
return hr;
}
@ -459,7 +459,7 @@ index fed3cf97126..15fb532b04d 100644
{
shader_cleanup(object);
heap_free(object);
@@ -4435,7 +4453,7 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
@@ -4434,7 +4452,7 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
return hr;
}
@ -469,10 +469,10 @@ index fed3cf97126..15fb532b04d 100644
shader_cleanup(object);
heap_free(object);
diff --git a/dlls/wined3d/shader_sm1.c b/dlls/wined3d/shader_sm1.c
index 6dedc83684c..c0280965a30 100644
index 50969c058f2..a69d37c1b24 100644
--- a/dlls/wined3d/shader_sm1.c
+++ b/dlls/wined3d/shader_sm1.c
@@ -542,7 +542,7 @@ static void *shader_sm1_init(const DWORD *byte_code, size_t byte_code_size,
@@ -540,7 +540,7 @@ static void *shader_sm1_init(const DWORD *byte_code, size_t byte_code_size,
major = WINED3D_SM1_VERSION_MAJOR(*byte_code);
minor = WINED3D_SM1_VERSION_MINOR(*byte_code);
@ -482,10 +482,10 @@ index 6dedc83684c..c0280965a30 100644
WARN("Invalid shader version %u.%u (%#x).\n", major, minor, *byte_code);
return NULL;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 650aa2e2f63..a4aaa7a8d66 100644
index 08485076c02..1485f362985 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3985,6 +3985,13 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
@@ -4039,6 +4039,13 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
LeaveCriticalSection(&device->bo_map_lock);
}
@ -500,5 +500,5 @@ index 650aa2e2f63..a4aaa7a8d66 100644
{
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
--
2.34.1
2.35.1

View File

@ -1,27 +1,28 @@
From abb20359684c77a063f6f3106fa51d8e8b25efa8 Mon Sep 17 00:00:00 2001
From 16d09c005e260719275cd32fc6db5ed35f44d174 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 4 Nov 2015 02:57:56 +0100
Subject: [PATCH] winepulse.drv: Use a separate mainloop and ctx for
pulse_test_connect.
---
dlls/winepulse.drv/pulse.c | 61 ++++++++++++++++++--------------------
1 file changed, 29 insertions(+), 32 deletions(-)
dlls/winepulse.drv/pulse.c | 62 ++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 32 deletions(-)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index 0e504b6b6dd..a1fcbcd8492 100644
index bd918b6f260..9690de61e20 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -659,7 +659,7 @@ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIB
@@ -661,7 +661,8 @@ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIB
fmt->dwChannelMask = pa_mask;
}
-static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
+static void pulse_probe_settings(pa_mainloop *ml, pa_context *ctx, int render, WAVEFORMATEXTENSIBLE *fmt) {
-static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATEXTENSIBLE *fmt, REFERENCE_TIME *def_period, REFERENCE_TIME *min_period)
+static void pulse_probe_settings(pa_mainloop *ml, pa_context *ctx, int render, const char *pulse_name,
+ WAVEFORMATEXTENSIBLE *fmt, REFERENCE_TIME *def_period, REFERENCE_TIME *min_period)
{
WAVEFORMATEX *wfx = &fmt->Format;
pa_stream *stream;
pa_channel_map map;
@@ -678,7 +678,7 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
@@ -684,7 +685,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE
attr.minreq = attr.fragsize = pa_frame_size(&ss);
attr.prebuf = 0;
@ -30,16 +31,16 @@ index 0e504b6b6dd..a1fcbcd8492 100644
if (stream)
pa_stream_set_state_callback(stream, pulse_stream_state, NULL);
if (!stream)
@@ -689,7 +689,7 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
@@ -695,7 +696,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE
else
ret = pa_stream_connect_record(stream, NULL, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS);
ret = pa_stream_connect_record(stream, pulse_name, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS);
if (ret >= 0) {
- while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 &&
+ while (pa_mainloop_iterate(ml, 1, &ret) >= 0 &&
pa_stream_get_state(stream) == PA_STREAM_CREATING)
{}
if (pa_stream_get_state(stream) == PA_STREAM_READY) {
@@ -700,7 +700,7 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
@@ -706,7 +707,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE
else
length = pa_stream_get_buffer_attr(stream)->fragsize;
pa_stream_disconnect(stream);
@ -48,8 +49,8 @@ index 0e504b6b6dd..a1fcbcd8492 100644
pa_stream_get_state(stream) == PA_STREAM_READY)
{}
}
@@ -747,31 +747,32 @@ static NTSTATUS pulse_test_connect(void *args)
struct pulse_config *config = params->config;
@@ -753,31 +754,32 @@ static NTSTATUS pulse_test_connect(void *args)
PhysDevice *dev;
pa_operation *o;
int ret;
+ pa_mainloop *ml;
@ -92,7 +93,7 @@ index 0e504b6b6dd..a1fcbcd8492 100644
if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED)
goto fail;
@@ -780,15 +781,15 @@ static NTSTATUS pulse_test_connect(void *args)
@@ -786,12 +788,12 @@ static NTSTATUS pulse_test_connect(void *args)
break;
}
@ -106,14 +107,9 @@ index 0e504b6b6dd..a1fcbcd8492 100644
+ pa_context_get_server(ctx),
+ pa_context_get_server_protocol_version(ctx));
- pulse_probe_settings(1, &pulse_fmt[0]);
- pulse_probe_settings(0, &pulse_fmt[1]);
+ pulse_probe_settings(ml, ctx, 1, &pulse_fmt[0]);
+ pulse_probe_settings(ml, ctx, 0, &pulse_fmt[1]);
free_phys_device_lists();
list_init(&g_phys_speakers);
@@ -797,26 +798,24 @@ static NTSTATUS pulse_test_connect(void *args)
@@ -800,34 +802,32 @@ static NTSTATUS pulse_test_connect(void *args)
pulse_add_device(&g_phys_speakers, NULL, 0, Speakers, 0, "", "PulseAudio");
pulse_add_device(&g_phys_sources, NULL, 0, Microphone, 0, "", "PulseAudio");
@ -137,6 +133,16 @@ index 0e504b6b6dd..a1fcbcd8492 100644
pa_operation_unref(o);
}
LIST_FOR_EACH_ENTRY(dev, &g_phys_speakers, PhysDevice, entry) {
- pulse_probe_settings(1, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period);
+ pulse_probe_settings(ml, ctx, 1, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period);
}
LIST_FOR_EACH_ENTRY(dev, &g_phys_sources, PhysDevice, entry) {
- pulse_probe_settings(0, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period);
+ pulse_probe_settings(ml, ctx, 0, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period);
}
- pa_context_unref(pulse_ctx);
- pulse_ctx = NULL;
- pa_mainloop_free(pulse_ml);
@ -144,9 +150,9 @@ index 0e504b6b6dd..a1fcbcd8492 100644
+ pa_context_unref(ctx);
+ pa_mainloop_free(ml);
config->modes[0].format = pulse_fmt[0];
config->modes[0].def_period = pulse_def_period[0];
@@ -831,10 +830,8 @@ static NTSTATUS pulse_test_connect(void *args)
pulse_unlock();
@@ -835,10 +835,8 @@ static NTSTATUS pulse_test_connect(void *args)
return STATUS_SUCCESS;
fail:

View File

@ -1 +1 @@
b2bf7b6b899dc18d092deebb0356a909db656ba8
9af3a79b96318471818e0abacfc1a6f8ecc91463