Path: blob/21.2-virgl/src/gallium/auxiliary/tessellator/p_tessellator.h
4565 views
/**************************************************************************1*2* Copyright 2020 Red Hat.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice shall be included13* in all copies or substantial portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS16* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,20* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21* SOFTWARE.22*23**************************************************************************/24#ifndef PIPE_TESSELLATOR_H25#define PIPE_TESSELLATOR_H2627#include "pipe/p_defines.h"2829#ifdef __cplusplus30extern "C" {31#endif3233struct pipe_tessellator;34struct pipe_tessellation_factors35{36float outer_tf[4];37float inner_tf[2];38float pad[2];39};4041struct pipe_tessellator_data42{43uint32_t num_indices;44uint32_t num_domain_points;4546uint32_t *indices;47float *domain_points_u;48float *domain_points_v;49// For Tri: domain_points_w[i] = 1.0f - domain_points_u[i] - domain_points_v[i]50};5152/// Allocate and initialize a new tessellation context53struct pipe_tessellator *p_tess_init(enum pipe_prim_type tes_prim_mode,54enum pipe_tess_spacing spacing,55bool tes_vertex_order_cw, bool tes_point_mode);56/// Destroy & de-allocate tessellation context57void p_tess_destroy(struct pipe_tessellator *pipe_ts);585960/// Perform Tessellation61void p_tessellate(struct pipe_tessellator *pipe_ts,62const struct pipe_tessellation_factors *tess_factors,63struct pipe_tessellator_data *tess_data);6465#ifdef __cplusplus66}67#endif68#endif697071