26 vk::ImageLayout layout)
const {
27 const auto old_layout = layout_;
33 const vk::ImageLayout old_layout =
35 vk::ImageMemoryBarrier image_barrier;
36 image_barrier.srcAccessMask = barrier.
src_access;
37 image_barrier.dstAccessMask = barrier.
dst_access;
38 image_barrier.oldLayout = old_layout;
41 image_barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
42 image_barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
44 image_barrier.subresourceRange.baseMipLevel = barrier.
base_mip_level;
45 image_barrier.subresourceRange.levelCount =
47 image_barrier.subresourceRange.baseArrayLayer = 0u;
65 for (
auto& entry : frame_data_) {
66 if (entry.sample_count == sample_count && entry.mip_level == mip_level &&
67 entry.slice == slice) {
72 frame_data_.push_back({sample_count, mip_level, slice, data});
78 uint32_t slice)
const {
79 for (
const auto& entry : frame_data_) {
80 if (entry.sample_count == sample_count && entry.mip_level == mip_level &&
81 entry.slice == slice) {
TextureSourceVK(TextureDescriptor desc)
virtual std::shared_ptr< YUVConversionVK > GetYUVConversion() const
When sampling from textures whose formats are not known to Vulkan, a custom conversion is necessary t...
void SetCachedFrameData(const FramebufferAndRenderPass &data, SampleCount sample_count, uint32_t mip_level=0u, uint32_t slice=0u)
const TextureDescriptor & GetTextureDescriptor() const
Gets the texture descriptor for this image source.
FramebufferAndRenderPass GetCachedFrameData(SampleCount sample_count, uint32_t mip_level=0u, uint32_t slice=0u) const
virtual vk::Image GetImage() const =0
Get the image handle for this texture source.
virtual ~TextureSourceVK()
vk::ImageLayout GetLayout() const
Get the last layout assigned to the TextureSourceVK.
vk::ImageLayout SetLayoutWithoutEncoding(vk::ImageLayout layout) const
Store the layout of the image.
const TextureDescriptor desc_
fml::Status SetLayout(const BarrierVK &barrier) const
Encodes the layout transition barrier to barrier.cmd_buffer for the image.
std::optional< PipelineDescriptor > desc_
constexpr uint32_t ToArrayLayerCount(TextureType type)
constexpr vk::ImageAspectFlags ToImageAspectFlags(PixelFormat format)
Defines an operations and memory access barrier on a resource.
vk::CommandBuffer cmd_buffer
vk::AccessFlags src_access
vk::PipelineStageFlags dst_stage
vk::ImageLayout new_layout
vk::PipelineStageFlags src_stage
uint32_t base_mip_level
The base mip level to apply the barrier to in the subresource range.
vk::AccessFlags dst_access
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...