55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "VideoFrame.hpp"
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
struct FeedTexture
|
|
{
|
|
VkBuffer stagingBuffer = VK_NULL_HANDLE;
|
|
VkDeviceMemory stagingBufferMemory = VK_NULL_HANDLE;
|
|
void* mappedData = nullptr;
|
|
|
|
VkImage image = VK_NULL_HANDLE;
|
|
VkDeviceMemory imageMemory = VK_NULL_HANDLE;
|
|
VkImageView imageView = VK_NULL_HANDLE;
|
|
VkSampler sampler = VK_NULL_HANDLE;
|
|
|
|
VkDescriptorSet descriptorSet = VK_NULL_HANDLE;
|
|
};
|
|
|
|
void createFeedTexture(
|
|
VkDevice device,
|
|
VkPhysicalDevice physicalDevice,
|
|
VkCommandPool commandPool,
|
|
VkQueue graphicsQueue,
|
|
const VideoFrame& initialFrame,
|
|
VkDeviceSize imageSize,
|
|
FeedTexture& texture);
|
|
|
|
void updateFeedDescriptorSet(
|
|
VkDevice device,
|
|
const FeedTexture& texture);
|
|
|
|
void updateSampledImageDescriptorSet(
|
|
VkDevice device,
|
|
VkDescriptorSet descriptorSet,
|
|
VkImageView imageView,
|
|
VkSampler sampler,
|
|
VkImageLayout imageLayout);
|
|
|
|
void copyFrameToFeedTextureStaging(
|
|
const VideoFrame& frame,
|
|
VkDeviceSize imageSize,
|
|
FeedTexture& texture);
|
|
|
|
void recordFeedTextureUpload(
|
|
VkCommandBuffer commandBuffer,
|
|
const FeedTexture& texture,
|
|
uint32_t width,
|
|
uint32_t height);
|
|
|
|
void destroyFeedTexture(
|
|
VkDevice device,
|
|
FeedTexture& texture);
|