|
Blender V4.3
|
#include <vk_texture.hh>
Inherits blender::gpu::Texture.
Protected Member Functions | |
| bool | init_internal () override |
| bool | init_internal (VertBuf *vbo) override |
| bool | init_internal (GPUTexture *src, int mip_offset, int layer_offset, bool use_stencil) override |
Friends | |
| class | VKDescriptorSetTracker |
Image Views | |
| const VKImageView & | image_view_get (const VKImageViewInfo &info) |
| const VKImageView & | image_view_get (VKImageViewArrayed arrayed) |
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_ |
| eGPUTextureFormat | format_ |
| eGPUTextureFormatFlag | format_flag_ |
| eGPUTextureType | 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 22 of file vk_texture.hh.
|
inline |
Definition at line 71 of file vk_texture.hh.
|
overridevirtual |
Definition at line 42 of file vk_texture.cc.
References blender::gpu::VKBackend::device, blender::gpu::VKDiscardPool::discard_image(), blender::gpu::VKDevice::discard_pool_for_current_thread(), and blender::gpu::VKBackend::get().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 121 of file vk_texture.cc.
References blender::gpu::VKContext::get(), 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(), and blender::gpu::render_graph::VKClearColorImageData::vk_image_subresource_range.
| void blender::gpu::VKTexture::clear_depth_stencil | ( | const eGPUFrameBufferBits | buffer, |
| float | clear_depth, | ||
| uint | clear_stencil ) |
Definition at line 141 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(), and blender::gpu::render_graph::VKClearDepthStencilImageData::vk_image_subresource_range.
Referenced by blender::gpu::VKFrameBuffer::clear().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 108 of file vk_texture.cc.
References BLI_assert, copy_to(), blender::gpu::Texture::d_, blender::gpu::Texture::h_, tex, blender::gpu::to_vk_image_aspect_flag_bits(), UNUSED_VARS_NDEBUG, blender::gpu::unwrap(), 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 90 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, and vk_image_handle().
|
inline |
Get the texture format how the texture is stored on the device.
Definition at line 111 of file vk_texture.hh.
Referenced by blender::gpu::blit_aspect(), clear_depth_stencil(), copy_to(), and blender::gpu::VKFrameBuffer::rendering_ensure().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 60 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, and vk_image_handle().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 326 of file vk_texture.cc.
| 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 566 of file vk_texture.cc.
References blender::gpu::VKImageViewInfo::arrayed, image_view_get(), and blender::gpu::Texture::name_.
Referenced by image_view_get(), image_view_get(), and blender::gpu::VKFrameBuffer::rendering_ensure().
| const VKImageView & blender::gpu::VKTexture::image_view_get | ( | VKImageViewArrayed | arrayed | ) |
Get the current image view for this texture.
Definition at line 583 of file vk_texture.cc.
References blender::gpu::VKImageViewInfo::arrayed, ELEM, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, image_view_get(), blender::gpu::VKImageViewInfo::layer_range, blender::gpu::VKImageViewInfo::mip_range, blender::gpu::NOT_ARRAYED, blender::IndexRange::slice(), blender::gpu::Texture::type_, blender::gpu::VKImageViewInfo::use_srgb, and blender::gpu::VKImageViewInfo::use_stencil.
| void blender::gpu::VKTexture::init | ( | VkImage | vk_image, |
| VkImageLayout | layout, | ||
| eGPUTextureFormat | texture_format ) |
Definition at line 52 of file vk_texture.cc.
References blender::gpu::Texture::format_.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 333 of file vk_texture.cc.
References blender::gpu::VKBackend::device, blender::gpu::Texture::format_, blender::gpu::VKBackend::get(), GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_DEPTH_COMPONENT24, GPU_DEPTH_COMPONENT32F, GPU_RGB16F, GPU_RGB32F, GPU_RGBA16F, GPU_RGBA32F, mip_range_set(), blender::gpu::Texture::mipmaps_, blender::gpu::VKWorkarounds::not_aligned_pixel_formats, and blender::gpu::VKDevice::workarounds_get().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 369 of file vk_texture.cc.
References BLI_assert, blender::gpu::Texture::mip_max_, blender::gpu::Texture::mip_min_, texture, and blender::gpu::unwrap().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 361 of file vk_texture.cc.
References BLI_assert, blender::gpu::Texture::format_, and blender::gpu::unwrap().
Implements blender::gpu::Texture.
Definition at line 175 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 217 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::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 181 of file vk_texture.cc.
References blender::gpu::convert_device_to_host(), blender::gpu::VKBuffer::create(), blender::gpu::render_graph::VKCopyImageToBufferData::dst_buffer, blender::gpu::Texture::format_, blender::gpu::VKContext::get(), GPU_USAGE_DYNAMIC, blender::gpu::VKBuffer::mapped_memory_get(), blender::gpu::render_graph::VKCopyImageToBufferData::region, blender::gpu::render_graph::VKCopyImageToBufferData::src_image, 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(), and vk_image_handle().
Referenced by read().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 170 of file vk_texture.cc.
References blender::gpu::VKImageViewInfo::swizzle.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 250 of file vk_texture.cc.
References BLI_assert, BLI_assert_msg, blender::gpu::convert_host_to_device(), blender::gpu::VKBuffer::create(), divide_ceil_u(), blender::gpu::render_graph::VKCopyBufferToImageData::dst_image, 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, GPU_USAGE_DYNAMIC, blender::gpu::VKBuffer::mapped_memory_get(), max_ii(), 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(), and vk_image_handle().
Referenced by update_sub().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 317 of file vk_texture.cc.
References blender::gpu::VKPixelBuffer::map(), blender::gpu::unwrap(), and update_sub().
|
inline |
Definition at line 99 of file vk_texture.hh.
References BLI_assert, and vk_image_handle().
Referenced by blender::gpu::blit_aspect(), clear(), clear_depth_stencil(), copy_to(), generate_mipmap(), read_sub(), blender::gpu::VKFrameBuffer::rendering_ensure(), update_sub(), and vk_image_handle().
|
friend |
Definition at line 23 of file vk_texture.hh.