Blender V5.0
gpu_shader_cxx_sampler.hh File Reference

Go to the source code of this file.

Classes

struct  SamplerBase< T, Dimensions, Cube, Array, Atomic, Depth >

Macros

#define RET

Sampler Types

#define TEX_TEMPLATE
using samplerBuffer = SamplerBase<float, 1>
using sampler1D = SamplerBase<float, 1>
using sampler2D = SamplerBase<float, 2>
using sampler3D = SamplerBase<float, 3>
using isamplerBuffer = SamplerBase<int, 1>
using isampler1D = SamplerBase<int, 1>
using isampler2D = SamplerBase<int, 2>
using isampler3D = SamplerBase<int, 3>
using usamplerBuffer = SamplerBase<uint, 1>
using usampler1D = SamplerBase<uint, 1>
using usampler2D = SamplerBase<uint, 2>
using usampler3D = SamplerBase<uint, 3>
using sampler1DArray = SamplerBase<float, 1, false, true>
using sampler2DArray = SamplerBase<float, 2, false, true>
using isampler1DArray = SamplerBase<int, 1, false, true>
using isampler2DArray = SamplerBase<int, 2, false, true>
using usampler1DArray = SamplerBase<uint, 1, false, true>
using usampler2DArray = SamplerBase<uint, 2, false, true>
using samplerCube = SamplerBase<float, 2, true>
using isamplerCube = SamplerBase<int, 2, true>
using usamplerCube = SamplerBase<uint, 2, true>
using samplerCubeArray = SamplerBase<float, 2, true, true>
using isamplerCubeArray = SamplerBase<int, 2, true, true>
using usamplerCubeArray = SamplerBase<uint, 2, true, true>
using usampler1DAtomic = SamplerBase<uint, 1, false, false, true>
using usampler2DAtomic = SamplerBase<uint, 2, false, false, true>
using usampler2DArrayAtomic = SamplerBase<uint, 2, false, true, true>
using usampler3DAtomic = SamplerBase<uint, 3, false, false, true>
using isampler1DAtomic = SamplerBase<int, 1, false, false, true>
using isampler2DAtomic = SamplerBase<int, 2, false, false, true>
using isampler2DArrayAtomic = SamplerBase<int, 2, false, true, true>
using isampler3DAtomic = SamplerBase<int, 3, false, false, true>
using sampler2DDepth = SamplerBase<float, 2, false, false, false, true>
using sampler2DArrayDepth = SamplerBase<float, 2, false, true, false, true>
using samplerCubeDepth = SamplerBase<float, 2, true, false, false, true>
using samplerCubeArrayDepth = SamplerBase<float, 2, true, true, false, true>
TEX_TEMPLATE SizeVec textureSize (T, int) RET
TEX_TEMPLATE DataVec texelFetch (T, IntCoord, int) RET
TEX_TEMPLATE DataVec texelFetchOffset (T, IntCoord, int, IntCoord) RET
TEX_TEMPLATE DataVec texture (T, FltCoord, float=0.0f) RET
TEX_TEMPLATE DataVec textureGather (T, FltCoord) RET
TEX_TEMPLATE DataVec textureGrad (T, FltCoord, DerivVec, DerivVec) RET
TEX_TEMPLATE DataVec textureLod (T, FltCoord, float) RET
TEX_TEMPLATE DataVec textureLodOffset (T, FltCoord, float, IntCoord) RET
float4 texelFetch (samplerBuffer, int) RET
int4 texelFetch (isamplerBuffer, int) RET
uint4 texelFetch (usamplerBuffer, int) RET

Macro Definition Documentation

◆ RET

#define RET
Value:
{ \
return {}; \
}

C++ stubs for shading language.

IMPORTANT: Please ask the module team if you need some feature that are not listed in this file.

Definition at line 16 of file gpu_shader_cxx_sampler.hh.

◆ TEX_TEMPLATE

#define TEX_TEMPLATE
Value:
template<typename T, \
typename IntCoord = typename T::int_coord_type, \
typename FltCoord = typename T::flt_coord_type, \
typename DerivVec = typename T::derivative_type, \
typename DataVec = typename T::data_vec_type, \
typename SizeVec = typename T::size_vec_type>
#define T

Definition at line 43 of file gpu_shader_cxx_sampler.hh.

Referenced by texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGrad(), textureLod(), textureLodOffset(), and textureSize().

Typedef Documentation

◆ isampler1D

using isampler1D = SamplerBase<int, 1>

Definition at line 67 of file gpu_shader_cxx_sampler.hh.

◆ isampler1DArray

Definition at line 77 of file gpu_shader_cxx_sampler.hh.

◆ isampler1DAtomic

Definition at line 95 of file gpu_shader_cxx_sampler.hh.

◆ isampler2D

using isampler2D = SamplerBase<int, 2>

Definition at line 68 of file gpu_shader_cxx_sampler.hh.

◆ isampler2DArray

Definition at line 78 of file gpu_shader_cxx_sampler.hh.

◆ isampler2DArrayAtomic

Definition at line 97 of file gpu_shader_cxx_sampler.hh.

◆ isampler2DAtomic

Definition at line 96 of file gpu_shader_cxx_sampler.hh.

◆ isampler3D

using isampler3D = SamplerBase<int, 3>

Definition at line 69 of file gpu_shader_cxx_sampler.hh.

◆ isampler3DAtomic

Definition at line 98 of file gpu_shader_cxx_sampler.hh.

◆ isamplerBuffer

using isamplerBuffer = SamplerBase<int, 1>

Definition at line 66 of file gpu_shader_cxx_sampler.hh.

◆ isamplerCube

using isamplerCube = SamplerBase<int, 2, true>

Definition at line 83 of file gpu_shader_cxx_sampler.hh.

◆ isamplerCubeArray

Definition at line 87 of file gpu_shader_cxx_sampler.hh.

◆ sampler1D

Definition at line 63 of file gpu_shader_cxx_sampler.hh.

◆ sampler1DArray

Definition at line 75 of file gpu_shader_cxx_sampler.hh.

◆ sampler2D

Definition at line 64 of file gpu_shader_cxx_sampler.hh.

◆ sampler2DArray

Definition at line 76 of file gpu_shader_cxx_sampler.hh.

◆ sampler2DArrayDepth

Definition at line 101 of file gpu_shader_cxx_sampler.hh.

◆ sampler2DDepth

Definition at line 100 of file gpu_shader_cxx_sampler.hh.

◆ sampler3D

Definition at line 65 of file gpu_shader_cxx_sampler.hh.

◆ samplerBuffer

Definition at line 62 of file gpu_shader_cxx_sampler.hh.

◆ samplerCube

Definition at line 82 of file gpu_shader_cxx_sampler.hh.

◆ samplerCubeArray

Definition at line 86 of file gpu_shader_cxx_sampler.hh.

◆ samplerCubeArrayDepth

◆ samplerCubeDepth

Definition at line 102 of file gpu_shader_cxx_sampler.hh.

◆ usampler1D

Definition at line 71 of file gpu_shader_cxx_sampler.hh.

◆ usampler1DArray

Definition at line 79 of file gpu_shader_cxx_sampler.hh.

◆ usampler1DAtomic

Definition at line 90 of file gpu_shader_cxx_sampler.hh.

◆ usampler2D

Definition at line 72 of file gpu_shader_cxx_sampler.hh.

◆ usampler2DArray

Definition at line 80 of file gpu_shader_cxx_sampler.hh.

◆ usampler2DArrayAtomic

Definition at line 92 of file gpu_shader_cxx_sampler.hh.

◆ usampler2DAtomic

Definition at line 91 of file gpu_shader_cxx_sampler.hh.

◆ usampler3D

Definition at line 73 of file gpu_shader_cxx_sampler.hh.

◆ usampler3DAtomic

Definition at line 93 of file gpu_shader_cxx_sampler.hh.

◆ usamplerBuffer

Definition at line 70 of file gpu_shader_cxx_sampler.hh.

◆ usamplerCube

Definition at line 84 of file gpu_shader_cxx_sampler.hh.

◆ usamplerCubeArray

Definition at line 88 of file gpu_shader_cxx_sampler.hh.

Function Documentation

◆ texelFetch() [1/4]

int4 texelFetch ( isamplerBuffer ,
int  )

References RET.

◆ texelFetch() [2/4]

float4 texelFetch ( samplerBuffer ,
int  )

References RET.

◆ texelFetch() [3/4]

TEX_TEMPLATE DataVec texelFetch ( T ,
IntCoord ,
int  )

References RET, T, and TEX_TEMPLATE.

◆ texelFetch() [4/4]

uint4 texelFetch ( usamplerBuffer ,
int  )

References RET.

◆ texelFetchOffset()

TEX_TEMPLATE DataVec texelFetchOffset ( T ,
IntCoord ,
int ,
IntCoord  )

References RET, T, and TEX_TEMPLATE.

◆ texture()

TEX_TEMPLATE DataVec texture ( T ,
FltCoord ,
float = 0.0f )

References RET, T, and TEX_TEMPLATE.

Referenced by blender::draw::Manager::acquire_texture(), blender::gpu::MTLFrameBuffer::add_color_attachment(), blender::gpu::MTLFrameBuffer::add_depth_attachment(), blender::nodes::add_eval_dependencies_from_socket(), blender::gpu::MTLFrameBuffer::add_stencil_attachment(), blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor(), blender::draw::Manager::begin_sync(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), BKE_texture_dependsOnTime(), BKE_texture_dependsOnTime(), BKE_texture_fetch_images_for_pool(), BKE_texture_get_value(), BKE_texture_get_value_ex(), BKE_texture_is_image_user(), blf_batch_draw(), blender::gpu::MTLFrameBuffer::blit(), blender::deg::DepsgraphRelationBuilder::build_nodetree_socket(), blender::deg::DepsgraphNodeBuilder::build_texture(), blender::deg::DepsgraphRelationBuilder::build_texture(), blender::ocio::GPUShaderBinder::create_gpu_shader(), blender::ed::vse::create_texture(), GeometryManager::create_volume_mesh(), draw_display_buffer(), blender::workbench::Instance::draw_mesh(), draw_plane_marker_image(), draw_tile(), DRW_view_data_reset(), blender::gpu::MTLContext::ensure_texture_bindings(), blender::gpu::MTLContext::ensure_texture_bindings(), blender::gpu::MTLFrameBuffer::get_color_attachment_slot_from_texture(), blender::workbench::MeshPass::get_subpass(), GPU_image_tiled(), GPU_texture_anisotropic_filter(), GPU_texture_bind(), GPU_texture_bind_ex(), GPU_texture_compare_mode(), GPU_texture_depth(), GPU_texture_dimensions(), GPU_texture_extend_mode(), GPU_texture_extend_mode_x(), GPU_texture_extend_mode_y(), GPU_texture_filter_mode(), GPU_texture_format(), GPU_texture_free(), GPU_texture_get_mipmap_size(), GPU_texture_has_depth_format(), GPU_texture_has_float_format(), GPU_texture_has_integer_format(), GPU_texture_has_normalized_format(), GPU_texture_has_signed_format(), GPU_texture_has_stencil_format(), GPU_texture_height(), GPU_texture_is_array(), GPU_texture_is_cube(), GPU_texture_layer_count(), GPU_texture_mip_count(), GPU_texture_mipmap_mode(), GPU_texture_original_height(), GPU_texture_original_size_set(), GPU_texture_original_width(), GPU_texture_py_reference_get(), GPU_texture_py_reference_set(), GPU_texture_read(), GPU_texture_ref(), GPU_texture_swizzle_set(), GPU_texture_unbind(), GPU_texture_update_mipmap(), GPU_texture_update_sub_from_pixel_buffer(), GPU_texture_width(), blender::ocio::FallbackGPUShaderBinder::GPUShaderBinder(), blender::workbench::Instance::hair_sync(), blender::gpu::MTLFrameBuffer::has_color_attachment_with_texture(), blender::gpu::VKStateManager::image_bind(), image_foreach_cache(), blender::gpu::VKStateManager::image_unbind(), blender::gpu::VKTexture::init_internal(), blender::nodes::init_socket_cpp_value_from_property(), blender::compositor::is_compatible_texture(), make_socket_type_texture(), blender::workbench::Instance::mesh_sync(), blender::gpu::MTLStorageBuf::MTLStorageBuf(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), blender::compositor::parallel_reduction_dispatch(), blender::seq::preview_cache_set_gpu_display_texture(), blender::seq::preview_cache_set_gpu_texture(), blender::ed::vse::preview_draw_texture_simple(), blender::ed::vse::preview_draw_texture_to_linear(), pygpu_offscreen_texture_color_get(), blender::gpu::VKFrameBuffer::read(), blender::workbench::Instance::sculpt_sync(), blender::eevee::HiZBuffer::set_source(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), blender::eevee::LookdevWorld::sync(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::gpu::tests::test_framebuffer_clear_color_single_attachment(), blender::gpu::tests::test_framebuffer_clear_depth(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_scissor_test(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), blender::gpu::tests::test_texture_update_sub_no_unpack_row_length(), blender::gpu::tests::test_texture_update_sub_unpack_row_length(), blender::gpu::VKStateManager::texture_bind(), blender::gpu::tests::texture_create_upload_read(), blender::gpu::tests::texture_create_upload_read_pixel(), blender::gpu::tests::texture_create_upload_read_with_bias(), texture_foreach_id(), texture_free_data(), texture_init_data(), texture_nodes_fetch_images_for_pool(), blender::gpu::VKStateManager::texture_unbind(), blender::ed::outliner::TreeElementIDTexture::TreeElementIDTexture(), uiTemplateTextureShow(), blender::gpu::VKFrameBuffer::update_srgb(), update_tile_texture_pixels(), blender::gpu::VKImageView::VKImageView(), weightvg_do_mask(), wm_draw_offscreen_texture_parameters(), wm_draw_region_blend(), wm_draw_window(), wm_software_cursor_draw_bitmap(), blender::gpu::wrap(), blender::compositor::Result::wrap_external(), and blender::draw::Manager::~Manager().

◆ textureGather()

TEX_TEMPLATE DataVec textureGather ( T ,
FltCoord  )

References RET, T, TEX_TEMPLATE, and textureGather().

Referenced by textureGather().

◆ textureGrad()

TEX_TEMPLATE DataVec textureGrad ( T ,
FltCoord ,
DerivVec ,
DerivVec  )

References RET, T, TEX_TEMPLATE, and textureGrad().

Referenced by textureGrad().

◆ textureLod()

TEX_TEMPLATE DataVec textureLod ( T ,
FltCoord ,
float  )

References RET, T, TEX_TEMPLATE, and textureLod().

Referenced by textureLod().

◆ textureLodOffset()

TEX_TEMPLATE DataVec textureLodOffset ( T ,
FltCoord ,
float ,
IntCoord  )

References RET, T, TEX_TEMPLATE, and textureLodOffset().

Referenced by textureLodOffset().

◆ textureSize()

TEX_TEMPLATE SizeVec textureSize ( T ,
int  )

References RET, T, and TEX_TEMPLATE.