diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h')
-rw-r--r-- | gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h b/gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h new file mode 100644 index 0000000000..54624bb29b --- /dev/null +++ b/gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h @@ -0,0 +1,80 @@ +// +// Copyright 2013 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +// copyvertex.h: Defines vertex buffer copying and conversion functions + +#ifndef LIBANGLE_RENDERER_COPYVERTEX_H_ +#define LIBANGLE_RENDERER_COPYVERTEX_H_ + +#include "common/mathutil.h" + +namespace rx +{ + +using VertexCopyFunction = void (*)(const uint8_t *input, + size_t stride, + size_t count, + uint8_t *output); + +// 'alphaDefaultValueBits' gives the default value for the alpha channel (4th component) +template <typename T, + size_t inputComponentCount, + size_t outputComponentCount, + uint32_t alphaDefaultValueBits> +void CopyNativeVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); + +template <size_t inputComponentCount, size_t outputComponentCount> +void Copy8SintTo16SintVertexData(const uint8_t *input, + size_t stride, + size_t count, + uint8_t *output); + +template <size_t componentCount> +void Copy8SnormTo16SnormVertexData(const uint8_t *input, + size_t stride, + size_t count, + uint8_t *output); + +template <size_t inputComponentCount, size_t outputComponentCount> +void Copy32FixedTo32FVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); + +template <typename T, + size_t inputComponentCount, + size_t outputComponentCount, + bool normalized, + bool toHalf> +void CopyToFloatVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); + +template <size_t inputComponentCount, size_t outputComponentCount> +void Copy32FTo16FVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); + +void CopyXYZ32FToXYZ9E5(const uint8_t *input, size_t stride, size_t count, uint8_t *output); + +void CopyXYZ32FToX11Y11B10F(const uint8_t *input, size_t stride, size_t count, uint8_t *output); + +template <bool isSigned, bool normalized, bool toFloat, bool toHalf> +void CopyXYZ10W2ToXYZWFloatVertexData(const uint8_t *input, + size_t stride, + size_t count, + uint8_t *output); + +template <bool isSigned, bool normalized, bool toHalf> +void CopyXYZ10ToXYZWFloatVertexData(const uint8_t *input, + size_t stride, + size_t count, + uint8_t *output); + +template <bool isSigned, bool normalized, bool toHalf> +void CopyW2XYZ10ToXYZWFloatVertexData(const uint8_t *input, + size_t stride, + size_t count, + uint8_t *output); + +} // namespace rx + +#include "copyvertex.inc.h" + +#endif // LIBANGLE_RENDERER_COPYVERTEX_H_ |