2023-10-03 19:04:21 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "gskvulkandescriptorsprivate.h"
|
|
|
|
|
2023-11-04 05:11:27 +00:00
|
|
|
#include "gskvulkanbufferprivate.h"
|
2023-10-03 19:04:21 +00:00
|
|
|
#include "gskvulkanframeprivate.h"
|
|
|
|
#include "gskvulkanimageprivate.h"
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GskVulkanDescriptors, gsk_vulkan_descriptors, GSK_TYPE_GPU_DESCRIPTORS)
|
|
|
|
|
|
|
|
static void
|
|
|
|
gsk_vulkan_descriptors_class_init (GskVulkanDescriptorsClass *klass)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gsk_vulkan_descriptors_init (GskVulkanDescriptors *self)
|
|
|
|
{
|
2023-11-04 05:11:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GskVulkanPipelineLayout *
|
|
|
|
gsk_vulkan_descriptors_get_pipeline_layout (GskVulkanDescriptors *self)
|
|
|
|
{
|
2023-11-05 09:00:11 +00:00
|
|
|
return GSK_VULKAN_DESCRIPTORS_GET_CLASS (self)->get_pipeline_layout (self);
|
2023-10-03 19:04:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gsk_vulkan_descriptors_transition (GskVulkanDescriptors *self,
|
2023-11-29 22:14:00 +00:00
|
|
|
GskVulkanSemaphores *semaphores,
|
2023-11-05 09:00:11 +00:00
|
|
|
VkCommandBuffer vk_command_buffer)
|
2023-10-03 19:04:21 +00:00
|
|
|
{
|
|
|
|
GskGpuDescriptors *desc = GSK_GPU_DESCRIPTORS (self);
|
|
|
|
gsize i;
|
|
|
|
|
2023-11-19 14:40:55 +00:00
|
|
|
for (i = 0; i < gsk_gpu_descriptors_get_n_images (desc); i++)
|
2023-10-03 19:04:21 +00:00
|
|
|
{
|
|
|
|
gsk_vulkan_image_transition (GSK_VULKAN_IMAGE (gsk_gpu_descriptors_get_image (desc, i)),
|
2023-11-29 22:14:00 +00:00
|
|
|
semaphores,
|
2023-11-05 09:00:11 +00:00
|
|
|
vk_command_buffer,
|
2023-10-03 19:04:21 +00:00
|
|
|
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
|
|
|
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
|
|
|
VK_ACCESS_SHADER_READ_BIT);
|
|
|
|
}
|
|
|
|
}
|
2023-11-04 05:11:27 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
gsk_vulkan_descriptors_bind (GskVulkanDescriptors *self,
|
2023-11-05 09:00:11 +00:00
|
|
|
GskVulkanDescriptors *previous,
|
2023-11-04 05:11:27 +00:00
|
|
|
VkCommandBuffer vk_command_buffer)
|
|
|
|
{
|
2023-11-05 09:00:11 +00:00
|
|
|
return GSK_VULKAN_DESCRIPTORS_GET_CLASS (self)->bind (self, previous, vk_command_buffer);
|
2023-11-04 05:11:27 +00:00
|
|
|
}
|