revolver

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

util_bump_cache.h (892B)


      1 //////////////////////////////////////////////////////////////////
      2 // util_bump_cache.h
      3 
      4 typedef struct {
      5     // initialization
      6     s64 element_size;
      7     rv_arena* arena;
      8 
      9     // construction
     10     s64 current_count;
     11     s64 committed_so_far;
     12 
     13     // upload
     14     void* begin;
     15     s64 total_count;
     16 } rv_bump_cache_ctx_t;
     17 
     18 RV_GLOBAL void rv_bump_cache_create(rv_bump_cache_ctx_t* bc, s64 element_size);
     19 RV_GLOBAL void rv_bump_cache_destroy(rv_bump_cache_ctx_t* bc);
     20 
     21 RV_GLOBAL void* rv_bump_cache_push(rv_bump_cache_ctx_t* bc, const void* new);
     22 RV_GLOBAL void* rv_bump_cache_push_many(rv_bump_cache_ctx_t* bc, const void* new, s64 count);
     23 RV_GLOBAL void  rv_bump_cache_break(rv_bump_cache_ctx_t* bc, s64* offset_out, s64* count_out);
     24 // returns draw command with filled data
     25 
     26 RV_GLOBAL void rv_bump_cache_upload_and_reset(rv_bump_cache_ctx_t* bc, rv_arena* arena, void** data_out, s64* size_out);