if (ctx->vs)
pipe->delete_vs_state(pipe, ctx->vs);
- for (i = 0; i < Elements(ctx->fs); i++) {
- for (j = 0; j < Elements(ctx->fs[i]); j++) {
- for (k = 0; k < Elements(ctx->fs[i][j]); k++) {
+ for (i = 0; i < ARRAY_SIZE(ctx->fs); i++) {
+ for (j = 0; j < ARRAY_SIZE(ctx->fs[i]); j++) {
+ for (k = 0; k < ARRAY_SIZE(ctx->fs[i][j]); k++) {
if (ctx->fs[i][j][k])
pipe->delete_fs_state(pipe, ctx->fs[i][j][k]);
}
for (j = 0; j < 2; j++)
pipe->delete_blend_state(pipe, ctx->blend[i][j]);
- for (i = 0; i < Elements(ctx->blend_clear); i++) {
+ for (i = 0; i < ARRAY_SIZE(ctx->blend_clear); i++) {
if (ctx->blend_clear[i])
pipe->delete_blend_state(pipe, ctx->blend_clear[i]);
}
if (ctx->fs_texfetch_stencil_msaa[i])
ctx->delete_fs_state(pipe, ctx->fs_texfetch_stencil_msaa[i]);
- for (j = 0; j< Elements(ctx->fs_resolve[i]); j++)
+ for (j = 0; j< ARRAY_SIZE(ctx->fs_resolve[i]); j++)
for (f = 0; f < 2; f++)
if (ctx->fs_resolve[i][j][f])
ctx->delete_fs_state(pipe, ctx->fs_resolve[i][j][f]);
- for (j = 0; j< Elements(ctx->fs_resolve_sint[i]); j++)
+ for (j = 0; j< ARRAY_SIZE(ctx->fs_resolve_sint[i]); j++)
for (f = 0; f < 2; f++)
if (ctx->fs_resolve_sint[i][j][f])
ctx->delete_fs_state(pipe, ctx->fs_resolve_sint[i][j][f]);
- for (j = 0; j< Elements(ctx->fs_resolve_uint[i]); j++)
+ for (j = 0; j< ARRAY_SIZE(ctx->fs_resolve_uint[i]); j++)
for (f = 0; f < 2; f++)
if (ctx->fs_resolve_uint[i][j][f])
ctx->delete_fs_state(pipe, ctx->fs_resolve_uint[i][j][f]);
util_dump_##_name(unsigned value, boolean shortened) \
{ \
if(shortened) \
- return util_dump_enum_continuous(value, Elements(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
else \
- return util_dump_enum_continuous(value, Elements(util_dump_##_name##_names), util_dump_##_name##_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_names), util_dump_##_name##_names); \
}
const char * \
util_dump_##_name(unsigned value, boolean shortened) \
{ \
- STATIC_ASSERT(Elements(util_dump_##_name##_names) == _count); \
- STATIC_ASSERT(Elements(util_dump_##_name##_short_names) == _count); \
+ STATIC_ASSERT(ARRAY_SIZE(util_dump_##_name##_names) == _count); \
+ STATIC_ASSERT(ARRAY_SIZE(util_dump_##_name##_short_names) == _count); \
if(shortened) \
- return util_dump_enum_continuous(value, Elements(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
else \
- return util_dump_enum_continuous(value, Elements(util_dump_##_name##_names), util_dump_##_name##_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_names), util_dump_##_name##_names); \
}
util_dump_struct_begin(stream, "pipe_stream_output_info");
util_dump_member(stream, uint, &state->stream_output, num_outputs);
util_dump_array(stream, uint, state->stream_output.stride,
- Elements(state->stream_output.stride));
+ ARRAY_SIZE(state->stream_output.stride));
util_dump_array_begin(stream);
for(i = 0; i < state->stream_output.num_outputs; ++i) {
util_dump_elem_begin(stream);
util_dump_member_begin(stream, "stencil");
util_dump_array_begin(stream);
- for(i = 0; i < Elements(state->stencil); ++i) {
+ for(i = 0; i < ARRAY_SIZE(state->stencil); ++i) {
util_dump_elem_begin(stream);
util_dump_struct_begin(stream, "pipe_stencil_state");
util_dump_member(stream, bool, &state->stencil[i], enabled);
};
-const unsigned util_format_nr_test_cases = Elements(util_format_test_cases);
+const unsigned util_format_nr_test_cases = ARRAY_SIZE(util_format_test_cases);
pipe_surface_reference(&dst->cbufs[i], src->cbufs[i]);
/* Set remaining dest cbuf pointers to NULL */
- for ( ; i < Elements(dst->cbufs); i++)
+ for ( ; i < ARRAY_SIZE(dst->cbufs); i++)
pipe_surface_reference(&dst->cbufs[i], NULL);
dst->nr_cbufs = src->nr_cbufs;
struct tgsi_token tokens[1000];
struct pipe_shader_state state = {tokens};
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
struct tgsi_token tokens[1000];
struct pipe_shader_state state = {tokens};
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
struct tgsi_token tokens[1000];
struct pipe_shader_state state = {tokens};
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
tgsi_semantic_names[input_semantic],
tgsi_interpolate_names[input_interpolate]);
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
sprintf(text, shader_templ, type, samp_type,
output_semantic, output_mask, type);
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
puts(text);
assert(0);
return NULL;
sprintf(text, shader_templ, type, type, type);
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
struct tgsi_token tokens[1000];
struct pipe_shader_state state = {tokens};
- if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
puts("Can't compile a fragment shader.");
util_report_result(FAIL);
return;
for (i = 0; i < PIPE_FORMAT_COUNT; i++)
caps->format_translation[i] = i;
- for (i = 0; i < Elements(vbuf_format_fallbacks); i++) {
+ for (i = 0; i < ARRAY_SIZE(vbuf_format_fallbacks); i++) {
enum pipe_format format = vbuf_format_fallbacks[i].from;
if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0,