if (dst->texture->format != src->texture->format) {
debug_printf("r300: Implementation error: Format mismatch in %s\n"
" : src: %s dst: %s\n", __FUNCTION__,
- util_format_name(src->texture->format),
- util_format_name(dst->texture->format));
+ util_format_short_name(src->texture->format),
+ util_format_short_name(dst->texture->format));
debug_assert(0);
}
old_format, src->texture->target,
PIPE_BIND_RENDER_TARGET |
PIPE_BIND_SAMPLER_VIEW, 0) &&
- util_format_description(old_format)->layout == UTIL_FORMAT_LAYOUT_PLAIN) {
+ util_format_is_plain(old_format)) {
switch (util_format_get_blocksize(old_format)) {
case 1:
new_format = PIPE_FORMAT_I8_UNORM;
default:
debug_printf("r300: surface_copy: Unhandled format: %s. Falling back to software.\n"
"r300: surface_copy: Software fallback doesn't work for tiled textures.\n",
- util_format_name(old_format));
+ util_format_short_name(old_format));
}
}
desc = util_format_description(format);
if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
- fprintf(stderr, "r300: Bad format %s in %s:%d\n", util_format_name(format),
+ fprintf(stderr, "r300: Bad format %s in %s:%d\n", util_format_short_name(format),
__FUNCTION__, __LINE__);
assert(0);
abort();
break;
default:
fprintf(stderr, "r300: Bad format %s in %s:%d\n",
- util_format_name(format), __FUNCTION__, __LINE__);
+ util_format_short_name(format), __FUNCTION__, __LINE__);
assert(0);
abort();
}
break;
default:
fprintf(stderr, "r300: Bad format %s in %s:%d\n",
- util_format_name(format), __FUNCTION__, __LINE__);
+ util_format_short_name(format), __FUNCTION__, __LINE__);
fprintf(stderr, "r300: desc->channel[0].size == %d\n",
desc->channel[0].size);
assert(0);
break;
default:
fprintf(stderr, "r300: Bad format %s in %s:%d\n",
- util_format_name(format), __FUNCTION__, __LINE__);
+ util_format_short_name(format), __FUNCTION__, __LINE__);
assert(0);
abort();
}
if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
fprintf(stderr, "r300: Bad format %s in %s:%d\n",
- util_format_name(format), __FUNCTION__, __LINE__);
+ util_format_short_name(format), __FUNCTION__, __LINE__);
return 0;
}
{{ 2, 1}, {0, 0}, {0, 0}} /* 128 bits per pixel */
};
-/* Return true for non-compressed and non-YUV formats. */
-static boolean r300_format_is_plain(enum pipe_format format)
-{
- const struct util_format_description *desc = util_format_description(format);
-
- if (!format) {
- return FALSE;
- }
-
- return desc->layout == UTIL_FORMAT_LAYOUT_PLAIN;
-}
-
/* Translate a pipe_format into a useful texture format for sampling.
*
* Some special formats are translated directly using R300_EASY_TX_FORMAT,
struct r300_screen *r300screen = r300_screen(screen);
SCREEN_DBG(r300screen, DBG_TEX, "r300: texture_reinterpret_format: %s -> %s\n",
- util_format_name(tex->format), util_format_name(new_format));
+ util_format_short_name(tex->format), util_format_short_name(new_format));
tex->format = new_format;
width = u_minify(tex->b.b.width0, level);
- if (r300_format_is_plain(tex->b.b.format)) {
+ if (util_format_is_plain(tex->b.b.format)) {
tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH,
tex->mip_macrotile[level]);
width = align(width, tile_width);
height = u_minify(tex->b.b.height0, level);
- if (r300_format_is_plain(tex->b.b.format)) {
+ if (util_format_is_plain(tex->b.b.format)) {
tile_height = r300_texture_get_tile_size(tex, TILE_HEIGHT,
tex->mip_macrotile[level]);
height = align(height, tile_height);
boolean rv350_mode = screen->caps.is_rv350;
SCREEN_DBG(screen, DBG_TEXALLOC, "r300: Making miptree for texture, format %s\n",
- util_format_name(base->format));
+ util_format_short_name(base->format));
for (i = 0; i <= base->last_level; i++) {
/* Let's see if this miplevel can be macrotiled. */
boolean is_zb = util_format_is_depth_or_stencil(format);
boolean dbg_no_tiling = SCREEN_DBG_ON(r300_screen(screen), DBG_NO_TILING);
- if (!r300_format_is_plain(format)) {
+ if (!util_format_is_plain(format)) {
return;
}
tex->microtile ? "YES" : " NO",
tex->hwpitch[0],
base->width0, base->height0, base->depth0, base->last_level,
- util_format_name(base->format));
+ util_format_short_name(base->format));
tex->buffer = rws->buffer_create(rws, 2048,
PIPE_BIND_SAMPLER_VIEW, /* XXX */
tex->microtile ? "YES" : " NO",
stride / util_format_get_blocksize(base->format),
base->width0, base->height0,
- util_format_name(base->format));
+ util_format_short_name(base->format));
/* Enforce microtiled zbuffer. */
override_zb_flags = util_format_is_depth_or_stencil(base->format) &&