jit_image->row_stride = lp_res->row_stride[image->u.tex.level];
jit_image->img_stride = lp_res->img_stride[image->u.tex.level];
- jit_image->sample_stride = 0;
+ jit_image->sample_stride = lp_res->sample_stride;
jit_image->base = (uint8_t *)jit_image->base + mip_offset;
}
else {
jit_tex->img_stride[j] = lp_tex->img_stride[j];
}
+ jit_tex->sample_stride = lp_tex->sample_stride;
+
if (res->target == PIPE_TEXTURE_1D_ARRAY ||
res->target == PIPE_TEXTURE_2D_ARRAY ||
res->target == PIPE_TEXTURE_CUBE ||
jit_tex->row_stride[j] = lp_tex->row_stride[j];
jit_tex->img_stride[j] = lp_tex->img_stride[j];
}
+ jit_tex->sample_stride = lp_tex->sample_stride;
if (res->target == PIPE_TEXTURE_1D_ARRAY ||
res->target == PIPE_TEXTURE_2D_ARRAY ||
jit_image->row_stride = lp_res->row_stride[image->u.tex.level];
jit_image->img_stride = lp_res->img_stride[image->u.tex.level];
- jit_image->sample_stride = 0;
+ jit_image->sample_stride = lp_res->sample_stride;
jit_image->base = (uint8_t *)jit_image->base + mip_offset;
} else {
unsigned view_blocksize = util_format_get_blocksize(image->format);
assert(last_level <= res->last_level);
addr = lp_tex->tex_data;
+ sample_stride = lp_tex->sample_stride;
+
for (j = first_level; j <= last_level; j++) {
mip_offsets[j] = lp_tex->mip_offsets[j];
row_stride[j] = lp_tex->row_stride[j];
row_stride = lp_img->row_stride[view->u.tex.level];
img_stride = lp_img->img_stride[view->u.tex.level];
- sample_stride = 0;
+ sample_stride = lp_img->sample_stride;
addr = (uint8_t *)addr + mip_offset;
}
else {
unsigned depth = pt->depth0;
uint64_t total_size = 0;
unsigned layers = pt->array_size;
+ unsigned num_samples = util_res_sample_count(pt);
+
/* XXX:
* This alignment here (same for displaytarget) was added for the purpose of
* ARB_map_buffer_alignment. I am not convinced it's needed for non-buffer
depth = u_minify(depth, 1);
}
+ lpr->sample_stride = total_size;
+ total_size *= num_samples;
+
if (allocate) {
lpr->tex_data = align_malloc(total_size, mip_align);
if (!lpr->tex_data) {
unsigned id; /**< temporary, for debugging */
+ unsigned sample_stride;
#ifdef DEBUG
/** for linked list */
struct llvmpipe_resource *prev, *next;