1c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim#ifndef _VKTPIPELINEVERTEXUTIL_HPP 2c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim#define _VKTPIPELINEVERTEXUTIL_HPP 3c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim/*------------------------------------------------------------------------ 4c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * Vulkan Conformance Tests 5c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * ------------------------ 6c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * 7c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * Copyright (c) 2015 The Khronos Group Inc. 8c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * Copyright (c) 2015 Imagination Technologies Ltd. 9c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * 10978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * Licensed under the Apache License, Version 2.0 (the "License"); 11978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * you may not use this file except in compliance with the License. 12978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * You may obtain a copy of the License at 13c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * 14978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * http://www.apache.org/licenses/LICENSE-2.0 15c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * 16978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * Unless required by applicable law or agreed to in writing, software 17978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * distributed under the License is distributed on an "AS IS" BASIS, 18978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * See the License for the specific language governing permissions and 20978d3d585aa549eb1e729b51e9d85fc6477240f9Pyry Haulos * limitations under the License. 21c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * 22c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim *//*! 23c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * \file 24c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * \brief Utilities for vertex buffers. 25c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim *//*--------------------------------------------------------------------*/ 26c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim 2783a6066224454de177655eb414dd3453c2059536Dae Kim#include "vkDefs.hpp" 28c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim#include "tcuDefs.hpp" 29c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim#include "tcuVectorUtil.hpp" 30e718db90d26ba3ee70dcbcac4259c2ca5162ad17Pyry Haulos 31c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim#include <vector> 32c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim 33c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kimnamespace vkt 34c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim{ 35c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kimnamespace pipeline 36c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim{ 37c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim 38c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kimstruct Vertex4RGBA 39c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim{ 40c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim tcu::Vec4 position; 41c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim tcu::Vec4 color; 42c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim}; 43c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim 4483a6066224454de177655eb414dd3453c2059536Dae Kimstruct Vertex4Tex4 4583a6066224454de177655eb414dd3453c2059536Dae Kim{ 4683a6066224454de177655eb414dd3453c2059536Dae Kim tcu::Vec4 position; 4783a6066224454de177655eb414dd3453c2059536Dae Kim tcu::Vec4 texCoord; 4883a6066224454de177655eb414dd3453c2059536Dae Kim}; 4983a6066224454de177655eb414dd3453c2059536Dae Kim 500bb5880e80be5e70bc68e56a9e21a197641ccd48Dae KimdeUint32 getVertexFormatSize (vk::VkFormat format); 510bb5880e80be5e70bc68e56a9e21a197641ccd48Dae KimdeUint32 getVertexFormatComponentCount (vk::VkFormat format); 520bb5880e80be5e70bc68e56a9e21a197641ccd48Dae KimdeUint32 getVertexFormatComponentSize (vk::VkFormat format); 530bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatComponentOrderBGR (vk::VkFormat format); 540bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatSint (vk::VkFormat format); 550bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatUint (vk::VkFormat format); 560bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatSfloat (vk::VkFormat format); 570bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatUfloat (vk::VkFormat format); 580bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatUnorm (vk::VkFormat format); 590bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatSnorm (vk::VkFormat format); 600bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatSRGB (vk::VkFormat format); 610bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatSscaled (vk::VkFormat format); 620bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kimbool isVertexFormatUscaled (vk::VkFormat format); 63328abaa4cfc33328c5da07249cd52a1055d2792aDae Kimbool isVertexFormatDouble (vk::VkFormat format); 640bb5880e80be5e70bc68e56a9e21a197641ccd48Dae Kim 65c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim/*! \brief Creates a pattern of 4 overlapping quads. 66c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * 67c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * The quads are alined along the plane Z = 0, with X,Y taking values between -1 and 1. 68c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * Each quad covers one of the quadrants of the scene and partially extends to the other 3 quadrants. 69c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim * The triangles of each quad have different winding orders (CW/CCW). 70c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim */ 7183a6066224454de177655eb414dd3453c2059536Dae Kimstd::vector<Vertex4RGBA> createOverlappingQuads (void); 7283a6066224454de177655eb414dd3453c2059536Dae Kim 7383a6066224454de177655eb414dd3453c2059536Dae Kimstd::vector<Vertex4Tex4> createFullscreenQuad (void); 7483a6066224454de177655eb414dd3453c2059536Dae Kimstd::vector<Vertex4Tex4> createQuadMosaic (int rows, int columns); 7583a6066224454de177655eb414dd3453c2059536Dae Kimstd::vector<Vertex4Tex4> createQuadMosaicCube (void); 7683a6066224454de177655eb414dd3453c2059536Dae Kimstd::vector<Vertex4Tex4> createQuadMosaicCubeArray (int faceArrayIndices[6]); 7783a6066224454de177655eb414dd3453c2059536Dae Kim 7883a6066224454de177655eb414dd3453c2059536Dae Kimstd::vector<Vertex4Tex4> createTestQuadMosaic (vk::VkImageViewType viewType); 79c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim 80c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim} // pipeline 81c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim} // vkt 82c6e8b5a8389a64972259b357407b5e0f4edd5716Dae Kim 83e718db90d26ba3ee70dcbcac4259c2ca5162ad17Pyry Haulos#endif // _VKTPIPELINEVERTEXUTIL_HPP 84