40 #define USE_GPU_SELECT
43 #define USE_BATCHING 1
46 #define DRW_DEBUG_USE_UNIFORM_NAME 0
47 #define DRW_UNIFORM_BUFFER_NAME 64
56 # define PROFILE_TIMER_FALLOFF 0.04
58 # define PROFILE_START(time_start) \
59 double time_start = PIL_check_seconds_timer(); \
62 # define PROFILE_END_ACCUM(time_accum, time_start) \
64 time_accum += (PIL_check_seconds_timer() - time_start) * 1e3; \
69 # define PROFILE_END_UPDATE(time_update, time_start) \
71 double _time_delta = (PIL_check_seconds_timer() - time_start) * 1e3; \
72 time_update = (time_update * (1.0 - PROFILE_TIMER_FALLOFF)) + \
73 (_time_delta * PROFILE_TIMER_FALLOFF); \
79 # define PROFILE_START(time_start) ((void)0)
80 # define PROFILE_END_ACCUM(time_accum, time_start) ((void)0)
81 # define PROFILE_END_UPDATE(time_update, time_start) ((void)0)
116 #define DRW_RESOURCE_CHUNK_LEN 512
136 return (*handle & 0x80000000) != 0;
141 return (*handle & 0x7FFFFFFF) >> 9;
146 return (*handle & 0x000001FF);
156 *handle |= 0x80000000;
206 #define DRW_MAX_DRAW_CMD_TYPE DRW_CMD_DRAW_PROCEDURAL
409 #define MAX_PASS_NAME 32
430 #define MAX_CULLED_VIEWS 32
554 #define DST_MAX_SLOTS 64
555 #define MAX_CLIP_PLANES 6
556 #define STENCIL_UNDEFINED 256
557 #define DRW_DRAWLIST_LEN 256
631 #ifdef USE_GPU_SELECT
693 struct Object *dupli_parent,
#define BLI_STATIC_ASSERT_ALIGN(st, align)
void * BLI_memblock_elem_get(BLI_memblock *mblk, int chunk, int elem) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool() DRWCallVisibilityFn(bool vis_in, void *user_data)
struct GPUContext GPUContext
struct GPUDrawList GPUDrawList
struct GPUFrameBuffer GPUFrameBuffer
struct GPUShader GPUShader
struct GPUStorageBuf GPUStorageBuf
struct GPUTexture GPUTexture
struct GPUVertBuf GPUVertBuf
Platform independent time functions.
#define MAX_INSTANCE_DATA_SIZE
struct DRWCommandComputeRef DRWCommandComputeRef
void drw_texture_set_parameters(GPUTexture *tex, DRWTextureFlag flags)
void drw_resource_buffer_finish(DRWData *vmempool)
@ DRW_UNIFORM_VERTEX_BUFFER_AS_TEXTURE_REF
@ DRW_UNIFORM_BLOCK_OBINFOS
@ DRW_UNIFORM_TFEEDBACK_TARGET
@ DRW_UNIFORM_TEXTURE_REF
@ DRW_UNIFORM_MODEL_MATRIX
@ DRW_UNIFORM_VERTEX_BUFFER_AS_STORAGE
@ DRW_UNIFORM_MODEL_MATRIX_INVERSE
@ DRW_UNIFORM_VERTEX_BUFFER_AS_STORAGE_REF
@ DRW_UNIFORM_BASE_INSTANCE
@ DRW_UNIFORM_BLOCK_OBMATS
@ DRW_UNIFORM_RESOURCE_ID
@ DRW_UNIFORM_STORAGE_BLOCK_REF
@ DRW_UNIFORM_VERTEX_BUFFER_AS_TEXTURE
@ DRW_UNIFORM_RESOURCE_CHUNK
@ DRW_UNIFORM_BLOCK_OBATTRS
@ DRW_UNIFORM_STORAGE_BLOCK
struct DRWCommandSetSelectID DRWCommandSetSelectID
struct DRWUniformChunk DRWUniformChunk
BLI_INLINE uint32_t DRW_handle_chunk_get(const DRWResourceHandle *handle)
void drw_batch_cache_generate_requested_evaluated_mesh_or_curve(Object *ob)
eDRWCommandType command_type_get(const uint64_t *command_type_bits, int index)
struct DRWRegisteredDrawEngine DRWRegisteredDrawEngine
struct DRWCommandDrawInstance DRWCommandDrawInstance
void drw_uniform_attrs_pool_update(struct GHash *table, struct GPUUniformAttrList *key, DRWResourceHandle *handle, struct Object *ob, struct Object *dupli_parent, struct DupliObject *dupli_source)
bool drw_engine_data_engines_data_validate(GPUViewport *viewport, void **engine_handle_array)
struct DRWCommandClear DRWCommandClear
void drw_state_set(DRWState state)
struct DRWCommandSetStencil DRWCommandSetStencil
void drw_debug_draw(void)
GPUBatch * drw_cache_procedural_points_get(void)
void * drw_viewport_engine_data_ensure(void *engine_type)
void drw_batch_cache_generate_requested(struct Object *ob)
struct DRWCommandDrawProcedural DRWCommandDrawProcedural
GPUBatch * drw_cache_procedural_triangles_get(void)
BLI_INLINE void * DRW_memblock_elem_from_handle(struct BLI_memblock *memblock, const DRWResourceHandle *handle)
struct DRWCommandDrawRange DRWCommandDrawRange
@ DRW_CMD_COMPUTE_INDIRECT
@ DRW_CMD_DRAW_INSTANCE_RANGE
@ DRW_CMD_DRAW_PROCEDURAL
struct DRWObjectInfos DRWObjectInfos
struct DRWDebugLine DRWDebugLine
void drw_batch_cache_validate(Object *ob)
struct DRWCommandCompute DRWCommandCompute
BLI_INLINE uint32_t DRW_handle_negative_scale_get(const DRWResourceHandle *handle)
void * drw_engine_data_engine_data_get(GPUViewport *viewport, void *engine_handle)
void drw_batch_cache_generate_requested_delayed(Object *ob)
double * drw_engine_data_cache_time_get(GPUViewport *viewport)
void * drw_engine_data_engine_data_create(GPUViewport *viewport, void *engine_type)
struct DRWDebugSphere DRWDebugSphere
struct DRWObjectMatrix DRWObjectMatrix
BLI_INLINE void DRW_handle_increment(DRWResourceHandle *handle)
struct DRWCommandDrawInstanceRange DRWCommandDrawInstanceRange
struct DRWCommandSmallChunk DRWCommandSmallChunk
BLI_INLINE uint32_t DRW_handle_id_get(const DRWResourceHandle *handle)
void drw_engine_data_cache_release(GPUViewport *viewport)
union DRWCommand DRWCommand
void drw_debug_init(void)
uint32_t DRWResourceHandle
BLI_INLINE void DRW_handle_negative_scale_enable(DRWResourceHandle *handle)
struct DRWCullingState DRWCullingState
struct DRWCommandChunk DRWCommandChunk
struct DRWManager DRWManager
void drw_engine_data_free(GPUViewport *viewport)
struct DRWCommandBarrier DRWCommandBarrier
GPUBatch * drw_cache_procedural_lines_get(void)
struct DRWCommandDraw DRWCommandDraw
struct DRWCommandComputeIndirect DRWCommandComputeIndirect
struct DRWCommandSetMutableState DRWCommandSetMutableState
unsigned __int64 uint64_t
struct DRWCommandChunk * next
eGPUFrameBufferBits clear_channels
GPUStorageBuf * indirect_buf
struct DRWCommandChunk * next
struct GHash * obattrs_ubo_pool
struct BLI_memblock * images
struct BLI_memblock * commands_small
struct BLI_memblock * obinfos
struct BLI_memblock * commands
struct BLI_memblock * shgroups
struct BLI_memblock * passes
struct BLI_memblock * uniforms
struct DRWTexturePool * texture_pool
struct GPUUniformBuf ** obinfos_ubo
struct DRWViewData * view_data[2]
struct BLI_memblock * obmats
struct GPUUniformBuf ** matrices_ubo
DRWInstanceDataList * idatalist
struct BLI_memblock * views
struct BLI_memblock * callbuffers
struct CurvesUniformBufPool * curves_ubos
struct BLI_memblock * cullstates
struct DRWDebugLine * next
struct DRWDebugSphere * next
ViewInfos view_storage_cpy
struct DupliObject * dupli_source
DRWResourceHandle ob_handle
struct DRWViewData * view_data_active
DRWResourceHandle pass_handle
struct TaskGraph * task_graph
bool buffer_finish_called
DRWResourceHandle resource_handle
struct ID * dupli_origin_data
struct DRWManager::@314 debug
struct DRWTextStore ** text_store_p
DRWInstanceData * object_instance_data[MAX_INSTANCE_DATA_SIZE]
struct Object * dupli_parent
struct GSet * delayed_extraction
bool ob_state_obinfo_init
struct GHash * dupli_ghash
struct DRWManager::@313 options
struct GPUFrameBuffer * default_framebuffer
struct Object * dupli_origin
TicketMutex * gl_context_mutex
struct DRWPass::@312 shgroups
DrawEngineType * draw_engine
struct DRWCommandChunk * first
struct DRWShadingGroup::@307::@311 z_sorting
struct GPUUniformAttrList * uniform_attrs
struct DRWUniformChunk * uniforms
struct DRWShadingGroup::@306 cmd
DRWResourceHandle pass_handle
struct DRWCommandChunk * last
DRWCallVisibilityFn * visibility_fn
BoundSphere frustum_bsphere
float frustum_planes[6][4]
DRWCommandComputeIndirect compute_indirect
DRWCommandSetStencil stencil
DRWCommandComputeRef compute_ref
DRWCommandDrawInstance instance
DRWCommandDrawRange range
DRWCommandSetMutableState state
DRWCommandCompute compute
DRWCommandBarrier barrier
DRWCommandDrawInstanceRange instance_range
DRWCommandDrawProcedural procedural
DRWCommandSetSelectID select_id