• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _RRPRIMITIVEPACKET_HPP
2 #define _RRPRIMITIVEPACKET_HPP
3 /*-------------------------------------------------------------------------
4  * drawElements Quality Program Reference Renderer
5  * -----------------------------------------------
6  *
7  * Copyright 2014 The Android Open Source Project
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  *//*!
22  * \file
23  * \brief Primitive packet
24  *//*--------------------------------------------------------------------*/
25 
26 #include "rrDefs.hpp"
27 #include "rrGenericVector.hpp"
28 
29 #include <vector>
30 
31 namespace rr
32 {
33 
34 struct VertexPacket;
35 class VertexPacketAllocator;
36 
37 /*--------------------------------------------------------------------*//*!
38  * \brief Geometry packet
39  *
40  * Geometry packet contains inputs for geometry shading.
41  *//*--------------------------------------------------------------------*/
42 struct PrimitivePacket
43 {
44 	int						primitiveIDIn;
45 	const VertexPacket*		vertices[6];
46 } DE_WARN_UNUSED_TYPE;
47 
48 /*--------------------------------------------------------------------*//*!
49  * \brief Geometry emitter
50  *
51  * Geometry emitter handles outputting of new vertices from geometry shader
52  *//*--------------------------------------------------------------------*/
53 class GeometryEmitter
54 {
55 public:
56 								GeometryEmitter	(VertexPacketAllocator& vpalloc, size_t numVertices);
57 
58 	void						EmitVertex		(const tcu::Vec4& position, float pointSize, const GenericVec4* varyings, int primitiveID);
59 	void						EndPrimitive	(void);
60 
61 	void						moveEmittedTo	(std::vector<VertexPacket*>&);
62 
63 private:
64 								GeometryEmitter	(const GeometryEmitter&);
65 	GeometryEmitter&			operator=		(const GeometryEmitter&);
66 
67 	std::vector<VertexPacket*>	m_emitted;	//!< NULL elements mean primitive end
68 	VertexPacketAllocator&		m_vpalloc;
69 	size_t						m_numEmitted;
70 	size_t						m_maxVertices;
71 
72 } DE_WARN_UNUSED_TYPE;
73 
74 } // rr
75 
76 #endif // _RRPRIMITIVEPACKET_HPP
77