|
Blender V4.3
|
#include <DRW_gpu_wrapper.hh>
Inherits blender::NonCopyable.
Inherited by blender::draw::TextureFromPool, blender::draw::TextureRef, and blender::eevee::UtilityTexture.
Public Member Functions | |
| Texture (const char *name="gpu::Texture") | |
| Texture (const char *name, eGPUTextureFormat format, eGPUTextureUsage usage, int extent, const float *data=nullptr, bool cubemap=false, int mip_len=1) | |
| Texture (const char *name, eGPUTextureFormat format, eGPUTextureUsage usage, int extent, int layers, const float *data=nullptr, bool cubemap=false, int mip_len=1) | |
| Texture (const char *name, eGPUTextureFormat format, eGPUTextureUsage usage, int2 extent, const float *data=nullptr, int mip_len=1) | |
| Texture (const char *name, eGPUTextureFormat format, eGPUTextureUsage usage, int2 extent, int layers, const float *data=nullptr, int mip_len=1) | |
| Texture (const char *name, eGPUTextureFormat format, eGPUTextureUsage usage, int3 extent, const float *data=nullptr, int mip_len=1) | |
| Texture (Texture &&other)=default | |
| ~Texture () | |
| GPUTexture * | gpu_texture () |
| operator GPUTexture * () const | |
| GPUTexture ** | operator& () |
| Texture * | ptr () |
| Texture & | operator= (Texture &&a) |
| bool | ensure_1d (eGPUTextureFormat format, int extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1) |
| bool | ensure_1d_array (eGPUTextureFormat format, int extent, int layers, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1) |
| bool | ensure_2d (eGPUTextureFormat format, int2 extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1) |
| bool | ensure_2d_array (eGPUTextureFormat format, int2 extent, int layers, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1) |
| bool | ensure_3d (eGPUTextureFormat format, int3 extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1) |
| bool | ensure_cube (eGPUTextureFormat format, int extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, float *data=nullptr, int mip_len=1) |
| bool | ensure_cube_array (eGPUTextureFormat format, int extent, int layers, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1) |
| bool | ensure_mip_views (bool cube_as_array=false) |
| GPUTexture * | mip_view (int miplvl) |
| int | mip_count () const |
| bool | ensure_layer_views (bool cube_as_array=false) |
| GPUTexture * | layer_view (int layer) |
| GPUTexture * | stencil_view (bool cube_as_array=false) |
| GPUTexture * | layer_range_view (int layer_start, int layer_len, bool cube_as_array=false) |
| bool | is_valid () const |
| int | width () const |
| int | height () const |
| int | depth () const |
| int | pixel_count () const |
| bool | is_depth () const |
| bool | is_stencil () const |
| bool | is_integer () const |
| bool | is_cube () const |
| bool | is_array () const |
| int3 | size (int miplvl=0) const |
| void | clear (float4 values) |
| void | clear (uint4 values) |
| void | clear (int4 values) |
| void | debug_clear () |
| template<typename T > | |
| T * | read (eGPUDataFormat format, int miplvl=0) |
| void | filter_mode (bool do_filter) |
| void | free () |
Static Public Member Functions | |
| static void | swap (Texture &a, Texture &b) |
Protected Attributes | |
| GPUTexture * | tx_ = nullptr |
| GPUTexture * | stencil_view_ = nullptr |
| Vector< GPUTexture *, 0 > | mip_views_ |
| Vector< GPUTexture *, 0 > | layer_views_ |
| GPUTexture * | layer_range_view_ = nullptr |
| const char * | name_ |
Definition at line 526 of file DRW_gpu_wrapper.hh.
|
inline |
Definition at line 536 of file DRW_gpu_wrapper.hh.
|
inline |
Definition at line 538 of file DRW_gpu_wrapper.hh.
References tx_.
|
inline |
Definition at line 550 of file DRW_gpu_wrapper.hh.
References tx_.
|
inline |
Definition at line 563 of file DRW_gpu_wrapper.hh.
|
inline |
Definition at line 574 of file DRW_gpu_wrapper.hh.
|
inline |
Definition at line 586 of file DRW_gpu_wrapper.hh.
|
default |
|
inline |
Definition at line 598 of file DRW_gpu_wrapper.hh.
References free().
|
inline |
Clear the entirety of the texture using one pixel worth of data.
Definition at line 906 of file DRW_gpu_wrapper.hh.
References GPU_DATA_FLOAT, GPU_texture_clear(), and tx_.
Referenced by blender::eevee::GBuffer::bind(), debug_clear(), blender::eevee::VolumeModule::end_sync(), blender::eevee::RayTraceBuffer::feedback_ensure(), blender::eevee::Film::init(), blender::eevee::VolumeProbeModule::init(), blender::eevee::DepthOfField::render(), blender::eevee::RayTraceModule::render(), blender::eevee::VolumeLayer::render(), blender::eevee::WorldVolumePipeline::render(), blender::eevee::CaptureView::render_probes(), blender::eevee::ShadowTileMapPool::ShadowTileMapPool(), and blender::draw::test_eevee_shadow_finalize().
|
inline |
Clear the entirety of the texture using one pixel worth of data.
Definition at line 922 of file DRW_gpu_wrapper.hh.
References GPU_DATA_INT, GPU_texture_clear(), and tx_.
|
inline |
Clear the entirety of the texture using one pixel worth of data.
Definition at line 914 of file DRW_gpu_wrapper.hh.
References GPU_DATA_UINT, GPU_texture_clear(), and tx_.
|
inline |
Clear the texture to NaN for floats, or a to debug value for integers. (For debugging uninitialized data issues)
Definition at line 931 of file DRW_gpu_wrapper.hh.
References clear(), GPU_texture_has_float_format(), GPU_texture_has_integer_format(), GPU_texture_has_normalized_format(), GPU_texture_has_signed_format(), and NAN_FLT.
Referenced by blender::draw::TextureFromPool::acquire().
|
inline |
Definition at line 861 of file DRW_gpu_wrapper.hh.
References GPU_texture_depth(), and tx_.
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 653 of file DRW_gpu_wrapper.hh.
Referenced by blender::workbench::VolumePass::sync().
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 666 of file DRW_gpu_wrapper.hh.
References BLI_assert.
Referenced by blender::workbench::SceneResources::init().
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 681 of file DRW_gpu_wrapper.hh.
References UNPACK2.
Referenced by blender::eevee::GBuffer::acquire(), blender::eevee::RenderBuffers::acquire(), blender::workbench::AntiAliasingPass::AntiAliasingPass(), blender::eevee::DeferredLayer::DeferredLayer(), blender::workbench::AntiAliasingPass::draw(), blender::workbench::OpaquePass::draw(), blender::eevee::VolumeModule::end_sync(), blender::workbench::StencilViewWorkaround::extract(), blender::eevee::RayTraceBuffer::feedback_ensure(), blender::draw::overlay::Instance::init(), blender::eevee::Film::init(), blender::eevee::LookdevModule::init(), blender::eevee::RayTraceModule::init(), blender::workbench::DofPass::init(), blender::workbench::SceneResources::init(), blender::workbench::SceneResources::load_jitter_tx(), blender::eevee::DepthOfField::render(), blender::eevee::ShadowTileMapPool::ShadowTileMapPool(), blender::eevee::DepthOfField::sync(), blender::eevee::WorldPipeline::sync(), blender::workbench::AntiAliasingPass::sync(), blender::draw::test_draw_resource_id_gen(), blender::draw::test_draw_visibility(), blender::draw::test_eevee_shadow_finalize(), and blender::draw::test_eevee_shadow_tilemap_amend().
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 694 of file DRW_gpu_wrapper.hh.
References BLI_assert, and UNPACK2.
Referenced by blender::eevee::GBuffer::acquire(), blender::eevee::RenderBuffers::acquire(), blender::eevee::Film::init(), blender::eevee::LookdevModule::init(), blender::eevee::ShadowModule::init(), blender::workbench::SceneResources::init(), blender::eevee::RayTraceModule::render(), blender::eevee::PlanarProbeModule::set_view(), blender::eevee::ShadowModule::set_view(), and blender::eevee::WorldPipeline::sync().
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 709 of file DRW_gpu_wrapper.hh.
References UNPACK3.
Referenced by blender::eevee::VolumeModule::end_sync(), blender::eevee::VolumeProbeModule::init(), blender::eevee::Precompute::Precompute(), blender::workbench::VolumePass::sync(), and blender::eevee::VolumeModule::VolumeModule().
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 722 of file DRW_gpu_wrapper.hh.
|
inline |
Ensure the texture has the correct properties. Recreating it if needed. Return true if a texture has been created.
Definition at line 735 of file DRW_gpu_wrapper.hh.
|
inline |
Ensure the availability of layer views. Layer views covers all layers of array textures. Returns true if the views were (re)created.
Definition at line 784 of file DRW_gpu_wrapper.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), GPU_texture_create_view(), GPU_texture_format(), GPU_TEXTURE_FREE_SAFE, GPU_texture_layer_count(), layer_views_, name_, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and tx_.
Referenced by blender::eevee::GBuffer::acquire(), blender::eevee::Film::get_aov_texture(), blender::eevee::Film::get_pass_texture(), and blender::eevee::PlanarProbeModule::set_view().
|
inline |
Ensure the availability of mipmap views. MIP view covers all layers of array textures.
Definition at line 749 of file DRW_gpu_wrapper.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), GPU_texture_create_view(), GPU_texture_format(), GPU_TEXTURE_FREE_SAFE, GPU_texture_mip_count(), mip_views_, name_, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and tx_.
Referenced by blender::workbench::DofPass::init(), and blender::eevee::DepthOfField::sync().
|
inline |
Definition at line 955 of file DRW_gpu_wrapper.hh.
References GPU_texture_filter_mode(), and tx_.
Referenced by blender::eevee::ShadowModule::init(), and blender::workbench::DofPass::init().
|
inline |
Free the internal texture but not the #draw::Texture itself.
Definition at line 963 of file DRW_gpu_wrapper.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), GPU_TEXTURE_FREE_SAFE, layer_range_view_, layer_views_, mip_views_, stencil_view_, and tx_.
Referenced by blender::workbench::AntiAliasingPass::draw(), blender::workbench::OpaquePass::draw(), blender::eevee::VolumeModule::end_sync(), blender::eevee::VolumeProbeModule::init(), blender::workbench::DofPass::init(), blender::workbench::SceneResources::load_jitter_tx(), operator=(), blender::eevee::ShadowModule::set_view(), blender::workbench::AntiAliasingPass::sync(), and ~Texture().
|
inline |
Definition at line 603 of file DRW_gpu_wrapper.hh.
References tx_.
Referenced by blender::draw::compositor::Context::get_input_texture().
|
inline |
Definition at line 856 of file DRW_gpu_wrapper.hh.
References GPU_texture_height(), and tx_.
Referenced by blender::workbench::StencilViewWorkaround::extract(), and blender::eevee::MotionBlurModule::render().
|
inline |
Definition at line 891 of file DRW_gpu_wrapper.hh.
References GPU_texture_is_array(), and tx_.
|
inline |
Definition at line 886 of file DRW_gpu_wrapper.hh.
References GPU_texture_is_cube(), and tx_.
|
inline |
Definition at line 871 of file DRW_gpu_wrapper.hh.
References GPU_texture_has_depth_format(), and tx_.
|
inline |
Definition at line 881 of file DRW_gpu_wrapper.hh.
References GPU_texture_has_integer_format(), and tx_.
|
inline |
Definition at line 876 of file DRW_gpu_wrapper.hh.
References GPU_texture_has_stencil_format(), and tx_.
|
inline |
Returns true if the texture has been allocated or acquired from the pool.
Definition at line 846 of file DRW_gpu_wrapper.hh.
References tx_.
Referenced by blender::draw::overlay::Instance::draw(), blender::workbench::AntiAliasingPass::draw(), blender::workbench::OpaquePass::draw(), blender::workbench::TransparentDepthPass::draw(), blender::draw::overlay::MeshUVs::end_sync(), blender::eevee::ShadowModule::init(), blender::eevee::VolumeProbeModule::init(), blender::workbench::SceneResources::init(), layer_range_view(), blender::eevee::RayTraceModule::render(), and blender::eevee::ShadowModule::set_view().
|
inline |
Layer range view cover only the given range. This can only called to create one range. View is recreated if:
Definition at line 825 of file DRW_gpu_wrapper.hh.
References BLI_assert, BLI_assert_msg, GPU_texture_create_view(), GPU_texture_format(), GPU_TEXTURE_FREE_SAFE, GPU_texture_layer_count(), is_valid(), layer_range_view_, name_, and tx_.
Referenced by blender::eevee::GBuffer::acquire().
|
inline |
Definition at line 801 of file DRW_gpu_wrapper.hh.
References layer_views_.
Referenced by blender::eevee::Film::get_aov_texture(), blender::eevee::Film::get_pass_texture(), blender::eevee::ShadingView::render(), blender::eevee::CaptureView::render_probes(), and blender::eevee::PlanarProbeModule::set_view().
|
inline |
Definition at line 774 of file DRW_gpu_wrapper.hh.
References GPU_texture_mip_count(), and tx_.
|
inline |
Definition at line 766 of file DRW_gpu_wrapper.hh.
References BLI_assert_msg, mip_views_, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
|
inline |
Definition at line 609 of file DRW_gpu_wrapper.hh.
References BLI_assert, and tx_.
|
inline |
Definition at line 616 of file DRW_gpu_wrapper.hh.
References tx_.
Definition at line 627 of file DRW_gpu_wrapper.hh.
References free().
|
inline |
Definition at line 866 of file DRW_gpu_wrapper.hh.
References GPU_texture_height(), GPU_texture_width(), and tx_.
Referenced by blender::eevee::DepthOfField::sync().
|
inline |
WORKAROUND: used when needing a ref to the Texture and not the GPUTexture.
Definition at line 622 of file DRW_gpu_wrapper.hh.
|
inline |
Returns a buffer containing the texture data for the specified miplvl. The memory block needs to be manually freed by MEM_freeN().
Definition at line 950 of file DRW_gpu_wrapper.hh.
References GPU_texture_read(), and tx_.
Referenced by blender::eevee::Precompute::Precompute(), blender::draw::test_eevee_shadow_finalize(), and blender::draw::test_eevee_shadow_tilemap_amend().
Definition at line 896 of file DRW_gpu_wrapper.hh.
References GPU_texture_get_mipmap_size(), size(), and tx_.
Referenced by blender::draw::overlay::Instance::draw(), blender::draw::overlay::Outline::draw(), blender::draw::overlay::MeshUVs::end_sync(), size(), and blender::eevee::Film::sync().
|
inline |
Definition at line 806 of file DRW_gpu_wrapper.hh.
References GPU_texture_create_view(), GPU_texture_format(), name_, stencil_view_, and tx_.
Referenced by blender::workbench::StencilViewWorkaround::extract().
Swap the content of the two textures.
Definition at line 981 of file DRW_gpu_wrapper.hh.
References b.
Referenced by blender::draw::TextureFromPool::swap(), and blender::draw::TextureFromPool::swap().
|
inline |
Definition at line 851 of file DRW_gpu_wrapper.hh.
References GPU_texture_width(), and tx_.
Referenced by blender::workbench::StencilViewWorkaround::extract(), and blender::eevee::MotionBlurModule::render().
|
protected |
Definition at line 532 of file DRW_gpu_wrapper.hh.
Referenced by free(), and layer_range_view().
|
protected |
Definition at line 531 of file DRW_gpu_wrapper.hh.
Referenced by ensure_layer_views(), free(), and layer_view().
|
protected |
Definition at line 530 of file DRW_gpu_wrapper.hh.
Referenced by ensure_mip_views(), free(), and mip_view().
|
protected |
Definition at line 533 of file DRW_gpu_wrapper.hh.
Referenced by ensure_layer_views(), ensure_mip_views(), layer_range_view(), and stencil_view().
|
protected |
Definition at line 529 of file DRW_gpu_wrapper.hh.
Referenced by free(), and stencil_view().
|
protected |
Definition at line 528 of file DRW_gpu_wrapper.hh.
Referenced by clear(), clear(), clear(), depth(), ensure_layer_views(), ensure_mip_views(), filter_mode(), free(), gpu_texture(), height(), is_array(), is_cube(), is_depth(), is_integer(), is_stencil(), is_valid(), layer_range_view(), mip_count(), operator GPUTexture *(), operator&(), pixel_count(), read(), size(), stencil_view(), Texture(), Texture(), Texture(), Texture(), Texture(), and width().