Rebase against c2ee20c95bea55069d32cfa69a95ae3e4486a02b

This commit is contained in:
Alistair Leslie-Hughes
2020-03-17 09:18:11 +11:00
parent cd7d77fe36
commit 0830db32cd
7 changed files with 38 additions and 193 deletions

View File

@@ -1,4 +1,4 @@
From d02344d80cd0e34f23a091a73663a65abe8e5978 Mon Sep 17 00:00:00 2001
From d7aab74ca535217432f800c8243809359db2ba34 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 bc9a3b98b2..95fe87df8a 100644
index a0daaf42880..79ed44c2285 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -40,6 +40,7 @@
@@ -31,7 +31,7 @@ index bc9a3b98b2..95fe87df8a 100644
struct d3d9
{
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 8d85a43523..492a4e4603 100644
index 85798db4440..bc3c65906ee 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
@@ -80,7 +80,7 @@ index 8d85a43523..492a4e4603 100644
return hr;
}
@@ -3548,14 +3554,20 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i
@@ -3551,14 +3557,20 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i
UINT reg_idx, const float *data, UINT count)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
@@ -103,7 +103,7 @@ index 8d85a43523..492a4e4603 100644
return D3DERR_INVALIDCALL;
}
@@ -3571,14 +3583,21 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
@@ -3574,14 +3586,21 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
UINT start_idx, float *constants, UINT count)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
@@ -127,11 +127,11 @@ index 8d85a43523..492a4e4603 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 04ff3fe5b6..6bd0a7a555 100644
index 7766fa8b336..eddd9a8ff1a 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -380,7 +380,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD
hr = wined3d_get_device_caps(d3d9->wined3d, adapter, device_type, &wined3d_caps);
@@ -439,7 +439,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD
hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps);
wined3d_mutex_unlock();
- d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
@@ -140,5 +140,5 @@ index 04ff3fe5b6..6bd0a7a555 100644
return hr;
}
--
2.24.1
2.25.1

View File

@@ -1,4 +1,4 @@
From 8e780b04bb6d1d02bbcce89390abe864a0bb5932 Mon Sep 17 00:00:00 2001
From 284768caa7c7a7c2e46d3ec90226d57cddd6dfd7 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
@@ -13,10 +13,10 @@ Subject: [PATCH] wined3d: Report actual vertex shader float constants limit
5 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index e4d59b739..d1e99276c 100644
index aca36a2377a..38fb0712547 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -5131,7 +5131,8 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
@@ -5159,7 +5159,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,10 +27,10 @@ index e4d59b739..d1e99276c 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 927c9456e..91b897d7e 100644
index 2cb5300e37e..a93c473d8da 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3808,10 +3808,21 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3819,9 +3819,20 @@ 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)
{
@@ -40,9 +40,8 @@ index 927c9456e..91b897d7e 100644
+
TRACE("device %p, caps %p.\n", device, caps);
- return wined3d_get_device_caps(device->wined3d, device->adapter->ordinal,
+ hr = wined3d_get_device_caps(device->wined3d, device->adapter->ordinal,
device->create_parms.device_type, 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))
+ return hr;
+
@@ -54,10 +53,10 @@ index 927c9456e..91b897d7e 100644
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 e30669453..4f7cc772b 100644
index 4b751cba161..412b12184f1 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -11261,7 +11261,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
@@ -11275,7 +11275,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;
@@ -70,7 +69,7 @@ index e30669453..4f7cc772b 100644
caps->varying_count = gl_info->limits.glsl_varyings;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b09811b84..51b5cc4ac 100644
index 2a371d021aa..4a7f843a108 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -173,6 +173,7 @@ struct wined3d_d3d_limits
@@ -82,10 +81,10 @@ index b09811b84..51b5cc4ac 100644
unsigned int varying_count;
unsigned int ffp_textures;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 042f9c4a3..e682f6b6e 100644
index 95292faca5c..cdefb46e969 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1605,6 +1605,7 @@ enum wined3d_shader_type
@@ -1604,6 +1604,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 9f047af5beb62d323a14c9d36183d20d3286ea12 Mon Sep 17 00:00:00 2001
From d4dd6612e5d2ad13deb9b9e543ef73a5fd6c083f 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
@@ -49,10 +49,10 @@ 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 cb84ef6f284..2d6e1fa688f 100644
index 9ceb758c605..0ae4eb7a347 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -24884,7 +24884,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -24877,7 +24877,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);
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, (unsigned int)c_index[0], c_color, 1);
@@ -61,10 +61,10 @@ index cb84ef6f284..2d6e1fa688f 100644
hr = IDirect3DDevice9_BeginScene(device);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 99787fcb39e..152072d5935 100644
index a93c473d8da..ac855848f24 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3513,10 +3513,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -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;
@@ -75,9 +75,9 @@ index 99787fcb39e..152072d5935 100644
- unsigned int i, j, start, idx;
+ unsigned int i, j, start, idx, vs_uniform_count;
struct wined3d_range range;
DWORD map, stage;
uint32_t map;
@@ -3527,9 +3528,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3518,9 +3519,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
if (changed->pixelShader)
wined3d_device_set_pixel_shader(device, state->ps);
@@ -106,7 +106,7 @@ 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 248f413f623..2423411916d 100644
index db0019adbf4..0641fb4b754 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,
@@ -163,7 +163,7 @@ index 248f413f623..2423411916d 100644
break;
wined3d_stateblock_set_vs_consts_f(device_state, range.offset, range.size, &state->vs_consts_f[range.offset]);
}
@@ -1190,12 +1200,16 @@ HRESULT CDECL wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *stat
@@ -1184,12 +1194,16 @@ HRESULT CDECL wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *stat
unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
{
const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
@@ -182,7 +182,7 @@ index 248f413f623..2423411916d 100644
return WINED3DERR_INVALIDCALL;
memcpy(&stateblock->stateblock_state.vs_consts_f[start_idx], constants, count * sizeof(*constants));
@@ -1949,7 +1963,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
@@ -1937,7 +1951,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 +191,7 @@ index 248f413f623..2423411916d 100644
break;
case WINED3D_SBT_PIXEL_STATE:
@@ -1961,7 +1975,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
@@ -1949,7 +1963,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 +201,10 @@ index 248f413f623..2423411916d 100644
default:
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e9dc5f7846b..946d60f0e93 100644
index 4a7f843a108..6073331b5d2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3209,7 +3209,7 @@ struct wined3d_state
@@ -3210,7 +3210,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 +213,7 @@ index e9dc5f7846b..946d60f0e93 100644
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
@@ -3944,7 +3944,7 @@ struct wined3d_vertex_declaration
@@ -3947,7 +3947,7 @@ struct wined3d_vertex_declaration
struct wined3d_saved_states
{
@@ -223,10 +223,10 @@ index e9dc5f7846b..946d60f0e93 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 ce420f164f6..34ed79fb668 100644
index cdefb46e969..3c109b8058c 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2166,7 +2166,7 @@ struct wined3d_stateblock_state
@@ -2174,7 +2174,7 @@ struct wined3d_stateblock_state
int base_vertex_index;
struct wined3d_shader *vs;