diff options
author | Marek Olšák <[email protected]> | 2012-07-08 00:23:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-09 13:57:59 +0200 |
commit | a460df9299dfeb7915689befc15155e18e41ddb8 (patch) | |
tree | 6f8d2388b794c79d880d4a1aa4142f946c00905e /src/gallium/drivers/r600/evergreen_state.c | |
parent | c1e8c845ea9c6f843cc5bba5974668c007799bbc (diff) |
r600g: add assertions after translate_colorswap/colorformat/dbformat/texformat
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 15727986ea8..939e05b06d8 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -983,8 +983,10 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte format = r600_translate_texformat(ctx->screen, state->format, swizzle, &word4, &yuv_format); + assert(format != ~0); if (format == ~0) { - format = 0; + FREE(view); + return NULL; } if (tmp->is_depth && !tmp->is_flushing_texture) { @@ -1415,7 +1417,11 @@ static void evergreen_cb(struct r600_context *rctx, struct r600_pipe_state *rsta } format = r600_translate_colorformat(surf->base.format); + assert(format != ~0); + swap = r600_translate_colorswap(surf->base.format); + assert(swap != ~0); + if (rtex->resource.b.b.usage == PIPE_USAGE_STAGING) { endian = ENDIAN_NONE; } else { @@ -1534,6 +1540,7 @@ static void evergreen_db(struct r600_context *rctx, struct r600_pipe_state *rsta rtex = (struct r600_resource_texture*)surf->base.texture; first_layer = surf->base.u.tex.first_layer; format = r600_translate_dbformat(surf->base.format); + assert(format != ~0); offset = r600_resource_va(rctx->context.screen, surf->base.texture); /* XXX remove this once tiling is properly supported */ |