Fix last rebase

This commit is contained in:
Alistair Leslie-Hughes 2020-03-08 12:07:37 +11:00
parent ffe93505d2
commit 8450903b5c

View File

@ -1,4 +1,4 @@
From 15026047d13543bb9f4c8ca21342299d219c99b8 Mon Sep 17 00:00:00 2001
From d6f79f90c4dcb5b37a5cd56feed9da7c21cef8fb 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,12 +7,12 @@ 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 | 18 ++++++++++++++++--
dlls/wined3d/device.c | 9 +++++++--
dlls/wined3d/glsl_shader.c | 2 +-
dlls/wined3d/stateblock.c | 30 ++++++++++++++++++++++--------
dlls/wined3d/wined3d_private.h | 4 ++--
include/wine/wined3d.h | 2 +-
7 files changed, 42 insertions(+), 20 deletions(-)
7 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index d00a26b942c..09446d0be62 100644
@ -61,31 +61,10 @@ index cb84ef6f284..2d6e1fa688f 100644
hr = IDirect3DDevice9_BeginScene(device);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a583df85307..46e7a0ad566 100644
index 1ce4b321a69..3eadc8165e5 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2071,11 +2071,20 @@ static void wined3d_device_set_vs_consts_i(struct wined3d_device *device,
static void wined3d_device_set_vs_consts_f(struct wined3d_device *device,
unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
{
+ const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
+ unsigned int constants_count;
unsigned int i;
TRACE("device %p, start_idx %u, count %u, constants %p.\n",
device, start_idx, count, constants);
+ constants_count = device->create_parms.flags
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
+ if (!constants || start_idx >= constants_count
+ || count > constants_count - start_idx)
+ return WINED3DERR_INVALIDCALL;
+
memcpy(&device->state.vs_consts_f[start_idx], constants, count * sizeof(*constants));
if (TRACE_ON(d3d))
{
@@ -3506,11 +3515,12 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3483,11 +3483,12 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
struct wined3d_stateblock *stateblock)
{
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
@ -99,7 +78,7 @@ index a583df85307..46e7a0ad566 100644
struct wined3d_color colour;
struct wined3d_range range;
DWORD map, stage;
@@ -3522,9 +3532,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
@@ -3499,9 +3500,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
if (changed->pixelShader)
wined3d_device_set_pixel_shader(device, state->ps);
@ -115,7 +94,7 @@ index a583df85307..46e7a0ad566 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 4f7cc772beb..a88f92cc039 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
@ -223,10 +202,10 @@ index 70943afddaa..22862403e90 100644
default:
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 21d7f1e28f7..81f915b7c25 100644
index 43406b25dfe..8de94efeb4c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3208,7 +3208,7 @@ struct wined3d_state
@@ -3204,7 +3204,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];
@ -235,7 +214,7 @@ index 21d7f1e28f7..81f915b7c25 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
@@ -3922,7 +3922,7 @@ struct wined3d_vertex_declaration
struct wined3d_saved_states
{
@ -245,10 +224,10 @@ index 21d7f1e28f7..81f915b7c25 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 08e7890b12b..e7e3af50166 100644
index 4837ff8f970..c1bc1e95e68 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2161,7 +2161,7 @@ struct wined3d_stateblock_state
@@ -2152,7 +2152,7 @@ struct wined3d_stateblock_state
int base_vertex_index;
struct wined3d_shader *vs;