Skip to content

Commit 13baec3

Browse files
authored
Update CMO and vbo headers (#561)
1 parent a2b00d5 commit 13baec3

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

Src/CMO.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ namespace VSD3DStarter
109109

110110
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
111111
// tangent, color (RGBA), and texture mapping information
112-
struct VertexPositionNormalTangentColorTexture
112+
struct Vertex
113113
{
114114
DirectX::XMFLOAT3 position;
115115
DirectX::XMFLOAT3 normal;
@@ -173,7 +173,7 @@ namespace VSD3DStarter
173173

174174
static_assert(sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect");
175175
static_assert(sizeof(VSD3DStarter::SubMesh) == 20, "CMO Mesh structure size incorrect");
176-
static_assert(sizeof(VSD3DStarter::VertexPositionNormalTangentColorTexture) == 52, "CMO Mesh structure size incorrect");
176+
static_assert(sizeof(VSD3DStarter::Vertex) == 52, "CMO Mesh structure size incorrect");
177177
static_assert(sizeof(VSD3DStarter::SkinningVertex) == 32, "CMO Mesh structure size incorrect");
178178
static_assert(sizeof(VSD3DStarter::MeshExtents) == 40, "CMO Mesh structure size incorrect");
179179
static_assert(sizeof(VSD3DStarter::Bone) == 196, "CMO Mesh structure size incorrect");

Src/ModelLoadCMO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using Microsoft::WRL::ComPtr;
2020

2121
#include "CMO.h"
2222

23-
static_assert(sizeof(VertexPositionNormalTangentColorTexture) == sizeof(VSD3DStarter::VertexPositionNormalTangentColorTexture), "mismatch with CMO vertex type");
23+
static_assert(sizeof(VertexPositionNormalTangentColorTexture) == sizeof(VSD3DStarter::Vertex), "mismatch with CMO vertex type");
2424

2525

2626
namespace

Src/ModelLoadVBO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using namespace DirectX;
2121
using Microsoft::WRL::ComPtr;
2222

23-
static_assert(sizeof(VertexPositionNormalTexture) == 32, "VBO vertex size mismatch");
23+
static_assert(sizeof(VertexPositionNormalTexture) == sizeof(VBO::vertex_t), "VBO vertex size mismatch");
2424

2525
namespace
2626
{

Src/vbo.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@ namespace VBO
2828
uint32_t numIndices;
2929
};
3030

31+
struct vertex_t
32+
{
33+
DirectX::XMFLOAT3 position;
34+
DirectX::XMFLOAT3 normal;
35+
DirectX::XMFLOAT2 textureCoordinate;
36+
};
37+
3138
#pragma pack(pop)
3239

3340
} // namespace
3441

3542
static_assert(sizeof(VBO::header_t) == 8, "VBO header size mismatch");
43+
static_assert(sizeof(VBO::vertex_t) == 32, "VBO vertex size mismatch");

0 commit comments

Comments
 (0)