|
Blender V5.3
|
#include <GPU_texture.hh>
Public Member Functions | |
| void | enable_filtering_flag (GPUSamplerFiltering filtering_flags) |
| void | disable_filtering_flag (GPUSamplerFiltering filtering_flags) |
| void | set_filtering_flag_from_test (GPUSamplerFiltering filtering_flags, bool test) |
| std::string | to_string () const |
| uint32_t | as_uint () const |
| bool | operator== (GPUSamplerState const &rhs) const |
Static Public Member Functions | |
| static constexpr GPUSamplerState | default_sampler () |
| static constexpr GPUSamplerState | internal_sampler () |
| static constexpr GPUSamplerState | icon_sampler () |
| static constexpr GPUSamplerState | compare_sampler () |
Public Attributes | |
| GPUSamplerFiltering | filtering: 8 |
| GPUSamplerExtendMode | extend_x: 4 |
| GPUSamplerExtendMode | extend_yz: 4 |
| GPUSamplerCustomType | custom_type: 8 |
| GPUSamplerStateType | type: 8 |
The GPUSamplerState specifies the sampler state to bind a texture with.
When the state type is set to GPU_SAMPLER_STATE_TYPE_CUSTOM or GPU_SAMPLER_STATE_TYPE_INTERNAL, the rest of the members of the structure will be ignored. However, we can't turn this structure into a union, because various functions merely temporally change the state type and expect the rest of the members' values to be retained when the state type is changed back to GPU_SAMPLER_STATE_TYPE_PARAMETERS. For the instance, a function might do the following and expect the original sampler state of the texture to be retained after disabling comparison mode:
GPU_texture_compare_mode(texture, true); // Use the texture ... GPU_texture_compare_mode(texture, false);
Definition at line 478 of file GPU_texture.hh.
|
inline |
Definition at line 702 of file GPU_texture.hh.
References custom_type, extend_x, extend_yz, filtering, and type.
|
inlinestaticconstexpr |
Constructs a special sampler state for depth comparison. See the documentation on GPU_SAMPLER_CUSTOM_COMPARE for more information.
GPU_SAMPLER_STATE_TYPE_CUSTOM is set in order to specify a custom sampler type, so the rest of the options before it are ignored and irrelevant, but they are set to sensible defaults in case comparison mode is turned off, in which case, the sampler state will become equivalent to GPUSamplerState::default_sampler().
Definition at line 556 of file GPU_texture.hh.
References blender::GPU_SAMPLER_CUSTOM_COMPARE, blender::GPU_SAMPLER_EXTEND_MODE_EXTEND, blender::GPU_SAMPLER_FILTERING_DEFAULT, and blender::GPU_SAMPLER_STATE_TYPE_CUSTOM.
Referenced by blender::gpu::VKSamplers::init().
|
inlinestaticconstexpr |
Constructs a sampler state with default filtering and extended extend in both x and y axis. See the documentation on GPU_SAMPLER_FILTERING_DEFAULT and GPU_SAMPLER_EXTEND_MODE_EXTEND for more information.
GPU_SAMPLER_STATE_TYPE_PARAMETERS is set in order to utilize the aforementioned parameters, so GPU_SAMPLER_CUSTOM_COMPARE is arbitrary, ignored, and irrelevant.
Definition at line 505 of file GPU_texture.hh.
References blender::GPU_SAMPLER_CUSTOM_COMPARE, blender::GPU_SAMPLER_EXTEND_MODE_EXTEND, blender::GPU_SAMPLER_FILTERING_DEFAULT, and blender::GPU_SAMPLER_STATE_TYPE_PARAMETERS.
Referenced by draw_tile(), blender::gpu::MTLContext::get_default_sampler_state(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), blender::gpu::GLFrameBuffer::subpass_transition_impl(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), blender::eevee::MotionBlurModule::sync(), blender::eevee::RayTraceModule::sync(), blender::gpu::VKStateManager::texel_buffer_bind(), and blender::gpu::BindSpaceTextures::unbind().
|
inline |
Disables the given filtering flags.
Definition at line 576 of file GPU_texture.hh.
References filtering.
Referenced by blender::draw::detail::PassBase< DrawCommandBufType >::material_set(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), and set_filtering_flag_from_test().
|
inline |
Enables the given filtering flags.
Definition at line 568 of file GPU_texture.hh.
References filtering.
Referenced by blender::draw::detail::PassBase< DrawCommandBufType >::material_set(), and set_filtering_flag_from_test().
|
inlinestaticconstexpr |
Constructs a special sampler state that can be used sampler icons. See the documentation on GPU_SAMPLER_CUSTOM_ICON for more information.
GPU_SAMPLER_STATE_TYPE_CUSTOM is set in order to specify a custom sampler type, so the rest of the options before it are arbitrary, ignored, and irrelevant.
Definition at line 538 of file GPU_texture.hh.
References blender::GPU_SAMPLER_CUSTOM_ICON, blender::GPU_SAMPLER_EXTEND_MODE_EXTEND, blender::GPU_SAMPLER_FILTERING_DEFAULT, and blender::GPU_SAMPLER_STATE_TYPE_CUSTOM.
Referenced by blender::gpu::VKSamplers::init().
|
inlinestaticconstexpr |
Constructs a sampler state that can be used to signal that the internal sampler of the texture should be used instead. See the documentation on GPU_SAMPLER_STATE_TYPE_INTERNAL for more information.
GPU_SAMPLER_STATE_TYPE_INTERNAL is set in order to signal the use of the internal sampler of the texture, so the rest of the options before it are arbitrary, ignored, and irrelevant.
Definition at line 522 of file GPU_texture.hh.
References blender::GPU_SAMPLER_CUSTOM_COMPARE, blender::GPU_SAMPLER_EXTEND_MODE_EXTEND, blender::GPU_SAMPLER_FILTERING_DEFAULT, and blender::GPU_SAMPLER_STATE_TYPE_INTERNAL.
Referenced by blender::GPU_color_band().
|
inline |
Definition at line 712 of file GPU_texture.hh.
References custom_type, extend_x, extend_yz, filtering, and type.
|
inline |
Enables the given filtering flags if the given test is true, otherwise, disables the given filtering flags.
Definition at line 585 of file GPU_texture.hh.
References disable_filtering_flag(), and enable_filtering_flag().
Referenced by blender::gpu::GLTexturePool::acquire_texture_impl(), and blender::workbench::ObjectState::ObjectState().
|
inline |
Definition at line 595 of file GPU_texture.hh.
References blender::BLI_assert(), BLI_assert_unreachable, custom_type, extend_x, extend_yz, filtering, blender::GPU_SAMPLER_CUSTOM_COMPARE, blender::GPU_SAMPLER_CUSTOM_ICON, blender::GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER, blender::GPU_SAMPLER_EXTEND_MODE_EXTEND, blender::GPU_SAMPLER_EXTEND_MODE_MIRRORED_REPEAT, blender::GPU_SAMPLER_EXTEND_MODE_REPEAT, blender::GPU_SAMPLER_FILTERING_ANISOTROPIC_16, blender::GPU_SAMPLER_FILTERING_ANISOTROPIC_2, blender::GPU_SAMPLER_FILTERING_ANISOTROPIC_4, blender::GPU_SAMPLER_FILTERING_ANISOTROPIC_8, blender::GPU_SAMPLER_FILTERING_ANISOTROPIC_MASK, blender::GPU_SAMPLER_FILTERING_LINEAR, blender::GPU_SAMPLER_FILTERING_MIPMAP, blender::GPU_SAMPLER_STATE_TYPE_CUSTOM, blender::GPU_SAMPLER_STATE_TYPE_INTERNAL, blender::GPU_SAMPLER_STATE_TYPE_PARAMETERS, and type.
Referenced by blender::gpu::VKSampler::create(), blender::gpu::GLTexture::samplers_init(), and blender::draw::command::ResourceBind::serialize().
| GPUSamplerCustomType blender::GPUSamplerState::custom_type |
Specifies the type of sampler if the state type is GPU_SAMPLER_STATE_TYPE_CUSTOM.
Definition at line 493 of file GPU_texture.hh.
Referenced by as_uint(), blender::gpu::VKSampler::create(), blender::gpu::VKSamplers::get(), blender::gpu::GLTexture::get_sampler(), blender::gpu::MTLContext::get_sampler_from_state(), blender::gpu::MTLSamplerState::operator uint(), blender::gpu::MTLSamplerState::operator uint64_t(), operator==(), and to_string().
| GPUSamplerExtendMode blender::GPUSamplerState::extend_x |
Specifies how the texture will be extrapolated for out-of-bound texture sampling along the x axis.
Definition at line 485 of file GPU_texture.hh.
Referenced by as_uint(), blender::gpu::VKSampler::create(), blender::gpu::VKSamplers::get(), blender::gpu::GLTexture::get_sampler(), blender::gpu::MTLContext::get_sampler_from_state(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), blender::workbench::ObjectState::ObjectState(), blender::gpu::MTLSamplerState::operator uint(), blender::gpu::MTLSamplerState::operator uint64_t(), operator==(), and to_string().
| GPUSamplerExtendMode blender::GPUSamplerState::extend_yz |
Specifies how the texture will be extrapolated for out-of-bound texture sampling along both the y and z axis. There is no individual control for the z axis because 3D textures have limited use, and when used, their extend mode is typically the same for all axis.
Definition at line 491 of file GPU_texture.hh.
Referenced by as_uint(), blender::gpu::VKSampler::create(), blender::gpu::VKSamplers::get(), blender::gpu::GLTexture::get_sampler(), blender::gpu::MTLContext::get_sampler_from_state(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), blender::workbench::ObjectState::ObjectState(), blender::gpu::MTLSamplerState::operator uint(), blender::gpu::MTLSamplerState::operator uint64_t(), operator==(), and to_string().
| GPUSamplerFiltering blender::GPUSamplerState::filtering |
Specifies the enabled filtering options for the sampler.
Definition at line 480 of file GPU_texture.hh.
Referenced by as_uint(), blender::gpu::VKSampler::create(), disable_filtering_flag(), enable_filtering_flag(), blender::gpu::VKSamplers::get(), blender::gpu::GLTexture::get_sampler(), blender::gpu::MTLContext::get_sampler_from_state(), blender::gpu::Texture::init_1D(), blender::gpu::Texture::init_2D(), blender::gpu::Texture::init_3D(), blender::gpu::Texture::init_cubemap(), blender::draw::detail::PassBase< DrawCommandBufType >::material_set(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), blender::gpu::MTLSamplerState::operator uint(), blender::gpu::MTLSamplerState::operator uint64_t(), operator==(), and to_string().
| GPUSamplerStateType blender::GPUSamplerState::type |
Specifies how the GPUSamplerState structure should be interpreted when passed around.
Definition at line 495 of file GPU_texture.hh.
Referenced by as_uint(), blender::gpu::VKSampler::create(), blender::gpu::VKSamplers::get(), blender::gpu::GLTexture::get_sampler(), blender::gpu::MTLContext::get_sampler_from_state(), blender::gpu::MTLSamplerState::operator uint(), blender::gpu::MTLSamplerState::operator uint64_t(), operator==(), and to_string().