Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/DRW_render.h
| Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | void (*render_to_image)(void *vedata, | ||||
| struct RenderLayer *layer, | struct RenderLayer *layer, | ||||
| const struct rcti *rect); | const struct rcti *rect); | ||||
| } DrawEngineType; | } DrawEngineType; | ||||
| #ifndef __DRW_ENGINE_H__ | #ifndef __DRW_ENGINE_H__ | ||||
| /* Buffer and textures used by the viewport by default */ | /* Buffer and textures used by the viewport by default */ | ||||
| typedef struct DefaultFramebufferList { | typedef struct DefaultFramebufferList { | ||||
| struct GPUFrameBuffer *default_fb; | struct GPUFrameBuffer *default_fb; | ||||
| struct GPUFrameBuffer *in_front_fb; | |||||
| struct GPUFrameBuffer *color_only_fb; | struct GPUFrameBuffer *color_only_fb; | ||||
| struct GPUFrameBuffer *depth_only_fb; | struct GPUFrameBuffer *depth_only_fb; | ||||
| struct GPUFrameBuffer *multisample_fb; | struct GPUFrameBuffer *multisample_fb; | ||||
| } DefaultFramebufferList; | } DefaultFramebufferList; | ||||
| typedef struct DefaultTextureList { | typedef struct DefaultTextureList { | ||||
| struct GPUTexture *color; | struct GPUTexture *color; | ||||
| struct GPUTexture *depth; | struct GPUTexture *depth; | ||||
| struct GPUTexture *depth_in_front; | |||||
| struct GPUTexture *multisample_color; | struct GPUTexture *multisample_color; | ||||
| struct GPUTexture *multisample_depth; | struct GPUTexture *multisample_depth; | ||||
| } DefaultTextureList; | } DefaultTextureList; | ||||
| #endif | #endif | ||||
| /* Textures */ | /* Textures */ | ||||
| typedef enum { | typedef enum { | ||||
| DRW_TEX_FILTER = (1 << 0), | DRW_TEX_FILTER = (1 << 0), | ||||
| ▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | typedef enum { | ||||
| /** Use that if color is already premult by alpha. */ | /** Use that if color is already premult by alpha. */ | ||||
| DRW_STATE_BLEND_ALPHA_PREMUL = (1 << 19), | DRW_STATE_BLEND_ALPHA_PREMUL = (1 << 19), | ||||
| DRW_STATE_BLEND_ALPHA_UNDER_PREMUL = (1 << 20), | DRW_STATE_BLEND_ALPHA_UNDER_PREMUL = (1 << 20), | ||||
| DRW_STATE_BLEND_OIT = (1 << 21), | DRW_STATE_BLEND_OIT = (1 << 21), | ||||
| DRW_STATE_BLEND_MUL = (1 << 22), | DRW_STATE_BLEND_MUL = (1 << 22), | ||||
| /** Use dual source blending. WARNING: Only one color buffer allowed. */ | /** Use dual source blending. WARNING: Only one color buffer allowed. */ | ||||
| DRW_STATE_BLEND_CUSTOM = (1 << 23), | DRW_STATE_BLEND_CUSTOM = (1 << 23), | ||||
| DRW_STATE_IN_FRONT_SELECT = (1 << 25), | |||||
| DRW_STATE_LOGIC_INVERT = (1 << 26), | |||||
| DRW_STATE_SHADOW_OFFSET = (1 << 27), | DRW_STATE_SHADOW_OFFSET = (1 << 27), | ||||
| DRW_STATE_CLIP_PLANES = (1 << 28), | DRW_STATE_CLIP_PLANES = (1 << 28), | ||||
| DRW_STATE_WIRE_SMOOTH = (1 << 29), | DRW_STATE_WIRE_SMOOTH = (1 << 29), | ||||
| DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 30), | DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 30), | ||||
| /** DO NOT USE. Assumed always enabled. Only used internally. */ | /** DO NOT USE. Assumed always enabled. Only used internally. */ | ||||
| DRW_STATE_PROGRAM_POINT_SIZE = (1u << 31), | DRW_STATE_PROGRAM_POINT_SIZE = (1u << 31), | ||||
| } DRWState; | } DRWState; | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
| void DRW_shgroup_call_range(DRWShadingGroup *shgroup, | void DRW_shgroup_call_range(DRWShadingGroup *shgroup, | ||||
| struct GPUBatch *geom, | struct GPUBatch *geom, | ||||
| uint v_sta, | uint v_sta, | ||||
| uint v_ct); | uint v_ct); | ||||
| void DRW_shgroup_call_procedural_points(DRWShadingGroup *sh, Object *ob, uint point_ct); | void DRW_shgroup_call_procedural_points(DRWShadingGroup *sh, Object *ob, uint point_ct); | ||||
| void DRW_shgroup_call_procedural_lines(DRWShadingGroup *sh, Object *ob, uint line_ct); | void DRW_shgroup_call_procedural_lines(DRWShadingGroup *sh, Object *ob, uint line_ct); | ||||
| void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *sh, Object *ob, uint tri_ct); | void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *sh, Object *ob, uint tri_ct); | ||||
| /* Warning: Only use with Shaders that have IN_PLACE_INSTANCES defined. */ | |||||
| void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, | void DRW_shgroup_call_instances(DRWShadingGroup *shgroup, | ||||
| Object *ob, | Object *ob, | ||||
| struct GPUBatch *geom, | struct GPUBatch *geom, | ||||
| uint count); | uint count); | ||||
| /* Warning: Only use with Shaders that have INSTANCED_ATTRIB defined. */ | |||||
| void DRW_shgroup_call_instances_with_attribs(DRWShadingGroup *shgroup, | void DRW_shgroup_call_instances_with_attribs(DRWShadingGroup *shgroup, | ||||
| Object *ob, | Object *ob, | ||||
| struct GPUBatch *geom, | struct GPUBatch *geom, | ||||
| struct GPUBatch *inst_attributes); | struct GPUBatch *inst_attributes); | ||||
| void DRW_shgroup_call_sculpt(DRWShadingGroup *sh, Object *ob, bool wire, bool mask, bool vcol); | void DRW_shgroup_call_sculpt(DRWShadingGroup *sh, Object *ob, bool wire, bool mask, bool vcol); | ||||
| void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **sh, Object *ob, bool vcol); | void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **sh, Object *ob, bool vcol); | ||||
| DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shading_group, | DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shading_group, | ||||
| struct GPUVertFormat *format, | struct GPUVertFormat *format, | ||||
| GPUPrimType prim_type); | GPUPrimType prim_type); | ||||
| DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shading_group, | DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shading_group, | ||||
| struct GPUVertFormat *format, | struct GPUVertFormat *format, | ||||
| struct GPUBatch *geom); | struct GPUBatch *geom); | ||||
| void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data); | |||||
| void DRW_buffer_add_entry_array(DRWCallBuffer *buffer, const void *attr[], uint attr_len); | void DRW_buffer_add_entry_array(DRWCallBuffer *buffer, const void *attr[], uint attr_len); | ||||
| #define DRW_buffer_add_entry(buffer, ...) \ | #define DRW_buffer_add_entry(buffer, ...) \ | ||||
| do { \ | do { \ | ||||
| const void *array[] = {__VA_ARGS__}; \ | const void *array[] = {__VA_ARGS__}; \ | ||||
| DRW_buffer_add_entry_array(buffer, array, (sizeof(array) / sizeof(*array))); \ | DRW_buffer_add_entry_array(buffer, array, (sizeof(array) / sizeof(*array))); \ | ||||
| } while (0) | } while (0) | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
| /* TODO Replace with passes inheritance. */ | /* TODO Replace with passes inheritance. */ | ||||
| void DRW_pass_state_set(DRWPass *pass, DRWState state); | void DRW_pass_state_set(DRWPass *pass, DRWState state); | ||||
| void DRW_pass_state_add(DRWPass *pass, DRWState state); | void DRW_pass_state_add(DRWPass *pass, DRWState state); | ||||
| void DRW_pass_state_remove(DRWPass *pass, DRWState state); | void DRW_pass_state_remove(DRWPass *pass, DRWState state); | ||||
| void DRW_pass_foreach_shgroup(DRWPass *pass, | void DRW_pass_foreach_shgroup(DRWPass *pass, | ||||
| void (*callback)(void *userData, DRWShadingGroup *shgrp), | void (*callback)(void *userData, DRWShadingGroup *shgrp), | ||||
| void *userData); | void *userData); | ||||
| void DRW_pass_sort_shgroup_z(DRWPass *pass); | void DRW_pass_sort_shgroup_z(DRWPass *pass); | ||||
| void DRW_pass_sort_shgroup_reverse(DRWPass *pass); | |||||
| bool DRW_pass_is_empty(DRWPass *pass); | bool DRW_pass_is_empty(DRWPass *pass); | ||||
| #define DRW_PASS_CREATE(pass, state) (pass = DRW_pass_create(#pass, state)) | #define DRW_PASS_CREATE(pass, state) (pass = DRW_pass_create(#pass, state)) | ||||
| /* Views */ | /* Views */ | ||||
| DRWView *DRW_view_create(const float viewmat[4][4], | DRWView *DRW_view_create(const float viewmat[4][4], | ||||
| const float winmat[4][4], | const float winmat[4][4], | ||||
| ▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines | |||||