Signed-off-by: Zebediah Figura z.figura12@gmail.com --- Since it will be moved to the public header.
dlls/wined3d/device.c | 6 +++--- dlls/wined3d/directx.c | 2 +- dlls/wined3d/stateblock.c | 8 ++++---- dlls/wined3d/vertexdeclaration.c | 2 +- dlls/wined3d/wined3d_private.h | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d9d6cf2676..93eae75463 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1368,7 +1368,7 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI TRACE("device %p, stream_idx %u, buffer %p, offset %u, stride %u.\n", device, stream_idx, buffer, offset, stride);
- if (stream_idx >= MAX_STREAMS) + if (stream_idx >= WINED3D_MAX_STREAMS) { WARN("Stream index %u out of range.\n", stream_idx); return WINED3DERR_INVALIDCALL; @@ -1423,7 +1423,7 @@ HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *devi TRACE("device %p, stream_idx %u, buffer %p, offset %p, stride %p.\n", device, stream_idx, buffer, offset, stride);
- if (stream_idx >= MAX_STREAMS) + if (stream_idx >= WINED3D_MAX_STREAMS) { WARN("Stream index %u out of range.\n", stream_idx); return WINED3DERR_INVALIDCALL; @@ -5249,7 +5249,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso break;
case WINED3D_RTYPE_BUFFER: - for (i = 0; i < MAX_STREAMS; ++i) + for (i = 0; i < WINED3D_MAX_STREAMS; ++i) { if (&device->state.streams[i].buffer->resource == resource) { diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 827d4f6df2..0c70f046eb 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2210,7 +2210,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ - caps->MaxStreams = MAX_STREAMS; + caps->MaxStreams = WINED3D_MAX_STREAMS; caps->MaxStreamStride = 1024;
/* d3d9.dll sets D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES here because StretchRects is implemented in d3d9 */ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index cd72209391..3dfd368780 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -457,7 +457,7 @@ void state_unbind_resources(struct wined3d_state *state) } }
- for (i = 0; i < MAX_STREAMS; ++i) + for (i = 0; i < WINED3D_MAX_STREAMS; ++i) { if ((buffer = state->streams[i].buffer)) { @@ -535,7 +535,7 @@ void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) wined3d_vertex_declaration_decref(decl); }
- for (i = 0; i < MAX_STREAMS; ++i) + for (i = 0; i < WINED3D_MAX_STREAMS; ++i) { if ((buffer = state->streams[i].buffer)) { @@ -1480,7 +1480,7 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->blend_factor.b = 1.0f; state->blend_factor.a = 1.0f;
- for (i = 0; i < MAX_STREAMS; ++i) + for (i = 0; i < WINED3D_MAX_STREAMS; ++i) state->streams[i].frequency = 1; }
@@ -1531,7 +1531,7 @@ static void stateblock_state_init_default(struct wined3d_stateblock_state *state state->blend_factor.b = 1.0f; state->blend_factor.a = 1.0f;
- for (i = 0; i < MAX_STREAMS; ++i) + for (i = 0; i < WINED3D_MAX_STREAMS; ++i) state->streams[i].frequency = 1; }
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index 863366b924..cd8bb5e423 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -217,7 +217,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
/* Find the streams used in the declaration. The vertex buffers have * to be loaded when drawing, but filter tesselation pseudo streams. */ - if (e->input_slot >= MAX_STREAMS) + if (e->input_slot >= WINED3D_MAX_STREAMS) continue;
if (!(e->format->flags[WINED3D_GL_RES_TYPE_BUFFER] & WINED3DFMT_FLAG_VERTEX_ATTRIBUTE)) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 57df9f1eb2..24db1fd469 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -258,7 +258,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup }
/* Device caps */ -#define MAX_STREAMS 16 +#define WINED3D_MAX_STREAMS 16 #define MAX_TEXTURES 8 #define MAX_FRAGMENT_SAMPLERS 16 #define MAX_VERTEX_SAMPLERS 4 @@ -2911,7 +2911,7 @@ struct wined3d_state
struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[WINED3D_MAX_STREAM_OUTPUT_BUFFERS]; - struct wined3d_stream_state streams[MAX_STREAMS + 1 /* tesselated pseudo-stream */]; + struct wined3d_stream_state streams[WINED3D_MAX_STREAMS + 1 /* tesselated pseudo-stream */]; struct wined3d_buffer *index_buffer; enum wined3d_format_id index_format; unsigned int index_offset; @@ -2980,7 +2980,7 @@ struct wined3d_dummy_textures struct wined3d_stateblock_state { struct wined3d_vertex_declaration *vertex_declaration; - struct wined3d_stream_state streams[MAX_STREAMS + 1]; + struct wined3d_stream_state streams[WINED3D_MAX_STREAMS + 1]; struct wined3d_buffer *index_buffer; enum wined3d_format_id index_format; int base_vertex_index; @@ -3568,8 +3568,8 @@ struct wined3d_vertex_declaration struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; - WORD streamSource; /* MAX_STREAMS, 16 */ - WORD streamFreq; /* MAX_STREAMS, 16 */ + WORD streamSource; /* WINED3D_MAX_STREAMS, 16 */ + WORD streamFreq; /* WINED3D_MAX_STREAMS, 16 */ DWORD renderState[(WINEHIGHEST_RENDER_STATE >> 5) + 1]; DWORD textureState[MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ WORD samplerState[MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/adapter_gl.c | 14 ++--- dlls/wined3d/arb_program_shader.c | 32 ++++++------ dlls/wined3d/ati_fragment_shader.c | 18 +++---- dlls/wined3d/context.c | 14 ++--- dlls/wined3d/glsl_shader.c | 76 ++++++++++++++-------------- dlls/wined3d/nvidia_texture_shader.c | 2 +- dlls/wined3d/shader.c | 6 +-- dlls/wined3d/state.c | 8 +-- dlls/wined3d/stateblock.c | 12 ++--- dlls/wined3d/utils.c | 24 ++++----- dlls/wined3d/wined3d_private.h | 34 ++++++------- 11 files changed, 120 insertions(+), 120 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index af0db3eec2..c75b19eae3 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -2915,13 +2915,13 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max); - gl_info->limits.textures = min(MAX_TEXTURES, gl_max); + gl_info->limits.textures = min(WINED3D_MAX_TEXTURES, gl_max); TRACE("Max textures: %d.\n", gl_info->limits.textures);
if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) { gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &gl_max); - gl_info->limits.texture_coords = min(MAX_TEXTURES, gl_max); + gl_info->limits.texture_coords = min(WINED3D_MAX_TEXTURES, gl_max); } else { @@ -2961,7 +2961,7 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct * use any samplers. If fixed-function fragment processing is used * we have to make sure that all vertex sampler setups are valid * together with all possible fixed-function fragment processing - * setups. This is true if vsamplers + MAX_TEXTURES <= max_samplers. + * setups. This is true if vsamplers + WINED3D_MAX_TEXTURES <= max_samplers. * This is true on all Direct3D 9 cards that support vertex * texture fetch (GeForce 6 and GeForce 7 cards). Direct3D 9 * Radeon cards do not support vertex texture fetch. Direct3D 10 @@ -2973,13 +2973,13 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct * true. If not, write a warning and reduce the number of vertex * samplers or probably disable vertex texture fetch. */ if (vertex_sampler_count && gl_info->limits.combined_samplers < 12 - && MAX_TEXTURES + vertex_sampler_count > gl_info->limits.combined_samplers) + && WINED3D_MAX_TEXTURES + vertex_sampler_count > gl_info->limits.combined_samplers) { FIXME("OpenGL implementation supports %u vertex samplers and %u total samplers.\n", vertex_sampler_count, gl_info->limits.combined_samplers); - FIXME("Expected vertex samplers + MAX_TEXTURES(=8) > combined_samplers.\n"); - if (gl_info->limits.combined_samplers > MAX_TEXTURES) - vertex_sampler_count = gl_info->limits.combined_samplers - MAX_TEXTURES; + FIXME("Expected vertex samplers + WINED3D_MAX_TEXTURES(=8) > combined_samplers.\n"); + if (gl_info->limits.combined_samplers > WINED3D_MAX_TEXTURES) + vertex_sampler_count = gl_info->limits.combined_samplers - WINED3D_MAX_TEXTURES; else vertex_sampler_count = 0; gl_info->limits.samplers[WINED3D_SHADER_TYPE_VERTEX] = vertex_sampler_count; diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 6b6df16b83..ebe70a4bb6 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -177,8 +177,8 @@ struct arb_ps_compiled_shader { struct arb_ps_compile_args args; struct arb_ps_np2fixup_info np2fixup_info; - struct stb_const_desc bumpenvmatconst[MAX_TEXTURES]; - struct stb_const_desc luminanceconst[MAX_TEXTURES]; + struct stb_const_desc bumpenvmatconst[WINED3D_MAX_TEXTURES]; + struct stb_const_desc luminanceconst[WINED3D_MAX_TEXTURES]; UINT int_consts[WINED3D_MAX_CONSTS_I]; GLuint prgId; UINT ycorrection; @@ -2009,7 +2009,7 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins) if (shader_version < WINED3D_SHADER_VERSION(1,4)) { DWORD flags = 0; - if (reg_sampler_code < MAX_TEXTURES) + if (reg_sampler_code < WINED3D_MAX_TEXTURES) flags = priv->cur_ps_args->super.tex_transform >> reg_sampler_code * WINED3D_PSARGS_TEXTRANSFORM_SHIFT; if (flags & WINED3D_PSARGS_PROJECTED) { @@ -2082,7 +2082,7 @@ static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins) /* Move .x first in case src_str is "TA" */ shader_addline(buffer, "MOV TA.y, %s.x;\n", src_str); shader_addline(buffer, "MOV TA.x, %s.w;\n", src_str); - if (reg1 < MAX_TEXTURES) + if (reg1 < WINED3D_MAX_TEXTURES) { struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; flags = priv->cur_ps_args->super.tex_transform >> reg1 * WINED3D_PSARGS_TEXTRANSFORM_SHIFT; @@ -2207,7 +2207,7 @@ static void pshader_hw_texm3x2tex(const struct wined3d_shader_instruction *ins) shader_arb_get_dst_param(ins, &ins->dst[0], dst_str); shader_arb_get_src_param(ins, &ins->src[0], 0, src0_name); shader_addline(buffer, "DP3 %s.y, fragment.texcoord[%u], %s;\n", dst_reg, reg, src0_name); - flags = reg < MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; + flags = reg < WINED3D_MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; shader_hw_sample(ins, reg, dst_str, dst_reg, flags & WINED3D_PSARGS_PROJECTED ? TEX_PROJ : 0, NULL, NULL); }
@@ -2250,7 +2250,7 @@ static void pshader_hw_texm3x3tex(const struct wined3d_shader_instruction *ins)
/* Sample the texture using the calculated coordinates */ shader_arb_get_dst_param(ins, &ins->dst[0], dst_str); - flags = reg < MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; + flags = reg < WINED3D_MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; shader_hw_sample(ins, reg, dst_str, dst_name, flags & WINED3D_PSARGS_PROJECTED ? TEX_PROJ : 0, NULL, NULL); tex_mx->current_row = 0; } @@ -2291,7 +2291,7 @@ static void pshader_hw_texm3x3vspec(const struct wined3d_shader_instruction *ins
/* Sample the texture using the calculated coordinates */ shader_arb_get_dst_param(ins, &ins->dst[0], dst_str); - flags = reg < MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; + flags = reg < WINED3D_MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; shader_hw_sample(ins, reg, dst_str, dst_reg, flags & WINED3D_PSARGS_PROJECTED ? TEX_PROJ : 0, NULL, NULL); tex_mx->current_row = 0; } @@ -2332,7 +2332,7 @@ static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins)
/* Sample the texture using the calculated coordinates */ shader_arb_get_dst_param(ins, &ins->dst[0], dst_str); - flags = reg < MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; + flags = reg < WINED3D_MAX_TEXTURES ? priv->cur_ps_args->super.tex_transform >> reg * WINED3D_PSARGS_TEXTRANSFORM_SHIFT : 0; shader_hw_sample(ins, reg, dst_str, dst_reg, flags & WINED3D_PSARGS_PROJECTED ? TEX_PROJ : 0, NULL, NULL); tex_mx->current_row = 0; } @@ -5766,8 +5766,8 @@ static void arbfp_get_caps(const struct wined3d_gl_info *gl_info, struct fragmen
/* TODO: Implement WINED3DTEXOPCAPS_PREMODULATE */
- caps->MaxTextureBlendStages = MAX_TEXTURES; - caps->MaxSimultaneousTextures = min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], MAX_TEXTURES); + caps->MaxTextureBlendStages = WINED3D_MAX_TEXTURES; + caps->MaxSimultaneousTextures = min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], WINED3D_MAX_TEXTURES); }
static DWORD arbfp_get_emul_mask(const struct wined3d_gl_info *gl_info) @@ -6239,7 +6239,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con }
/* Find out which textures are read */ - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (settings->op[stage].cop == WINED3D_TOP_DISABLE) break; @@ -6322,7 +6322,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con shader_addline(&buffer, "TEMP arg0;\n"); shader_addline(&buffer, "TEMP arg1;\n"); shader_addline(&buffer, "TEMP arg2;\n"); - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (constant_used & (1u << stage)) shader_addline(&buffer, "PARAM const%u = program.env[%u];\n", stage, ARB_FFP_CONST_CONSTANT(stage)); @@ -6361,7 +6361,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con shader_addline(&buffer, "MOV tempreg, 0.0;\n");
/* Generate texture sampling instructions */ - for (stage = 0; stage < MAX_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage) { if (!(tex_read & (1u << stage))) continue; @@ -6457,7 +6457,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con shader_addline(&buffer, "MOV ret, fragment.color.primary;\n");
/* Generate the main shader */ - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (settings->op[stage].cop == WINED3D_TOP_DISABLE) break; @@ -6548,7 +6548,7 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi { /* Reload fixed function constants since they collide with the * pixel shader constants. */ - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { set_bumpmat_arbfp(context, state, STATE_TEXTURESTAGE(i, WINED3D_TSS_BUMPENV_MAT00)); state_tss_constant_arbfp(context, state, STATE_TEXTURESTAGE(i, WINED3D_TSS_CONSTANT)); @@ -6599,7 +6599,7 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi { /* Reload fixed function constants since they collide with the * pixel shader constants. */ - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { set_bumpmat_arbfp(context, state, STATE_TEXTURESTAGE(i, WINED3D_TSS_BUMPENV_MAT00)); state_tss_constant_arbfp(context, state, STATE_TEXTURESTAGE(i, WINED3D_TSS_CONSTANT)); diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index 9a1cae34cd..ff2f711f4e 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -52,7 +52,7 @@ struct atifs_ffp_desc struct ffp_frag_desc parent; GLuint shader; unsigned int num_textures_used; - enum atifs_constant_value constants[MAX_TEXTURES]; + enum atifs_constant_value constants[WINED3D_MAX_TEXTURES]; };
struct atifs_private_data @@ -322,15 +322,15 @@ static GLuint register_for_arg(DWORD arg, const struct wined3d_gl_info *gl_info, return ret; }
-static GLuint find_tmpreg(const struct texture_stage_op op[MAX_TEXTURES]) +static GLuint find_tmpreg(const struct texture_stage_op op[WINED3D_MAX_TEXTURES]) { int lowest_read = -1; int lowest_write = -1; int i; - BOOL tex_used[MAX_TEXTURES]; + BOOL tex_used[WINED3D_MAX_TEXTURES];
memset(tex_used, 0, sizeof(tex_used)); - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (op[i].cop == WINED3D_TOP_DISABLE) break; @@ -467,7 +467,7 @@ static BOOL op_reads_constant(const struct texture_stage_op *op) || (op->aarg2 & WINED3DTA_SELECTMASK) == WINED3DTA_CONSTANT; }
-static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], +static GLuint gen_ati_shader(const struct texture_stage_op op[WINED3D_MAX_TEXTURES], const struct wined3d_gl_info *gl_info, enum atifs_constant_value *constants) { GLuint ret = GL_EXTCALL(glGenFragmentShadersATI(1)); @@ -604,7 +604,7 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], }
/* Pass 4: Generate the arithmetic instructions */ - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (op[stage].cop == WINED3D_TOP_DISABLE) { @@ -936,7 +936,7 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], constants[ATIFS_CONST_TFACTOR - GL_CON_0_ATI] = ATIFS_CONSTANT_TFACTOR;
/* Assign unused constants to avoid reloading due to unused <-> bump matrix switches. */ - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (constants[stage] == ATIFS_CONSTANT_UNUSED) constants[stage] = ATIFS_CONSTANT_BUMP; @@ -1062,7 +1062,7 @@ static void set_tex_op_atifs(struct wined3d_context *context, const struct wined GL_EXTCALL(glBindFragmentShaderATI(desc->shader)); ctx_priv->last_shader = desc;
- for (i = 0; i < MAX_TEXTURES; i++) + for (i = 0; i < WINED3D_MAX_TEXTURES; i++) { if (last_shader && last_shader->constants[i] == desc->constants[i]) continue; @@ -1307,7 +1307,7 @@ static void atifs_get_caps(const struct wined3d_gl_info *gl_info, struct fragmen * The proper fix for this is not to use GL_ATI_fragment_shader on cards newer than the * r200 series and use an ARB or GLSL shader instead */ - caps->MaxTextureBlendStages = MAX_TEXTURES; + caps->MaxTextureBlendStages = WINED3D_MAX_TEXTURES; caps->MaxSimultaneousTextures = 6; }
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 96ba06ddf1..cbe0e264ca 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2350,7 +2350,7 @@ const DWORD *context_get_tex_unit_mapping(const struct wined3d_context *context, if (!shader_version) { *base = 0; - *count = MAX_TEXTURES; + *count = WINED3D_MAX_TEXTURES; return context->tex_unit_map; }
@@ -2841,7 +2841,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine sampler = context->rev_tex_unit_map[0]; if (sampler != WINED3D_UNMAPPED_STAGE) { - if (sampler < MAX_TEXTURES) + if (sampler < WINED3D_MAX_TEXTURES) { context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + sampler)); context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)); @@ -2962,7 +2962,7 @@ void context_apply_ffp_blit_state(struct wined3d_context *context, const struct sampler = context->rev_tex_unit_map[i]; if (sampler != WINED3D_UNMAPPED_STAGE) { - if (sampler < MAX_TEXTURES) + if (sampler < WINED3D_MAX_TEXTURES) context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)); context_invalidate_state(context, STATE_SAMPLER(sampler)); } @@ -3263,7 +3263,7 @@ static void context_update_fixed_function_usage_map(struct wined3d_context *cont UINT i, start, end;
context->fixed_function_usage_map = 0; - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { enum wined3d_texture_op color_op = state->texture_states[i][WINED3D_TSS_COLOR_OP]; enum wined3d_texture_op alpha_op = state->texture_states[i][WINED3D_TSS_ALPHA_OP]; @@ -3289,7 +3289,7 @@ static void context_update_fixed_function_usage_map(struct wined3d_context *cont context->fixed_function_usage_map |= (1u << i);
if ((color_op == WINED3D_TOP_BUMPENVMAP || color_op == WINED3D_TOP_BUMPENVMAP_LUMINANCE) - && i < MAX_TEXTURES - 1) + && i < WINED3D_MAX_TEXTURES - 1) context->fixed_function_usage_map |= (1u << (i + 1)); }
@@ -3391,7 +3391,7 @@ static BOOL context_unit_free_for_vs(const struct wined3d_context *context, if (!ps_resource_info) { /* No pixel shader, check fixed function */ - return current_mapping >= MAX_TEXTURES || !(context->fixed_function_usage_map & (1u << current_mapping)); + return current_mapping >= WINED3D_MAX_TEXTURES || !(context->fixed_function_usage_map & (1u << current_mapping)); }
/* Pixel shader, check the shader's sampler map */ @@ -5081,7 +5081,7 @@ void context_load_tex_coords(const struct wined3d_context *context, const struct continue; }
- if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) + if (coord_idx < WINED3D_MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) { const struct wined3d_stream_info_element *e = &si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx];
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 78eed3ecea..b6879d0b4d 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -160,7 +160,7 @@ struct glsl_vs_program GLint modelview_matrix_location[MAX_VERTEX_BLENDS]; GLint projection_matrix_location; GLint normal_matrix_location; - GLint texture_matrix_location[MAX_TEXTURES]; + GLint texture_matrix_location[WINED3D_MAX_TEXTURES]; GLint material_ambient_location; GLint material_diffuse_location; GLint material_specular_location; @@ -220,10 +220,10 @@ struct glsl_ps_program GLint uniform_f_locations[WINED3D_MAX_PS_CONSTS_F]; GLint uniform_i_locations[WINED3D_MAX_CONSTS_I]; GLint uniform_b_locations[WINED3D_MAX_CONSTS_B]; - GLint bumpenv_mat_location[MAX_TEXTURES]; - GLint bumpenv_lum_scale_location[MAX_TEXTURES]; - GLint bumpenv_lum_offset_location[MAX_TEXTURES]; - GLint tss_constant_location[MAX_TEXTURES]; + GLint bumpenv_mat_location[WINED3D_MAX_TEXTURES]; + GLint bumpenv_lum_scale_location[WINED3D_MAX_TEXTURES]; + GLint bumpenv_lum_offset_location[WINED3D_MAX_TEXTURES]; + GLint tss_constant_location[WINED3D_MAX_TEXTURES]; GLint tex_factor_location; GLint specular_enable_location; GLint fog_color_location; @@ -1586,7 +1586,7 @@ static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_contex const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_matrix mat;
- if (tex >= MAX_TEXTURES) + if (tex >= WINED3D_MAX_TEXTURES) return; if (prog->vs.texture_matrix_location[tex] == -1) return; @@ -1877,7 +1877,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_FFP_TEXMATRIX) { - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) shader_glsl_ffp_vertex_texmatrix_uniform(context, state, i, prog); }
@@ -1966,7 +1966,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_PS_BUMP_ENV) { - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (prog->ps.bumpenv_mat_location[i] == -1) continue; @@ -2020,7 +2020,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context else GL_EXTCALL(glUniform4f(prog->ps.specular_enable_location, 0.0f, 0.0f, 0.0f, 0.0f));
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (prog->ps.tss_constant_location[i] == -1) continue; @@ -7310,13 +7310,13 @@ static GLuint shader_glsl_generate_vs3_rasterizer_input_setup(struct shader_glsl if (ps_major < 3) { DWORD colors_written_mask[2] = {0}; - DWORD texcoords_written_mask[MAX_TEXTURES] = {0}; + DWORD texcoords_written_mask[WINED3D_MAX_TEXTURES] = {0};
if (!legacy_syntax) { declare_out_varying(gl_info, buffer, flatshading, "vec4 ffp_varying_diffuse;\n"); declare_out_varying(gl_info, buffer, flatshading, "vec4 ffp_varying_specular;\n"); - declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); declare_out_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); }
@@ -7353,7 +7353,7 @@ static GLuint shader_glsl_generate_vs3_rasterizer_input_setup(struct shader_glsl } else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_TEXCOORD)) { - if (semantic_idx < MAX_TEXTURES) + if (semantic_idx < WINED3D_MAX_TEXTURES) { shader_addline(buffer, "%s[%u]%s = outputs[%u]%s;\n", legacy_syntax ? "gl_TexCoord" : "ffp_varying_texcoord", @@ -7389,7 +7389,7 @@ static GLuint shader_glsl_generate_vs3_rasterizer_input_setup(struct shader_glsl reg_mask, reg_mask); } } - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (ps && !(ps->reg_maps.texcoord & (1u << i))) continue; @@ -7893,7 +7893,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context shader_addline(buffer, "vec4 ffp_varying_diffuse;\n"); if (glsl_is_color_reg_read(shader, 1)) shader_addline(buffer, "vec4 ffp_varying_specular;\n"); - shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", WINED3D_MAX_TEXTURES); shader_addline(buffer, "float ffp_varying_fogcoord;\n"); } else @@ -7902,8 +7902,8 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context declare_in_varying(gl_info, buffer, args->flatshading, "vec4 ffp_varying_diffuse;\n"); if (glsl_is_color_reg_read(shader, 1)) declare_in_varying(gl_info, buffer, args->flatshading, "vec4 ffp_varying_specular;\n"); - declare_in_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); - shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + declare_in_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", WINED3D_MAX_TEXTURES); declare_in_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); } } @@ -8193,7 +8193,7 @@ static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context { declare_out_varying(gl_info, buffer, args->flatshading, "vec4 ffp_varying_diffuse;\n"); declare_out_varying(gl_info, buffer, args->flatshading, "vec4 ffp_varying_specular;\n"); - declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); declare_out_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); } } @@ -9161,7 +9161,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "uniform mat4 ffp_modelview_matrix[%u];\n", MAX_VERTEX_BLENDS); shader_addline(buffer, "uniform mat4 ffp_projection_matrix;\n"); shader_addline(buffer, "uniform mat3 ffp_normal_matrix;\n"); - shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", WINED3D_MAX_TEXTURES);
shader_addline(buffer, "uniform struct\n{\n"); shader_addline(buffer, " vec4 emissive;\n"); @@ -9203,7 +9203,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr { shader_addline(buffer, "vec4 ffp_varying_diffuse;\n"); shader_addline(buffer, "vec4 ffp_varying_specular;\n"); - shader_addline(buffer, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); shader_addline(buffer, "float ffp_varying_fogcoord;\n"); } else @@ -9213,7 +9213,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
declare_out_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_diffuse;\n"); declare_out_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_specular;\n"); - declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); declare_out_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); }
@@ -9227,7 +9227,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "%s %s = vs_in%u%s;\n", attrib_info[i].type, attrib_info[i].name, i, settings->swizzle_map & (1u << i) ? ".zyxw" : ""); } - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { unsigned int coord_idx = settings->texgen[i] & 0x0000ffff; if ((settings->texgen[i] & 0xffff0000) == WINED3DTSS_TCI_PASSTHRU @@ -9293,7 +9293,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr shader_addline(buffer, "ffp_varying_specular = clamp(ffp_varying_specular, 0.0, 1.0);\n"); }
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { BOOL output_legacy_texcoord = legacy_syntax;
@@ -9652,7 +9652,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * string_buffer_clear(buffer);
/* Find out which textures are read */ - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (settings->op[stage].cop == WINED3D_TOP_DISABLE) break; @@ -9735,7 +9735,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * shader_addline(buffer, "vec4 temp_reg = vec4(0.0);\n"); shader_addline(buffer, "vec4 arg0, arg1, arg2;\n");
- for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { const char *sampler_type;
@@ -9815,16 +9815,16 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * { shader_addline(buffer, "vec4 ffp_varying_diffuse;\n"); shader_addline(buffer, "vec4 ffp_varying_specular;\n"); - shader_addline(buffer, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); - shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", WINED3D_MAX_TEXTURES); shader_addline(buffer, "float ffp_varying_fogcoord;\n"); } else { declare_in_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_diffuse;\n"); declare_in_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_specular;\n"); - declare_in_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); - shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + declare_in_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", WINED3D_MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", WINED3D_MAX_TEXTURES); declare_in_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); }
@@ -9836,7 +9836,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * shader_addline(buffer, "ffp_varying_specular = gl_SecondaryColor;\n"); }
- for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { if (tex_map & (1u << stage)) { @@ -9857,7 +9857,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * shader_addline(buffer, "if (any(lessThan(ffp_texcoord[7], vec4(0.0)))) discard;\n");
/* Generate texture sampling instructions */ - for (stage = 0; stage < MAX_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage) { const char *texture_function, *coord_mask; BOOL proj; @@ -9974,7 +9974,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * shader_addline(buffer, "ret = ffp_varying_diffuse;\n");
/* Generate the main shader */ - for (stage = 0; stage < MAX_TEXTURES; ++stage) + for (stage = 0; stage < WINED3D_MAX_TEXTURES; ++stage) { BOOL op_equal;
@@ -10121,7 +10121,7 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info * } vs->projection_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_projection_matrix")); vs->normal_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_normal_matrix")); - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { string_buffer_sprintf(name, "ffp_texture_matrix[%u]", i); vs->texture_matrix_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer)); @@ -10207,7 +10207,7 @@ static void shader_glsl_init_ps_uniform_locations(const struct wined3d_gl_info * ps->uniform_b_locations[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer)); }
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { string_buffer_sprintf(name, "bumpenv_mat%u", i); ps->bumpenv_mat_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer)); @@ -10703,7 +10703,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const } }
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (entry->vs.texture_matrix_location[i] != -1) { @@ -10765,7 +10765,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const shader_glsl_load_samplers(context, priv, program_id, NULL); }
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (entry->ps.bumpenv_mat_location[i] != -1) { @@ -11931,7 +11931,7 @@ static void glsl_vertex_pipe_texmatrix_np2(struct wined3d_context *context, if (!texture) return;
- if (sampler >= MAX_TEXTURES) + if (sampler >= WINED3D_MAX_TEXTURES) return;
if ((np2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT)) @@ -12179,8 +12179,8 @@ static void glsl_fragment_pipe_get_caps(const struct wined3d_gl_info *gl_info, s | WINED3DTEXOPCAPS_LERP | WINED3DTEXOPCAPS_BUMPENVMAP | WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE; - caps->MaxTextureBlendStages = MAX_TEXTURES; - caps->MaxSimultaneousTextures = min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], MAX_TEXTURES); + caps->MaxTextureBlendStages = WINED3D_MAX_TEXTURES; + caps->MaxSimultaneousTextures = min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], WINED3D_MAX_TEXTURES); }
static DWORD glsl_fragment_pipe_get_emul_mask(const struct wined3d_gl_info *gl_info) diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index e05df20bfd..14cb73f2c3 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -739,7 +739,7 @@ static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct WINED3DTEXOPCAPS_PREMODULATE */ #endif
- caps->MaxTextureBlendStages = min(MAX_TEXTURES, gl_info->limits.general_combiners); + caps->MaxTextureBlendStages = min(WINED3D_MAX_TEXTURES, gl_info->limits.general_combiners); caps->MaxSimultaneousTextures = gl_info->limits.textures; }
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index b75ff6f99c..00933f2bb3 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -4098,7 +4098,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
args->texcoords_initialized = 0; - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (vs) { @@ -4112,14 +4112,14 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT) & WINED3D_FFP_TCI_MASK - || (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) + || (coord_idx < WINED3D_MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) args->texcoords_initialized |= 1u << i; } } } else { - args->texcoords_initialized = (1u << MAX_TEXTURES) - 1; + args->texcoords_initialized = (1u << WINED3D_MAX_TEXTURES) - 1; }
args->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE] diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 0f7b030b0c..6578a3070c 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3501,7 +3501,7 @@ static void sampler_texmatrix(struct wined3d_context *context, const struct wine * wined3d_texture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the * scaling is reapplied or removed, the texture matrix has to be reapplied. */ - if (sampler < MAX_TEXTURES) + if (sampler < WINED3D_MAX_TEXTURES) { const BOOL tex_is_pow2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT);
@@ -3993,7 +3993,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine { unsigned int i;
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (!isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + i))) transform_texture(context, state, STATE_TEXTURESTAGE(i, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS)); @@ -5392,7 +5392,7 @@ static void prune_invalid_states(struct StateEntry *state_table, const struct wi unsigned int start, last, i;
start = STATE_TEXTURESTAGE(d3d_info->limits.ffp_blend_stages, 0); - last = STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE); + last = STATE_TEXTURESTAGE(WINED3D_MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE); for (i = start; i <= last; ++i) { state_table[i].representative = 0; @@ -5400,7 +5400,7 @@ static void prune_invalid_states(struct StateEntry *state_table, const struct wi }
start = STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + d3d_info->limits.ffp_blend_stages); - last = STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + MAX_TEXTURES - 1); + last = STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + WINED3D_MAX_TEXTURES - 1); for (i = start; i <= last; ++i) { state_table[i].representative = 0; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 3dfd368780..403724745c 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -216,7 +216,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states, states->textures = 0xfffff; stateblock_set_bits(states->transform, HIGHEST_TRANSFORMSTATE + 1); stateblock_set_bits(states->renderState, WINEHIGHEST_RENDER_STATE + 1); - for (i = 0; i < MAX_TEXTURES; ++i) states->textureState[i] = 0x3ffff; + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) states->textureState[i] = 0x3ffff; for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = 0x3ffe; states->clipplane = (1u << MAX_CLIP_DISTANCES) - 1; states->pixelShaderConstantsB = 0xffff; @@ -246,7 +246,7 @@ static void stateblock_savedstates_set_pixel(struct wined3d_saved_states *states
for (i = 0; i < ARRAY_SIZE(pixel_states_texture); ++i) texture_mask |= 1u << pixel_states_texture[i]; - for (i = 0; i < MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; for (i = 0; i < ARRAY_SIZE(pixel_states_sampler); ++i) sampler_mask |= 1u << pixel_states_sampler[i]; for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; @@ -273,7 +273,7 @@ static void stateblock_savedstates_set_vertex(struct wined3d_saved_states *state
for (i = 0; i < ARRAY_SIZE(vertex_states_texture); ++i) texture_mask |= 1u << vertex_states_texture[i]; - for (i = 0; i < MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; for (i = 0; i < ARRAY_SIZE(vertex_states_sampler); ++i) sampler_mask |= 1u << vertex_states_sampler[i]; for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; @@ -366,7 +366,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) } }
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { DWORD map = stateblock->changed.textureState[i];
@@ -1466,7 +1466,7 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d init_default_render_states(state->render_states, d3d_info);
/* Texture Stage States - Put directly into state block, we will call function below */ - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { TRACE("Setting up default texture states for texture Stage %u.\n", i); state->transforms[WINED3D_TS_TEXTURE0 + i] = identity; @@ -1518,7 +1518,7 @@ static void stateblock_state_init_default(struct wined3d_stateblock_state *state
init_default_render_states(state->rs, d3d_info);
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { state->transforms[WINED3D_TS_TEXTURE0 + i] = identity; init_default_texture_state(i, state->texture_states[i]); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 54e3b1031a..dd452409b8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5387,7 +5387,7 @@ void get_texture_matrix(const struct wined3d_context *context, const struct wine BOOL generated = (state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX] & 0xffff0000) != WINED3DTSS_TCI_PASSTHRU; unsigned int coord_idx = min(state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX & 0x0000ffff], - MAX_TEXTURES - 1); + WINED3D_MAX_TEXTURES - 1);
compute_texture_matrix(gl_info, &state->transforms[WINED3D_TS_TEXTURE0 + tex], state->texture_states[tex][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS], @@ -5718,7 +5718,7 @@ unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info) { /* On core profile we have to also count diffuse and specular colors and the * fog coordinate. */ - return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? MAX_TEXTURES * 4 : (MAX_TEXTURES + 2) * 4 + 1; + return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? WINED3D_MAX_TEXTURES * 4 : (WINED3D_MAX_TEXTURES + 2) * 4 + 1; }
void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, @@ -5926,7 +5926,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d }
/* Clear unsupported stages */ - for(; i < MAX_TEXTURES; i++) { + for(; i < WINED3D_MAX_TEXTURES; i++) { memset(&settings->op[i], 0xff, sizeof(settings->op[i])); }
@@ -6003,7 +6003,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d && d3d_info->limits.varying_count < wined3d_max_compat_varyings(gl_info)) { settings->texcoords_initialized = 0; - for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { if (use_vs(state)) { @@ -6016,14 +6016,14 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT) & WINED3D_FFP_TCI_MASK - || (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) + || (coord_idx < WINED3D_MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) settings->texcoords_initialized |= 1u << i; } } } else { - settings->texcoords_initialized = (1u << MAX_TEXTURES) - 1; + settings->texcoords_initialized = (1u << WINED3D_MAX_TEXTURES) - 1; }
settings->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE] @@ -6208,15 +6208,15 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, else settings->fog_mode = WINED3D_FFP_VS_FOG_FOGCOORD;
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; - if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) + if (coord_idx < WINED3D_MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) settings->texcoords |= 1u << i; settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; } if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info)) - settings->texcoords = (1u << MAX_TEXTURES) - 1; + settings->texcoords = (1u << WINED3D_MAX_TEXTURES) - 1;
if (d3d_info->emulated_flatshading) settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; @@ -6269,15 +6269,15 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, settings->specular_source = WINED3D_MCS_MATERIAL; }
- for (i = 0; i < MAX_TEXTURES; ++i) + for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) { coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; - if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) + if (coord_idx < WINED3D_MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) settings->texcoords |= 1u << i; settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; } if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info)) - settings->texcoords = (1u << MAX_TEXTURES) - 1; + settings->texcoords = (1u << WINED3D_MAX_TEXTURES) - 1;
for (i = 0; i < MAX_ACTIVE_LIGHTS; ++i) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 24db1fd469..40bc7618bf 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -259,7 +259,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
/* Device caps */ #define WINED3D_MAX_STREAMS 16 -#define MAX_TEXTURES 8 +#define WINED3D_MAX_TEXTURES 8 #define MAX_FRAGMENT_SAMPLERS 16 #define MAX_VERTEX_SAMPLERS 4 #define MAX_COMBINED_SAMPLERS (MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS) @@ -1003,8 +1003,8 @@ struct wined3d_shader_reg_maps struct wined3d_shader_resource_info resource_info[MAX_SHADER_RESOURCE_VIEWS]; struct wined3d_shader_sampler_map sampler_map; DWORD sampler_comparison_mode; - BYTE bumpmat; /* MAX_TEXTURES, 8 */ - BYTE luminanceparams; /* MAX_TEXTURES, 8 */ + BYTE bumpmat; /* WINED3D_MAX_TEXTURES, 8 */ + BYTE luminanceparams; /* WINED3D_MAX_TEXTURES, 8 */ struct wined3d_shader_resource_info uav_resource_info[MAX_UNORDERED_ACCESS_VIEWS]; DWORD uav_read_mask : 8; /* MAX_UNORDERED_ACCESS_VIEWS, 8 */ DWORD uav_counter_mask : 8; /* MAX_UNORDERED_ACCESS_VIEWS, 8 */ @@ -1355,7 +1355,7 @@ struct ps_compile_args in D3D10 (unconditional NP2 support mandatory). */ WORD np2_fixup; WORD shadow; /* MAX_FRAGMENT_SAMPLERS, 16 */ - WORD texcoords_initialized; /* MAX_TEXTURES, 8 */ + WORD texcoords_initialized; /* WINED3D_MAX_TEXTURES, 8 */ DWORD pointsprite : 1; DWORD flatshading : 1; DWORD alpha_test_func : 3; @@ -1577,10 +1577,10 @@ enum wined3d_pipeline #define STATE_TEXTURESTAGE(stage, num) \ (STATE_RENDER(WINEHIGHEST_RENDER_STATE) + 1 + (stage) * (WINED3D_HIGHEST_TEXTURE_STATE + 1) + (num)) #define STATE_IS_TEXTURESTAGE(a) \ - ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE)) + ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(WINED3D_MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE))
/* + 1 because samplers start with 0 */ -#define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num)) +#define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(WINED3D_MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num)) #define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1))
#define STATE_GRAPHICS_SHADER(a) (STATE_SAMPLER(MAX_COMBINED_SAMPLERS) + (a)) @@ -1902,10 +1902,10 @@ struct wined3d_context DWORD destroyed : 1; DWORD valid : 1;
- DWORD texShaderBumpMap : 8; /* MAX_TEXTURES, 8 */ - DWORD lastWasPow2Texture : 8; /* MAX_TEXTURES, 8 */ - DWORD fixed_function_usage_map : 8; /* MAX_TEXTURES, 8 */ - DWORD lowest_disabled_stage : 4; /* Max MAX_TEXTURES, 8 */ + DWORD texShaderBumpMap : 8; /* WINED3D_MAX_TEXTURES, 8 */ + DWORD lastWasPow2Texture : 8; /* WINED3D_MAX_TEXTURES, 8 */ + DWORD fixed_function_usage_map : 8; /* WINED3D_MAX_TEXTURES, 8 */ + DWORD lowest_disabled_stage : 4; /* Max WINED3D_MAX_TEXTURES, 8 */ DWORD use_immediate_mode_draw : 1; DWORD rebind_fbo : 1; DWORD needs_set : 1; @@ -2755,7 +2755,7 @@ struct texture_stage_op
struct ffp_frag_settings { - struct texture_stage_op op[MAX_TEXTURES]; + struct texture_stage_op op[WINED3D_MAX_TEXTURES]; enum wined3d_ffp_ps_fog_mode fog; unsigned char sRGB_write; unsigned char emul_clipplanes; @@ -2824,13 +2824,13 @@ struct wined3d_ffp_vs_settings DWORD point_size : 1; DWORD per_vertex_point_size : 1; DWORD fog_mode : 2; - DWORD texcoords : 8; /* MAX_TEXTURES */ + DWORD texcoords : 8; /* WINED3D_MAX_TEXTURES */ DWORD ortho_fog : 1; DWORD flatshading : 1; DWORD swizzle_map : 16; /* MAX_ATTRIBS, 16 */ DWORD padding : 2;
- DWORD texgen[MAX_TEXTURES]; + DWORD texgen[WINED3D_MAX_TEXTURES]; };
struct wined3d_ffp_vs_desc @@ -2938,7 +2938,7 @@ struct wined3d_state
struct wined3d_texture *textures[MAX_COMBINED_SAMPLERS]; DWORD sampler_states[MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; - DWORD texture_states[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1]; + DWORD texture_states[WINED3D_MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1]; struct wined3d_vec4 clip_planes[MAX_CLIP_DISTANCES]; @@ -3000,7 +3000,7 @@ struct wined3d_stateblock_state
struct wined3d_texture *textures[MAX_COMBINED_SAMPLERS]; DWORD sampler_states[MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; - DWORD texture_states[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1]; + DWORD texture_states[WINED3D_MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1]; struct wined3d_vec4 clip_planes[MAX_CLIP_DISTANCES]; @@ -3571,7 +3571,7 @@ struct wined3d_saved_states WORD streamSource; /* WINED3D_MAX_STREAMS, 16 */ WORD streamFreq; /* WINED3D_MAX_STREAMS, 16 */ DWORD renderState[(WINEHIGHEST_RENDER_STATE >> 5) + 1]; - DWORD textureState[MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ + DWORD textureState[WINED3D_MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ WORD samplerState[MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */ DWORD clipplane; /* WINED3D_MAX_USER_CLIP_PLANES, 32 */ WORD pixelShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ @@ -3623,7 +3623,7 @@ struct wined3d_stateblock unsigned int num_contained_ps_consts_b; DWORD contained_ps_consts_f[WINED3D_MAX_PS_CONSTS_F]; unsigned int num_contained_ps_consts_f; - struct StageState contained_tss_states[MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)]; + struct StageState contained_tss_states[WINED3D_MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)]; unsigned int num_contained_tss_states; struct StageState contained_sampler_states[MAX_COMBINED_SAMPLERS * WINED3D_HIGHEST_SAMPLER_STATE]; unsigned int num_contained_sampler_states;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/arb_program_shader.c | 18 +++++++++--------- dlls/wined3d/context.c | 22 +++++++++++----------- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 4 ++-- dlls/wined3d/state.c | 4 ++-- dlls/wined3d/stateblock.c | 4 ++-- dlls/wined3d/wined3d_private.h | 10 +++++----- 8 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index ebe70a4bb6..49d06455f7 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -497,7 +497,7 @@ static unsigned int shader_arb_load_constants_f(const struct wined3d_shader *sha static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info *fixup, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) { - GLfloat np2fixup_constants[4 * MAX_FRAGMENT_SAMPLERS]; + GLfloat np2fixup_constants[4 * WINED3D_MAX_FRAGMENT_SAMPLERS]; WORD active = fixup->super.active; UINT i;
@@ -1421,7 +1421,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD struct color_fixup_masks masks;
/* D3D vertex shader sampler IDs are vertex samplers(0-3), not global d3d samplers */ - if(!pshader) sampler_idx += MAX_FRAGMENT_SAMPLERS; + if(!pshader) sampler_idx += WINED3D_MAX_FRAGMENT_SAMPLERS;
switch (resource_type) { @@ -1465,9 +1465,9 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD else mod = "";
/* Fragment samplers always have indentity mapping */ - if(sampler_idx >= MAX_FRAGMENT_SAMPLERS) + if(sampler_idx >= WINED3D_MAX_FRAGMENT_SAMPLERS) { - sampler_idx = priv->cur_vs_args->vertex.samplers[sampler_idx - MAX_FRAGMENT_SAMPLERS]; + sampler_idx = priv->cur_vs_args->vertex.samplers[sampler_idx - WINED3D_MAX_FRAGMENT_SAMPLERS]; }
if (pshader) @@ -3749,7 +3749,7 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
/* Load constants to fixup NP2 texcoords if there are still free constants left: * Constants (texture dimensions) for the NP2 fixup are loaded as local program parameters. This will consume - * at most 8 (MAX_FRAGMENT_SAMPLERS / 2) parameters, which is highly unlikely, since the application had to + * at most 8 (WINED3D_MAX_FRAGMENT_SAMPLERS / 2) parameters, which is highly unlikely, since the application had to * use 16 NP2 textures at the same time. In case that we run out of constants the fixup is simply not * applied / activated. This will probably result in wrong rendering of the texture, but will save us from * shader compilation errors and the subsequent errors when drawing with this shader. */ @@ -3763,7 +3763,7 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader, fixup->offset = next_local; fixup->super.active = 0;
- for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i) { if (!(map & (1u << i))) continue; @@ -4518,9 +4518,9 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state, args->clip.boolclip.bools |= (1u << i); }
- args->vertex.samplers[0] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 0]; - args->vertex.samplers[1] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 1]; - args->vertex.samplers[2] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 2]; + args->vertex.samplers[0] = context->tex_unit_map[WINED3D_MAX_FRAGMENT_SAMPLERS + 0]; + args->vertex.samplers[1] = context->tex_unit_map[WINED3D_MAX_FRAGMENT_SAMPLERS + 1]; + args->vertex.samplers[2] = context->tex_unit_map[WINED3D_MAX_FRAGMENT_SAMPLERS + 2]; args->vertex.samplers[3] = 0;
/* Skip if unused or local */ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index cbe0e264ca..c973b03e26 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2024,12 +2024,12 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, unsigned int base, count;
wined3d_gl_limits_get_texture_unit_range(&gl_info->limits, WINED3D_SHADER_TYPE_PIXEL, &base, &count); - if (base + MAX_FRAGMENT_SAMPLERS > ARRAY_SIZE(context->rev_tex_unit_map)) + if (base + WINED3D_MAX_FRAGMENT_SAMPLERS > ARRAY_SIZE(context->rev_tex_unit_map)) { ERR("Unexpected texture unit base index %u.\n", base); return FALSE; } - for (i = 0; i < min(count, MAX_FRAGMENT_SAMPLERS); ++i) + for (i = 0; i < min(count, WINED3D_MAX_FRAGMENT_SAMPLERS); ++i) { context->tex_unit_map[i] = base + i; context->rev_tex_unit_map[base + i] = i; @@ -2043,8 +2043,8 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, } for (i = 0; i < min(count, MAX_VERTEX_SAMPLERS); ++i) { - context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + i] = base + i; - context->rev_tex_unit_map[base + i] = MAX_FRAGMENT_SAMPLERS + i; + context->tex_unit_map[WINED3D_MAX_FRAGMENT_SAMPLERS + i] = base + i; + context->rev_tex_unit_map[base + i] = WINED3D_MAX_FRAGMENT_SAMPLERS + i; } }
@@ -2364,10 +2364,10 @@ const DWORD *context_get_tex_unit_mapping(const struct wined3d_context *context, { case WINED3D_SHADER_TYPE_PIXEL: *base = 0; - *count = MAX_FRAGMENT_SAMPLERS; + *count = WINED3D_MAX_FRAGMENT_SAMPLERS; break; case WINED3D_SHADER_TYPE_VERTEX: - *base = MAX_FRAGMENT_SAMPLERS; + *base = WINED3D_MAX_FRAGMENT_SAMPLERS; *count = MAX_VERTEX_SAMPLERS; break; default: @@ -3363,7 +3363,7 @@ static void context_map_psamplers(struct wined3d_context *context, const struct state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.resource_info; unsigned int i;
- for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i) { if (resource_info[i].type && context->tex_unit_map[i] != i) { @@ -3384,7 +3384,7 @@ static BOOL context_unit_free_for_vs(const struct wined3d_context *context, if (current_mapping == WINED3D_UNMAPPED_STAGE) return TRUE;
- if (current_mapping < MAX_FRAGMENT_SAMPLERS) + if (current_mapping < WINED3D_MAX_FRAGMENT_SAMPLERS) { /* Used by a fragment sampler */
@@ -3418,7 +3418,7 @@ static void context_map_vsamplers(struct wined3d_context *context, BOOL ps, cons
for (i = 0; i < MAX_VERTEX_SAMPLERS; ++i) { - DWORD vsampler_idx = i + MAX_FRAGMENT_SAMPLERS; + DWORD vsampler_idx = i + WINED3D_MAX_FRAGMENT_SAMPLERS; if (vs_resource_info[i].type) { while (start >= 0) @@ -3732,13 +3732,13 @@ static void context_preload_textures(struct wined3d_context *context, const stru for (i = 0; i < MAX_VERTEX_SAMPLERS; ++i) { if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.resource_info[i].type) - context_preload_texture(context, state, MAX_FRAGMENT_SAMPLERS + i); + context_preload_texture(context, state, WINED3D_MAX_FRAGMENT_SAMPLERS + i); } }
if (use_ps(state)) { - for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i) { if (state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.resource_info[i].type) context_preload_texture(context, state, i); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 93eae75463..594a17ea16 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2124,7 +2124,7 @@ void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device, device, sampler_idx, debug_d3dsamplerstate(state), value);
if (sampler_idx >= WINED3DVERTEXTEXTURESAMPLER0 && sampler_idx <= WINED3DVERTEXTEXTURESAMPLER3) - sampler_idx -= (WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS); + sampler_idx -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (sampler_idx >= ARRAY_SIZE(device->state.sampler_states)) { @@ -2159,7 +2159,7 @@ DWORD CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device device, sampler_idx, debug_d3dsamplerstate(state));
if (sampler_idx >= WINED3DVERTEXTEXTURESAMPLER0 && sampler_idx <= WINED3DVERTEXTEXTURESAMPLER3) - sampler_idx -= (WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS); + sampler_idx -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (sampler_idx >= ARRAY_SIZE(device->state.sampler_states)) { @@ -3541,7 +3541,7 @@ HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device, TRACE("device %p, stage %u, texture %p.\n", device, stage, texture);
if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3) - stage -= (WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS); + stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
/* Windows accepts overflowing this array... we do not. */ if (stage >= ARRAY_SIZE(device->state.textures)) @@ -3588,7 +3588,7 @@ struct wined3d_texture * CDECL wined3d_device_get_texture(const struct wined3d_d TRACE("device %p, stage %u.\n", device, stage);
if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3) - stage -= (WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS); + stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (stage >= ARRAY_SIZE(device->state.textures)) { diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b6879d0b4d..2e87e5ff85 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1244,7 +1244,7 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps { float sx, sy; } - np2fixup_constants[MAX_FRAGMENT_SAMPLERS]; + np2fixup_constants[WINED3D_MAX_FRAGMENT_SAMPLERS]; UINT fixup = ps->np2_fixup_info->active; UINT i;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 00933f2bb3..8faae3a31e 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -4018,13 +4018,13 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 { /* In SM4+ we use dcl_sampler in order to determine if we should use shadow sampler. */ args->shadow = 0; - for (i = 0 ; i < MAX_FRAGMENT_SAMPLERS; ++i) + for (i = 0 ; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i) args->color_fixup[i] = COLOR_FIXUP_IDENTITY; args->np2_fixup = 0; } else { - for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i) { if (!shader->reg_maps.resource_info[i].type) continue; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 6578a3070c..f65c81ed0c 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3328,7 +3328,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d return; }
- if (mapped_stage >= min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], MAX_FRAGMENT_SAMPLERS)) + if (mapped_stage >= min(gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL], WINED3D_MAX_FRAGMENT_SAMPLERS)) { WARN("stage %u not mapped to a valid texture unit (%u)\n", stage, mapped_stage); return; @@ -3673,7 +3673,7 @@ void apply_pixelshader(struct wined3d_context *context, const struct wined3d_sta /* Former draw without a pixel shader, some samplers may be * disabled because of WINED3D_TSS_COLOR_OP = WINED3DTOP_DISABLE * make sure to enable them. */ - for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i) { if (!isStateDirty(context, STATE_SAMPLER(i))) sampler(context, state, STATE_SAMPLER(i)); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 403724745c..420e51547d 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1137,7 +1137,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) DWORD value = stateblock->stateblock_state.sampler_states[stage][sampler_state];
state->sampler_states[stage][sampler_state] = value; - if (stage >= MAX_FRAGMENT_SAMPLERS) stage += WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS; + if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS) stage += WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS; wined3d_device_set_sampler_state(device, stage, sampler_state, value); }
@@ -1237,7 +1237,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
if (!(map & 1)) continue;
- stage = i < MAX_FRAGMENT_SAMPLERS ? i : WINED3DVERTEXTEXTURESAMPLER0 + i - MAX_FRAGMENT_SAMPLERS; + stage = i < WINED3D_MAX_FRAGMENT_SAMPLERS ? i : WINED3DVERTEXTEXTURESAMPLER0 + i - WINED3D_MAX_FRAGMENT_SAMPLERS; if (stateblock->stateblock_state.textures[i]) wined3d_texture_incref(stateblock->stateblock_state.textures[i]); if (state->textures[i]) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 40bc7618bf..a7f83d7bc1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -260,9 +260,9 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup /* Device caps */ #define WINED3D_MAX_STREAMS 16 #define WINED3D_MAX_TEXTURES 8 -#define MAX_FRAGMENT_SAMPLERS 16 +#define WINED3D_MAX_FRAGMENT_SAMPLERS 16 #define MAX_VERTEX_SAMPLERS 4 -#define MAX_COMBINED_SAMPLERS (MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS) +#define MAX_COMBINED_SAMPLERS (WINED3D_MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS) #define MAX_ACTIVE_LIGHTS 8 #define MAX_CLIP_DISTANCES 8 #define MAX_CONSTANT_BUFFERS 15 @@ -1344,7 +1344,7 @@ enum wined3d_shader_tex_types
struct ps_compile_args { - struct color_fixup_desc color_fixup[MAX_FRAGMENT_SAMPLERS]; + struct color_fixup_desc color_fixup[WINED3D_MAX_FRAGMENT_SAMPLERS]; enum wined3d_vertex_processing_mode vp_mode; enum wined3d_ffp_ps_fog_mode fog; WORD tex_transform; /* ps 1.0-1.3, 4 textures */ @@ -1354,7 +1354,7 @@ struct ps_compile_args D3D9 has a limit of 16 samplers and the fixup is superfluous in D3D10 (unconditional NP2 support mandatory). */ WORD np2_fixup; - WORD shadow; /* MAX_FRAGMENT_SAMPLERS, 16 */ + WORD shadow; /* WINED3D_MAX_FRAGMENT_SAMPLERS, 16 */ WORD texcoords_initialized; /* WINED3D_MAX_TEXTURES, 8 */ DWORD pointsprite : 1; DWORD flatshading : 1; @@ -4415,7 +4415,7 @@ void get_fog_start_end(const struct wined3d_context *context, const struct wined * * This structure is shared between the GLSL and the ARB backend.*/ struct ps_np2fixup_info { - unsigned char idx[MAX_FRAGMENT_SAMPLERS]; /* indices to the real constant */ + unsigned char idx[WINED3D_MAX_FRAGMENT_SAMPLERS]; /* indices to the real constant */ WORD active; /* bitfield indicating if we can apply the fixup */ WORD num_consts; };
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/context.c | 10 +++++----- dlls/wined3d/wined3d_private.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index c973b03e26..e233e59e65 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2036,12 +2036,12 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, }
wined3d_gl_limits_get_texture_unit_range(&gl_info->limits, WINED3D_SHADER_TYPE_VERTEX, &base, &count); - if (base + MAX_VERTEX_SAMPLERS > ARRAY_SIZE(context->rev_tex_unit_map)) + if (base + WINED3D_MAX_VERTEX_SAMPLERS > ARRAY_SIZE(context->rev_tex_unit_map)) { ERR("Unexpected texture unit base index %u.\n", base); return FALSE; } - for (i = 0; i < min(count, MAX_VERTEX_SAMPLERS); ++i) + for (i = 0; i < min(count, WINED3D_MAX_VERTEX_SAMPLERS); ++i) { context->tex_unit_map[WINED3D_MAX_FRAGMENT_SAMPLERS + i] = base + i; context->rev_tex_unit_map[base + i] = WINED3D_MAX_FRAGMENT_SAMPLERS + i; @@ -2368,7 +2368,7 @@ const DWORD *context_get_tex_unit_mapping(const struct wined3d_context *context, break; case WINED3D_SHADER_TYPE_VERTEX: *base = WINED3D_MAX_FRAGMENT_SAMPLERS; - *count = MAX_VERTEX_SAMPLERS; + *count = WINED3D_MAX_VERTEX_SAMPLERS; break; default: ERR("Unhandled shader type %#x.\n", shader_version->type); @@ -3416,7 +3416,7 @@ static void context_map_vsamplers(struct wined3d_context *context, BOOL ps, cons if (ps) ps_resource_info = state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.resource_info;
- for (i = 0; i < MAX_VERTEX_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_VERTEX_SAMPLERS; ++i) { DWORD vsampler_idx = i + WINED3D_MAX_FRAGMENT_SAMPLERS; if (vs_resource_info[i].type) @@ -3729,7 +3729,7 @@ static void context_preload_textures(struct wined3d_context *context, const stru
if (use_vs(state)) { - for (i = 0; i < MAX_VERTEX_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_VERTEX_SAMPLERS; ++i) { if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.resource_info[i].type) context_preload_texture(context, state, WINED3D_MAX_FRAGMENT_SAMPLERS + i); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index a7f83d7bc1..d9389a156b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -261,8 +261,8 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup #define WINED3D_MAX_STREAMS 16 #define WINED3D_MAX_TEXTURES 8 #define WINED3D_MAX_FRAGMENT_SAMPLERS 16 -#define MAX_VERTEX_SAMPLERS 4 -#define MAX_COMBINED_SAMPLERS (WINED3D_MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS) +#define WINED3D_MAX_VERTEX_SAMPLERS 4 +#define MAX_COMBINED_SAMPLERS (WINED3D_MAX_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS) #define MAX_ACTIVE_LIGHTS 8 #define MAX_CLIP_DISTANCES 8 #define MAX_CONSTANT_BUFFERS 15 @@ -1996,7 +1996,7 @@ struct wined3d_context GLuint blit_vbo;
DWORD tex_unit_map[MAX_COMBINED_SAMPLERS]; - DWORD rev_tex_unit_map[MAX_GL_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS]; + DWORD rev_tex_unit_map[MAX_GL_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS];
/* Extension emulation */ GLint gl_fog_source;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/context.c | 6 +++--- dlls/wined3d/cs.c | 2 +- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/stateblock.c | 16 ++++++++-------- dlls/wined3d/wined3d_private.h | 22 +++++++++++----------- 5 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index e233e59e65..b5a16f8543 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2018,7 +2018,7 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, context->tex_unit_map[i] = WINED3D_UNMAPPED_STAGE; for (i = 0; i < ARRAY_SIZE(context->rev_tex_unit_map); ++i) context->rev_tex_unit_map[i] = WINED3D_UNMAPPED_STAGE; - if (gl_info->limits.graphics_samplers >= MAX_COMBINED_SAMPLERS) + if (gl_info->limits.graphics_samplers >= WINED3D_MAX_COMBINED_SAMPLERS) { /* Initialize the texture unit mapping to a 1:1 mapping. */ unsigned int base, count; @@ -3407,7 +3407,7 @@ static void context_map_vsamplers(struct wined3d_context *context, BOOL ps, cons state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.resource_info; const struct wined3d_shader_resource_info *ps_resource_info = NULL; const struct wined3d_gl_info *gl_info = context->gl_info; - int start = min(MAX_COMBINED_SAMPLERS, gl_info->limits.graphics_samplers) - 1; + int start = min(WINED3D_MAX_COMBINED_SAMPLERS, gl_info->limits.graphics_samplers) - 1; int i;
/* Note that we only care if a resource is used or not, not the @@ -3457,7 +3457,7 @@ static void context_update_tex_unit_map(struct wined3d_context *context, const s * When the mapping of a stage is changed, sampler and ALL texture stage * states have to be reset. */
- if (gl_info->limits.graphics_samplers >= MAX_COMBINED_SAMPLERS) + if (gl_info->limits.graphics_samplers >= WINED3D_MAX_COMBINED_SAMPLERS) return;
if (ps) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 7e1c4ef0ec..3de29d5f94 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1397,7 +1397,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) /* Search for other stages the texture is bound to. Shouldn't * happen if applications bind textures to a single stage only. */ TRACE("Searching for other stages the texture is bound to.\n"); - for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { if (cs->state.textures[i] == prev) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 594a17ea16..f4cfad4be1 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3973,7 +3973,7 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
TRACE("device %p, num_passes %p.\n", device, num_passes);
- for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { if (state->sampler_states[i][WINED3D_SAMP_MIN_FILTER] == WINED3D_TEXF_NONE) { @@ -5231,7 +5231,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso case WINED3D_RTYPE_TEXTURE_1D: case WINED3D_RTYPE_TEXTURE_2D: case WINED3D_RTYPE_TEXTURE_3D: - for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { if (&device->state.textures[i]->resource == resource) { diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 420e51547d..0194917148 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -217,7 +217,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states, stateblock_set_bits(states->transform, HIGHEST_TRANSFORMSTATE + 1); stateblock_set_bits(states->renderState, WINEHIGHEST_RENDER_STATE + 1); for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) states->textureState[i] = 0x3ffff; - for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = 0x3ffe; + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = 0x3ffe; states->clipplane = (1u << MAX_CLIP_DISTANCES) - 1; states->pixelShaderConstantsB = 0xffff; states->pixelShaderConstantsI = 0xffff; @@ -249,7 +249,7 @@ static void stateblock_savedstates_set_pixel(struct wined3d_saved_states *states for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; for (i = 0; i < ARRAY_SIZE(pixel_states_sampler); ++i) sampler_mask |= 1u << pixel_states_sampler[i]; - for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; states->pixelShaderConstantsB = 0xffff; states->pixelShaderConstantsI = 0xffff;
@@ -276,7 +276,7 @@ static void stateblock_savedstates_set_vertex(struct wined3d_saved_states *state for (i = 0; i < WINED3D_MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; for (i = 0; i < ARRAY_SIZE(vertex_states_sampler); ++i) sampler_mask |= 1u << vertex_states_sampler[i]; - for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; states->vertexShaderConstantsB = 0xffff; states->vertexShaderConstantsI = 0xffff;
@@ -380,7 +380,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) } }
- for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { DWORD map = stateblock->changed.samplerState[i];
@@ -439,7 +439,7 @@ void state_unbind_resources(struct wined3d_state *state) wined3d_vertex_declaration_decref(decl); }
- for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { if ((texture = state->textures[i])) { @@ -562,7 +562,7 @@ void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) wined3d_shader_decref(shader); }
- for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { if ((texture = state->textures[i])) { @@ -1419,11 +1419,11 @@ 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[MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]) +static void init_default_sampler_states(DWORD states[WINED3D_MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]) { unsigned int i;
- for (i = 0 ; i < MAX_COMBINED_SAMPLERS; ++i) + for (i = 0 ; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i) { TRACE("Setting up default samplers states for sampler %u.\n", i); states[i][WINED3D_SAMP_ADDRESS_U] = WINED3D_TADDRESS_WRAP; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d9389a156b..074832633b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -262,7 +262,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup #define WINED3D_MAX_TEXTURES 8 #define WINED3D_MAX_FRAGMENT_SAMPLERS 16 #define WINED3D_MAX_VERTEX_SAMPLERS 4 -#define MAX_COMBINED_SAMPLERS (WINED3D_MAX_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS) +#define WINED3D_MAX_COMBINED_SAMPLERS (WINED3D_MAX_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS) #define MAX_ACTIVE_LIGHTS 8 #define MAX_CLIP_DISTANCES 8 #define MAX_CONSTANT_BUFFERS 15 @@ -1581,9 +1581,9 @@ enum wined3d_pipeline
/* + 1 because samplers start with 0 */ #define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(WINED3D_MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num)) -#define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1)) +#define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(WINED3D_MAX_COMBINED_SAMPLERS - 1))
-#define STATE_GRAPHICS_SHADER(a) (STATE_SAMPLER(MAX_COMBINED_SAMPLERS) + (a)) +#define STATE_GRAPHICS_SHADER(a) (STATE_SAMPLER(WINED3D_MAX_COMBINED_SAMPLERS) + (a)) #define STATE_IS_GRAPHICS_SHADER(a) \ ((a) >= STATE_GRAPHICS_SHADER(0) && (a) < STATE_GRAPHICS_SHADER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT))
@@ -1995,7 +1995,7 @@ struct wined3d_context
GLuint blit_vbo;
- DWORD tex_unit_map[MAX_COMBINED_SAMPLERS]; + DWORD tex_unit_map[WINED3D_MAX_COMBINED_SAMPLERS]; DWORD rev_tex_unit_map[MAX_GL_FRAGMENT_SAMPLERS + WINED3D_MAX_VERTEX_SAMPLERS];
/* Extension emulation */ @@ -2936,8 +2936,8 @@ struct wined3d_state struct wined3d_ivec4 ps_consts_i[WINED3D_MAX_CONSTS_I]; struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
- struct wined3d_texture *textures[MAX_COMBINED_SAMPLERS]; - DWORD sampler_states[MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; + 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];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1]; @@ -2998,8 +2998,8 @@ struct wined3d_stateblock_state DWORD rs[WINEHIGHEST_RENDER_STATE + 1]; struct wined3d_color blend_factor;
- struct wined3d_texture *textures[MAX_COMBINED_SAMPLERS]; - DWORD sampler_states[MAX_COMBINED_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1]; + 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];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1]; @@ -3572,7 +3572,7 @@ struct wined3d_saved_states WORD streamFreq; /* WINED3D_MAX_STREAMS, 16 */ DWORD renderState[(WINEHIGHEST_RENDER_STATE >> 5) + 1]; DWORD textureState[WINED3D_MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ - WORD samplerState[MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */ + WORD samplerState[WINED3D_MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */ DWORD clipplane; /* WINED3D_MAX_USER_CLIP_PLANES, 32 */ WORD pixelShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ WORD pixelShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */ @@ -3580,7 +3580,7 @@ struct wined3d_saved_states WORD vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ WORD vertexShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */ BOOL vs_consts_f[WINED3D_MAX_VS_CONSTS_F]; - DWORD textures : 20; /* MAX_COMBINED_SAMPLERS, 20 */ + DWORD textures : 20; /* WINED3D_MAX_COMBINED_SAMPLERS, 20 */ DWORD indices : 1; DWORD material : 1; DWORD viewport : 1; @@ -3625,7 +3625,7 @@ struct wined3d_stateblock unsigned int num_contained_ps_consts_f; struct StageState contained_tss_states[WINED3D_MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)]; unsigned int num_contained_tss_states; - struct StageState contained_sampler_states[MAX_COMBINED_SAMPLERS * WINED3D_HIGHEST_SAMPLER_STATE]; + struct StageState contained_sampler_states[WINED3D_MAX_COMBINED_SAMPLERS * WINED3D_HIGHEST_SAMPLER_STATE]; unsigned int num_contained_sampler_states; };
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com