Notes: - kept byte_code as a 'DWORD *'. Alternative: use 'uint32_t *' instead, but would require larger changes: + internally in wined3d + requiring also to typecast from 'DWORD *' (the type in D3D* interfaces), to 'uint32_t*' (to be decided where: either is every client, or inside wined3d) - except in view.c, as most of definitions in wined3d_shader.h use uint32_t (and using cast to store in wined3d_shader_desc) // I'm not happy with this inconsistency. But even less happy with larger changes. - kept state_id as DWORD (ditto previous commits)
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/shader_sm1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/shader_sm1.c b/dlls/wined3d/shader_sm1.c index 553dff20fef..ff8d904e463 100644 --- a/dlls/wined3d/shader_sm1.c +++ b/dlls/wined3d/shader_sm1.c @@ -398,7 +398,7 @@ static const enum wined3d_shader_resource_type resource_type_table[] = * and possibly a relative addressing token. * Return the number of tokens read */ static unsigned int shader_get_param(const struct wined3d_sm1_data *priv, const DWORD *ptr, - DWORD *token, DWORD *addr_token) + unsigned int *token, unsigned int *addr_token) { unsigned int count = 1;
@@ -427,7 +427,7 @@ static unsigned int shader_get_param(const struct wined3d_sm1_data *priv, const return count; }
-static const struct wined3d_sm1_opcode_info *shader_get_opcode(const struct wined3d_sm1_data *priv, DWORD token) +static const struct wined3d_sm1_opcode_info *shader_get_opcode(const struct wined3d_sm1_data *priv, unsigned int token) { unsigned int shader_version = WINED3D_SHADER_VERSION(priv->shader_version.major, priv->shader_version.minor); const struct wined3d_sm1_opcode_info *opcode_table = priv->opcode_table; @@ -503,7 +503,7 @@ static unsigned int shader_skip_unrecognized(const struct wined3d_sm1_data *priv /* TODO: Think of a good name for 0x80000000 and replace it with a constant */ while (*ptr & 0x80000000) { - DWORD token, addr_token = 0; + unsigned int token, addr_token = 0; struct wined3d_shader_src_param rel_addr;
tokens_read += shader_get_param(priv, ptr, &token, &addr_token); @@ -594,7 +594,7 @@ static void shader_sm1_read_header(void *data, const DWORD **ptr, struct wined3d static void shader_sm1_read_src_param(struct wined3d_sm1_data *priv, const DWORD **ptr, struct wined3d_shader_src_param *src_param, struct wined3d_shader_src_param *src_rel_addr) { - DWORD token, addr_token; + unsigned int token, addr_token;
*ptr += shader_get_param(priv, *ptr, &token, &addr_token); if (token & WINED3D_SM1_ADDRESS_MODE_RELATIVE) @@ -611,7 +611,7 @@ static void shader_sm1_read_src_param(struct wined3d_sm1_data *priv, const DWORD static void shader_sm1_read_dst_param(struct wined3d_sm1_data *priv, const DWORD **ptr, struct wined3d_shader_dst_param *dst_param, struct wined3d_shader_src_param *dst_rel_addr) { - DWORD token, addr_token; + unsigned int token, addr_token;
*ptr += shader_get_param(priv, *ptr, &token, &addr_token); if (token & WINED3D_SM1_ADDRESS_MODE_RELATIVE) @@ -724,7 +724,7 @@ static void shader_sm1_read_instruction(void *data, const DWORD **ptr, struct wi { const struct wined3d_sm1_opcode_info *opcode_info; struct wined3d_sm1_data *priv = data; - DWORD opcode_token; + unsigned int opcode_token; unsigned int i; const DWORD *p;
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/shader_sm1.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/shader_sm1.c b/dlls/wined3d/shader_sm1.c index ff8d904e463..ed4af5a0409 100644 --- a/dlls/wined3d/shader_sm1.c +++ b/dlls/wined3d/shader_sm1.c @@ -21,7 +21,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES /* temporary */
#include "wined3d_private.h"
@@ -537,13 +536,13 @@ static void *shader_sm1_init(const DWORD *byte_code, size_t byte_code_size, struct wined3d_sm1_data *priv; BYTE major, minor;
- TRACE("Version: 0x%08x.\n", *byte_code); + TRACE("Version: 0x%08lx.\n", *byte_code);
major = WINED3D_SM1_VERSION_MAJOR(*byte_code); minor = WINED3D_SM1_VERSION_MINOR(*byte_code); if (WINED3D_SHADER_VERSION(major, minor) > WINED3D_SHADER_VERSION(3, 0)) { - WARN("Invalid shader version %u.%u (%#x).\n", major, minor, *byte_code); + WARN("Invalid shader version %u.%u (%#lx).\n", major, minor, *byte_code); return NULL; }
@@ -566,7 +565,7 @@ static void *shader_sm1_init(const DWORD *byte_code, size_t byte_code_size, break;
default: - FIXME("Unrecognized shader type %#x.\n", *byte_code >> 16); + FIXME("Unrecognized shader type %#lx.\n", *byte_code >> 16); heap_free(priv); return NULL; }
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/shader_sm4.c | 49 ++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 9c1cf185f24..ea09d64eb9c 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -579,7 +579,7 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, enum wined3d_sm4_resource_type resource_type; enum wined3d_sm4_data_type data_type; enum wined3d_data_type reg_data_type; - DWORD components; + uint32_t components;
resource_type = (opcode_token & WINED3D_SM4_RESOURCE_TYPE_MASK) >> WINED3D_SM4_RESOURCE_TYPE_SHIFT; if (!resource_type || (resource_type >= ARRAY_SIZE(resource_type_table))) @@ -1238,7 +1238,7 @@ static enum wined3d_data_type map_data_type(char t)
static enum wined3d_shader_type wined3d_get_sm4_shader_type(const DWORD *byte_code, size_t byte_code_size) { - DWORD shader_type; + unsigned int shader_type;
if (byte_code_size / sizeof(*byte_code) < 1) { @@ -1276,7 +1276,7 @@ static enum wined3d_shader_type wined3d_get_sm4_shader_type(const DWORD *byte_co static void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size, const struct wined3d_shader_signature *output_signature) { - DWORD version_token, token_count; + unsigned int version_token, token_count; struct wined3d_sm4_data *priv; unsigned int i;
@@ -1415,7 +1415,7 @@ static BOOL shader_sm4_read_param(struct wined3d_sm4_data *priv, const DWORD **p enum wined3d_shader_src_modifier *modifier) { enum wined3d_sm4_register_type register_type; - DWORD token, order; + uint32_t token, order;
if (*ptr >= end) { @@ -1439,7 +1439,7 @@ static BOOL shader_sm4_read_param(struct wined3d_sm4_data *priv, const DWORD **p
if (token & WINED3D_SM4_REGISTER_MODIFIER) { - DWORD m; + unsigned int m;
if (*ptr >= end) { @@ -1625,7 +1625,7 @@ static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD return TRUE; }
-static void shader_sm4_read_instruction_modifier(DWORD modifier, struct wined3d_shader_instruction *ins) +static void shader_sm4_read_instruction_modifier(uint32_t modifier, struct wined3d_shader_instruction *ins) { enum wined3d_sm4_instruction_modifier modifier_type = modifier & WINED3D_SM4_MODIFIER_MASK;
@@ -1661,7 +1661,7 @@ static void shader_sm4_read_instruction_modifier(DWORD modifier, struct wined3d_
case WINED3D_SM5_MODIFIER_DATA_TYPE: { - DWORD components = (modifier & WINED3D_SM5_MODIFIER_DATA_TYPE_MASK) >> WINED3D_SM5_MODIFIER_DATA_TYPE_SHIFT; + uint32_t components = (modifier & WINED3D_SM5_MODIFIER_DATA_TYPE_MASK) >> WINED3D_SM5_MODIFIER_DATA_TYPE_SHIFT; enum wined3d_sm4_data_type data_type = components & 0xf;
if ((components & 0xfff0) != (components & 0xf) * 0x1110) @@ -1687,8 +1687,9 @@ static void shader_sm4_read_instruction_modifier(DWORD modifier, struct wined3d_ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins) { const struct wined3d_sm4_opcode_info *opcode_info; - DWORD opcode_token, opcode, previous_token; + uint32_t opcode_token, previous_token; struct wined3d_sm4_data *priv = data; + unsigned int opcode; unsigned int i, len; SIZE_T remaining; const DWORD *p; @@ -1837,9 +1838,9 @@ const struct wined3d_shader_frontend sm4_shader_frontend = struct aon9_header { DWORD chunk_size; - DWORD shader_version; + unsigned int shader_version; DWORD unknown; - DWORD byte_code_offset; + unsigned int byte_code_offset; };
struct shader_handler_context @@ -1849,7 +1850,7 @@ struct shader_handler_context unsigned int max_version; };
-static void read_dword(const char **ptr, DWORD *d) +static void read_dword(const char **ptr, unsigned int *d) { memcpy(d, *ptr, sizeof(*d)); *ptr += sizeof(*d); @@ -1863,7 +1864,7 @@ static BOOL require_space(size_t offset, size_t count, size_t size, size_t data_ static void skip_dword_unknown(const char **ptr, unsigned int count) { unsigned int i; - DWORD d; + unsigned int d;
WARN("Skipping %u unknown DWORDs:\n", count); for (i = 0; i < count; ++i) @@ -1874,15 +1875,15 @@ static void skip_dword_unknown(const char **ptr, unsigned int count) }
static HRESULT parse_dxbc(const char *data, SIZE_T data_size, - HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) + HRESULT (*chunk_handler)(const char *data, unsigned int data_size, unsigned int tag, void *ctx), void *ctx) { const char *ptr = data; HRESULT hr = S_OK; - DWORD chunk_count; - DWORD total_size; + unsigned int chunk_count; + unsigned int total_size; unsigned int i; - DWORD version; - DWORD tag; + unsigned int version; + unsigned int tag;
read_dword(&ptr, &tag); TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4)); @@ -1912,9 +1913,9 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
for (i = 0; i < chunk_count; ++i) { - DWORD chunk_tag, chunk_size; + unsigned int chunk_tag, chunk_size; const char *chunk_ptr; - DWORD chunk_offset; + unsigned int chunk_offset;
read_dword(&ptr, &chunk_offset); TRACE("chunk %u at offset %#x\n", i, chunk_offset); @@ -1944,7 +1945,7 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size, return hr; }
-static const char *shader_get_string(const char *data, size_t data_size, DWORD offset) +static const char *shader_get_string(const char *data, size_t data_size, unsigned int offset) { if (offset >= data_size) { @@ -1958,14 +1959,14 @@ static const char *shader_get_string(const char *data, size_t data_size, DWORD o return data + offset; }
-static HRESULT shader_parse_signature(DWORD tag, const char *data, DWORD data_size, +static HRESULT shader_parse_signature(DWORD tag, const char *data, unsigned int data_size, struct wined3d_shader_signature *s) { struct wined3d_shader_signature_element *e; bool has_stream_index, has_min_precision; const char *ptr = data; unsigned int i; - DWORD count; + unsigned int count;
if (!require_space(0, 2, sizeof(DWORD), data_size)) { @@ -1995,7 +1996,7 @@ static HRESULT shader_parse_signature(DWORD tag, const char *data, DWORD data_si
for (i = 0; i < count; ++i) { - DWORD name_offset; + unsigned int name_offset;
if (has_stream_index) read_dword(&ptr, &e[i].stream_idx); @@ -2031,7 +2032,7 @@ static HRESULT shader_parse_signature(DWORD tag, const char *data, DWORD data_si return S_OK; }
-static HRESULT shader_dxbc_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *context) +static HRESULT shader_dxbc_chunk_handler(const char *data, unsigned int data_size, unsigned int tag, void *context) { struct shader_handler_context *ctx = context; struct wined3d_shader *shader = ctx->shader;
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/shader_sm4.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index ea09d64eb9c..d5ca8ea9501 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -15,7 +15,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES /* temporary */
#include "wined3d_private.h"
@@ -759,7 +758,7 @@ static void shader_sm5_read_dcl_function_table(struct wined3d_shader_instruction struct wined3d_sm4_data *priv) { ins->declaration.index = *tokens++; - FIXME("Ignoring set of function bodies (count %u).\n", *tokens); + FIXME("Ignoring set of function bodies (count %lu).\n", *tokens); }
static void shader_sm5_read_dcl_interface(struct wined3d_shader_instruction *ins, @@ -1729,7 +1728,7 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi TRACE_(d3d_bytecode)("[ %08x ", opcode_token); for (i = 0; i < len; ++i) { - TRACE_(d3d_bytecode)("%08x ", (*ptr)[i]); + TRACE_(d3d_bytecode)("%08lx ", (*ptr)[i]); } TRACE_(d3d_bytecode)("]\n"); } @@ -2125,7 +2124,7 @@ static HRESULT shader_dxbc_chunk_handler(const char *data, unsigned int data_siz shader->function = (const DWORD *)byte_code; shader->functionLength = data_size - header->byte_code_offset; *ctx->format = WINED3D_SHADER_BYTE_CODE_FORMAT_SM1; - TRACE("Feature level 9 shader version 0%08x, 0%08x.\n", + TRACE("Feature level 9 shader version 0%08x, 0%08lx.\n", header->shader_version, *shader->function); } else @@ -2157,7 +2156,7 @@ HRESULT shader_extract_from_dxbc(struct wined3d_shader *shader, hr = E_INVALIDARG;
if (FAILED(hr)) - WARN("Failed to parse DXBC, hr %#x.\n", hr); + WARN("Failed to parse DXBC, hr %#lx.\n", hr);
return hr; }
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/state.c | 4 ++-- dlls/wined3d/stateblock.c | 4 ++-- dlls/wined3d/wined3d_private.h | 6 +++--- include/wine/wined3d.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 3479b407974..557db3c9759 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3696,7 +3696,7 @@ static enum wined3d_texture_address wined3d_texture_gl_address_mode(const struct }
static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc *desc, - const struct wined3d_context_gl *context_gl, const DWORD *sampler_states, + const struct wined3d_context_gl *context_gl, const uint32_t *sampler_states, const struct wined3d_texture_gl *texture_gl) { union @@ -3777,7 +3777,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state if (state->textures[sampler_idx]) { struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(state->textures[sampler_idx]); - const DWORD *sampler_states = state->sampler_states[sampler_idx]; + const uint32_t *sampler_states = state->sampler_states[sampler_idx]; struct wined3d_device *device = context->device; BOOL srgb = is_srgb_enabled(sampler_states); struct wined3d_sampler_desc desc; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index ad9f29b72f9..d678a6ea2a0 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1782,7 +1782,7 @@ static void init_default_render_states(unsigned int rs[WINEHIGHEST_RENDER_STATE rs[WINED3D_RS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD; }
-static void init_default_texture_state(unsigned int i, DWORD stage[WINED3D_HIGHEST_TEXTURE_STATE + 1]) +static void init_default_texture_state(unsigned int i, uint32_t stage[WINED3D_HIGHEST_TEXTURE_STATE + 1]) { stage[WINED3D_TSS_COLOR_OP] = i ? WINED3D_TOP_DISABLE : WINED3D_TOP_MODULATE; stage[WINED3D_TSS_COLOR_ARG1] = WINED3DTA_TEXTURE; @@ -1803,7 +1803,7 @@ static void init_default_texture_state(unsigned int i, DWORD stage[WINED3D_HIGHE stage[WINED3D_TSS_RESULT_ARG] = WINED3DTA_CURRENT; }
-static void init_default_sampler_states(DWORD states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]) +static void init_default_sampler_states(uint32_t states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]) { unsigned int i;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e4104d2c61a..449db821249 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3897,8 +3897,8 @@ struct wined3d_state BOOL ps_consts_b[WINED3D_MAX_CONSTS_B];
struct wined3d_texture *textures[WINED3D_MAX_COMBINED_SAMPLERS]; - DWORD sampler_states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; - DWORD texture_states[WINED3D_MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1]; + uint32_t sampler_states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; + uint32_t texture_states[WINED3D_MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
struct wined3d_matrix transforms[WINED3D_HIGHEST_TRANSFORM_STATE + 1]; struct wined3d_vec4 clip_planes[WINED3D_MAX_CLIP_DISTANCES]; @@ -6365,7 +6365,7 @@ static inline void context_apply_state(struct wined3d_context *context, state_table[rep].apply(context, state, rep); }
-static inline BOOL is_srgb_enabled(const DWORD *sampler_states) +static inline BOOL is_srgb_enabled(const uint32_t *sampler_states) { /* Only use the LSB of the WINED3D_SAMP_SRGB_TEXTURE value. This matches * the behaviour of the AMD Windows driver. diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 2e709543127..0070a7dd4c0 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2173,8 +2173,8 @@ struct wined3d_stateblock_state BOOL alpha_to_coverage;
struct wined3d_texture *textures[WINED3D_MAX_COMBINED_SAMPLERS]; - DWORD sampler_states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; - DWORD texture_states[WINED3D_MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1]; + uint32_t sampler_states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; + uint32_t texture_states[WINED3D_MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
struct wined3d_matrix transforms[WINED3D_HIGHEST_TRANSFORM_STATE + 1]; struct wined3d_vec4 clip_planes[WINED3D_MAX_CLIP_DISTANCES];
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/stateblock.c | 20 ++++++++++---------- dlls/wined3d/wined3d_private.h | 2 +- include/wine/wined3d.h | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index d678a6ea2a0..f3a4d728c7b 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -189,7 +189,7 @@ static const DWORD vertex_states_sampler[] = WINED3D_SAMP_DMAP_OFFSET, };
-static inline void stateblock_set_all_bits(DWORD *map, UINT map_size) +static inline void stateblock_set_all_bits(uint32_t *map, UINT map_size) { DWORD mask = (1u << (map_size & 0x1f)) - 1; memset(map, 0xff, (map_size >> 5) * sizeof(*map)); @@ -734,7 +734,7 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock, const struct wined3d_stateblock_state *state = &device_state->stateblock_state; struct wined3d_range range; unsigned int i, start; - DWORD map; + uint32_t map;
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
@@ -935,8 +935,8 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock, /* Texture states */ for (i = 0; i < stateblock->num_contained_tss_states; ++i) { - DWORD stage = stateblock->contained_tss_states[i].stage; - DWORD texture_state = stateblock->contained_tss_states[i].state; + unsigned int stage = stateblock->contained_tss_states[i].stage; + unsigned int texture_state = stateblock->contained_tss_states[i].state;
TRACE("Updating texturestage state %u, %u to %#x (was %#x).\n", stage, texture_state, state->texture_states[stage][texture_state], @@ -963,8 +963,8 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
for (i = 0; i < stateblock->num_contained_sampler_states; ++i) { - DWORD stage = stateblock->contained_sampler_states[i].stage; - DWORD sampler_state = stateblock->contained_sampler_states[i].state; + unsigned int stage = stateblock->contained_sampler_states[i].stage; + unsigned int sampler_state = stateblock->contained_sampler_states[i].state;
TRACE("Updating sampler state %u, %u to %#x (was %#x).\n", stage, sampler_state, state->sampler_states[stage][sampler_state], @@ -997,7 +997,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, const struct wined3d_stateblock_state *state = &stateblock->stateblock_state; struct wined3d_range range; unsigned int i, start; - DWORD map; + uint32_t map;
TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
@@ -1335,7 +1335,7 @@ void CDECL wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock * }
void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock, - enum wined3d_render_state state, DWORD value) + enum wined3d_render_state state, unsigned int value) { TRACE("stateblock %p, state %s (%#x), value %#x.\n", stateblock, debug_d3drenderstate(state), state, value);
@@ -1357,7 +1357,7 @@ void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateb }
void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, - UINT sampler_idx, enum wined3d_sampler_state state, DWORD value) + UINT sampler_idx, enum wined3d_sampler_state state, unsigned int value) { TRACE("stateblock %p, sampler_idx %u, state %s, value %#x.\n", stateblock, sampler_idx, debug_d3dsamplerstate(state), value); @@ -1373,7 +1373,7 @@ void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *state }
void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, - UINT stage, enum wined3d_texture_stage_state state, DWORD value) + UINT stage, enum wined3d_texture_stage_state state, unsigned int value) { TRACE("stateblock %p, stage %u, state %s, value %#x.\n", stateblock, stage, debug_d3dtexturestate(state), value); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 449db821249..b22865beafa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2955,7 +2955,7 @@ void context_state_fb(struct wined3d_context *context, struct wined3d_light_info { struct wined3d_light OriginalParms; /* Note D3D8LIGHT == D3D9LIGHT */ - DWORD OriginalIndex; + unsigned int OriginalIndex; LONG glIndex; BOOL enabled;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 0070a7dd4c0..f4ec2470bba 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2767,16 +2767,16 @@ HRESULT __cdecl wined3d_stateblock_set_ps_consts_f(struct wined3d_stateblock *st HRESULT __cdecl wined3d_stateblock_set_ps_consts_i(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants); void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock, - enum wined3d_render_state state, DWORD value); + enum wined3d_render_state state, unsigned int value); void __cdecl wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, - UINT sampler_idx, enum wined3d_sampler_state state, DWORD value); + UINT sampler_idx, enum wined3d_sampler_state state, unsigned int value); void __cdecl wined3d_stateblock_set_scissor_rect(struct wined3d_stateblock *stateblock, const RECT *rect); HRESULT __cdecl wined3d_stateblock_set_stream_source(struct wined3d_stateblock *stateblock, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride); HRESULT __cdecl wined3d_stateblock_set_stream_source_freq(struct wined3d_stateblock *stateblock, UINT stream_idx, UINT divider); void __cdecl wined3d_stateblock_set_texture(struct wined3d_stateblock *stateblock, UINT stage, struct wined3d_texture *texture); void __cdecl wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, - UINT stage, enum wined3d_texture_stage_state state, DWORD value); + UINT stage, enum wined3d_texture_stage_state state, unsigned int value); void __cdecl wined3d_stateblock_set_transform(struct wined3d_stateblock *stateblock, enum wined3d_transform_state state, const struct wined3d_matrix *matrix); void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock,
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/stateblock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index f3a4d728c7b..16f58b726d0 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -21,7 +21,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES /* temporary */
#include "wined3d_private.h"
@@ -2065,7 +2064,7 @@ HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, const str hr = stateblock_init(object, device_state, device, type); if (FAILED(hr)) { - WARN("Failed to initialize stateblock, hr %#x.\n", hr); + WARN("Failed to initialize stateblock, hr %#lx.\n", hr); heap_free(object); return hr; }
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/state.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 557db3c9759..ae10ccbf13f 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2193,7 +2193,7 @@ static void state_swvp(struct wined3d_context *context, const struct wined3d_sta } }
-static void get_src_and_opr(DWORD arg, BOOL is_alpha, GLenum* source, GLenum* operand) { +static void get_src_and_opr(uint32_t arg, BOOL is_alpha, GLenum* source, GLenum* operand) { /* The WINED3DTA_ALPHAREPLICATE flag specifies the alpha component of the * input should be used for all input components. The WINED3DTA_COMPLEMENT * flag specifies the complement of the input should be used. */ @@ -2233,7 +2233,7 @@ static void get_src_and_opr(DWORD arg, BOOL is_alpha, GLenum* source, GLenum* op
/* Setup the texture operations texture stage states */ static void set_tex_op(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, - BOOL isAlpha, int Stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3) + BOOL isAlpha, int Stage, enum wined3d_texture_op op, uint32_t arg1, uint32_t arg2, uint32_t arg3) { GLenum src1, src2, src3; GLenum opr1, opr2, opr3; @@ -5633,7 +5633,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) {206, 209}, { 0, 0}, }; - static const DWORD simple_states[] = + static const unsigned int simple_states[] = { STATE_MATERIAL, STATE_VDECL, @@ -5693,7 +5693,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table)
for (i = 0; i < STATE_HIGHEST + 1; ++i) { - DWORD rep = state_table[i].representative; + unsigned int rep = state_table[i].representative; if (rep) { if (state_table[rep].representative != rep) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b22865beafa..3e4d4c91017 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2808,7 +2808,7 @@ struct wined3d_state_entry
struct wined3d_state_entry_template { - DWORD state; + unsigned int state; struct wined3d_state_entry content; unsigned int extension; };
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/state.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index ae10ccbf13f..eb25f01130e 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -24,7 +24,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES /* temporary */
#include <stdio.h>
@@ -262,7 +261,7 @@ HRESULT CDECL wined3d_rasterizer_state_create(struct wined3d_device *device,
static void state_undefined(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - ERR("Undefined state %s (%#x).\n", debug_d3dstate(state_id), state_id); + ERR("Undefined state %s (%#lx).\n", debug_d3dstate(state_id), state_id); }
void state_nop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) @@ -813,7 +812,7 @@ void state_alpha_test(struct wined3d_context *context, const struct wined3d_stat float ref; BOOL enable_ckey = FALSE;
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
/* Find out if the texture on the first stage has a ckey set. The alpha * state func reads the texture settings, even though alpha and texture @@ -1256,7 +1255,7 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
if (!state->render_states[WINED3D_RS_FOGENABLE]) return; @@ -1347,7 +1346,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART]; DWORD fogend = state->render_states[WINED3D_RS_FOGEND];
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
if (!state->render_states[WINED3D_RS_FOGENABLE]) { @@ -3653,7 +3652,7 @@ static void sampler_texmatrix(struct wined3d_context *context, const struct wine const DWORD sampler = state_id - STATE_SAMPLER(0); const struct wined3d_texture *texture = state->textures[sampler];
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
if (!texture) return; @@ -4578,7 +4577,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
if (needs_srgb_write(context->d3d_info, state, &state->fb)) gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB); @@ -4594,7 +4593,7 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state unsigned int i, base, count; struct wined3d_bo_gl *bo_gl;
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
if (STATE_IS_GRAPHICS_CONSTANT_BUFFER(state_id)) shader_type = state_id - STATE_GRAPHICS_CONSTANT_BUFFER(0); @@ -4627,7 +4626,7 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
static void state_cb_warn(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
WARN("Constant buffers (%s) no supported.\n", debug_d3dstate(state_id)); } @@ -4635,7 +4634,7 @@ static void state_cb_warn(struct wined3d_context *context, const struct wined3d_ static void state_shader_resource_binding(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
context->update_shader_resource_bindings = 1; } @@ -4643,21 +4642,21 @@ static void state_shader_resource_binding(struct wined3d_context *context, static void state_cs_resource_binding(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id); context->update_compute_shader_resource_bindings = 1; }
static void state_uav_binding(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id); context->update_unordered_access_view_bindings = 1; }
static void state_cs_uav_binding(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id); context->update_compute_unordered_access_view_bindings = 1; }
@@ -4674,7 +4673,7 @@ static void state_so(struct wined3d_context *context, const struct wined3d_state unsigned int offset, size, i; struct wined3d_bo_gl *bo_gl;
- TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); + TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
wined3d_context_gl_end_transform_feedback(context_gl);
From: Eric Pouech eric.pouech@gmail.com
--- dlls/wined3d/view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index a650ab4c4bd..cf17db62da8 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1800,7 +1800,7 @@ struct wined3d_uav_clear_constants_vk };
static VkPipeline create_uav_pipeline(struct wined3d_context_vk *context_vk, - struct wined3d_pipeline_layout_vk *layout, const DWORD *byte_code, size_t byte_code_size, + struct wined3d_pipeline_layout_vk *layout, const unsigned int *byte_code, size_t byte_code_size, enum wined3d_shader_resource_type resource_type) { VkComputePipelineCreateInfo pipeline_info; @@ -1815,7 +1815,7 @@ static VkPipeline create_uav_pipeline(struct wined3d_context_vk *context_vk, vk_info = context_vk->vk_info; context = &context_vk->c;
- shader_desc.byte_code = byte_code; + shader_desc.byte_code = (const DWORD *)byte_code; shader_desc.byte_code_size = byte_code_size;
shader_module = (VkShaderModule)context->device->adapter->shader_backend->shader_compile(context, &shader_desc,
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/view.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index cf17db62da8..11f099b7ec5 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -16,7 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#define WINE_NO_LONG_TYPES /* temporary */
#include "wined3d_private.h" #include "wined3d_shaders.h"
kept byte_code as a 'DWORD *'. Alternative: use 'uint32_t *' instead, but would require larger changes:
- internally in wined3d
- requiring also to typecast from 'DWORD *' (the type in D3D* interfaces), to 'uint32_t*' (to be decided where: either is every client, or inside wined3d)
Ideally we'd change these anyway, but since the ultimate plan is to move these all to vkd3d-shader, it doesn't really matter.
- kept state_id as DWORD (ditto previous commits)
Ideally we'd also change this anyway, but I think we want to get rid of the state table completely, so I guess this is fine as a temporary measure.
This merge request was approved by Zebediah Figura.