|
Blender
V2.93
|
#include <gl_texture.hh>
Inherits blender::gpu::Texture.
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] |
| FrameBuffer * | fb_ [GPU_TEX_MAX_FBO_ATTACHED] |
Definition at line 39 of file gl_texture.hh.
| blender::gpu::GLTexture::GLTexture | ( | const char * | name | ) |
Definition at line 45 of file gl_texture.cc.
References BLI_assert, and blender::gpu::GLContext::get().
| blender::gpu::GLTexture::~GLTexture | ( | ) |
Definition at line 52 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 blender::gpu::GLTexture::check_feedback_loop | ( | void | ) |
Definition at line 675 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::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(), SNPRINTF, and type.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 334 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().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 358 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(), 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.
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().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 705 of file gl_texture.cc.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 104 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().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 66 of file gl_texture.cc.
References blender::gpu::GLContext::direct_state_access_support, blender::gpu::Texture::format_, GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_depth_blitting_workaround(), blender::gpu::GPU_TEXTURE_CUBE_ARRAY, 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::to_gl_target(), and blender::gpu::Texture::type_.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 447 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().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 386 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 560 of file gl_texture.cc.
References GPU_SAMPLER_MAX.
Referenced by blender::gpu::GLBackend::~GLBackend().
|
static |
Other states are left to default:
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().
|
static |
Definition at line 541 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().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 432 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 232 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_, 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 41 of file gl_texture.hh.
|
friend |
Definition at line 40 of file gl_texture.hh.