Commit 16fdde13 by Frank Henigman Committed by Commit Bot

Move vertex data copy functions out of D3D.

Move the vertex buffer copying and conversion functions from the D3D back end so the Vulkan back end can use them. No functional change. BUG=angleproject:2405 Change-Id: If3c04a6c0dc37c78c1779d8b5d3cece263e8a031 Reviewed-on: https://chromium-review.googlesource.com/1083817 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 33f11fbc
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,18 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// copyvertex.h: Defines D3D11 vertex buffer copying and conversion functions // copyvertex.h: Defines vertex buffer copying and conversion functions
#ifndef LIBANGLE_RENDERER_D3D_D3D11_COPYVERTEX_H_ #ifndef LIBANGLE_RENDERER_COPYVERTEX_H_
#define LIBANGLE_RENDERER_D3D_D3D11_COPYVERTEX_H_ #define LIBANGLE_RENDERER_COPYVERTEX_H_
#include "common/mathutil.h" #include "common/mathutil.h"
namespace rx 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) // 'alphaDefaultValueBits' gives the default value for the alpha channel (4th component)
template <typename T, size_t inputComponentCount, size_t outputComponentCount, uint32_t alphaDefaultValueBits> template <typename T, size_t inputComponentCount, size_t outputComponentCount, uint32_t alphaDefaultValueBits>
inline void CopyNativeVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output); inline void CopyNativeVertexData(const uint8_t *input, size_t stride, size_t count, uint8_t *output);
...@@ -35,6 +37,6 @@ inline void CopyXYZ10W2ToXYZW32FVertexData(const uint8_t *input, size_t stride, ...@@ -35,6 +37,6 @@ inline void CopyXYZ10W2ToXYZW32FVertexData(const uint8_t *input, size_t stride,
} }
#include "copyvertex.inl" #include "copyvertex.inc"
#endif // LIBANGLE_RENDERER_D3D_D3D11_COPYVERTEX_H_ #endif // LIBANGLE_RENDERER_COPYVERTEX_H_
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// copyvertex.inc: Implementation of vertex buffer copying and conversion functions
namespace rx namespace rx
{ {
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
#include "image_util/loadimage.h" #include "image_util/loadimage.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/d3d11/copyvertex.h" #include "libANGLE/renderer/copyvertex.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/dxgi_support_table.h" #include "libANGLE/renderer/d3d/d3d11/dxgi_support_table.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h" #include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
namespace rx namespace rx
{ {
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
#include "common/platform.h" #include "common/platform.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/renderer_utils.h" #include "libANGLE/renderer/copyvertex.h"
#include "libANGLE/renderer/d3d/formatutilsD3D.h" #include "libANGLE/renderer/d3d/formatutilsD3D.h"
#include "libANGLE/renderer/renderer_utils.h"
namespace rx namespace rx
{ {
......
...@@ -8,16 +8,17 @@ ...@@ -8,16 +8,17 @@
// the actual underlying surfaces of a Texture. // the actual underlying surfaces of a Texture.
#include "libANGLE/renderer/d3d/d3d9/Image9.h" #include "libANGLE/renderer/d3d/d3d9/Image9.h"
#include "libANGLE/renderer/d3d/d3d9/renderer9_utils.h" #include "common/utilities.h"
#include "libANGLE/renderer/d3d/d3d9/formatutils9.h"
#include "libANGLE/renderer/d3d/d3d9/Renderer9.h"
#include "libANGLE/renderer/d3d/d3d9/RenderTarget9.h"
#include "libANGLE/renderer/d3d/d3d9/TextureStorage9.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/Framebuffer.h" #include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/Renderbuffer.h" #include "libANGLE/Renderbuffer.h"
#include "common/utilities.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/copyvertex.h"
#include "libANGLE/renderer/d3d/d3d9/RenderTarget9.h"
#include "libANGLE/renderer/d3d/d3d9/Renderer9.h"
#include "libANGLE/renderer/d3d/d3d9/TextureStorage9.h"
#include "libANGLE/renderer/d3d/d3d9/formatutils9.h"
#include "libANGLE/renderer/d3d/d3d9/renderer9_utils.h"
namespace rx namespace rx
{ {
......
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/Format.h" #include "libANGLE/renderer/Format.h"
#include "libANGLE/renderer/renderer_utils.h" #include "libANGLE/renderer/copyvertex.h"
#include "libANGLE/renderer/d3d/formatutilsD3D.h" #include "libANGLE/renderer/d3d/formatutilsD3D.h"
#include "libANGLE/renderer/renderer_utils.h"
namespace rx namespace rx
{ {
......
...@@ -10,22 +10,8 @@ ...@@ -10,22 +10,8 @@
#ifndef LIBANGLE_RENDERER_D3D_FORMATUTILSD3D_H_ #ifndef LIBANGLE_RENDERER_D3D_FORMATUTILSD3D_H_
#define LIBANGLE_RENDERER_D3D_FORMATUTILSD3D_H_ #define LIBANGLE_RENDERER_D3D_FORMATUTILSD3D_H_
#include "angle_gl.h"
#include <cstddef>
#include <stdint.h>
#include <map>
namespace gl
{
struct FormatType;
}
namespace rx namespace rx
{ {
typedef void (*VertexCopyFunction)(const uint8_t *input, size_t stride, size_t count, uint8_t *output);
enum VertexConversionType enum VertexConversionType
{ {
VERTEX_CONVERT_NONE = 0, VERTEX_CONVERT_NONE = 0,
......
...@@ -296,6 +296,8 @@ ...@@ -296,6 +296,8 @@
'libANGLE/renderer/TextureImpl.h', 'libANGLE/renderer/TextureImpl.h',
'libANGLE/renderer/TransformFeedbackImpl.h', 'libANGLE/renderer/TransformFeedbackImpl.h',
'libANGLE/renderer/VertexArrayImpl.h', 'libANGLE/renderer/VertexArrayImpl.h',
'libANGLE/renderer/copyvertex.h',
'libANGLE/renderer/copyvertex.inc',
'libANGLE/renderer/load_functions_table.h', 'libANGLE/renderer/load_functions_table.h',
'libANGLE/renderer/load_functions_table_autogen.cpp', 'libANGLE/renderer/load_functions_table_autogen.cpp',
'libANGLE/renderer/renderer_utils.cpp', 'libANGLE/renderer/renderer_utils.cpp',
...@@ -430,8 +432,6 @@ ...@@ -430,8 +432,6 @@
'libANGLE/renderer/d3d/d3d11/Clear11.h', 'libANGLE/renderer/d3d/d3d11/Clear11.h',
'libANGLE/renderer/d3d/d3d11/Context11.cpp', 'libANGLE/renderer/d3d/d3d11/Context11.cpp',
'libANGLE/renderer/d3d/d3d11/Context11.h', 'libANGLE/renderer/d3d/d3d11/Context11.h',
'libANGLE/renderer/d3d/d3d11/copyvertex.h',
'libANGLE/renderer/d3d/d3d11/copyvertex.inl',
'libANGLE/renderer/d3d/d3d11/DebugAnnotator11.cpp', 'libANGLE/renderer/d3d/d3d11/DebugAnnotator11.cpp',
'libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h', 'libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h',
'libANGLE/renderer/d3d/d3d11/dxgi_format_map_autogen.cpp', 'libANGLE/renderer/d3d/d3d11/dxgi_format_map_autogen.cpp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment