1e5c31af7Sopenharmony_ci#ifndef _VKTPIPELINEVERTEXUTIL_HPP
2e5c31af7Sopenharmony_ci#define _VKTPIPELINEVERTEXUTIL_HPP
3e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------
4e5c31af7Sopenharmony_ci * Vulkan Conformance Tests
5e5c31af7Sopenharmony_ci * ------------------------
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Copyright (c) 2015 The Khronos Group Inc.
8e5c31af7Sopenharmony_ci * Copyright (c) 2015 Imagination Technologies Ltd.
9e5c31af7Sopenharmony_ci *
10e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
11e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
12e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
13e5c31af7Sopenharmony_ci *
14e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
15e5c31af7Sopenharmony_ci *
16e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
17e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
18e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
20e5c31af7Sopenharmony_ci * limitations under the License.
21e5c31af7Sopenharmony_ci *
22e5c31af7Sopenharmony_ci *//*!
23e5c31af7Sopenharmony_ci * \file
24e5c31af7Sopenharmony_ci * \brief Utilities for vertex buffers.
25e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/
26e5c31af7Sopenharmony_ci
27e5c31af7Sopenharmony_ci#include "vkDefs.hpp"
28e5c31af7Sopenharmony_ci#include "tcuDefs.hpp"
29e5c31af7Sopenharmony_ci#include "tcuVectorUtil.hpp"
30e5c31af7Sopenharmony_ci
31e5c31af7Sopenharmony_ci#include <vector>
32e5c31af7Sopenharmony_ci
33e5c31af7Sopenharmony_cinamespace vkt
34e5c31af7Sopenharmony_ci{
35e5c31af7Sopenharmony_cinamespace pipeline
36e5c31af7Sopenharmony_ci{
37e5c31af7Sopenharmony_ci
38e5c31af7Sopenharmony_cistruct Vertex4RGBA
39e5c31af7Sopenharmony_ci{
40e5c31af7Sopenharmony_ci	tcu::Vec4 position;
41e5c31af7Sopenharmony_ci	tcu::Vec4 color;
42e5c31af7Sopenharmony_ci};
43e5c31af7Sopenharmony_ci
44e5c31af7Sopenharmony_cistruct Vertex4RGBARGBA
45e5c31af7Sopenharmony_ci{
46e5c31af7Sopenharmony_ci	tcu::Vec4 position;
47e5c31af7Sopenharmony_ci	tcu::Vec4 color0;
48e5c31af7Sopenharmony_ci	tcu::Vec4 color1;
49e5c31af7Sopenharmony_ci};
50e5c31af7Sopenharmony_ci
51e5c31af7Sopenharmony_cistruct Vertex4Tex4
52e5c31af7Sopenharmony_ci{
53e5c31af7Sopenharmony_ci	tcu::Vec4 position;
54e5c31af7Sopenharmony_ci	tcu::Vec4 texCoord;
55e5c31af7Sopenharmony_ci};
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_cideUint32					getVertexFormatSize					(vk::VkFormat format);
58e5c31af7Sopenharmony_cideUint32					getVertexFormatComponentCount		(vk::VkFormat format);
59e5c31af7Sopenharmony_cideUint32					getVertexFormatComponentSize		(vk::VkFormat format);
60e5c31af7Sopenharmony_cideUint32					getPackedVertexFormatComponentWidth	(vk::VkFormat format, deUint32 componentNdx);
61e5c31af7Sopenharmony_cibool						isVertexFormatComponentOrderBGR		(vk::VkFormat format);
62e5c31af7Sopenharmony_cibool						isVertexFormatComponentOrderABGR	(vk::VkFormat format);
63e5c31af7Sopenharmony_cibool						isVertexFormatComponentOrderARGB	(vk::VkFormat format);
64e5c31af7Sopenharmony_cibool						isVertexFormatSint					(vk::VkFormat format);
65e5c31af7Sopenharmony_cibool						isVertexFormatUint					(vk::VkFormat format);
66e5c31af7Sopenharmony_cibool						isVertexFormatSfloat				(vk::VkFormat format);
67e5c31af7Sopenharmony_cibool						isVertexFormatUfloat				(vk::VkFormat format);
68e5c31af7Sopenharmony_cibool						isVertexFormatUnorm					(vk::VkFormat format);
69e5c31af7Sopenharmony_cibool						isVertexFormatSnorm					(vk::VkFormat format);
70e5c31af7Sopenharmony_cibool						isVertexFormatSRGB					(vk::VkFormat format);
71e5c31af7Sopenharmony_cibool						isVertexFormatSscaled				(vk::VkFormat format);
72e5c31af7Sopenharmony_cibool						isVertexFormatUscaled				(vk::VkFormat format);
73e5c31af7Sopenharmony_cibool						isVertexFormatDouble				(vk::VkFormat format);
74e5c31af7Sopenharmony_cibool						isVertexFormatPacked				(vk::VkFormat format);
75e5c31af7Sopenharmony_ci
76e5c31af7Sopenharmony_ci/*! \brief Creates a pattern of 4 overlapping quads.
77e5c31af7Sopenharmony_ci *
78e5c31af7Sopenharmony_ci *  The quads are alined along the plane Z = 0, with X,Y taking values between -1 and 1.
79e5c31af7Sopenharmony_ci *  Each quad covers one of the quadrants of the scene and partially extends to the other 3 quadrants.
80e5c31af7Sopenharmony_ci *  The triangles of each quad have different winding orders (CW/CCW).
81e5c31af7Sopenharmony_ci */
82e5c31af7Sopenharmony_cistd::vector<Vertex4RGBA>		createOverlappingQuads				(void);
83e5c31af7Sopenharmony_cistd::vector<Vertex4RGBARGBA>	createOverlappingQuadsDualSource	(void);
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_cistd::vector<Vertex4Tex4>	createFullscreenQuad		(void);
86e5c31af7Sopenharmony_cistd::vector<Vertex4Tex4>	createQuadMosaic			(int rows, int columns);
87e5c31af7Sopenharmony_cistd::vector<Vertex4Tex4>	createQuadMosaicCube		(void);
88e5c31af7Sopenharmony_cistd::vector<Vertex4Tex4>	createQuadMosaicCubeArray	(int faceArrayIndices[6]);
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_cistd::vector<Vertex4Tex4>	createTestQuadMosaic		(vk::VkImageViewType viewType);
91e5c31af7Sopenharmony_ci
92e5c31af7Sopenharmony_ci} // pipeline
93e5c31af7Sopenharmony_ci} // vkt
94e5c31af7Sopenharmony_ci
95e5c31af7Sopenharmony_ci#endif // _VKTPIPELINEVERTEXUTIL_HPP
96