Commit 076697e3 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename MAX_CONST_B to WINED3D_MAX_CONSTS_B.

parent 228c0608
......@@ -4563,7 +4563,7 @@ static void find_arb_ps_compile_args(const struct wined3d_state *state,
/* This forces all local boolean constants to 1 to make them stateblock independent */
args->bools = shader->reg_maps.local_bool_consts;
for(i = 0; i < MAX_CONST_B; i++)
for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
{
if (state->ps_consts_b[i])
args->bools |= ( 1u << i);
......@@ -4645,7 +4645,7 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state,
/* This forces all local boolean constants to 1 to make them stateblock independent */
args->clip.boolclip.bools = shader->reg_maps.local_bool_consts;
/* TODO: Figure out if it would be better to store bool constants as bitmasks in the stateblock */
for(i = 0; i < MAX_CONST_B; i++)
for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
{
if (state->vs_consts_b[i])
args->clip.boolclip.bools |= (1u << i);
......
......@@ -2376,13 +2376,13 @@ static void device_invalidate_shader_constants(const struct wined3d_device *devi
HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
UINT start_register, const BOOL *constants, UINT bool_count)
{
UINT count = min(bool_count, MAX_CONST_B - start_register);
UINT count = min(bool_count, WINED3D_MAX_CONSTS_B - start_register);
UINT i;
TRACE("device %p, start_register %u, constants %p, bool_count %u.\n",
device, start_register, constants, bool_count);
if (!constants || start_register >= MAX_CONST_B)
if (!constants || start_register >= WINED3D_MAX_CONSTS_B)
return WINED3DERR_INVALIDCALL;
memcpy(&device->update_state->vs_consts_b[start_register], constants, count * sizeof(BOOL));
......@@ -2405,12 +2405,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
HRESULT CDECL wined3d_device_get_vs_consts_b(const struct wined3d_device *device,
UINT start_register, BOOL *constants, UINT bool_count)
{
UINT count = min(bool_count, MAX_CONST_B - start_register);
UINT count = min(bool_count, WINED3D_MAX_CONSTS_B - start_register);
TRACE("device %p, start_register %u, constants %p, bool_count %u.\n",
device, start_register, constants, bool_count);
if (!constants || start_register >= MAX_CONST_B)
if (!constants || start_register >= WINED3D_MAX_CONSTS_B)
return WINED3DERR_INVALIDCALL;
memcpy(constants, &device->state.vs_consts_b[start_register], count * sizeof(BOOL));
......@@ -2605,13 +2605,13 @@ struct wined3d_sampler * CDECL wined3d_device_get_ps_sampler(const struct wined3
HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device,
UINT start_register, const BOOL *constants, UINT bool_count)
{
UINT count = min(bool_count, MAX_CONST_B - start_register);
UINT count = min(bool_count, WINED3D_MAX_CONSTS_B - start_register);
UINT i;
TRACE("device %p, start_register %u, constants %p, bool_count %u.\n",
device, start_register, constants, bool_count);
if (!constants || start_register >= MAX_CONST_B)
if (!constants || start_register >= WINED3D_MAX_CONSTS_B)
return WINED3DERR_INVALIDCALL;
memcpy(&device->update_state->ps_consts_b[start_register], constants, count * sizeof(BOOL));
......@@ -2634,12 +2634,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device,
HRESULT CDECL wined3d_device_get_ps_consts_b(const struct wined3d_device *device,
UINT start_register, BOOL *constants, UINT bool_count)
{
UINT count = min(bool_count, MAX_CONST_B - start_register);
UINT count = min(bool_count, WINED3D_MAX_CONSTS_B - start_register);
TRACE("device %p, start_register %u, constants %p, bool_count %u.\n",
device, start_register, constants, bool_count);
if (!constants || start_register >= MAX_CONST_B)
if (!constants || start_register >= WINED3D_MAX_CONSTS_B)
return WINED3DERR_INVALIDCALL;
memcpy(constants, &device->state.ps_consts_b[start_register], count * sizeof(BOOL));
......
......@@ -119,7 +119,7 @@ struct glsl_vs_program
GLenum vertex_color_clamp;
GLint uniform_f_locations[WINED3D_MAX_VS_CONSTS_F];
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I];
GLint uniform_b_locations[MAX_CONST_B];
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B];
GLint pos_fixup_location;
GLint modelview_matrix_location[MAX_VERTEX_BLENDS];
......@@ -167,7 +167,7 @@ struct glsl_ps_program
GLuint id;
GLint uniform_f_locations[WINED3D_MAX_PS_CONSTS_F];
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I];
GLint uniform_b_locations[MAX_CONST_B];
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];
......@@ -759,7 +759,7 @@ static void shader_glsl_load_constants_i(const struct wined3d_shader *shader, co
/* Context activation is done by the caller. */
static void shader_glsl_load_constantsB(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info,
const GLint locations[MAX_CONST_B], const BOOL *constants, WORD constants_set)
const GLint locations[WINED3D_MAX_CONSTS_B], const BOOL *constants, WORD constants_set)
{
unsigned int i;
struct list* ptr;
......@@ -7026,7 +7026,7 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
vs->uniform_i_locations[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
}
for (i = 0; i < MAX_CONST_B; ++i)
for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
{
string_buffer_sprintf(name, "vs_b[%u]", i);
vs->uniform_b_locations[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
......@@ -7108,7 +7108,7 @@ static void shader_glsl_init_ps_uniform_locations(const struct wined3d_gl_info *
ps->uniform_i_locations[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
}
for (i = 0; i < MAX_CONST_B; ++i)
for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
{
string_buffer_sprintf(name, "ps_b[%u]", i);
ps->uniform_b_locations[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
......
......@@ -330,7 +330,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock)
}
}
for (i = 0; i < MAX_CONST_B; ++i)
for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
{
if (stateblock->changed.vertexShaderConstantsB & (1u << i))
{
......@@ -357,7 +357,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock)
}
}
for (i = 0; i < MAX_CONST_B; ++i)
for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
{
if (stateblock->changed.pixelShaderConstantsB & (1u << i))
{
......
......@@ -510,8 +510,8 @@ enum wined3d_shader_rel_op
#define MAX_REG_TEXCRD 8
#define MAX_REG_INPUT 32
#define MAX_REG_OUTPUT 32
#define MAX_CONST_B 16
#define WINED3D_MAX_CBS 15
#define WINED3D_MAX_CONSTS_B 16
#define WINED3D_MAX_CONSTS_I 16
#define WINED3D_MAX_VS_CONSTS_F 256
#define WINED3D_MAX_PS_CONSTS_F 224
......@@ -763,9 +763,9 @@ struct wined3d_shader_reg_maps
DWORD input_registers; /* max(MAX_REG_INPUT, MAX_ATTRIBS), 32 */
DWORD output_registers; /* MAX_REG_OUTPUT, 32 */
WORD integer_constants; /* WINED3D_MAX_CONSTS_I, 16 */
WORD boolean_constants; /* MAX_CONST_B, 16 */
WORD boolean_constants; /* WINED3D_MAX_CONSTS_B, 16 */
WORD local_int_consts; /* WINED3D_MAX_CONSTS_I, 16 */
WORD local_bool_consts; /* MAX_CONST_B, 16 */
WORD local_bool_consts; /* WINED3D_MAX_CONSTS_B, 16 */
UINT cb_sizes[WINED3D_MAX_CBS];
struct wined3d_shader_resource_info resource_info[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)];
......@@ -2212,11 +2212,11 @@ struct wined3d_state
struct wined3d_sampler *sampler[WINED3D_SHADER_TYPE_COUNT][MAX_SAMPLER_OBJECTS];
struct wined3d_shader_resource_view *shader_resource_view[WINED3D_SHADER_TYPE_COUNT][MAX_SHADER_RESOURCE_VIEWS];
BOOL vs_consts_b[MAX_CONST_B];
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
struct wined3d_vec4 vs_consts_f[WINED3D_MAX_VS_CONSTS_F];
BOOL ps_consts_b[MAX_CONST_B];
BOOL ps_consts_b[WINED3D_MAX_CONSTS_B];
struct wined3d_ivec4 ps_consts_i[WINED3D_MAX_CONSTS_I];
struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
......@@ -2774,10 +2774,10 @@ struct wined3d_saved_states
DWORD textureState[MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */
WORD samplerState[MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */
DWORD clipplane; /* WINED3DMAXUSERCLIPPLANES, 32 */
WORD pixelShaderConstantsB; /* MAX_CONST_B, 16 */
WORD pixelShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */
WORD pixelShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */
BOOL ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
WORD vertexShaderConstantsB; /* MAX_CONST_B, 16 */
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 */
......@@ -2813,13 +2813,13 @@ struct wined3d_stateblock
unsigned int num_contained_transform_states;
DWORD contained_vs_consts_i[WINED3D_MAX_CONSTS_I];
unsigned int num_contained_vs_consts_i;
DWORD contained_vs_consts_b[MAX_CONST_B];
DWORD contained_vs_consts_b[WINED3D_MAX_CONSTS_B];
unsigned int num_contained_vs_consts_b;
DWORD contained_vs_consts_f[WINED3D_MAX_VS_CONSTS_F];
unsigned int num_contained_vs_consts_f;
DWORD contained_ps_consts_i[WINED3D_MAX_CONSTS_I];
unsigned int num_contained_ps_consts_i;
DWORD contained_ps_consts_b[MAX_CONST_B];
DWORD contained_ps_consts_b[WINED3D_MAX_CONSTS_B];
unsigned int num_contained_ps_consts_b;
DWORD contained_ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
unsigned int num_contained_ps_consts_f;
......
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