You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against f266dc094a9b4fbe95792ed706891609901834e3.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From e8a4c08a831329bf42e8b6a80519d013a899d5ef Mon Sep 17 00:00:00 2001
|
||||
From d0b6d8084015412dfca021f0aa2e889725609de9 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,10 +15,10 @@ 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 0a95e819018..83d05cf8bc5 100644
|
||||
index 8ab52c7d5e4..4cd2a93f7e9 100644
|
||||
--- a/dlls/d3d9/tests/device.c
|
||||
+++ b/dlls/d3d9/tests/device.c
|
||||
@@ -6973,13 +6973,10 @@ static void test_vertex_shader_constant(void)
|
||||
@@ -6989,13 +6989,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);
|
||||
@@ -32,7 +32,7 @@ index 0a95e819018..83d05cf8bc5 100644
|
||||
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 %#lx.\n", hr);
|
||||
@@ -7004,7 +7001,6 @@ static void test_vertex_shader_constant(void)
|
||||
@@ -7020,7 +7017,6 @@ static void test_vertex_shader_constant(void)
|
||||
|
||||
IDirect3DDevice9_SetSoftwareVertexProcessing(device, 0);
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts + 0, c, 1);
|
||||
@@ -40,7 +40,7 @@ index 0a95e819018..83d05cf8bc5 100644
|
||||
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 %#lx.\n", hr);
|
||||
@@ -7012,7 +7008,6 @@ static void test_vertex_shader_constant(void)
|
||||
@@ -7028,7 +7024,6 @@ static void test_vertex_shader_constant(void)
|
||||
IDirect3DDevice9_SetSoftwareVertexProcessing(device, 1);
|
||||
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts + 0, c, 1);
|
||||
@@ -49,10 +49,10 @@ index 0a95e819018..83d05cf8bc5 100644
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts_swvp - 1, c, 1);
|
||||
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 230f7deabb2..6a62cddcb06 100644
|
||||
index cb0a2549b2e..f8f06fba45a 100644
|
||||
--- a/dlls/d3d9/tests/visual.c
|
||||
+++ b/dlls/d3d9/tests/visual.c
|
||||
@@ -25199,7 +25199,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
@@ -25234,7 +25234,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, c_index, 1);
|
||||
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, (unsigned int)c_index[0], c_color, 1);
|
||||
@@ -61,10 +61,10 @@ index 230f7deabb2..6a62cddcb06 100644
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 8be63df577a..28c8fb09d0d 100644
|
||||
index 0d9f49f8096..fa7680a6054 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3922,7 +3922,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
|
||||
@@ -3918,7 +3918,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 8be63df577a..28c8fb09d0d 100644
|
||||
bool set_depth_bounds = false;
|
||||
struct wined3d_range range;
|
||||
uint32_t map;
|
||||
@@ -3934,9 +3934,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 8be63df577a..28c8fb09d0d 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 1422871a2b3..53de4803a3f 100644
|
||||
index 4a131487b16..5bc15ca0389 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -1905,7 +1905,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
@@ -1903,7 +1903,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
if (priv->consts_ubo)
|
||||
return;
|
||||
|
||||
@@ -100,10 +100,10 @@ index 1422871a2b3..53de4803a3f 100644
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
}
|
||||
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
|
||||
index 16f58b726d0..f0ad28d37a0 100644
|
||||
index 3d6edbfa7f3..edf4ae8a6b2 100644
|
||||
--- a/dlls/wined3d/stateblock.c
|
||||
+++ b/dlls/wined3d/stateblock.c
|
||||
@@ -731,8 +731,8 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
|
||||
@@ -726,8 +726,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 16f58b726d0..f0ad28d37a0 100644
|
||||
uint32_t map;
|
||||
|
||||
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
|
||||
@@ -748,9 +748,11 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
|
||||
@@ -743,9 +743,11 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
|
||||
stateblock->stateblock_state.vs = state->vs;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ index 16f58b726d0..f0ad28d37a0 100644
|
||||
break;
|
||||
|
||||
memcpy(&stateblock->stateblock_state.vs_consts_f[range.offset], &state->vs_consts_f[range.offset],
|
||||
@@ -995,7 +997,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
|
||||
@@ -990,7 +992,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
|
||||
{
|
||||
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
|
||||
struct wined3d_range range;
|
||||
@@ -135,7 +135,7 @@ index 16f58b726d0..f0ad28d37a0 100644
|
||||
uint32_t map;
|
||||
|
||||
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
|
||||
@@ -1005,9 +1007,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
|
||||
@@ -1000,9 +1002,11 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
|
||||
if (stateblock->changed.pixelShader)
|
||||
wined3d_stateblock_set_pixel_shader(device_state, state->ps);
|
||||
|
||||
@@ -148,7 +148,7 @@ index 16f58b726d0..f0ad28d37a0 100644
|
||||
break;
|
||||
wined3d_stateblock_set_vs_consts_f(device_state, range.offset, range.size, &state->vs_consts_f[range.offset]);
|
||||
}
|
||||
@@ -1199,12 +1203,14 @@ static void wined3d_bitmap_set_bits(uint32_t *bitmap, unsigned int start, unsign
|
||||
@@ -1191,12 +1195,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)
|
||||
{
|
||||
@@ -165,18 +165,18 @@ index 16f58b726d0..f0ad28d37a0 100644
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
memcpy(&stateblock->stateblock_state.vs_consts_f[start_idx], constants, count * sizeof(*constants));
|
||||
@@ -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);
|
||||
@@ -2012,7 +2018,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
|
||||
case WINED3D_SBT_ALL:
|
||||
stateblock_init_lights(stateblock, &device_state->stateblock_state.light_state->lights_tree);
|
||||
stateblock_savedstates_set_all(&stateblock->changed,
|
||||
- d3d_info->limits.vs_uniform_count, d3d_info->limits.ps_uniform_count);
|
||||
+ d3d_info->limits.vs_uniform_count_swvp, d3d_info->limits.ps_uniform_count);
|
||||
break;
|
||||
|
||||
case WINED3D_SBT_PIXEL_STATE:
|
||||
@@ -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);
|
||||
@@ -2023,7 +2029,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
|
||||
case WINED3D_SBT_VERTEX_STATE:
|
||||
stateblock_init_lights(stateblock, &device_state->stateblock_state.light_state->lights_tree);
|
||||
stateblock_savedstates_set_vertex(&stateblock->changed,
|
||||
- d3d_info->limits.vs_uniform_count);
|
||||
+ d3d_info->limits.vs_uniform_count_swvp);
|
||||
@@ -184,10 +184,10 @@ index 16f58b726d0..f0ad28d37a0 100644
|
||||
|
||||
default:
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 27811745370..2772c130bc7 100644
|
||||
index 260ec1f110b..ced592fd699 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3906,7 +3906,7 @@ struct wined3d_state
|
||||
@@ -3917,7 +3917,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];
|
||||
|
||||
@@ -196,7 +196,7 @@ index 27811745370..2772c130bc7 100644
|
||||
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
|
||||
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
|
||||
|
||||
@@ -4090,6 +4090,15 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
|
||||
@@ -4101,6 +4101,15 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
|
||||
LeaveCriticalSection(&device->bo_map_lock);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ index 27811745370..2772c130bc7 100644
|
||||
struct wined3d_device_no3d
|
||||
{
|
||||
struct wined3d_device d;
|
||||
@@ -4978,7 +4987,7 @@ struct wined3d_vertex_declaration
|
||||
@@ -4991,7 +5000,7 @@ struct wined3d_vertex_declaration
|
||||
|
||||
struct wined3d_saved_states
|
||||
{
|
||||
@@ -222,7 +222,7 @@ index 27811745370..2772c130bc7 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 0ce807fc5c8..ba8e8759a58 100644
|
||||
index 53430c6530a..c2daace03d7 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -2162,7 +2162,7 @@ struct wined3d_stateblock_state
|
||||
@@ -235,5 +235,5 @@ index 0ce807fc5c8..ba8e8759a58 100644
|
||||
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
|
||||
|
||||
--
|
||||
2.39.1
|
||||
2.40.1
|
||||
|
||||
|
Reference in New Issue
Block a user