|
Blender V5.0
|
#include <vk_texture.hh>
Inherits blender::gpu::Texture.
Public Member Functions | |
| VKTexture (const char *name) | |
| virtual | ~VKTexture () override |
| void | generate_mipmap () override |
| void | copy_to (Texture *tex) override |
| void | copy_to (VKTexture &dst_texture, VkImageAspectFlags vk_image_aspect) |
| void | clear (eGPUDataFormat format, const void *data) override |
| void | clear_depth_stencil (const GPUFrameBufferBits buffer, float clear_depth, uint clear_stencil, std::optional< int > layer) |
| void | swizzle_set (const char swizzle_mask[4]) override |
| void | mip_range_set (int min, int max) override |
| void * | read (int mip, eGPUDataFormat format) override |
| void | read_sub (int mip, eGPUDataFormat format, const int region[6], IndexRange layers, void *r_data) |
| void | update_sub (int mip, int offset[3], int extent[3], eGPUDataFormat format, const void *data, VKPixelBuffer *pixel_buffer) |
| void | update_sub (int mip, int offset[3], int extent[3], eGPUDataFormat format, const void *data) override |
| void | update_sub (int offset[3], int extent[3], eGPUDataFormat format, GPUPixelBuffer *pixbuf) override |
| VKMemoryExport | export_memory (VkExternalMemoryHandleTypeFlagBits handle_type) |
| VkImage | vk_image_handle () const |
| TextureFormat | device_format_get () const |
| Public Member Functions inherited from blender::gpu::Texture | |
| int | width_get () const |
| int | height_get () const |
| int | depth_get () const |
| eGPUTextureUsage | usage_get () const |
| void | mip_size_get (int mip, int r_size[3]) const |
| int | mip_width_get (int mip) const |
| int | mip_height_get (int mip) const |
| int | mip_depth_get (int mip) const |
| int | dimensions_count () const |
| int | layer_count () const |
| int | mip_count () const |
| TextureFormat | format_get () const |
| GPUTextureFormatFlag | format_flag_get () const |
| GPUTextureType | type_get () const |
| GPUAttachmentType | attachment_type (int slot) const |
| Texture (const char *name) | |
| virtual | ~Texture () |
| bool | init_1D (int w, int layers, int mip_len, TextureFormat format) |
| bool | init_2D (int w, int h, int layers, int mip_len, TextureFormat format) |
| bool | init_3D (int w, int h, int d, int mip_len, TextureFormat format) |
| bool | init_cubemap (int w, int layers, int mip_len, TextureFormat format) |
| bool | init_buffer (VertBuf *vbo, TextureFormat format) |
| bool | init_view (Texture *src, TextureFormat format, GPUTextureType type, int mip_start, int mip_len, int layer_start, int layer_len, bool cube_as_array, bool use_stencil) |
| void | usage_set (eGPUTextureUsage usage_flags) |
| void | attach_to (FrameBuffer *fb, GPUAttachmentType type) |
| void | detach_from (FrameBuffer *fb) |
| void | update (eGPUDataFormat format, const void *data) |
Protected Member Functions | |
| bool | init_internal () override |
| bool | init_internal (VertBuf *vbo) override |
| bool | init_internal (gpu::Texture *src, int mip_offset, int layer_offset, bool use_stencil) override |
| void | init_swapchain (VkImage vk_image, TextureFormat gpu_format) |
Friends | |
| class | VKDescriptorSetUpdator |
| class | VKContext |
Image Views | |
| const VKImageView & | image_view_get (const VKImageViewInfo &info) |
| const VKImageView & | image_view_get (VKImageViewArrayed arrayed, VKImageViewFlags flags) |
Additional Inherited Members | |
| Public Attributes inherited from blender::gpu::Texture | |
| GPUSamplerState | sampler_state = GPUSamplerState::default_sampler() |
| int | refcount = 1 |
| int | src_w = 0 |
| int | src_h = 0 |
| void ** | py_ref = nullptr |
| Protected Attributes inherited from blender::gpu::Texture | |
| int | w_ |
| int | h_ |
| int | d_ |
| TextureFormat | format_ |
| GPUTextureFormatFlag | format_flag_ |
| GPUTextureType | type_ |
| eGPUTextureUsage | gpu_image_usage_flags_ |
| int | mipmaps_ = -1 |
| int | mip_min_ = 0 |
| int | mip_max_ = 0 |
| char | name_ [DEBUG_NAME_LEN] |
| GPUAttachmentType | fb_attachment_ [GPU_TEX_MAX_FBO_ATTACHED] |
| FrameBuffer * | fb_ [GPU_TEX_MAX_FBO_ATTACHED] |
Definition at line 31 of file vk_texture.hh.
|
inline |
Definition at line 77 of file vk_texture.hh.
References name, and blender::gpu::Texture::Texture().
Referenced by copy_to(), copy_to(), init_internal(), and VKContext.
|
overridevirtual |
Definition at line 46 of file vk_texture.cc.
References blender::gpu::VKDiscardPool::discard_image(), and blender::gpu::VKDiscardPool::discard_pool_get().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 116 of file vk_texture.cc.
References clear_depth_stencil(), blender::gpu::convert_host_to_device(), data, blender::gpu::VKContext::get(), GPU_DATA_UINT_24_8_DEPRECATED, GPU_DEPTH_BIT, GPU_STENCIL_BIT, blender::IndexRange::size(), blender::IndexRange::start(), blender::gpu::to_vk_clear_color_value(), blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::render_graph::VKClearColorImageData::vk_clear_color_value, blender::gpu::render_graph::VKClearColorImageData::vk_image, vk_image_handle(), blender::gpu::render_graph::VKClearColorImageData::vk_image_subresource_range, and VKContext.
| void blender::gpu::VKTexture::clear_depth_stencil | ( | const GPUFrameBufferBits | buffer, |
| float | clear_depth, | ||
| uint | clear_stencil, | ||
| std::optional< int > | layer ) |
Definition at line 148 of file vk_texture.cc.
References BLI_assert, buffers, device_format_get(), blender::gpu::VKContext::get(), GPU_DEPTH_BIT, GPU_STENCIL_BIT, blender::gpu::render_graph::VKClearDepthStencilImageCreateInfo::node_data, blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::render_graph::VKClearDepthStencilImageData::vk_clear_depth_stencil_value, blender::gpu::render_graph::VKClearDepthStencilImageData::vk_image, blender::gpu::render_graph::VKClearDepthStencilImageCreateInfo::vk_image_aspects, vk_image_handle(), blender::gpu::render_graph::VKClearDepthStencilImageData::vk_image_subresource_range, and VKContext.
Referenced by blender::gpu::VKFrameBuffer::clear(), and clear().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 103 of file vk_texture.cc.
References BLI_assert, copy_to(), blender::gpu::Texture::d_, blender::gpu::Texture::h_, blender::gpu::Texture::Texture(), blender::gpu::to_vk_image_aspect_flag_bits(), UNUSED_VARS_NDEBUG, blender::gpu::unwrap(), VKTexture(), and blender::gpu::Texture::w_.
Referenced by blender::gpu::blit_aspect(), and copy_to().
| void blender::gpu::VKTexture::copy_to | ( | VKTexture & | dst_texture, |
| VkImageAspectFlags | vk_image_aspect ) |
Definition at line 85 of file vk_texture.cc.
References device_format_get(), blender::gpu::render_graph::VKCopyImageData::dst_image, blender::gpu::VKContext::get(), blender::gpu::render_graph::VKCopyImageCreateInfo::node_data, blender::gpu::render_graph::VKCopyImageData::region, blender::gpu::render_graph::VKCopyImageData::src_image, blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::render_graph::VKCopyImageCreateInfo::vk_image_aspect, vk_image_handle(), VKContext, and VKTexture().
|
inline |
Get the texture format how the texture is stored on the device.
Definition at line 128 of file vk_texture.hh.
Referenced by blender::gpu::blit_aspect(), clear_depth_stencil(), copy_to(), and blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering().
| VKMemoryExport blender::gpu::VKTexture::export_memory | ( | VkExternalMemoryHandleTypeFlagBits | handle_type | ) |
Export the memory associated with this texture to be imported by a different API/Process/Instance.
Returns the handle + offset of the image inside the handle.
Definition at line 475 of file vk_texture.cc.
References BLI_assert_msg, BLI_assert_unreachable, blender::gpu::VKBackend::device, blender::gpu::VKDevice::extensions_get(), blender::gpu::VKExtensions::external_memory, blender::gpu::VKDevice::functions, blender::gpu::VKBackend::get(), blender::gpu::Texture::gpu_image_usage_flags_, GPU_TEXTURE_USAGE_MEMORY_EXPORT, blender::gpu::VKDevice::vk_handle(), and blender::gpu::VKDevice::vkGetMemoryFd.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 55 of file vk_texture.cc.
References BLI_assert, ELEM, blender::gpu::Texture::format_flag_, blender::gpu::VKContext::get(), blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::GPU_TEXTURE_2D_ARRAY, blender::gpu::render_graph::VKUpdateMipmapsData::l0_size, blender::gpu::render_graph::VKUpdateMipmapsData::layer_count, blender::gpu::Texture::mip_size_get(), blender::gpu::render_graph::VKUpdateMipmapsData::mipmaps, blender::gpu::Texture::mipmaps_, blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::Texture::type_get(), blender::gpu::render_graph::VKUpdateMipmapsData::vk_image, blender::gpu::render_graph::VKUpdateMipmapsData::vk_image_aspect, vk_image_handle(), and VKContext.
| const VKImageView & blender::gpu::VKTexture::image_view_get | ( | const VKImageViewInfo & | info | ) |
Get a specific image view for this texture. The specification of the image view are passed inside the info parameter.
Definition at line 773 of file vk_texture.cc.
References blender::gpu::VKImageViewInfo::arrayed, blender::gpu::DEFAULT, image_view_get(), and blender::gpu::Texture::name_.
Referenced by image_view_get(), image_view_get(), and blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering().
| const VKImageView & blender::gpu::VKTexture::image_view_get | ( | VKImageViewArrayed | arrayed, |
| VKImageViewFlags | flags ) |
Get the current image view for this texture.
Definition at line 790 of file vk_texture.cc.
References ELEM, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, image_view_get(), blender::gpu::NO_SWIZZLING, blender::gpu::NOT_ARRAYED, and blender::gpu::Texture::type_.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 512 of file vk_texture.cc.
References blender::gpu::Texture::format_, mip_range_set(), and blender::gpu::Texture::mipmaps_.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 539 of file vk_texture.cc.
References BLI_assert, blender::gpu::Texture::mip_max_, blender::gpu::Texture::mip_min_, texture(), blender::gpu::unwrap(), and VKTexture().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 531 of file vk_texture.cc.
References BLI_assert, blender::gpu::Texture::format_, and blender::gpu::unwrap().
|
protected |
Definition at line 558 of file vk_texture.cc.
References blender::gpu::Texture::format_, blender::gpu::Texture::format_flag_, blender::gpu::GPU_TEXTURE_2D, GPU_TEXTURE_USAGE_ATTACHMENT, GPU_TEXTURE_USAGE_SHADER_WRITE, blender::gpu::to_format_flag(), blender::gpu::Texture::type_, and blender::gpu::Texture::usage_set().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 187 of file vk_texture.cc.
References max, min, blender::gpu::Texture::mip_max_, and blender::gpu::Texture::mip_min_.
Referenced by init_internal().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 317 of file vk_texture.cc.
References BLI_assert, data, blender::gpu::Texture::format_, blender::gpu::Texture::format_flag_, blender::gpu::GPU_FORMAT_COMPRESSED, MEM_mallocN(), blender::gpu::Texture::mip_size_get(), read_sub(), blender::IndexRange::size(), blender::gpu::to_bytesize(), blender::gpu::to_vk_image_type(), and blender::gpu::Texture::type_.
| void blender::gpu::VKTexture::read_sub | ( | int | mip, |
| eGPUDataFormat | format, | ||
| const int | region[6], | ||
| IndexRange | layers, | ||
| void * | r_data ) |
Definition at line 193 of file vk_texture.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert_msg, blender::gpu::convert_device_to_host(), blender::gpu::VKBuffer::create(), blender::gpu::render_graph::VKCopyImageToBufferData::dst_buffer, blender::gpu::TransferRegion::extent, blender::gpu::Texture::format_, blender::gpu::VKContext::get(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::gpu::TransferRegion::layers, blender::gpu::VKBuffer::mapped_memory_get(), min_ii(), blender::gpu::render_graph::VKCopyImageToBufferCreateInfo::node_data, blender::gpu::TransferRegion::offset, blender::gpu::render_graph::VKCopyImageToBufferData::region, blender::gpu::RENEW_RENDER_GRAPH, blender::gpu::TransferRegion::sample_count(), blender::IndexRange::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::gpu::render_graph::VKCopyImageToBufferData::src_image, blender::IndexRange::start(), blender::gpu::SUBMIT, blender::gpu::to_bytesize(), blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::to_vk_image_aspect_single_bit(), blender::gpu::VKBuffer::vk_handle(), blender::gpu::render_graph::VKCopyImageToBufferCreateInfo::vk_image_aspects, vk_image_handle(), VKContext, blender::gpu::WAIT_FOR_COMPLETION, and z().
Referenced by read().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 182 of file vk_texture.cc.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 460 of file vk_texture.cc.
References data, and update_sub().
| void blender::gpu::VKTexture::update_sub | ( | int | mip, |
| int | offset[3], | ||
| int | extent[3], | ||
| eGPUDataFormat | format, | ||
| const void * | data, | ||
| VKPixelBuffer * | pixel_buffer ) |
Definition at line 350 of file vk_texture.cc.
References BLI_assert, BLI_assert_msg, blender::gpu::VKPixelBuffer::buffer_get(), blender::gpu::convert_host_to_device(), blender::gpu::VKBuffer::create(), data, blender::gpu::Texture::depth_get(), divide_ceil_u(), blender::gpu::render_graph::VKCopyBufferToImageData::dst_image, ELEM, blender::gpu::Texture::format_, blender::gpu::Texture::format_flag_, blender::gpu::VKContext::get(), blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_2D, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::Texture::height_get(), blender::gpu::VKBuffer::mapped_memory_get(), max_ii(), blender::gpu::render_graph::VKCopyBufferToImageCreateInfo::node_data, blender::gpu::render_graph::VKCopyBufferToImageData::region, blender::gpu::render_graph::VKCopyBufferToImageData::src_buffer, blender::gpu::to_block_size(), blender::gpu::to_bytesize(), blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::to_vk_image_aspect_single_bit(), blender::gpu::Texture::type_, blender::gpu::VKBuffer::vk_handle(), blender::gpu::render_graph::VKCopyBufferToImageCreateInfo::vk_image_aspects, vk_image_handle(), VKContext, blender::gpu::Texture::width_get(), and y.
Referenced by update_sub(), and update_sub().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 466 of file vk_texture.cc.
References blender::gpu::unwrap(), and update_sub().
|
inline |
Definition at line 116 of file vk_texture.hh.
References BLI_assert.
Referenced by blender::gpu::blit_aspect(), clear(), clear_depth_stencil(), copy_to(), generate_mipmap(), read_sub(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), and update_sub().
|
friend |
Definition at line 33 of file vk_texture.hh.
References blender::gpu::Invalid, VKContext, and VKTexture().
Referenced by clear(), clear_depth_stencil(), copy_to(), generate_mipmap(), read_sub(), update_sub(), and VKContext.
|
friend |
Definition at line 32 of file vk_texture.hh.
References VKDescriptorSetUpdator.
Referenced by VKDescriptorSetUpdator.