1 /****************************************************************************
2 * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 * @brief Tessellator fixed function unit interface definition
27 ******************************************************************************/
30 /// Allocate and initialize a new tessellation context
31 HANDLE SWR_API
TSInitCtx(
32 SWR_TS_DOMAIN tsDomain
, ///< [IN] Tessellation domain (isoline, quad, triangle)
33 SWR_TS_PARTITIONING tsPartitioning
, ///< [IN] Tessellation partitioning algorithm
34 SWR_TS_OUTPUT_TOPOLOGY tsOutputTopology
, ///< [IN] Tessellation output topology
35 void* pContextMem
, ///< [IN] Memory to use for the context
36 size_t& memSize
); ///< [INOUT] In: Amount of memory in pContextMem. Out: Mem required
38 /// Destroy & de-allocate tessellation context
39 void SWR_API
TSDestroyCtx(
40 HANDLE tsCtx
); ///< [IN] Tessellation context to be destroyed
42 struct SWR_TS_TESSELLATED_DATA
44 uint32_t NumPrimitives
;
45 uint32_t NumDomainPoints
;
47 uint32_t* ppIndices
[3];
48 float* pDomainPointsU
;
49 float* pDomainPointsV
;
50 // For Tri: pDomainPointsW[i] = 1.0f - pDomainPointsU[i] - pDomainPointsV[i]
53 /// Perform Tessellation
54 void SWR_API
TSTessellate(
55 HANDLE tsCtx
, ///< [IN] Tessellation Context
56 const SWR_TESSELLATION_FACTORS
& tsTessFactors
, ///< [IN] Tessellation Factors
57 SWR_TS_TESSELLATED_DATA
& tsTessellatedData
); ///< [OUT] Tessellated Data
61 /// @TODO - Implement OSS tessellator
63 INLINE HANDLE SWR_API
TSInitCtx(
64 SWR_TS_DOMAIN tsDomain
,
65 SWR_TS_PARTITIONING tsPartitioning
,
66 SWR_TS_OUTPUT_TOPOLOGY tsOutputTopology
,
75 INLINE
void SWR_API
TSDestroyCtx(HANDLE tsCtx
)
81 INLINE
void SWR_API
TSTessellate(
83 const SWR_TESSELLATION_FACTORS
& tsTessFactors
,
84 SWR_TS_TESSELLATED_DATA
& tsTessellatedData
)