1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 3bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 4bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 5bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 6bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 7bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 8bf215546Sopenharmony_ci * 9bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next 10bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the 11bf215546Sopenharmony_ci * Software. 12bf215546Sopenharmony_ci * 13bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19bf215546Sopenharmony_ci * IN THE SOFTWARE. 20bf215546Sopenharmony_ci */ 21bf215546Sopenharmony_ci 22bf215546Sopenharmony_ci#ifndef U_SPLIT_DRAW_H 23bf215546Sopenharmony_ci#define U_SPLIT_DRAW_H 24bf215546Sopenharmony_ci 25bf215546Sopenharmony_ci#include "pipe/p_state.h" 26bf215546Sopenharmony_ci 27bf215546Sopenharmony_ci/** 28bf215546Sopenharmony_ci * For non-indexed drawing, this function helps work around hardware 29bf215546Sopenharmony_ci * limits on the number of verts in a single draw. 30bf215546Sopenharmony_ci * 31bf215546Sopenharmony_ci * For the given mode of primitive from info, calculate the count and 32bf215546Sopenharmony_ci * step in the buffer so the draw can be split into multiple draws. 33bf215546Sopenharmony_ci * 34bf215546Sopenharmony_ci * \param info pointer to the original pipe_draw_info from draw_vbo 35bf215546Sopenharmony_ci * \param max_verts max number of vertices that can be handled by the hardware 36bf215546Sopenharmony_ci * \param count number of vertices remaining in the draw call. It is also 37bf215546Sopenharmony_ci * used as a return parameter, containing how many vertices 38bf215546Sopenharmony_ci * should be sent in the next job to the hardware. 39bf215546Sopenharmony_ci * \param step return parameter, will contain how many vertices should be 40bf215546Sopenharmony_ci * skipped from the original count on the next call to this 41bf215546Sopenharmony_ci * function (may differ from count if the primitive mode 42bf215546Sopenharmony_ci * requires the last vertices to be reused in the next draw) 43bf215546Sopenharmony_ci */ 44bf215546Sopenharmony_cibool 45bf215546Sopenharmony_ciu_split_draw(const struct pipe_draw_info *info, uint32_t max_verts, 46bf215546Sopenharmony_ci uint32_t *count, uint32_t *step); 47bf215546Sopenharmony_ci 48bf215546Sopenharmony_ci#endif 49