From e0213a8ed0792814ec576c048a3f5496263749dd Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 28 May 2025 00:23:26 -0700 Subject: [PATCH] Update CMO and vbo headers --- Src/CMO.h | 4 ++-- Src/ModelLoadCMO.cpp | 2 +- Src/ModelLoadVBO.cpp | 2 +- Src/vbo.h | 8 ++++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Src/CMO.h b/Src/CMO.h index c40151a05..d74855950 100644 --- a/Src/CMO.h +++ b/Src/CMO.h @@ -109,7 +109,7 @@ namespace VSD3DStarter // Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal, // tangent, color (RGBA), and texture mapping information - struct VertexPositionNormalTangentColorTexture + struct Vertex { DirectX::XMFLOAT3 position; DirectX::XMFLOAT3 normal; @@ -173,7 +173,7 @@ namespace VSD3DStarter static_assert(sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect"); static_assert(sizeof(VSD3DStarter::SubMesh) == 20, "CMO Mesh structure size incorrect"); -static_assert(sizeof(VSD3DStarter::VertexPositionNormalTangentColorTexture) == 52, "CMO Mesh structure size incorrect"); +static_assert(sizeof(VSD3DStarter::Vertex) == 52, "CMO Mesh structure size incorrect"); static_assert(sizeof(VSD3DStarter::SkinningVertex) == 32, "CMO Mesh structure size incorrect"); static_assert(sizeof(VSD3DStarter::MeshExtents) == 40, "CMO Mesh structure size incorrect"); static_assert(sizeof(VSD3DStarter::Bone) == 196, "CMO Mesh structure size incorrect"); diff --git a/Src/ModelLoadCMO.cpp b/Src/ModelLoadCMO.cpp index fe45240a3..3ed67a6a4 100644 --- a/Src/ModelLoadCMO.cpp +++ b/Src/ModelLoadCMO.cpp @@ -20,7 +20,7 @@ using Microsoft::WRL::ComPtr; #include "CMO.h" -static_assert(sizeof(VertexPositionNormalTangentColorTexture) == sizeof(VSD3DStarter::VertexPositionNormalTangentColorTexture), "mismatch with CMO vertex type"); +static_assert(sizeof(VertexPositionNormalTangentColorTexture) == sizeof(VSD3DStarter::Vertex), "mismatch with CMO vertex type"); namespace diff --git a/Src/ModelLoadVBO.cpp b/Src/ModelLoadVBO.cpp index bd00c4e2a..4d194a357 100644 --- a/Src/ModelLoadVBO.cpp +++ b/Src/ModelLoadVBO.cpp @@ -20,7 +20,7 @@ using namespace DirectX; using Microsoft::WRL::ComPtr; -static_assert(sizeof(VertexPositionNormalTexture) == 32, "VBO vertex size mismatch"); +static_assert(sizeof(VertexPositionNormalTexture) == sizeof(VBO::vertex_t), "VBO vertex size mismatch"); namespace { diff --git a/Src/vbo.h b/Src/vbo.h index d79955baa..6fc15fa81 100644 --- a/Src/vbo.h +++ b/Src/vbo.h @@ -28,8 +28,16 @@ namespace VBO uint32_t numIndices; }; + struct vertex_t + { + DirectX::XMFLOAT3 position; + DirectX::XMFLOAT3 normal; + DirectX::XMFLOAT2 textureCoordinate; + }; + #pragma pack(pop) } // namespace static_assert(sizeof(VBO::header_t) == 8, "VBO header size mismatch"); +static_assert(sizeof(VBO::vertex_t) == 32, "VBO vertex size mismatch");