wined3d: Rename MAX_TEXTURES to WINED3D_MAX_TEXTURES.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7561ded004
commit
0be165a7cd
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
@ -2753,7 +2753,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;
|
||||
|
@ -2822,13 +2822,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
|
||||
|
@ -2936,7 +2936,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];
|
||||
|
@ -2998,7 +2998,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];
|
||||
|
@ -3569,7 +3569,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 */
|
||||
|
@ -3621,7 +3621,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;
|
||||
|
|
Loading…
Reference in New Issue