vulkan: Add a new way to upload data into images
authorBenjamin Otte <otte@redhat.com>
Wed, 14 Jun 2023 00:08:17 +0000 (02:08 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 14 Jun 2023 01:34:07 +0000 (03:34 +0200)
commit0c72f19cb1c16bc6affb7e85ed17db94ad3a64df
tree2cc705116cb647adcc92c03da99adefbc98d866e
parentcb4e92946b4684f21388872dd961507cefe42638
vulkan: Add a new way to upload data into images

As an alternative to gsk_vulkan_image_new_from_data() that
takes a given data and creates an image from it, add a 3 step process:
  gsk_vulkan_image_new_for_upload()
  gsk_vulkan_image_map_memory()
  /* put data into memory */
  gsk_vulkan_image_unmap_memory()

The benefit of this approach is that it potentially avoids a copy;
instead of creating a buffer to pass and writing the data into it before
then memcpy()ing it into the image, the data can be written straight
into image memory.

So far, only the staging buffer upload is implemented.

There are also no users, those come in the next commit(s).
gsk/vulkan/gskvulkanimage.c
gsk/vulkan/gskvulkanimageprivate.h