diff options
author | Brian Paul <[email protected]> | 2014-09-29 10:15:28 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2014-09-30 12:08:49 -0600 |
commit | 3d77b80d80d3a85930ca0011a1d4f97578a36477 (patch) | |
tree | fd3283b853bc18999814f75c6a9dd7b3be4e0f41 /src | |
parent | 8269bfdb8341f58c7c73671677f31076f42be22e (diff) |
llvmpipe: remove special case for PIPE_TEXTURE_CUBE in llvmpipe_texture_layout()
layers (aka array_size) should be 6 for cube textures so we don't need
to special-case it. But add an assertion just to be safe.
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_texture.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index ba0e7f8b5b8..a7d7ad48619 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -132,12 +132,15 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen, lpr->img_stride[level] = lpr->row_stride[level] * nblocksy; /* Number of 3D image slices, cube faces or texture array layers */ - if (lpr->base.target == PIPE_TEXTURE_CUBE) - num_slices = 6; - else if (lpr->base.target == PIPE_TEXTURE_3D) + if (lpr->base.target == PIPE_TEXTURE_CUBE) { + assert(layers == 6); + } + + if (lpr->base.target == PIPE_TEXTURE_3D) num_slices = depth; else if (lpr->base.target == PIPE_TEXTURE_1D_ARRAY || lpr->base.target == PIPE_TEXTURE_2D_ARRAY || + lpr->base.target == PIPE_TEXTURE_CUBE || lpr->base.target == PIPE_TEXTURE_CUBE_ARRAY) num_slices = layers; else |