1af69d88dSmrg/*
2af69d88dSmrg * Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
3af69d88dSmrg *
4af69d88dSmrg * Permission is hereby granted, free of charge, to any person obtaining a
5af69d88dSmrg * copy of this software and associated documentation files (the "Software"),
6af69d88dSmrg * to deal in the Software without restriction, including without limitation
7af69d88dSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8af69d88dSmrg * and/or sell copies of the Software, and to permit persons to whom the
9af69d88dSmrg * Software is furnished to do so, subject to the following conditions:
10af69d88dSmrg *
11af69d88dSmrg * The above copyright notice and this permission notice (including the next
12af69d88dSmrg * paragraph) shall be included in all copies or substantial portions of the
13af69d88dSmrg * Software.
14af69d88dSmrg *
15af69d88dSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16af69d88dSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17af69d88dSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19af69d88dSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20af69d88dSmrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21af69d88dSmrg * SOFTWARE.
22af69d88dSmrg *
23af69d88dSmrg * Authors:
24af69d88dSmrg *    Rob Clark <robclark@freedesktop.org>
25af69d88dSmrg */
26af69d88dSmrg
27af69d88dSmrg#ifndef U_PRIMCONVERT_H_
28af69d88dSmrg#define U_PRIMCONVERT_H_
29af69d88dSmrg
30af69d88dSmrg#include "pipe/p_state.h"
31af69d88dSmrg
327ec681f3Smrg#ifdef __cplusplus
337ec681f3Smrgextern "C" {
347ec681f3Smrg#endif
357ec681f3Smrg
36af69d88dSmrgstruct primconvert_context;
37af69d88dSmrg
387ec681f3Smrgstruct primconvert_config {
397ec681f3Smrg   uint32_t primtypes_mask;
407ec681f3Smrg   uint32_t restart_primtypes_mask;
417ec681f3Smrg   bool fixed_prim_restart;
427ec681f3Smrg};
437ec681f3Smrg
44af69d88dSmrgstruct primconvert_context *util_primconvert_create(struct pipe_context *pipe,
45af69d88dSmrg                                                    uint32_t primtypes_mask);
467ec681f3Smrgstruct primconvert_context *util_primconvert_create_config(struct pipe_context *pipe,
477ec681f3Smrg                                                           struct primconvert_config *cfg);
487ec681f3Smrg
49af69d88dSmrgvoid util_primconvert_destroy(struct primconvert_context *pc);
50af69d88dSmrgvoid util_primconvert_save_rasterizer_state(struct primconvert_context *pc,
51af69d88dSmrg                                            const struct pipe_rasterizer_state
52af69d88dSmrg                                            *rast);
537ec681f3Smrgvoid
547ec681f3Smrgutil_primconvert_save_flatshade_first(struct primconvert_context *pc, bool flatshade_first);
55af69d88dSmrgvoid util_primconvert_draw_vbo(struct primconvert_context *pc,
567ec681f3Smrg                               const struct pipe_draw_info *info,
577ec681f3Smrg                               unsigned drawid_offset,
587ec681f3Smrg                               const struct pipe_draw_indirect_info *indirect,
597ec681f3Smrg                               const struct pipe_draw_start_count_bias *draws,
607ec681f3Smrg                               unsigned num_draws);
617ec681f3Smrg
627ec681f3Smrg#ifdef __cplusplus
637ec681f3Smrg}
647ec681f3Smrg#endif
65af69d88dSmrg
66af69d88dSmrg#endif /* U_PRIMCONVERT_H_ */
67