Blender  V3.3
draw_view_info.hh File Reference
#include "gpu_shader_create_info.hh"

Go to the source code of this file.

Functions

Resource ID

This is used to fetch per object data in drw_matrices and other object indexed buffers. There is multiple possibilities depending on how we are drawing the object.

 GPU_SHADER_CREATE_INFO (draw_resource_id).define("DYNAMIC_RESOURCE_ID")
 
 flat (Type::INT, "resource_index")
 
 vertex_out (draw_resource_id_iface) .geometry_out(draw_resource_id_iface)
 
Draw View
 uniform_buf (0, "ViewInfos", "drw_view", Frequency::PASS) .typedef_source("draw_shader_shared.h")
 
 uniform_buf (8, "ObjectMatrices", "drw_matrices[DRW_RESOURCE_CHUNK_LEN]", Frequency::BATCH) .define("ModelMatrix"
 
drw_matrices[resource_id] drw_modelMatrix define ("ModelMatrixInverse", "(drw_matrices[resource_id].drw_modelMatrixInverse)") .additional_info("draw_view")
 
 GPU_SHADER_CREATE_INFO (drw_clipped).define("USE_WORLD_CLIP_PLANES")
 

Draw Globals

 GlobalsUboStorage
 
 globalsBlock
 
 typedef_source ("draw_common_shader_shared.h") .uniform_buf(7
 

Geometry Type

 draw_resource_id
 
sampler(15, ImageType::FLOAT_BUFFER, "hairPointBuffer") .push_constant(Type pos_inst draw_resource_id_uniform
 
 GPU_SHADER_CREATE_INFO (draw_mesh).additional_info("draw_modelmat"
 
sampler(15, ImageType::FLOAT_BUFFER, "hairPointBuffer") .push_constant(Type vertex_in (0, Type::VEC4, "pos") .vertex_in(1
 
sampler(15, ImageType::FLOAT_BUFFER, "hairPointBuffer") .push_constant(Type pos_inst vertex_in (2, Type::VEC3, "nor") .additional_info("draw_modelmat_instanced_attr"
 
 GPU_SHADER_CREATE_INFO (draw_volume).additional_info("draw_modelmat"
 
 typedef_source ("gpencil_shader_shared.h") .define("DRW_GPENCIL_INFO") .vertex_in(0
 
ma vertex_in (1, Type::IVEC4, "ma1") .vertex_in(2
 
ma ma2 vertex_in (3, Type::IVEC4, "ma3") .vertex_in(4
 
ma ma2 pos vertex_in (5, Type::VEC4, "pos1") .vertex_in(6
 
ma ma2 pos pos2 vertex_in (7, Type::VEC4, "pos3") .vertex_in(8
 
ma ma2 pos pos2 uv1 vertex_in (9, Type::VEC4, "uv2") .vertex_in(10
 
ma ma2 pos pos2 uv1 col1 vertex_in (11, Type::VEC4, "col2") .vertex_in(12
 

Function Documentation

◆ define()

drw_matrices [resource_id] drw_modelMatrix define ( "ModelMatrixInverse"  ,
"(drw_matrices[resource_id].drw_modelMatrixInverse)"   
)

◆ flat()

flat ( Type::INT  ,
"resource_index"   
)

Used if the resource index needs to be passed to the fragment shader. IMPORTANT: Vertex and Geometry shaders need to use PASS_RESOURCE_ID in main().

Referenced by do_kink(), and offset_child().

◆ GPU_SHADER_CREATE_INFO() [1/4]

GPU_SHADER_CREATE_INFO ( draw_mesh  )

◆ GPU_SHADER_CREATE_INFO() [2/4]

GPU_SHADER_CREATE_INFO ( draw_resource_id  )

◆ GPU_SHADER_CREATE_INFO() [3/4]

GPU_SHADER_CREATE_INFO ( draw_volume  )

◆ GPU_SHADER_CREATE_INFO() [4/4]

GPU_SHADER_CREATE_INFO ( drw_clipped  )

◆ typedef_source() [1/2]

typedef_source ( "draw_common_shader_shared.h"  )

◆ typedef_source() [2/2]

typedef_source ( "gpencil_shader_shared.h"  )

◆ uniform_buf() [1/2]

uniform_buf ( ,
"ViewInfos"  ,
"drw_view"  ,
Frequency::PASS   
)

◆ uniform_buf() [2/2]

uniform_buf ( ,
"ObjectMatrices"  ,
"drw_matrices"  [DRW_RESOURCE_CHUNK_LEN],
Frequency::BATCH   
)

◆ vertex_in() [1/8]

sampler (15, ImageType::FLOAT_BUFFER, "hairPointBuffer") .push_constant(Type vertex_in ( ,
Type::VEC4  ,
"pos"   
)

◆ vertex_in() [2/8]

ma vertex_in ( ,
Type::IVEC4  ,
"ma1"   
)

◆ vertex_in() [3/8]

ma ma2 pos pos2 uv1 col1 vertex_in ( 11  ,
Type::VEC4  ,
"col2"   
)

◆ vertex_in() [4/8]

sampler (15, ImageType::FLOAT_BUFFER, "hairPointBuffer") .push_constant(Type pos_inst vertex_in ( ,
Type::VEC3  ,
"nor"   
)

◆ vertex_in() [5/8]

ma ma2 vertex_in ( ,
Type::IVEC4  ,
"ma3"   
)

◆ vertex_in() [6/8]

ma ma2 pos vertex_in ( ,
Type::VEC4  ,
"pos1"   
)

◆ vertex_in() [7/8]

ma ma2 pos pos2 vertex_in ( ,
Type::VEC4  ,
"pos3"   
)

◆ vertex_in() [8/8]

ma ma2 pos pos2 uv1 vertex_in ( ,
Type::VEC4  ,
"uv2"   
)

◆ vertex_out()

vertex_out ( draw_resource_id_iface  )

Variable Documentation

◆ draw_resource_id

draw_resource_id

Definition at line 91 of file draw_view_info.hh.

◆ draw_resource_id_uniform

draw_resource_id_uniform

Definition at line 110 of file draw_view_info.hh.

◆ globalsBlock

globalsBlock

Definition at line 83 of file draw_view_info.hh.

◆ GlobalsUboStorage

Definition at line 83 of file draw_view_info.hh.