static INLINE void delete_cso(void *state, enum cso_cache_type type) { switch (type) { case CSO_BLEND: delete_blend_state(state, 0); break; case CSO_SAMPLER: delete_sampler_state(state, 0); break; case CSO_DEPTH_STENCIL_ALPHA: delete_depth_stencil_state(state, 0); break; case CSO_RASTERIZER: delete_rasterizer_state(state, 0); break; case CSO_FRAGMENT_SHADER: delete_fs_state(state, 0); break; case CSO_VERTEX_SHADER: delete_vs_state(state, 0); break; default: assert(0); FREE(state); } }
static INLINE boolean delete_cso(struct cso_context *ctx, void *state, enum cso_cache_type type) { switch (type) { case CSO_BLEND: return delete_blend_state(ctx, state); break; case CSO_SAMPLER: return delete_sampler_state(ctx, state); break; case CSO_DEPTH_STENCIL_ALPHA: return delete_depth_stencil_state(ctx, state); break; case CSO_RASTERIZER: return delete_rasterizer_state(ctx, state); break; case CSO_FRAGMENT_SHADER: return delete_fs_state(ctx, state); break; case CSO_VERTEX_SHADER: return delete_vs_state(ctx, state); break; case CSO_VELEMENTS: return delete_vertex_elements(ctx, state); break; default: assert(0); FREE(state); } return FALSE; }