Blender V5.3
blender::gpu::GLTexture Class Reference

#include <gl_texture.hh>

Inherits blender::gpu::Texture.

Public Member Functions

void check_feedback_loop ()
Public Member Functions inherited from blender::gpu::Texture
int width_get () const
int height_get () const
int depth_get () const
eGPUTextureUsage usage_get () const
bool is_texture_view () const
void mip_size_get (int mip, int r_size[3]) const
int3 mip_size_get (int mip) 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
IndexRange mip_map_range () const
IndexRange layer_range () 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)
size_t read_size_get (int mip, eGPUDataFormat format) const

Friends

class GLStateManager
class GLFrameBuffer
class GLTexturePool

Sampler objects

static void samplers_init ()
static void samplers_free ()
static GLuint get_sampler (const GPUSamplerState &sampler_state)

Creation & Deletion

 GLTexture (const char *name)
 ~GLTexture ()
bool init_internal () override
bool init_internal (VertBuf *vbo) override
bool init_internal (gpu::Texture *src, bool use_stencil) override

Operations

void update_sub (int mip, int offset[3], int extent[3], eGPUDataFormat type, const void *data, const uint unpack_row_length=0) override
void update_sub (int offset[3], int extent[3], eGPUDataFormat format, GPUPixelBuffer *pixbuf) override
void generate_mipmap () override
void copy_to (Texture *dst, IndexRange mip_levels) override
void clear (const double4 data) override
void read (int mip, eGPUDataFormat type, void *data) override

Getters & setters

void swizzle_set (const char swizzle_mask[4]) override

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
Texture * source_texture_ = nullptr
int view_layer_start_ = 0
std::string name_
Map< FrameBuffer *, GPUAttachmentType > fb_attachments_

Detailed Description

Definition at line 21 of file gl_texture.hh.

Constructor & Destructor Documentation

◆ GLTexture()

blender::gpu::GLTexture::GLTexture ( const char * name)

◆ ~GLTexture()

Member Function Documentation

◆ check_feedback_loop()

◆ clear()

void blender::gpu::GLTexture::clear ( const double4 data)
overridevirtual

◆ copy_to()

◆ generate_mipmap()

void blender::gpu::GLTexture::generate_mipmap ( )
overridevirtual

This will create the mipmap images and populate them with filtered data from base level.

Warning
Depth textures are not populated but they have their mips correctly defined.
This resets the mipmap range.

Implements blender::gpu::Texture.

Definition at line 394 of file gl_texture.cc.

References blender::gpu::GLContext::direct_state_access_support, blender::gpu::Texture::format_flag_, blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_FORMAT_DEPTH, blender::gpu::GLContext::state_manager_active_get(), and blender::gpu::GLStateManager::texture_bind_temp().

Referenced by GLTexturePool.

◆ get_sampler()

GLuint blender::gpu::GLTexture::get_sampler ( const GPUSamplerState & sampler_state)
static

◆ init_internal() [1/3]

◆ init_internal() [2/3]

◆ init_internal() [3/3]

◆ read()

◆ samplers_free()

void blender::gpu::GLTexture::samplers_free ( )
static

Free the samplers cache generated in samplers_init() method.

Definition at line 717 of file gl_texture.cc.

References GPU_SAMPLER_CUSTOM_TYPES_COUNT.

Referenced by blender::gpu::GLBackend::delete_resources(), and GLTexturePool.

◆ samplers_init()

void blender::gpu::GLTexture::samplers_init ( )
static

◆ swizzle_set()

void blender::gpu::GLTexture::swizzle_set ( const char swizzle_mask[4])
overridevirtual

◆ update_sub() [1/2]

◆ update_sub() [2/2]

◆ GLFrameBuffer

friend class GLFrameBuffer
friend

Definition at line 23 of file gl_texture.hh.

References GLFrameBuffer.

Referenced by check_feedback_loop(), and GLFrameBuffer.

◆ GLStateManager

friend class GLStateManager
friend

Definition at line 22 of file gl_texture.hh.

References GLStateManager.

Referenced by GLStateManager.

◆ GLTexturePool


The documentation for this class was generated from the following files: