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
23 * @file streamout_jit.h
25 * @brief Definition of the streamout jitter
29 ******************************************************************************/
32 #include "common/formats.h"
33 #include "core/state.h"
35 //////////////////////////////////////////////////////////////////////////
36 /// STREAMOUT_DECL - Stream decl
37 //////////////////////////////////////////////////////////////////////////
40 // Buffer that stream maps to.
43 // attribute to stream
46 // attribute component mask
47 uint32_t componentMask
;
49 // indicates this decl is a hole
53 //////////////////////////////////////////////////////////////////////////
54 /// STREAMOUT_STREAM - Stream decls
55 //////////////////////////////////////////////////////////////////////////
56 struct STREAMOUT_STREAM
58 // numnber of decls for this stream
61 // array of numDecls decls
62 STREAMOUT_DECL decl
[128];
65 //////////////////////////////////////////////////////////////////////////
66 /// State required for streamout jit
67 //////////////////////////////////////////////////////////////////////////
68 struct STREAMOUT_COMPILE_STATE
70 // number of verts per primitive
71 uint32_t numVertsPerPrim
;
72 uint32_t offsetAttribs
; ///< attrib offset to subtract from all STREAMOUT_DECL::attribSlot values.
77 STREAMOUT_STREAM stream
;
79 bool operator==(const STREAMOUT_COMPILE_STATE
&other
) const
81 if (numVertsPerPrim
!= other
.numVertsPerPrim
) return false;
82 if (stream
.numDecls
!= other
.stream
.numDecls
) return false;
84 for (uint32_t i
= 0; i
< stream
.numDecls
; ++i
)
86 if (stream
.decl
[i
].bufferIndex
!= other
.stream
.decl
[i
].bufferIndex
) return false;
87 if (stream
.decl
[i
].attribSlot
!= other
.stream
.decl
[i
].attribSlot
) return false;
88 if (stream
.decl
[i
].componentMask
!= other
.stream
.decl
[i
].componentMask
) return false;
89 if (stream
.decl
[i
].hole
!= other
.stream
.decl
[i
].hole
) return false;