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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user