llvmpipe: add multisample support to texture allocator.

This adds a sample stride field and allocates enough memory for
each sample storage. Hook up the sample_stride field to draw
and jit textures and images

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
This commit is contained in:
Dave Airlie
2020-03-10 10:30:13 +10:00
committed by Marge Bot
parent 339aec7241
commit 1b02eb1a4c
5 changed files with 14 additions and 3 deletions

View File

@@ -76,6 +76,8 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
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
@@ -166,6 +168,9 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
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) {