Blender  V3.3
Public Member Functions | Friends | List of all members
blender::gpu::GLTexture Class Reference

#include <gl_texture.hh>

Inheritance diagram for blender::gpu::GLTexture:
blender::gpu::Texture

Public Member Functions

void check_feedback_loop ()
 
uint gl_bindcode_get () const override
 
- Public Member Functions inherited from blender::gpu::Texture
int width_get () const
 
int height_get () const
 
int depth_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
 
eGPUTextureFormat format_get () const
 
eGPUTextureFormatFlag format_flag_get () const
 
eGPUTextureType 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, eGPUTextureFormat format)
 
bool init_2D (int w, int h, int layers, int mip_len, eGPUTextureFormat format)
 
bool init_3D (int w, int h, int d, int mip_len, eGPUTextureFormat format)
 
bool init_cubemap (int w, int layers, int mip_len, eGPUTextureFormat format)
 
bool init_buffer (GPUVertBuf *vbo, eGPUTextureFormat format)
 
bool init_view (const GPUTexture *src, eGPUTextureFormat format, int mip_start, int mip_len, int layer_start, int layer_len, bool cube_as_array)
 
void attach_to (FrameBuffer *fb, GPUAttachmentType type)
 
void detach_from (FrameBuffer *fb)
 
void update (eGPUDataFormat format, const void *data)
 

Friends

class GLStateManager
 
class GLFrameBuffer
 

Sampler objects

static void samplers_init ()
 
static void samplers_free ()
 
static void samplers_update ()
 

Creation & Deletion

 GLTexture (const char *name)
 
 ~GLTexture ()
 
bool init_internal () override
 
bool init_internal (GPUVertBuf *vbo) override
 
bool init_internal (const GPUTexture *src, int mip_offset, int layer_offset) override
 

Operations

void update_sub (int mip, int offset[3], int extent[3], eGPUDataFormat type, const void *data) override
 
void generate_mipmap () override
 
void copy_to (Texture *dst) override
 
void clear (eGPUDataFormat format, const void *data) override
 
voidread (int mip, eGPUDataFormat type) override
 

Getters & setters

void swizzle_set (const char swizzle_mask[4]) override
 
void stencil_texture_mode_set (bool use_stencil) override
 
void mip_range_set (int min, int max) override
 

Additional Inherited Members

- Public Attributes inherited from blender::gpu::Texture
eGPUSamplerState sampler_state = GPU_SAMPLER_DEFAULT
 
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_
 
int mipmaps_ = -1
 
int mip_min_ = 0
 
int mip_max_ = 0
 
char name_ [DEBUG_NAME_LEN]
 
GPUAttachmentType fb_attachment_ [GPU_TEX_MAX_FBO_ATTACHED]
 
FrameBufferfb_ [GPU_TEX_MAX_FBO_ATTACHED]
 

Detailed Description

Definition at line 23 of file gl_texture.hh.

Constructor & Destructor Documentation

◆ GLTexture()

GLTexture::GLTexture ( const char *  name)

Definition at line 27 of file gl_texture.cc.

References BLI_assert, and blender::gpu::GLContext::get().

◆ ~GLTexture()

GLTexture::~GLTexture ( )

Member Function Documentation

◆ check_feedback_loop()

void GLTexture::check_feedback_loop ( )

◆ clear()

void GLTexture::clear ( eGPUDataFormat  format,
const void data 
)
overridevirtual

◆ copy_to()

void GLTexture::copy_to ( Texture dst)
overridevirtual

◆ generate_mipmap()

void 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.

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. WARNING: This resets the mipmap range.

Implements blender::gpu::Texture.

Definition at line 311 of file gl_texture.cc.

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

◆ gl_bindcode_get()

uint GLTexture::gl_bindcode_get ( ) const
overridevirtual

Implements blender::gpu::Texture.

Definition at line 736 of file gl_texture.cc.

◆ init_internal() [1/3]

bool GLTexture::init_internal ( )
overrideprotectedvirtual

◆ init_internal() [2/3]

bool GLTexture::init_internal ( const GPUTexture src,
int  mip_offset,
int  layer_offset 
)
overrideprotectedvirtual

◆ init_internal() [3/3]

bool GLTexture::init_internal ( GPUVertBuf vbo)
overrideprotectedvirtual

◆ mip_range_set()

void GLTexture::mip_range_set ( int  min,
int  max 
)
overridevirtual

◆ read()

void * GLTexture::read ( int  mip,
eGPUDataFormat  type 
)
overridevirtual

◆ samplers_free()

void GLTexture::samplers_free ( )
static

Definition at line 586 of file gl_texture.cc.

References GPU_SAMPLER_MAX.

Referenced by blender::gpu::GLBackend::delete_resources().

◆ samplers_init()

void GLTexture::samplers_init ( )
static

Other states are left to default:

  • GL_TEXTURE_BORDER_COLOR is {0, 0, 0, 0}.
  • GL_TEXTURE_MIN_LOD is -1000.
  • GL_TEXTURE_MAX_LOD is 1000.
  • GL_TEXTURE_LOD_BIAS is 0.0f.

Definition at line 511 of file gl_texture.cc.

References GPU_SAMPLER_ANISO, GPU_SAMPLER_CLAMP_BORDER, GPU_SAMPLER_COMPARE, GPU_SAMPLER_DEFAULT, GPU_SAMPLER_FILTER, GPU_SAMPLER_ICON, GPU_SAMPLER_MAX, GPU_SAMPLER_MIPMAP, GPU_SAMPLER_REPEAT, GPU_SAMPLER_REPEAT_R, GPU_SAMPLER_REPEAT_S, GPU_SAMPLER_REPEAT_T, blender::gpu::debug::object_label(), samplers_update(), SNPRINTF, and state.

Referenced by blender::gpu::GLBackend::GLBackend().

◆ samplers_update()

void GLTexture::samplers_update ( )
static

◆ stencil_texture_mode_set()

void GLTexture::stencil_texture_mode_set ( bool  use_stencil)
overridevirtual

◆ swizzle_set()

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

◆ update_sub()

void GLTexture::update_sub ( int  mip,
int  offset[3],
int  extent[3],
eGPUDataFormat  type,
const void data 
)
overridevirtual

Friends And Related Function Documentation

◆ GLFrameBuffer

friend class GLFrameBuffer
friend

Definition at line 25 of file gl_texture.hh.

◆ GLStateManager

friend class GLStateManager
friend

Definition at line 24 of file gl_texture.hh.


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