#ifndef __VHEX_DISPLAY_STACK__ # define __VHEX_DISPLAY_STACK__ #include #include /* dstack_call - dstack indirect call (same as dshader) */ struct dstack_call { int (*routine)( struct dshader_surface *surface, dshader_call_arg_t *draw_args ); dshader_call_arg_t args[12]; }; typedef struct dstack_call dstack_call_t; /* dstack_action - dstack drawing action information */ struct dstack_action { struct dstack_call call; struct { dshader_call_t *table; int number; int idx; } shader; }; /* DSTACK_CALL - display indirect call */ #pragma GCC diagnostic ignored "-Wmissing-braces" #define DSTACK_CALL(fct, ...) (dstack_call_t){ \ .routine = (void*)fct, \ .args = { __VA_ARGS__ } \ } /* dstack_config - dstack configuration structure */ struct dstack_config { int default_icall_pool_slot; int default_icall_args_nb; int default_shader_per_action; }; #ifndef DSTACK_DEFAULT_ICALL_SLOT # define DSTACK_DEFAULT_ICALL_SLOT 32 #endif #ifndef DSTACK_DEFAULT_ICALL_ARGS # define DSTACK_DEFAULT_ICALL_ARGS 12 #endif #ifndef DSTACK_DEFAULT_SHADER_PER_ACTION # define DSTACK_DEFAULT_SHADER_PER_ACTION 4 #endif /* dstack_drv_interface - driver interface */ struct dstack_drv_interface { int (*frame_start)(struct dshader_surface *); int (*frame_frag_next)(struct dshader_surface *); int (*frame_frag_send)(struct dshader_surface *); int (*frame_end)(struct dshader_surface *); }; //--- // Display stack API //--- /* dstack_init() : Initialise the draw stack (should not be involved) */ extern int dstack_init(struct dstack_config *config); /* dstack_add_action() : add a new action in the draw stack */ extern did_t dstack_add_action(dstack_call_t *call, dshader_call_t *shaders); /* dstack_get_action() : get display stack action using its ID */ extern struct dstack_action *dstack_get_action(did_t did); /* dstack_render(): render a frame */ extern void dstack_render(void); /* dstack_invalidate() : Invalidate the draw stack (reset) */ extern int dstack_invalidate(void); /* dstack_quit() : Uninit the draw stack */ extern int dstack_quit(void); #endif /* __VHEX_DISPLAY_STACK__ */