Blender
V3.3
|
#include <gl_texture.hh>
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 |
void * | read (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 | |
![]() | |
eGPUSamplerState | sampler_state = GPU_SAMPLER_DEFAULT |
int | refcount = 1 |
int | src_w = 0 |
int | src_h = 0 |
void ** | py_ref = nullptr |
![]() | |
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] |
FrameBuffer * | fb_ [GPU_TEX_MAX_FBO_ATTACHED] |
Definition at line 23 of file gl_texture.hh.
GLTexture::GLTexture | ( | const char * | name | ) |
Definition at line 27 of file gl_texture.cc.
References BLI_assert, and blender::gpu::GLContext::get().
GLTexture::~GLTexture | ( | ) |
Definition at line 34 of file gl_texture.cc.
References blender::gpu::GLContext::get(), GPU_framebuffer_free(), blender::gpu::Context::state_manager, blender::gpu::GLContext::tex_free(), and blender::gpu::StateManager::texture_unbind().
void GLTexture::check_feedback_loop | ( | ) |
Definition at line 701 of file gl_texture.cc.
References blender::gpu::Context::active_fb, ARRAY_SIZE, fb(), blender::gpu::Texture::fb_, blender::gpu::Texture::fb_attachment_, blender::gpu::Context::get(), blender::gpu::GLContext::get(), GPU_mip_render_workaround(), GPUAttachment::mip, blender::gpu::Texture::mip_max_, blender::gpu::Texture::mip_min_, blender::gpu::Texture::name_, blender::gpu::debug::raise_gl_error(), sh, blender::gpu::Context::shader, SNPRINTF, and type.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 347 of file gl_texture.cc.
References blender::gpu::Texture::attachment_type(), BLI_assert, blender::gpu::GLContext::clear_texture_support, data, fb(), blender::gpu::Texture::format_, GPU_framebuffer_active_get(), GPU_framebuffer_bind(), blender::gpu::to_gl(), blender::gpu::to_gl_data_format(), and blender::gpu::validate_data_format().
Implements blender::gpu::Texture.
Definition at line 371 of file gl_texture.cc.
References BLI_assert, blender::gpu::GLContext::copy_image_support, blender::gpu::Texture::d_, blender::gpu::Texture::format_, GPU_framebuffer_blit(), blender::gpu::Texture::h_, blender::gpu::Texture::mip_size_get(), src, blender::gpu::to_framebuffer_bits(), blender::gpu::Texture::type_, UNPACK3, and blender::gpu::Texture::w_.
|
overridevirtual |
This will create the mipmap images and populate them with filtered data from base level.
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().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 736 of file gl_texture.cc.
|
overrideprotectedvirtual |
Return true on success.
Implements blender::gpu::Texture.
Definition at line 47 of file gl_texture.cc.
References bool, blender::gpu::Texture::d_, blender::gpu::Texture::dimensions_count(), blender::gpu::GLContext::direct_state_access_support, divide_ceil_u(), blender::gpu::Texture::format_, blender::gpu::Texture::format_flag_, GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_depth_blitting_workaround(), blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_TEXTURE_ARRAY, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, blender::gpu::Texture::h_, max_ii(), mip_range_set(), blender::gpu::Texture::mipmaps_, blender::gpu::Texture::name_, blender::gpu::debug::object_label(), blender::gpu::GLContext::state_manager_active_get(), blender::gpu::GLStateManager::texture_bind_temp(), blender::gpu::GLContext::texture_cube_map_array_support, blender::gpu::GLContext::texture_storage_support, blender::gpu::to_block_size(), blender::gpu::to_data_format(), blender::gpu::to_gl(), blender::gpu::to_gl_data_format(), blender::gpu::to_gl_internal_format(), blender::gpu::to_gl_target(), blender::gpu::Texture::type_, w(), and blender::gpu::Texture::w_.
|
overrideprotectedvirtual |
Return true on success.
Implements blender::gpu::Texture.
Definition at line 176 of file gl_texture.cc.
References BLI_assert, blender::gpu::Texture::format_, blender::gpu::Texture::mipmaps_, blender::gpu::Texture::name_, blender::gpu::debug::object_label(), src, blender::gpu::GLContext::texture_storage_support, blender::gpu::to_gl_internal_format(), blender::gpu::to_gl_target(), blender::gpu::Texture::type_, and blender::gpu::unwrap().
|
overrideprotectedvirtual |
Return true on success.
Implements blender::gpu::Texture.
Definition at line 154 of file gl_texture.cc.
References blender::gpu::GLContext::direct_state_access_support, blender::gpu::Texture::format_, blender::gpu::Texture::name_, blender::gpu::debug::object_label(), blender::gpu::GLContext::state_manager_active_get(), blender::gpu::GLStateManager::texture_bind_temp(), blender::gpu::to_gl_internal_format(), blender::gpu::to_gl_target(), blender::gpu::Texture::type_, and blender::gpu::unwrap().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 473 of file gl_texture.cc.
References BLI_assert, blender::gpu::GLContext::direct_state_access_support, max, min, blender::gpu::Texture::mip_max_, blender::gpu::Texture::mip_min_, blender::gpu::Texture::mipmaps_, blender::gpu::GLContext::state_manager_active_get(), and blender::gpu::GLStateManager::texture_bind_temp().
Referenced by generate_mipmap(), and init_internal().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 399 of file gl_texture.cc.
References BLI_assert, data, blender::gpu::GLContext::direct_state_access_support, blender::gpu::Texture::format_, blender::gpu::Texture::format_flag_, blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_TEXTURE_CUBE, MEM_mallocN, blender::gpu::Texture::mip_size_get(), blender::gpu::Texture::mipmaps_, blender::gpu::GLContext::state_manager_active_get(), blender::gpu::GLStateManager::texture_bind_temp(), blender::gpu::to_bytesize(), blender::gpu::to_gl(), blender::gpu::to_gl_data_format(), type, blender::gpu::Texture::type_, and blender::gpu::validate_data_format().
|
static |
Definition at line 586 of file gl_texture.cc.
References GPU_SAMPLER_MAX.
Referenced by blender::gpu::GLBackend::delete_resources().
|
static |
Other states are left to default:
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().
|
static |
Definition at line 567 of file gl_texture.cc.
References GPU_SAMPLER_ANISO, GPU_SAMPLER_ICON, GPU_SAMPLER_MIPMAP, min_ff(), state, and blender::gpu::GLContext::texture_filter_anisotropic_support.
Referenced by samplers_init(), and blender::gpu::GLBackend::samplers_update().
Implements blender::gpu::Texture.
Definition at line 460 of file gl_texture.cc.
References BLI_assert, blender::gpu::GLContext::direct_state_access_support, blender::gpu::GLContext::state_manager_active_get(), blender::gpu::GLContext::stencil_texturing_support, and blender::gpu::GLStateManager::texture_bind_temp().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 445 of file gl_texture.cc.
References blender::gpu::GLContext::direct_state_access_support, blender::gpu::GLContext::state_manager_active_get(), blender::gpu::swizzle_to_gl(), and blender::gpu::GLStateManager::texture_bind_temp().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 242 of file gl_texture.cc.
References BLI_assert, data, blender::gpu::Texture::dimensions_count(), blender::gpu::GLContext::direct_state_access_support, blender::gpu::Texture::format_, blender::gpu::Texture::format_flag_, blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::Texture::mipmaps_, offset, blender::gpu::debug::raise_gl_error(), size(), blender::gpu::GLContext::state_manager_active_get(), blender::gpu::GLStateManager::texture_bind_temp(), blender::gpu::to_block_size(), blender::gpu::to_gl(), blender::gpu::to_gl_data_format(), type, blender::gpu::Texture::type_, UNPACK2, UNPACK3, and blender::gpu::validate_data_format().
|
friend |
Definition at line 25 of file gl_texture.hh.
|
friend |
Definition at line 24 of file gl_texture.hh.