1// 2// Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved. 3// Use of this source code is governed by a BSD-style license that can be 4// found in the LICENSE file. 5// 6 7// copyvertex.h: Defines vertex buffer copying and conversion functions 8 9#ifndef LIBGLESV2_RENDERER_COPYVERTEX_H_ 10#define LIBGLESV2_RENDERER_COPYVERTEX_H_ 11 12#include "common/mathutil.h" 13 14namespace rx 15{ 16 17// 'widenDefaultValueBits' gives the default value for the alpha channel (4th component) 18// the sentinel value 0 means we do not want to widen the input or add an alpha channel 19template <typename T, size_t componentCount, uint32_t widenDefaultValueBits> 20inline void CopyNativeVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); 21 22template <size_t componentCount> 23inline void Copy32FixedTo32FVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); 24 25template <typename T, size_t componentCount, bool normalized> 26inline void CopyTo32FVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); 27 28template <bool isSigned, bool normalized, bool toFloat> 29inline void CopyXYZ10W2ToXYZW32FVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); 30 31} 32 33#include "copyvertex.inl" 34 35#endif // LIBGLESV2_RENDERER_COPYVERTEX_H_ 36