vulkan: Add premultiply step to texture upload
authorBenjamin Otte <otte@redhat.com>
Wed, 19 Jul 2023 04:14:55 +0000 (06:14 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 19 Jul 2023 19:30:35 +0000 (21:30 +0200)
commit4d9e7d30b00fb0bf33968781276533c178e38ab0
treeafd78f70d202f32988294010a5b22795abca9c19
parent65224f4533c90efe37735809f878ed39810841f8
vulkan: Add premultiply step to texture upload

When a GdkMemoryFormat is not supported natively and there's
postprocessing required, add a way to mark a VulkanImage as such via the
new postprocess flags.

Also allow texting such iamges only with new_for_upload() and detect
when that is the case and then run a postprocessing step that converts
that image to a suitable format.
This is done with a new "convert" shader/op.

This now supports all formats natively, no conversions happen on the CPU
anymore (unless the GPU is old).
gsk/meson.build
gsk/vulkan/gskvulkanconvertop.c [new file with mode: 0644]
gsk/vulkan/gskvulkanconvertopprivate.h [new file with mode: 0644]
gsk/vulkan/gskvulkanimage.c
gsk/vulkan/gskvulkanimageprivate.h
gsk/vulkan/gskvulkanrenderpass.c
gsk/vulkan/gskvulkanuploadop.c
gsk/vulkan/resources/convert.frag [new file with mode: 0644]
gsk/vulkan/resources/convert.vert [new file with mode: 0644]
gsk/vulkan/resources/meson.build