Blender  V2.93
Macros | Typedefs | Functions
draw_cache_impl_displist.c File Reference

DispList API for render engines. More...

#include "BLI_alloca.h"
#include "BLI_edgehash.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
#include "BKE_displist.h"
#include "BKE_displist_tangent.h"
#include "GPU_batch.h"
#include "GPU_capabilities.h"
#include "draw_cache_inline.h"
#include "draw_cache_impl.h"

Go to the source code of this file.

Macros

#define SURFACE_QUAD_ITER_BEGIN(dl)
 
#define SURFACE_QUAD_ITER_END
 
#define NO_EDGE   INT_MAX
 

Typedefs

typedef void() SetTriIndicesFn(void *thunk, uint v1, uint v2, uint v3)
 

Functions

static int dl_vert_len (const DispList *dl)
 
static int dl_tri_len (const DispList *dl)
 
static int curve_render_surface_vert_len_get (const ListBase *lb)
 
static int curve_render_surface_tri_len_get (const ListBase *lb)
 
static void displist_indexbufbuilder_set (SetTriIndicesFn *set_tri_indices, SetTriIndicesFn *set_quad_tri_indices, void *thunk, const DispList *dl, const int ofs)
 
static int displist_indexbufbuilder_tess_set (SetTriIndicesFn *set_tri_indices, SetTriIndicesFn *set_quad_tri_indices, void *thunk, const DispList *dl, const int ofs)
 
void DRW_displist_vertbuf_create_pos_and_nor (ListBase *lb, GPUVertBuf *vbo, const Scene *scene)
 
void DRW_vertbuf_create_wiredata (GPUVertBuf *vbo, const int vert_len)
 
void DRW_displist_vertbuf_create_wiredata (ListBase *lb, GPUVertBuf *vbo)
 
void DRW_displist_indexbuf_create_triangles_in_order (ListBase *lb, GPUIndexBuf *ibo)
 
void DRW_displist_indexbuf_create_triangles_loop_split_by_material (ListBase *lb, GPUIndexBuf **ibo_mats, uint mat_len)
 
static void set_overlay_wires_tri_indices (void *thunk, uint v1, uint v2, uint v3)
 
static void set_overlay_wires_quad_tri_indices (void *thunk, uint v1, uint v2, uint v3)
 
void DRW_displist_indexbuf_create_lines_in_order (ListBase *lb, GPUIndexBuf *ibo)
 
static void surf_uv_quad (const DispList *dl, const uint quad[4], float r_uv[4][2])
 
static void displist_vertbuf_attr_set_nor (GPUVertBufRaw *step, const GPUNormal *n1, const GPUNormal *n2, const GPUNormal *n3, const bool do_hq_normals)
 
static void displist_vertbuf_attr_set_tri_pos_nor_uv (GPUVertBufRaw *pos_step, GPUVertBufRaw *nor_step, GPUVertBufRaw *uv_step, GPUVertBufRaw *tan_step, const float v1[3], const float v2[3], const float v3[3], const GPUNormal *n1, const GPUNormal *n2, const GPUNormal *n3, const GPUNormal *t1, const GPUNormal *t2, const GPUNormal *t3, const float uv1[2], const float uv2[2], const float uv3[2], const bool do_hq_normals)
 
static void displist_surf_fnors_ensure (const DispList *dl, float(**fnors)[3])
 
void DRW_displist_vertbuf_create_loop_pos_and_nor_and_uv_and_tan (ListBase *lb, GPUVertBuf *vbo_pos_nor, GPUVertBuf *vbo_uv, GPUVertBuf *vbo_tan, const Scene *scene)
 
static void set_edge_adjacency_lines_indices (EdgeHash *eh, GPUIndexBufBuilder *elb, bool *r_is_manifold, uint v1, uint v2, uint v3)
 
static void set_edges_adjacency_lines_indices (void *thunk, uint v1, uint v2, uint v3)
 
void DRW_displist_indexbuf_create_edges_adjacency_lines (struct ListBase *lb, struct GPUIndexBuf *ibo, bool *r_is_manifold)
 

Detailed Description

DispList API for render engines.

Note
DispList may be removed soon! This is a utility for object types that use render.

Definition in file draw_cache_impl_displist.c.

Macro Definition Documentation

◆ NO_EDGE

#define NO_EDGE   INT_MAX

Definition at line 778 of file draw_cache_impl_displist.c.

◆ SURFACE_QUAD_ITER_BEGIN

#define SURFACE_QUAD_ITER_BEGIN (   dl)
Value:
{ \
uint quad[4]; \
int quad_index = 0; \
int max_v = (dl->flag & DL_CYCL_V) ? dl->parts : (dl->parts - 1); \
int max_u = (dl->flag & DL_CYCL_U) ? dl->nr : (dl->nr - 1); \
for (int v = 0; v < max_v; v++) { \
quad[3] = dl->nr * v; \
quad[0] = quad[3] + 1; \
quad[2] = quad[3] + dl->nr; \
quad[1] = quad[0] + dl->nr; \
/* Cyclic wrap */ \
if (v == dl->parts - 1) { \
quad[1] -= dl->parts * dl->nr; \
quad[2] -= dl->parts * dl->nr; \
} \
for (int u = 0; u < max_u; u++, quad_index++) { \
/* Cyclic wrap */ \
if (u == dl->nr - 1) { \
quad[0] -= dl->nr; \
quad[1] -= dl->nr; \
}
@ DL_CYCL_V
Definition: BKE_displist.h:54
@ DL_CYCL_U
Definition: BKE_displist.h:53
ATTR_WARN_UNUSED_RESULT const BMVert * v
GPUBatch * quad

Definition at line 436 of file draw_cache_impl_displist.c.

◆ SURFACE_QUAD_ITER_END

#define SURFACE_QUAD_ITER_END
Value:
quad[2] = quad[1]; \
quad[1]++; \
quad[3] = quad[0]; \
quad[0]++; \
} \
} \
}

Definition at line 459 of file draw_cache_impl_displist.c.

Typedef Documentation

◆ SetTriIndicesFn

typedef void() SetTriIndicesFn(void *thunk, uint v1, uint v2, uint v3)

Definition at line 91 of file draw_cache_impl_displist.c.

Function Documentation

◆ curve_render_surface_tri_len_get()

static int curve_render_surface_tri_len_get ( const ListBase lb)
static

◆ curve_render_surface_vert_len_get()

static int curve_render_surface_vert_len_get ( const ListBase lb)
static

◆ displist_indexbufbuilder_set()

static void displist_indexbufbuilder_set ( SetTriIndicesFn set_tri_indices,
SetTriIndicesFn set_quad_tri_indices,
void *  thunk,
const DispList dl,
const int  ofs 
)
static

◆ displist_indexbufbuilder_tess_set()

static int displist_indexbufbuilder_tess_set ( SetTriIndicesFn set_tri_indices,
SetTriIndicesFn set_quad_tri_indices,
void *  thunk,
const DispList dl,
const int  ofs 
)
static

◆ displist_surf_fnors_ensure()

static void displist_surf_fnors_ensure ( const DispList dl,
float(**)  fnors[3] 
)
static

◆ displist_vertbuf_attr_set_nor()

static void displist_vertbuf_attr_set_nor ( GPUVertBufRaw step,
const GPUNormal n1,
const GPUNormal n2,
const GPUNormal n3,
const bool  do_hq_normals 
)
static

◆ displist_vertbuf_attr_set_tri_pos_nor_uv()

static void displist_vertbuf_attr_set_tri_pos_nor_uv ( GPUVertBufRaw pos_step,
GPUVertBufRaw nor_step,
GPUVertBufRaw uv_step,
GPUVertBufRaw tan_step,
const float  v1[3],
const float  v2[3],
const float  v3[3],
const GPUNormal n1,
const GPUNormal n2,
const GPUNormal n3,
const GPUNormal t1,
const GPUNormal t2,
const GPUNormal t3,
const float  uv1[2],
const float  uv2[2],
const float  uv3[2],
const bool  do_hq_normals 
)
static

◆ dl_tri_len()

static int dl_tri_len ( const DispList dl)
static

◆ dl_vert_len()

static int dl_vert_len ( const DispList dl)
static

◆ DRW_displist_indexbuf_create_edges_adjacency_lines()

void DRW_displist_indexbuf_create_edges_adjacency_lines ( struct ListBase lb,
struct GPUIndexBuf ibo,
bool *  r_is_manifold 
)

◆ DRW_displist_indexbuf_create_lines_in_order()

void DRW_displist_indexbuf_create_lines_in_order ( ListBase lb,
GPUIndexBuf ibo 
)

◆ DRW_displist_indexbuf_create_triangles_in_order()

void DRW_displist_indexbuf_create_triangles_in_order ( ListBase lb,
GPUIndexBuf ibo 
)

◆ DRW_displist_indexbuf_create_triangles_loop_split_by_material()

void DRW_displist_indexbuf_create_triangles_loop_split_by_material ( ListBase lb,
GPUIndexBuf **  ibo_mats,
uint  mat_len 
)

◆ DRW_displist_vertbuf_create_loop_pos_and_nor_and_uv_and_tan()

void DRW_displist_vertbuf_create_loop_pos_and_nor_and_uv_and_tan ( ListBase lb,
GPUVertBuf vbo_pos_nor,
GPUVertBuf vbo_uv,
GPUVertBuf vbo_tan,
const Scene scene 
)

◆ DRW_displist_vertbuf_create_pos_and_nor()

void DRW_displist_vertbuf_create_pos_and_nor ( ListBase lb,
GPUVertBuf vbo,
const Scene scene 
)

◆ DRW_displist_vertbuf_create_wiredata()

void DRW_displist_vertbuf_create_wiredata ( ListBase lb,
GPUVertBuf vbo 
)

◆ DRW_vertbuf_create_wiredata()

void DRW_vertbuf_create_wiredata ( GPUVertBuf vbo,
const int  vert_len 
)

◆ set_edge_adjacency_lines_indices()

static void set_edge_adjacency_lines_indices ( EdgeHash eh,
GPUIndexBufBuilder elb,
bool *  r_is_manifold,
uint  v1,
uint  v2,
uint  v3 
)
static

◆ set_edges_adjacency_lines_indices()

static void set_edges_adjacency_lines_indices ( void *  thunk,
uint  v1,
uint  v2,
uint  v3 
)
static

◆ set_overlay_wires_quad_tri_indices()

static void set_overlay_wires_quad_tri_indices ( void *  thunk,
uint  v1,
uint  v2,
uint  v3 
)
static

◆ set_overlay_wires_tri_indices()

static void set_overlay_wires_tri_indices ( void *  thunk,
uint  v1,
uint  v2,
uint  v3 
)
static

◆ surf_uv_quad()

static void surf_uv_quad ( const DispList dl,
const uint  quad[4],
float  r_uv[4][2] 
)
static