ps->level = level;
ps->zslice = zslice;
- if (pt->target == PIPE_TEXTURE_CUBE || pt->target == PIPE_TEXTURE_3D) {
- ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) *
- pt->nblocksy[level] * spt->stride[level];
+ if (pt->target == PIPE_TEXTURE_CUBE) {
+ ps->offset += face * pt->nblocksy[level] * spt->stride[level];
+ }
+ else if (pt->target == PIPE_TEXTURE_3D) {
+ ps->offset += zslice * pt->nblocksy[level] * spt->stride[level];
}
else {
assert(face == 0);
spt->offset = sptex->level_offset[level];
- if (texture->target == PIPE_TEXTURE_CUBE ||
- texture->target == PIPE_TEXTURE_3D) {
- spt->offset += ((texture->target == PIPE_TEXTURE_CUBE) ? face :
- zslice) * pt->nblocksy * pt->stride;
+ if (texture->target == PIPE_TEXTURE_CUBE) {
+ spt->offset += face * pt->nblocksy * pt->stride;
+ }
+ else if (texture->target == PIPE_TEXTURE_3D) {
+ spt->offset += zslice * pt->nblocksy * pt->stride;
}
else {
assert(face == 0);