Paul Gofman : d3dx9: Factor out regstore_set_modified_reg() function.
Alexandre Julliard
julliard at winehq.org
Thu May 18 15:27:51 CDT 2017
Module: wine
Branch: master
Commit: b5784f926caa9d29235afcf994d5e0e408a7dd9b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b5784f926caa9d29235afcf994d5e0e408a7dd9b
Author: Paul Gofman <gofmanp at gmail.com>
Date: Tue May 16 19:49:19 2017 +0300
d3dx9: Factor out regstore_set_modified_reg() function.
Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3dx9_36/preshader.c | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c
index 880c66b..6eddf6e 100644
--- a/dlls/d3dx9_36/preshader.c
+++ b/dlls/d3dx9_36/preshader.c
@@ -265,21 +265,13 @@ static void regstore_free_tables(struct d3dx_regstore *rs)
}
}
-static void regstore_set_values(struct d3dx_regstore *rs, unsigned int table, void *data,
- unsigned int start_offset, unsigned int count)
+static void regstore_set_modified_reg(struct d3dx_regstore *rs, unsigned int table,
+ unsigned int start, unsigned int end)
{
- unsigned int block_idx, start, end, start_block, end_block;
+ unsigned int block_idx, start_block, end_block;
- if (!count)
- return;
-
- memcpy((BYTE *)rs->tables[table] + start_offset * table_info[table].component_size,
- data, count * table_info[table].component_size);
-
- start = get_reg_offset(table, start_offset);
start_block = start / PRES_BITMASK_BLOCK_SIZE;
start -= start_block * PRES_BITMASK_BLOCK_SIZE;
- end = get_reg_offset(table, start_offset + count - 1);
end_block = end / PRES_BITMASK_BLOCK_SIZE;
end = (end_block + 1) * PRES_BITMASK_BLOCK_SIZE - 1 - end;
@@ -298,6 +290,27 @@ static void regstore_set_values(struct d3dx_regstore *rs, unsigned int table, vo
}
}
+static void regstore_set_modified(struct d3dx_regstore *rs, unsigned int table,
+ unsigned int start_offset, unsigned int count)
+{
+ if (!count)
+ return;
+
+ regstore_set_modified_reg(rs, table, get_reg_offset(table, start_offset),
+ get_reg_offset(table, start_offset + count - 1));
+}
+
+static void regstore_set_values(struct d3dx_regstore *rs, unsigned int table, void *data,
+ unsigned int start_offset, unsigned int count)
+{
+ if (!count)
+ return;
+
+ memcpy((BYTE *)rs->tables[table] + start_offset * table_info[table].component_size,
+ data, count * table_info[table].component_size);
+ regstore_set_modified(rs, table, start_offset, count);
+}
+
static unsigned int regstore_is_val_set_reg(struct d3dx_regstore *rs, unsigned int table, unsigned int reg_idx)
{
return rs->table_value_set[table][reg_idx / PRES_BITMASK_BLOCK_SIZE] &
More information about the wine-cvs
mailing list