renderer: validate layer stride isn't set for some texture types

Some texture types have no layers, so a non-zero layer stride makes
no sense.
macos/master
Dave Airlie 10 years ago
parent 1fe0822ff4
commit 20e86f1771
  1. 10
      src/vrend_renderer.c

@ -3683,6 +3683,16 @@ static bool check_iov_bounds(struct vrend_resource *res,
return false;
if (iovsize < info->offset + send_size)
return false;
/* layer stride only makes sense for 3d,cube and arrays */
if (info->layer_stride &&
(res->base.target != PIPE_TEXTURE_3D &&
res->base.target != PIPE_TEXTURE_CUBE &&
res->base.target != PIPE_TEXTURE_1D_ARRAY &&
res->base.target != PIPE_TEXTURE_2D_ARRAY &&
res->base.target != PIPE_TEXTURE_CUBE_ARRAY))
return false;
return true;
}

Loading…
Cancel
Save