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

#include <gl_texture.hh>

Inherits blender::gpu::Texture.

Public Member Functions

void check_feedback_loop (void)
 
uint gl_bindcode_get (void) const override
 
- Public Member Functions inherited from blender::gpu::Texture
int width_get (void) const
 
int height_get (void) const
 
int depth_get (void) 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 (void) const
 
int layer_count (void) const
 
eGPUTextureFormat format_get (void) const
 
eGPUTextureFormatFlag format_flag_get (void) const
 
eGPUTextureType type_get (void) const
 
GPUAttachmentType attachment_type (int slot) const
 
 Texture (const char *name)
 
virtual ~Texture ()
 
bool init_1D (int w, int layers, eGPUTextureFormat format)
 
bool init_2D (int w, int h, int layers, eGPUTextureFormat format)
 
bool init_3D (int w, int h, int d, eGPUTextureFormat format)
 
bool init_cubemap (int w, int layers, eGPUTextureFormat format)
 
bool init_buffer (GPUVertBuf *vbo, eGPUTextureFormat format)
 
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 (void)
 
static void samplers_free (void)
 
static void samplers_update (void)
 

Creation & Deletion

 GLTexture (const char *name)
 
 ~GLTexture ()
 
bool init_internal (void) override
 
bool init_internal (GPUVertBuf *vbo) override
 

Operations

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

Getters & setters

void swizzle_set (const char swizzle_mask[4]) 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
 
- 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 39 of file gl_texture.hh.

Constructor & Destructor Documentation

◆ GLTexture()

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

Definition at line 45 of file gl_texture.cc.

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

◆ ~GLTexture()

blender::gpu::GLTexture::~GLTexture ( )

Member Function Documentation

◆ check_feedback_loop()

void blender::gpu::GLTexture::check_feedback_loop ( void  )

◆ clear()

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

◆ copy_to()

void blender::gpu::GLTexture::copy_to ( Texture dst)
overridevirtual

◆ generate_mipmap()

void blender::gpu::GLTexture::generate_mipmap ( void  )
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. WARNING: This resets the mipmap range.

Implements blender::gpu::Texture.

Definition at line 303 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_DEPTH, mip_range_set(), blender::gpu::GLContext::state_manager_active_get(), and blender::gpu::GLStateManager::texture_bind_temp().

◆ gl_bindcode_get()

uint blender::gpu::GLTexture::gl_bindcode_get ( void  ) const
overridevirtual

Implements blender::gpu::Texture.

Definition at line 705 of file gl_texture.cc.

◆ init_internal() [1/2]

bool blender::gpu::GLTexture::init_internal ( GPUVertBuf vbo)
overrideprotectedvirtual

◆ init_internal() [2/2]

bool blender::gpu::GLTexture::init_internal ( void  )
overrideprotectedvirtual

◆ mip_range_set()

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

◆ read()

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

◆ samplers_free()

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

Definition at line 560 of file gl_texture.cc.

References GPU_SAMPLER_MAX.

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

◆ samplers_init()

void blender::gpu::GLTexture::samplers_init ( void  )
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 485 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 blender::gpu::GLTexture::samplers_update ( void  )
static

◆ swizzle_set()

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

◆ update_sub()

void blender::gpu::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 41 of file gl_texture.hh.

◆ GLStateManager

friend class GLStateManager
friend

Definition at line 40 of file gl_texture.hh.


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