Updated wined3d-SWVP-shaders, wined3d-Indexed_Vertex_Blending patchsets.

Minor cleanup.
This commit is contained in:
Paul Gofman 2020-03-17 13:31:20 +03:00
parent 0830db32cd
commit a6f3bd989e
10 changed files with 198 additions and 198 deletions

View File

@ -1,18 +1,17 @@
From a218bc49c06c02bfd49eb1383a91be2eea66212e Mon Sep 17 00:00:00 2001
From 98ee9a7e02e2922b401203adcb00e5ae1f2e92e6 Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Thu, 17 Aug 2017 17:46:50 +0300
Subject: [PATCH 1/5] d3d9/tests: Add test for indexed vertex blending.
Subject: [PATCH] d3d9/tests: Add test for indexed vertex blending.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/d3d9/tests/visual.c | 252 +++++++++++++++++++++++++++++++++++++++
1 file changed, 252 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index ec27adef80..605b2b220b 100644
index 0463df7a56..9a2cc6b6b7 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -21522,6 +21522,257 @@ done:
@@ -21694,6 +21694,257 @@ done:
DestroyWindow(window);
}
@ -270,7 +269,7 @@ index ec27adef80..605b2b220b 100644
static void test_updatetexture(void)
{
BOOL r32f_supported, ati2n_supported, do_visual_test;
@@ -25676,6 +25927,7 @@ START_TEST(visual)
@@ -26853,6 +27104,7 @@ START_TEST(visual)
test_multisample_mismatch();
test_texcoordindex();
test_vertex_blending();
@ -279,5 +278,5 @@ index ec27adef80..605b2b220b 100644
test_depthbias();
test_flip();
--
2.20.1
2.25.1

View File

@ -1,19 +1,18 @@
From a25c75184c2e38dd25111ad8b0ebb316650b88e6 Mon Sep 17 00:00:00 2001
From 43fd47030361e72bea4ae671ffc92bd68335773f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 31 Aug 2017 00:23:43 +0200
Subject: [PATCH 2/5] d3d9/tests: Test normal calculation when indexed vertex
Subject: [PATCH] d3d9/tests: Test normal calculation when indexed vertex
blending is enabled.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/d3d9/tests/visual.c | 117 +++++++++++++++++++++++++++++++--------
1 file changed, 95 insertions(+), 22 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 605b2b220b..e665b9dbb3 100644
index 9a2cc6b6b7..483ffb328d 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -21524,47 +21524,68 @@ done:
@@ -21696,47 +21696,68 @@ done:
static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char *test_id_str)
{
@ -86,7 +85,7 @@ index 605b2b220b..e665b9dbb3 100644
static const POINT quad_upper_right_points[] =
{
{576, 48}, {-1, -1},
@@ -21605,6 +21626,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -21777,6 +21798,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
struct vec3 position;
struct vec3 blendweights;
DWORD matrixIndices;
@ -94,7 +93,7 @@ index 605b2b220b..e665b9dbb3 100644
}
vertex_data[4];
const POINT *quad_points;
@@ -21614,34 +21636,34 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -21786,34 +21808,34 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
{
/* upper right */
{
@ -145,7 +144,7 @@ index 605b2b220b..e665b9dbb3 100644
quad_fullscreen_points, quad_fullscreen_empty_points
}
};
@@ -21676,21 +21698,32 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -21848,21 +21870,32 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetRenderState D3DRS_INDEXEDVERTEXBLENDENABLE failed %08x.\n",
test_id_str, hr);
@ -180,7 +179,7 @@ index 605b2b220b..e665b9dbb3 100644
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice9_EndScene(device);
@@ -21714,7 +21747,47 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -21886,7 +21919,47 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
@ -229,5 +228,5 @@ index 605b2b220b..e665b9dbb3 100644
static void test_indexed_vertex_blending(void)
--
2.20.1
2.25.1

View File

@ -1,18 +1,17 @@
From c3af27da9a6025a1d2e25307a97aa23ec89b38ea Mon Sep 17 00:00:00 2001
From a13c7f2c2bc70d0690bec708e581c3e809fb39a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 31 Aug 2017 01:47:49 +0200
Subject: [PATCH 3/5] d3d9/tests: Check MaxVertexBlendMatrixIndex capability.
Subject: [PATCH] d3d9/tests: Check MaxVertexBlendMatrixIndex capability.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/d3d9/tests/visual.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index e665b9dbb3..6d9bdcf3da 100644
index 483ffb328d..4a9bc1943e 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -21796,7 +21796,9 @@ static void test_indexed_vertex_blending(void)
@@ -21968,7 +21968,9 @@ static void test_indexed_vertex_blending(void)
IDirect3DDevice9 *device;
IDirect3D9 *d3d;
ULONG refcount;
@ -22,7 +21,7 @@ index e665b9dbb3..6d9bdcf3da 100644
window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
@@ -21825,7 +21827,14 @@ static void test_indexed_vertex_blending(void)
@@ -21997,7 +21999,14 @@ static void test_indexed_vertex_blending(void)
if (SUCCEEDED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device)))
{
@ -37,7 +36,7 @@ index e665b9dbb3..6d9bdcf3da 100644
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
}
@@ -21835,7 +21844,26 @@ static void test_indexed_vertex_blending(void)
@@ -22007,7 +22016,26 @@ static void test_indexed_vertex_blending(void)
if (SUCCEEDED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
D3DCREATE_MIXED_VERTEXPROCESSING, &present_parameters, &device)))
{
@ -65,5 +64,5 @@ index e665b9dbb3..6d9bdcf3da 100644
ok(!refcount, "Device has %u references left.\n", refcount);
}
--
2.20.1
2.25.1

View File

@ -1,37 +1,36 @@
From 8913135cac5dc534714254b6a05d088811229cc2 Mon Sep 17 00:00:00 2001
From ffe075bc43500cb8a06ccb391cb3f1e884bcbace Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 20:15:07 +0300
Subject: [PATCH] wined3d: Allow higher world matrix states.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/wined3d/adapter_gl.c | 1 +
dlls/wined3d/cs.c | 3 +-
dlls/wined3d/device.c | 5 +
dlls/wined3d/device.c | 6 +
dlls/wined3d/directx.c | 2 +
dlls/wined3d/glsl_shader.c | 252 +++++++++++++++++++++++++++++++++
dlls/wined3d/state.c | 3 +-
dlls/wined3d/utils.c | 8 +-
dlls/wined3d/wined3d_private.h | 1 +
8 files changed, 268 insertions(+), 7 deletions(-)
8 files changed, 269 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 6a7a1ec12fe..77fb869b901 100644
index f1cb7d9659..dfad4e4842 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -5142,6 +5142,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
@@ -5147,6 +5147,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
d3d_info->limits.ffp_blend_stages = fragment_caps.MaxTextureBlendStages;
TRACE("Max texture stages: %u.\n", d3d_info->limits.ffp_blend_stages);
+ d3d_info->limits.ffp_max_vertex_blend_matrix_index = vertex_caps.max_vertex_blend_matrix_index;
d3d_info->limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices;
d3d_info->limits.active_light_count = vertex_caps.max_active_lights;
+ d3d_info->limits.ffp_max_vertex_blend_matrix_index = vertex_caps.max_vertex_blend_matrix_index;
d3d_info->valid_dual_rt_mask = 0;
for (i = 0; i < gl_info->limits.dual_buffers; ++i)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 732e5a2ce7e..0822e25e513 100644
index dbdf5f2ec2..a80a353398 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1671,7 +1671,8 @@ static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *dat
@@ -1670,7 +1670,8 @@ static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *dat
const struct wined3d_cs_set_transform *op = data;
cs->state.transforms[op->state] = op->matrix;
@ -42,26 +41,34 @@ index 732e5a2ce7e..0822e25e513 100644
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 95a53309aa7..a9c3a2cd296 100644
index 844d2f60ec..b8c88e2ffe 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4096,6 +4096,11 @@ HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device
adapter->vertex_pipe->vp_get_caps(adapter, &vertex_caps);
@@ -3798,6 +3798,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps)
{
+ struct wined3d_vertex_caps vertex_caps;
HRESULT hr;
TRACE("device %p, caps %p.\n", device, caps);
@@ -3807,6 +3808,11 @@ HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device
if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING)
caps->MaxVertexShaderConst = adapter->d3d_info.limits.vs_uniform_count_swvp;
caps->MaxVertexShaderConst = device->adapter->d3d_info.limits.vs_uniform_count_swvp;
+
+ device->adapter->vertex_pipe->vp_get_caps(device->adapter, &vertex_caps);
+ caps->MaxVertexBlendMatrixIndex = vertex_caps.max_vertex_blend_matrix_index;
+ if (!((device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING)
+ || ((device->create_parms.flags & WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ && device->softwareVertexProcessing)))
+ if (!wined3d_device_is_swvp_mode(device))
+ caps->MaxVertexBlendMatrixIndex = min(caps->MaxVertexBlendMatrixIndex, 8);
return hr;
}
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index fd03ce63494..88da6681525 100644
index 8cf0d77e82..0d244d1383 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2030,6 +2030,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, unsigned in
@@ -2112,6 +2112,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d_adapter *adapter,
caps->MaxActiveLights = vertex_caps.max_active_lights;
caps->MaxVertexBlendMatrices = vertex_caps.max_vertex_blend_matrices;
caps->MaxVertexBlendMatrixIndex = vertex_caps.max_vertex_blend_matrix_index;
@ -71,10 +78,10 @@ index fd03ce63494..88da6681525 100644
caps->FVFCaps = vertex_caps.fvf_caps;
caps->RasterCaps |= vertex_caps.raster_caps;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index df435e90d0f..c3fe023bb1b 100644
index a17d35e577..4aa205b327 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -11999,6 +11999,258 @@ static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] =
@@ -12026,6 +12026,258 @@ static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] =
{STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(1)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(1)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE },
{STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(2)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(2)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE },
{STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(3)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(3)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE },
@ -334,10 +341,10 @@ index df435e90d0f..c3fe023bb1b 100644
{STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_vertex_pipe_texmatrix}, WINED3D_GL_EXT_NONE },
{STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_vertex_pipe_texmatrix}, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 19eb36f28d0..f72bb0139cc 100644
index 099a612d05..26cf35fe65 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -5422,7 +5422,8 @@ static void prune_invalid_states(struct wined3d_state_entry *state_table, const
@@ -5459,7 +5459,8 @@ static void prune_invalid_states(struct wined3d_state_entry *state_table, const
state_table[i].apply = state_undefined;
}
@ -348,10 +355,10 @@ index 19eb36f28d0..f72bb0139cc 100644
for (i = start; i <= last; ++i)
{
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index e10d617b4e9..3772abb6186 100644
index 54866da533..3b805a2a6b 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -5088,11 +5088,9 @@ const char *debug_d3dtstype(enum wined3d_transform_state tstype)
@@ -5150,11 +5150,9 @@ const char *debug_d3dtstype(enum wined3d_transform_state tstype)
TSTYPE_TO_STR(WINED3D_TS_WORLD_MATRIX(3));
#undef TSTYPE_TO_STR
default:
@ -367,10 +374,10 @@ index e10d617b4e9..3772abb6186 100644
return "unrecognized";
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6a70ce3e369..bec02013c9f 100644
index 9762acd354..8c6513ebed 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -174,6 +174,7 @@ struct wined3d_d3d_limits
@@ -180,6 +180,7 @@ struct wined3d_d3d_limits
unsigned int ffp_blend_stages;
unsigned int ffp_vertex_blend_matrices;
unsigned int active_light_count;
@ -379,5 +386,5 @@ index 6a70ce3e369..bec02013c9f 100644
unsigned int max_rt_count;
unsigned int max_clip_distances;
--
2.17.1
2.25.1

View File

@ -1,9 +1,8 @@
From e52551261908a60af5964a48ac0fee4210a562b3 Mon Sep 17 00:00:00 2001
From 2b43fd4a10dc1fb6e897b8e78f7cb682b5742b90 Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 20:28:35 +0300
Subject: [PATCH] wined3d: Support indexed vertex blending.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/d3d9/tests/visual.c | 6 +-
dlls/wined3d/glsl_shader.c | 172 ++++++++++++++++++++++++++-----
@ -13,10 +12,10 @@ Signed-off-by: Paul Gofman <gofmanp@gmail.com>
5 files changed, 169 insertions(+), 30 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index a138afbcc3..e337a9bde3 100644
index 4a9bc1943e..c0fbc930b4 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -21785,7 +21785,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -21845,7 +21845,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
if (caps.MaxVertexBlendMatrixIndex < 7 || caps.MaxVertexBlendMatrices < 4)
{
@ -25,7 +24,7 @@ index a138afbcc3..e337a9bde3 100644
test_id_str, caps.MaxVertexBlendMatrices, caps.MaxVertexBlendMatrixIndex);
return;
}
@@ -21942,7 +21942,7 @@ static void test_indexed_vertex_blending(void)
@@ -22002,7 +22002,7 @@ static void test_indexed_vertex_blending(void)
memset(&caps, 0, sizeof(caps));
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
@ -34,7 +33,7 @@ index a138afbcc3..e337a9bde3 100644
caps.MaxVertexBlendMatrixIndex);
do_test_indexed_vertex_blending(device,"IVB software");
@@ -21968,7 +21968,7 @@ static void test_indexed_vertex_blending(void)
@@ -22028,7 +22028,7 @@ static void test_indexed_vertex_blending(void)
memset(&caps, 0, sizeof(caps));
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
@ -44,7 +43,7 @@ index a138afbcc3..e337a9bde3 100644
hr = IDirect3DDevice9_SetSoftwareVertexProcessing(device, FALSE);
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 2877ac7f54..7d7cf1e152 100644
index 4aa205b327..75f652d11c 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -150,6 +150,9 @@ struct shader_glsl_priv
@ -65,7 +64,7 @@ index 2877ac7f54..7d7cf1e152 100644
GLint projection_matrix_location;
GLint normal_matrix_location;
GLint texture_matrix_location[WINED3D_MAX_TEXTURES];
@@ -1606,10 +1610,10 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1608,10 +1612,10 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
{
unsigned int base, count;
@ -78,7 +77,7 @@ index 2877ac7f54..7d7cf1e152 100644
if (priv->ubo_vs_c == -1)
{
GL_EXTCALL(glGenBuffers(1, &priv->ubo_vs_c));
@@ -1622,6 +1626,21 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1624,6 +1628,21 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
GL_EXTCALL(glBindBufferBase(GL_UNIFORM_BUFFER, base, priv->ubo_vs_c));
checkGLcall("glBindBufferBase");
}
@ -100,7 +99,7 @@ index 2877ac7f54..7d7cf1e152 100644
ctx_data->ubo_bound = TRUE;
}
@@ -1668,28 +1687,41 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1670,28 +1689,41 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
}
if (update_mask & WINED3D_SHADER_CONST_FFP_MODELVIEW)
@ -156,7 +155,7 @@ index 2877ac7f54..7d7cf1e152 100644
}
}
@@ -9016,8 +9048,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9036,8 +9068,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
{
{"vec4", "ffp_attrib_position"}, /* WINED3D_FFP_POSITION */
{"vec4", "ffp_attrib_blendweight"}, /* WINED3D_FFP_BLENDWEIGHT */
@ -166,7 +165,7 @@ index 2877ac7f54..7d7cf1e152 100644
{"vec3", "ffp_attrib_normal"}, /* WINED3D_FFP_NORMAL */
{"float", "ffp_attrib_psize"}, /* WINED3D_FFP_PSIZE */
{"vec4", "ffp_attrib_diffuse"}, /* WINED3D_FFP_DIFFUSE */
@@ -9033,6 +9064,9 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9053,6 +9084,9 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
string_buffer_clear(buffer);
shader_glsl_add_version_declaration(buffer, gl_info);
@ -176,7 +175,7 @@ index 2877ac7f54..7d7cf1e152 100644
if (shader_glsl_use_explicit_attrib_location(gl_info))
shader_addline(buffer, "#extension GL_ARB_explicit_attrib_location : enable\n");
@@ -9047,7 +9081,18 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9067,7 +9101,18 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
}
shader_addline(buffer, "\n");
@ -196,7 +195,7 @@ index 2877ac7f54..7d7cf1e152 100644
shader_addline(buffer, "uniform mat4 ffp_projection_matrix;\n");
shader_addline(buffer, "uniform mat3 ffp_normal_matrix;\n");
shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", WINED3D_MAX_TEXTURES);
@@ -9109,6 +9154,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9129,6 +9174,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_addline(buffer, "\nvoid main()\n{\n");
shader_addline(buffer, "float m;\n");
shader_addline(buffer, "vec3 r;\n");
@ -205,7 +204,7 @@ index 2877ac7f54..7d7cf1e152 100644
for (i = 0; i < ARRAY_SIZE(attrib_info); ++i)
{
@@ -9138,8 +9185,21 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9158,8 +9205,21 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_addline(buffer, "ffp_attrib_blendweight[%u] -= ffp_attrib_blendweight[%u];\n", settings->vertexblends, i);
shader_addline(buffer, "vec4 ec_pos = vec4(0.0);\n");
@ -229,7 +228,7 @@ index 2877ac7f54..7d7cf1e152 100644
shader_addline(buffer, "gl_Position = ffp_projection_matrix * ec_pos;\n");
if (settings->clipping)
@@ -9163,7 +9223,19 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9183,7 +9243,19 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
else
{
for (i = 0; i < settings->vertexblends + 1; ++i)
@ -250,7 +249,7 @@ index 2877ac7f54..7d7cf1e152 100644
}
if (settings->normalize)
@@ -10028,6 +10100,28 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
@@ -10048,6 +10120,28 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
string_buffer_sprintf(name, "ffp_modelview_matrix[%u]", i);
vs->modelview_matrix_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
}
@ -279,7 +278,7 @@ index 2877ac7f54..7d7cf1e152 100644
vs->projection_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_projection_matrix"));
vs->normal_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_normal_matrix"));
for (i = 0; i < WINED3D_MAX_TEXTURES; ++i)
@@ -10607,7 +10701,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
@@ -10627,7 +10721,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW
| WINED3D_SHADER_CONST_FFP_PROJ;
@ -288,7 +287,7 @@ index 2877ac7f54..7d7cf1e152 100644
{
if (entry->vs.modelview_matrix_location[i] != -1)
{
@@ -10616,6 +10710,9 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
@@ -10636,6 +10730,9 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
}
}
@ -298,7 +297,7 @@ index 2877ac7f54..7d7cf1e152 100644
for (i = 0; i < WINED3D_MAX_TEXTURES; ++i)
{
if (entry->vs.texture_matrix_location[i] != -1)
@@ -11156,7 +11253,17 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -11176,7 +11273,17 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
priv->legacy_lighting = device->wined3d->flags & WINED3D_LEGACY_FFP_LIGHTING;
@ -317,7 +316,7 @@ index 2877ac7f54..7d7cf1e152 100644
device->vertex_priv = vertex_priv;
device->fragment_priv = fragment_priv;
device->shader_priv = priv;
@@ -11189,6 +11296,14 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
@@ -11209,6 +11316,14 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
string_buffer_free(&priv->shader_buffer);
priv->fragment_pipe->free_private(device, context);
priv->vertex_pipe->vp_free(device, context);
@ -332,7 +331,7 @@ index 2877ac7f54..7d7cf1e152 100644
if (priv->ubo_vs_c != -1)
{
@@ -11613,7 +11728,11 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_adapter *adapter,
@@ -11633,7 +11748,11 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_adapter *adapter,
caps->ffp_generic_attributes = TRUE;
caps->max_active_lights = WINED3D_MAX_ACTIVE_LIGHTS;
caps->max_vertex_blend_matrices = MAX_VERTEX_BLENDS;
@ -345,7 +344,7 @@ index 2877ac7f54..7d7cf1e152 100644
caps->vertex_processing_caps = WINED3DVTXPCAPS_TEXGEN
| WINED3DVTXPCAPS_MATERIALSOURCE7
| WINED3DVTXPCAPS_VERTEXFOG
@@ -11815,7 +11934,8 @@ static void glsl_vertex_pipe_pixel_shader(struct wined3d_context *context,
@@ -11835,7 +11954,8 @@ static void glsl_vertex_pipe_pixel_shader(struct wined3d_context *context,
static void glsl_vertex_pipe_world(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id)
{
@ -356,10 +355,10 @@ index 2877ac7f54..7d7cf1e152 100644
static void glsl_vertex_pipe_vertexblend(struct wined3d_context *context,
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 2d7f3d0d4c..95e83dba7f 100644
index 3b805a2a6b..b78f7a334d 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -6556,6 +6556,7 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
@@ -6570,6 +6570,7 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
settings->flatshading = FALSE;
settings->swizzle_map = si->swizzle_map;
@ -368,7 +367,7 @@ index 2d7f3d0d4c..95e83dba7f 100644
int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry)
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 81032745a0..e91409f452 100644
index c5df45541e..f8ee97a03d 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -119,6 +119,15 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
@ -388,10 +387,10 @@ index 81032745a0..e91409f452 100644
switch(element->format)
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6b974b99a9..936f71eabc 100644
index 8c6513ebed..da9778308d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -275,6 +275,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
@@ -281,6 +281,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
}
/* Device caps */
@ -399,7 +398,7 @@ index 6b974b99a9..936f71eabc 100644
#define WINED3D_MAX_ACTIVE_LIGHTS 8
#define WINED3D_MAX_SOFTWARE_ACTIVE_LIGHTS 32
#define MAX_CONSTANT_BUFFERS 15
@@ -3060,7 +3061,8 @@ struct wined3d_ffp_vs_settings
@@ -3111,7 +3112,8 @@ struct wined3d_ffp_vs_settings
DWORD ortho_fog : 1;
DWORD flatshading : 1;
DWORD swizzle_map : 16; /* MAX_ATTRIBS, 16 */
@ -409,7 +408,7 @@ index 6b974b99a9..936f71eabc 100644
DWORD texgen[WINED3D_MAX_TEXTURES];
};
@@ -5165,6 +5167,13 @@ static inline void wined3d_not_from_cs(struct wined3d_cs *cs)
@@ -5211,6 +5213,13 @@ static inline void wined3d_not_from_cs(struct wined3d_cs *cs)
assert(cs->thread_id != GetCurrentThreadId());
}
@ -424,5 +423,5 @@ index 6b974b99a9..936f71eabc 100644
enum wined3d_material_color_source source)
{
--
2.23.0
2.25.1

View File

@ -1,4 +1,4 @@
From be44f12b3c77f763a5eac9bb63d00cd71b4798fa Mon Sep 17 00:00:00 2001
From 34d8cd36334b26598b18d865a412cfa6ea8c2c37 Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 13:17:01 +0300
Subject: [PATCH] wined3d: Use UBO for vertex shader float constants if
@ -16,10 +16,10 @@ Subject: [PATCH] wined3d: Use UBO for vertex shader float constants if
8 files changed, 148 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 0f283b55354..a69f7d8542b 100644
index 343073f351..2154b49f49 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -413,7 +413,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
@@ -470,7 +470,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING
| WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
| WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART
@ -29,10 +29,10 @@ index 0f283b55354..a69f7d8542b 100644
struct wined3d_adapter *wined3d_adapter;
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index 3e9fabf758b..924c2d2e8c5 100644
index d79b32515f..7766fa8b33 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -589,7 +589,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
@@ -674,7 +674,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
DWORD flags = WINED3D_PRESENT_CONVERSION | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
| WINED3D_SRGB_READ_WRITE_CONTROL | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR
| WINED3D_NO_PRIMITIVE_RESTART | WINED3D_LEGACY_CUBEMAP_FILTERING
@ -42,10 +42,10 @@ index 3e9fabf758b..924c2d2e8c5 100644
struct wined3d_adapter *wined3d_adapter;
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 5e7ff6e2fae..0df82acc125 100644
index 2fd061b74a..078a874e1c 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -3145,6 +3145,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
@@ -3144,6 +3144,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_VERTEX] = min(gl_max, WINED3D_MAX_CBS);
TRACE("Max vertex uniform blocks: %u (%d).\n",
gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_VERTEX], gl_max);
@ -56,7 +56,7 @@ index 5e7ff6e2fae..0df82acc125 100644
}
if (gl_info->supported[ARB_TESSELLATION_SHADER])
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index d48c35c9ce2..4b751cba161 100644
index 4a2fbce553..e306694533 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -138,6 +138,10 @@ struct shader_glsl_priv
@ -257,7 +257,7 @@ index d48c35c9ce2..4b751cba161 100644
}
/* Always declare the full set of constants, the compiler can remove the
@@ -9904,17 +9994,36 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
@@ -9890,17 +9980,36 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *gl_info,
@ -299,7 +299,7 @@ index d48c35c9ce2..4b751cba161 100644
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
{
@@ -10989,6 +11098,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -10975,6 +11084,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
const struct wined3d_fragment_pipe_ops *fragment_pipe)
{
SIZE_T stack_size = wined3d_log2i(max(WINED3D_MAX_VS_CONSTS_F, WINED3D_MAX_PS_CONSTS_F)) + 1;
@ -307,7 +307,7 @@ index d48c35c9ce2..4b751cba161 100644
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv;
struct shader_glsl_priv *priv;
@@ -10996,6 +11106,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -10982,6 +11092,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
if (!(priv = heap_alloc_zero(sizeof(*priv))))
return E_OUTOFMEMORY;
@ -316,7 +316,7 @@ index d48c35c9ce2..4b751cba161 100644
string_buffer_list_init(&priv->string_buffers);
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
@@ -11050,6 +11162,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -11036,6 +11148,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
device->fragment_priv = fragment_priv;
device->shader_priv = priv;
@ -325,7 +325,7 @@ index d48c35c9ce2..4b751cba161 100644
return WINED3D_OK;
fail:
@@ -11077,6 +11191,13 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
@@ -11063,6 +11177,13 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
priv->fragment_pipe->free_private(device, context);
priv->vertex_pipe->vp_free(device, context);
@ -340,7 +340,7 @@ index d48c35c9ce2..4b751cba161 100644
device->shader_priv = NULL;
}
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 7ebd8c0226a..23e21158d44 100644
index d9ef1a96e2..f29b49b902 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -767,6 +767,8 @@ static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct w
@ -353,10 +353,10 @@ index 7ebd8c0226a..23e21158d44 100644
}
}
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 715d497d076..1a9a06d4c88 100644
index 6289317936..099a612d05 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4401,6 +4401,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
@@ -4461,6 +4461,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
unsigned int i, base, count;
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@ -369,7 +369,7 @@ index 715d497d076..1a9a06d4c88 100644
if (STATE_IS_GRAPHICS_CONSTANT_BUFFER(state_id))
shader_type = state_id - STATE_GRAPHICS_CONSTANT_BUFFER(0);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 665c9a73982..481d5798c7d 100644
index 9240b0e455..b09811b845 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1070,6 +1070,7 @@ struct wined3d_shader_reg_maps
@ -380,7 +380,7 @@ index 665c9a73982..481d5798c7d 100644
};
/* Keeps track of details for TEX_M#x# instructions which need to maintain
@@ -2746,6 +2747,7 @@ struct wined3d_gl_limits
@@ -2743,6 +2744,7 @@ struct wined3d_gl_limits
UINT glsl_varyings;
UINT glsl_vs_float_constants;
UINT glsl_ps_float_constants;
@ -389,10 +389,10 @@ index 665c9a73982..481d5798c7d 100644
UINT arb_vs_float_constants;
UINT arb_vs_native_constants;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 875bb6dfe40..581ed7b76fd 100644
index d192266583..1199408ec6 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1340,6 +1340,7 @@ enum wined3d_shader_type
@@ -1335,6 +1335,7 @@ enum wined3d_shader_type
#define WINED3D_NO_PRIMITIVE_RESTART 0x00000800
#define WINED3D_LEGACY_CUBEMAP_FILTERING 0x00001000
#define WINED3D_NORMALIZED_DEPTH_BIAS 0x00002000

View File

@ -1,4 +1,4 @@
From d7aab74ca535217432f800c8243809359db2ba34 Mon Sep 17 00:00:00 2001
From 0a28c2626c859cd92f22308443d77e5328ad6bee Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 14:24:50 +0300
Subject: [PATCH] d3d9: Support SWVP vertex shader float constants limits.
@ -10,7 +10,7 @@ Subject: [PATCH] d3d9: Support SWVP vertex shader float constants limits.
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index a0daaf42880..79ed44c2285 100644
index a0daaf4288..79ed44c228 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -40,6 +40,7 @@
@ -31,7 +31,7 @@ index a0daaf42880..79ed44c2285 100644
struct d3d9
{
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 85798db4440..bc3c65906ee 100644
index 85798db444..bc3c65906e 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -360,7 +360,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
@ -127,7 +127,7 @@ index 85798db4440..bc3c65906ee 100644
WARN("Trying to access %u constants, but d3d9 only supports %u\n",
start_idx + count, device->vs_uniform_count);
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index 7766fa8b336..eddd9a8ff1a 100644
index 7766fa8b33..eddd9a8ff1 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -439,7 +439,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD

View File

@ -1,22 +1,22 @@
From 284768caa7c7a7c2e46d3ec90226d57cddd6dfd7 Mon Sep 17 00:00:00 2001
From de420388d95e30644947be15c42bfa51349f48f9 Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 14:47:28 +0300
Subject: [PATCH] wined3d: Report actual vertex shader float constants limit
for SWVP device.
---
dlls/wined3d/adapter_gl.c | 3 ++-
dlls/wined3d/device.c | 13 ++++++++++++-
dlls/wined3d/glsl_shader.c | 5 ++++-
dlls/wined3d/wined3d_private.h | 1 +
include/wine/wined3d.h | 1 +
5 files changed, 20 insertions(+), 3 deletions(-)
dlls/wined3d/adapter_gl.c | 3 ++-
dlls/wined3d/device.c | 9 ++++++++-
dlls/wined3d/glsl_shader.c | 5 ++++-
dlls/wined3d/wined3d_private.h | 1 +
include/wine/wined3d.h | 1 +
5 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index aca36a2377a..38fb0712547 100644
index 078a874e1c..f1cb7d9659 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -5159,7 +5159,8 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
@@ -5140,7 +5140,8 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->limits.gs_version = shader_caps.gs_version;
d3d_info->limits.ps_version = shader_caps.ps_version;
d3d_info->limits.cs_version = shader_caps.cs_version;
@ -27,36 +27,32 @@ index aca36a2377a..38fb0712547 100644
d3d_info->limits.varying_count = shader_caps.varying_count;
d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2cb5300e37e..a93c473d8da 100644
index 42d645d201..b2db48ecf0 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3819,9 +3819,20 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3796,9 +3796,16 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps)
{
+ const struct wined3d_adapter *adapter = device->wined3d->adapters[device->adapter->ordinal];
+ struct wined3d_vertex_caps vertex_caps;
+ HRESULT hr;
+
TRACE("device %p, caps %p.\n", device, caps);
- return wined3d_get_device_caps(device->adapter, device->create_parms.device_type, caps);
+ hr = wined3d_get_device_caps(device->adapter, device->create_parms.device_type, caps);
+ if (FAILED(hr))
+ if (FAILED(hr = wined3d_get_device_caps(device->adapter, device->create_parms.device_type, caps)))
+ return hr;
+
+ adapter->vertex_pipe->vp_get_caps(adapter, &vertex_caps);
+ if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING)
+ caps->MaxVertexShaderConst = adapter->d3d_info.limits.vs_uniform_count_swvp;
+ caps->MaxVertexShaderConst = device->adapter->d3d_info.limits.vs_uniform_count_swvp;
+ return hr;
}
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 4b751cba161..412b12184f1 100644
index e306694533..4f7cc772be 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -11275,7 +11275,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
@@ -11261,7 +11261,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
caps->vs_version = gl_info->supported[ARB_VERTEX_SHADER] ? caps->vs_version : 0;
caps->ps_version = gl_info->supported[ARB_FRAGMENT_SHADER] ? caps->ps_version : 0;
@ -69,7 +65,7 @@ index 4b751cba161..412b12184f1 100644
caps->varying_count = gl_info->limits.glsl_varyings;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2a371d021aa..4a7f843a108 100644
index b09811b845..51b5cc4ac7 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -173,6 +173,7 @@ struct wined3d_d3d_limits
@ -81,10 +77,10 @@ index 2a371d021aa..4a7f843a108 100644
unsigned int varying_count;
unsigned int ffp_textures;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 95292faca5c..cdefb46e969 100644
index 1199408ec6..3606c4e245 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1604,6 +1604,7 @@ enum wined3d_shader_type
@@ -1602,6 +1602,7 @@ enum wined3d_shader_type
#define WINED3D_MAX_CONSTS_B 16
#define WINED3D_MAX_CONSTS_I 16
#define WINED3D_MAX_VS_CONSTS_F 256

View File

@ -1,4 +1,4 @@
From d4dd6612e5d2ad13deb9b9e543ef73a5fd6c083f Mon Sep 17 00:00:00 2001
From c08f3b5637a9d43e29b7d72cb61068f270d82133 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
@ -7,15 +7,15 @@ Subject: [PATCH] wined3d: Support SWVP vertex shader constants limit in state
---
dlls/d3d9/tests/device.c | 5 -----
dlls/d3d9/tests/visual.c | 1 -
dlls/wined3d/device.c | 9 +++++++--
dlls/wined3d/device.c | 6 ++++--
dlls/wined3d/glsl_shader.c | 2 +-
dlls/wined3d/stateblock.c | 30 ++++++++++++++++++++++--------
dlls/wined3d/wined3d_private.h | 4 ++--
dlls/wined3d/stateblock.c | 23 ++++++++++++++---------
dlls/wined3d/wined3d_private.h | 13 +++++++++++--
include/wine/wined3d.h | 2 +-
7 files changed, 33 insertions(+), 20 deletions(-)
7 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index d00a26b942c..09446d0be62 100644
index d00a26b942..09446d0be6 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -6413,13 +6413,10 @@ static void test_vertex_shader_constant(void)
@ -49,7 +49,7 @@ index d00a26b942c..09446d0be62 100644
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts_swvp - 1, c, 1);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 9ceb758c605..0ae4eb7a347 100644
index 9ceb758c60..0ae4eb7a34 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -24877,7 +24877,6 @@ static void test_mvp_software_vertex_shaders(void)
@ -61,14 +61,10 @@ index 9ceb758c605..0ae4eb7a347 100644
hr = IDirect3DDevice9_BeginScene(device);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a93c473d8da..ac855848f24 100644
index b2db48ecf0..1db974f118 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3504,10 +3504,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
struct wined3d_stateblock *stateblock)
{
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
+ const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
@@ -3484,7 +3484,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;
BOOL set_blend_state = FALSE, set_rasterizer_state = FALSE;
@ -77,13 +73,11 @@ index a93c473d8da..ac855848f24 100644
struct wined3d_range range;
uint32_t map;
@@ -3518,9 +3519,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3495,9 +3495,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
if (changed->pixelShader)
wined3d_device_set_pixel_shader(device, state->ps);
+ vs_uniform_count = device->create_parms.flags
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
+ vs_uniform_count = wined3d_device_get_vs_uniform_count(device);
+
for (start = 0; ; start = range.offset + range.size)
{
@ -93,7 +87,7 @@ index a93c473d8da..ac855848f24 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 412b12184f1..33666d5eb8c 100644
index 4f7cc772be..a88f92cc03 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1913,7 +1913,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
@ -106,14 +100,12 @@ index 412b12184f1..33666d5eb8c 100644
update_heap_entry(heap, i, priv->next_constant_version);
}
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index db0019adbf4..0641fb4b754 100644
index db0019adbf..6be1115f82 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -713,9 +713,10 @@ static void wined3d_state_record_lights(struct wined3d_light_state *dst_state,
void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
@@ -714,8 +714,8 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
const struct wined3d_stateblock *device_state)
{
+ const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
const struct wined3d_stateblock_state *state = &device_state->stateblock_state;
+ unsigned int i, start, vs_uniform_count;
struct wined3d_range range;
@ -121,13 +113,11 @@ index db0019adbf4..0641fb4b754 100644
DWORD map;
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
@@ -731,9 +732,13 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
@@ -731,9 +731,11 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
stateblock->stateblock_state.vs = state->vs;
}
+ vs_uniform_count = stateblock->device->create_parms.flags
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
+ vs_uniform_count = wined3d_device_get_vs_uniform_count(stateblock->device);
+
for (start = 0; ; start = range.offset + range.size)
{
@ -136,11 +126,9 @@ index db0019adbf4..0641fb4b754 100644
break;
memcpy(&stateblock->stateblock_state.vs_consts_f[range.offset], &state->vs_consts_f[range.offset],
@@ -976,9 +981,10 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
@@ -977,8 +979,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
struct wined3d_stateblock *device_state)
{
+ const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
+ unsigned int i, start, vs_uniform_count;
struct wined3d_range range;
@ -148,13 +136,11 @@ index db0019adbf4..0641fb4b754 100644
DWORD map;
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
@@ -986,9 +992,13 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
@@ -986,9 +988,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
if (stateblock->changed.vertexShader)
wined3d_stateblock_set_vertex_shader(device_state, state->vs);
+ vs_uniform_count = stateblock->device->create_parms.flags
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
+ vs_uniform_count = wined3d_device_get_vs_uniform_count(stateblock->device);
+
for (start = 0; ; start = range.offset + range.size)
{
@ -163,10 +149,11 @@ index db0019adbf4..0641fb4b754 100644
break;
wined3d_stateblock_set_vs_consts_f(device_state, range.offset, range.size, &state->vs_consts_f[range.offset]);
}
@@ -1184,12 +1194,16 @@ HRESULT CDECL wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *stat
@@ -1183,13 +1187,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)
{
const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
- const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
+ unsigned int constants_count;
TRACE("stateblock %p, start_idx %u, count %u, constants %p.\n",
@ -174,15 +161,13 @@ index db0019adbf4..0641fb4b754 100644
- if (!constants || start_idx >= d3d_info->limits.vs_uniform_count
- || count > d3d_info->limits.vs_uniform_count - start_idx)
+ constants_count = stateblock->device->create_parms.flags
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
+ constants_count = wined3d_device_get_vs_uniform_count(stateblock->device);
+
+ if (!constants || start_idx >= constants_count || count > constants_count - start_idx)
return WINED3DERR_INVALIDCALL;
memcpy(&stateblock->stateblock_state.vs_consts_f[start_idx], constants, count * sizeof(*constants));
@@ -1937,7 +1951,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
@@ -1937,7 +1942,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,
@ -191,7 +176,7 @@ index db0019adbf4..0641fb4b754 100644
break;
case WINED3D_SBT_PIXEL_STATE:
@@ -1949,7 +1963,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
@@ -1949,7 +1954,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,
@ -201,10 +186,10 @@ index db0019adbf4..0641fb4b754 100644
default:
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4a7f843a108..6073331b5d2 100644
index 51b5cc4ac7..eef5d4fec2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3210,7 +3210,7 @@ struct wined3d_state
@@ -3206,7 +3206,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];
@ -213,7 +198,23 @@ index 4a7f843a108..6073331b5d2 100644
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
@@ -3947,7 +3947,7 @@ struct wined3d_vertex_declaration
@@ -3354,6 +3354,15 @@ HRESULT wined3d_device_set_implicit_swapchain(struct wined3d_device *device,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_device_uninit_3d(struct wined3d_device *device) DECLSPEC_HIDDEN;
+static inline unsigned int wined3d_device_get_vs_uniform_count(const struct wined3d_device *device)
+{
+ const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
+
+ return device->create_parms.flags
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
+}
+
struct wined3d_device_no3d
{
struct wined3d_device d;
@@ -3923,7 +3932,7 @@ struct wined3d_vertex_declaration
struct wined3d_saved_states
{
@ -223,10 +224,10 @@ index 4a7f843a108..6073331b5d2 100644
WORD vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */
DWORD ps_consts_f[WINED3D_MAX_PS_CONSTS_F >> 5];
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index cdefb46e969..3c109b8058c 100644
index 3606c4e245..845cd6745f 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2174,7 +2174,7 @@ struct wined3d_stateblock_state
@@ -2165,7 +2165,7 @@ struct wined3d_stateblock_state
int base_vertex_index;
struct wined3d_shader *vs;

View File

@ -1,4 +1,4 @@
From 8e28a42c30774c48cbc5bc4c627357c4d26ed4cd Mon Sep 17 00:00:00 2001
From ee17d52379ab1bf8ed5c19ce3658a1996d19808b 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,7 +14,7 @@ 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 b60468e013..6e031be27f 100644
index 09446d0be6..7d62fd5823 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -6901,15 +6901,11 @@ float4 main(const float4 color : COLOR) : SV_TARGET
@ -59,10 +59,10 @@ index b60468e013..6e031be27f 100644
cleanup:
refcount = IDirect3DDevice9_Release(device);
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 2d6e1fa688..793b3f0c23 100644
index 0ae4eb7a34..0463df7a56 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -24810,7 +24810,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24803,7 +24803,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);
hr = IDirect3DDevice9_CreateVertexShader(device, pure_sw_shader_code, &pure_sw_shader);
@ -70,7 +70,7 @@ index 2d6e1fa688..793b3f0c23 100644
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration);
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
@@ -24848,7 +24847,7 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24841,7 +24840,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 2d6e1fa688..793b3f0c23 100644
expected_color, color);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
@@ -24867,7 +24866,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24860,7 +24859,6 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x00ffffff;
color = getPixelColor(device, 5, 5);
@ -87,7 +87,7 @@ index 2d6e1fa688..793b3f0c23 100644
ok(color == expected_color, "Expected color 0x%08x, got 0x%08x (sw shader in sw mode).\n",
expected_color, color);
@@ -24917,7 +24915,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24910,7 +24908,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 2d6e1fa688..793b3f0c23 100644
expected_color, color);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3aa3d13314..4a9b9a7781 100644
index 1db974f118..844d2f60ec 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4524,6 +4524,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
@@ -4256,6 +4256,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
warned = TRUE;
}
@ -115,7 +115,7 @@ index 3aa3d13314..4a9b9a7781 100644
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index a88f92cc03..4b151baf97 100644
index a88f92cc03..3ae361024e 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -140,7 +140,9 @@ struct shader_glsl_priv
@ -219,7 +219,7 @@ index a88f92cc03..4b151baf97 100644
shader_glsl_load_constants_f(vshader, gl_info, state->vs_consts_f,
- prog->vs.uniform_f_locations, &priv->vconst_heap, priv->stack, constant_version, priv);
+ prog->vs.uniform_f_locations, &priv->vconst_heap, priv->stack,
+ constant_version, priv, device_is_swvp(context->device));
+ constant_version, priv, wined3d_device_is_swvp_mode(context->device));
if (update_mask & WINED3D_SHADER_CONST_VS_I)
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
@ -272,7 +272,7 @@ index a88f92cc03..4b151baf97 100644
}
+ if (vshader && vshader->reg_maps.constant_float_count > WINED3D_MAX_VS_CONSTS_F
+ && !device_is_swvp(context_gl->c.device))
+ && !wined3d_device_is_swvp_mode(context_gl->c.device))
+ FIXME("Applying context with SW shader in HW mode.\n");
+
hshader = state->shader[WINED3D_SHADER_TYPE_HULL];
@ -316,7 +316,7 @@ index a88f92cc03..4b151baf97 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 a869b31a2c..b2145750d6 100644
index f29b49b902..294b65260e 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -592,7 +592,7 @@ static void shader_delete_constant_list(struct list *clist)
@ -482,23 +482,23 @@ index 0c6bb93317..1051307e88 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 d07ac1ab0b..81dfb45ec5 100644
index eef5d4fec2..cdfce0bea4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4864,6 +4864,13 @@ static inline BOOL shader_constant_is_local(const struct wined3d_shader *shader,
return FALSE;
}
@@ -3354,6 +3354,13 @@ HRESULT wined3d_device_set_implicit_swapchain(struct wined3d_device *device,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_device_uninit_3d(struct wined3d_device *device) DECLSPEC_HIDDEN;
+static inline BOOL device_is_swvp(const struct wined3d_device *device)
+static inline BOOL wined3d_device_is_swvp_mode(const struct wined3d_device *device)
+{
+ return (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING)
+ || ((device->create_parms.flags & WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ && device->softwareVertexProcessing);
+}
+
void get_identity_matrix(struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
void get_modelview_matrix(const struct wined3d_context *context, const struct wined3d_state *state,
unsigned int index, struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
static inline unsigned int wined3d_device_get_vs_uniform_count(const struct wined3d_device *device)
{
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
--
2.24.1
2.25.1