Commit 6bf349fc authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Rename MAX_COMBINED_SAMPLERS to WINED3D_MAX_COMBINED_SAMPLERS.

parent 8a1e746f
......@@ -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)
......
......@@ -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)
{
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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 */
......@@ -2934,8 +2934,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];
......@@ -2996,8 +2996,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];
......@@ -3570,7 +3570,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 */
......@@ -3578,7 +3578,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;
......@@ -3623,7 +3623,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;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment