render/vulkan: Fix 3dlut stage span map offset

The mapping is shared between all users of the stage span, so it should
always map the whole thing and apply the allocation offset to the mapped
pointer.
master
Kenny Levinsen 6 months ago committed by Simon Ser
parent 6da71b6a89
commit bf0246e50c

@ -823,14 +823,14 @@ static bool create_3d_lut_image(struct wlr_vk_renderer *renderer,
}
if (!span.buffer->cpu_mapping) {
res = vkMapMemory(dev, span.buffer->memory, span.alloc.start, size, 0, &span.buffer->cpu_mapping);
res = vkMapMemory(dev, span.buffer->memory, 0, VK_WHOLE_SIZE, 0, &span.buffer->cpu_mapping);
if (res != VK_SUCCESS) {
wlr_vk_error("vkMapMemory", res);
goto fail_imageview;
}
}
float *dst = span.buffer->cpu_mapping;
char *map = (char*)span.buffer->cpu_mapping + span.alloc.start;
float *dst = (float*)map;
size_t dim_len = lut_3d->dim_len;
for (size_t b_index = 0; b_index < dim_len; b_index++) {
for (size_t g_index = 0; g_index < dim_len; g_index++) {

Loading…
Cancel
Save