diff options
author | Rob Clark <[email protected]> | 2019-07-22 14:23:52 -0700 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-07-24 21:11:06 +0000 |
commit | b4f476867238a5ce288b9295e9ec38250493f2c1 (patch) | |
tree | a5fbb42e7ecef9eda22ff7fc5892656005117402 /src/gallium | |
parent | 53730ab32cd539c2ccce6027f7b873ed65b675cd (diff) |
gallium/u_transfer_helper: fix assert in RGTC case
Previously we'd hit the unreachable() for uploading RGTC.
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_transfer_helper.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/gallium/auxiliary/util/u_transfer_helper.c b/src/gallium/auxiliary/util/u_transfer_helper.c index 033a49b14e2..f33d98b47a4 100644 --- a/src/gallium/auxiliary/util/u_transfer_helper.c +++ b/src/gallium/auxiliary/util/u_transfer_helper.c @@ -300,32 +300,33 @@ u_transfer_helper_transfer_map(struct pipe_context *pctx, unreachable("Unexpected format"); } } - } else if (needs_pack(usage) && - util_format_description(prsc->format)->layout == UTIL_FORMAT_LAYOUT_RGTC) { - switch (prsc->format) { - case PIPE_FORMAT_RGTC1_UNORM: - case PIPE_FORMAT_RGTC1_SNORM: - case PIPE_FORMAT_LATC1_UNORM: - case PIPE_FORMAT_LATC1_SNORM: - util_format_rgtc1_unorm_pack_rgba_8unorm(trans->staging, - ptrans->stride, - trans->ptr, - trans->trans->stride, - width, height); - break; - case PIPE_FORMAT_RGTC2_UNORM: - case PIPE_FORMAT_RGTC2_SNORM: - case PIPE_FORMAT_LATC2_UNORM: - case PIPE_FORMAT_LATC2_SNORM: - util_format_rgtc2_unorm_pack_rgba_8unorm(trans->staging, - ptrans->stride, - trans->ptr, - trans->trans->stride, - width, height); - break; - default: - assert(!"Unexpected format"); - break; + } else if (util_format_description(prsc->format)->layout == UTIL_FORMAT_LAYOUT_RGTC) { + if (needs_pack(usage)) { + switch (prsc->format) { + case PIPE_FORMAT_RGTC1_UNORM: + case PIPE_FORMAT_RGTC1_SNORM: + case PIPE_FORMAT_LATC1_UNORM: + case PIPE_FORMAT_LATC1_SNORM: + util_format_rgtc1_unorm_pack_rgba_8unorm(trans->staging, + ptrans->stride, + trans->ptr, + trans->trans->stride, + width, height); + break; + case PIPE_FORMAT_RGTC2_UNORM: + case PIPE_FORMAT_RGTC2_SNORM: + case PIPE_FORMAT_LATC2_UNORM: + case PIPE_FORMAT_LATC2_SNORM: + util_format_rgtc2_unorm_pack_rgba_8unorm(trans->staging, + ptrans->stride, + trans->ptr, + trans->trans->stride, + width, height); + break; + default: + assert(!"Unexpected format"); + break; + } } } else { unreachable("bleh"); |