54 VkImage vk_image_ = VK_NULL_HANDLE;
55 VmaAllocation allocation_ = VK_NULL_HANDLE;
56 VmaAllocationInfo allocation_info_ = {};
64 int layer_offset_ = 0;
65 bool use_stencil_ =
false;
67 char swizzle_[4] = {
'r',
'g',
'b',
'a'};
71 {{
'r',
'g',
'b',
'a'}},
81 void generate_mipmap()
override;
82 void copy_to(
Texture *tex)
override;
83 void copy_to(
VKTexture &dst_texture, VkImageAspectFlags vk_image_aspect);
88 std::optional<int> layer);
89 void swizzle_set(
const char swizzle_mask[4])
override;
90 void mip_range_set(
int min,
int max)
override;
94 void update_sub(
int mip,
103 void update_sub(
int offset[3],
106 GPUPixelBuffer *pixbuf)
override;
114 VKMemoryExport export_memory(VkExternalMemoryHandleTypeFlagBits handle_type);
118 if (is_texture_view()) {
119 return source_texture_->vk_image_handle();
130 return device_format_;
145 bool init_internal()
override;
146 bool init_internal(
VertBuf *vbo)
override;
150 bool use_stencil)
override;
152 void init_swapchain(VkImage vk_image,
TextureFormat gpu_format);
156 bool is_texture_view()
const;
168 int vk_layer_count(
int non_layered_value)
const;
173 VkExtent3D vk_extent_3d(
int mip_level)
const;
Texture(const char *name)
friend class VKDescriptorSetUpdator
TextureFormat device_format_get() const
VkImage vk_image_handle() const
VKTexture(const char *name)