mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 10:00:36 +02:00
softpipe: minor code simplification for face/zslice offset calculation
This commit is contained in:
parent
192b7f20eb
commit
981b7c08ae
1 changed files with 10 additions and 7 deletions
|
|
@ -243,9 +243,11 @@ softpipe_get_tex_surface(struct pipe_screen *screen,
|
|||
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);
|
||||
|
|
@ -308,10 +310,11 @@ softpipe_get_tex_transfer(struct pipe_screen *screen,
|
|||
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue