Страница:
IsValid
Страницы
AttributeSort
Clean
CompactVB
ComputeCullData
ComputeInputLayout
ComputeMeshlets
ComputeNormals
ComputeSubsets
ComputeTangentFrame
ComputeVertexCacheMissRate
ConcatenateMesh
ConvertPointRepsToAdjacency
DirectXMesh
FinalizeIB
FinalizeVB
FinalizeVBAndPointReps
FlexibleVertexFormat
FormatUtilities
GenerateAdjacencyAndPointReps
GenerateGSAdjacency
Geometry formats
Home
IsValid
Meshconvert
OptimizeFaces
OptimizeFacesLRU
OptimizeVertices
ReorderIB
ReorderIBAndAdjacency
Resources
Utilities
VBO
VBReader
VBWriter
Validate
WaveFrontReader
WeldVertices
6
IsValid
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:34:24 -08:00
Содержание
DirectXMesh |
---|
Returns true if the given Direct3D input layout is valid, or false otherwise.
bool IsValid( const D3D11_INPUT_ELEMENT_DESC* vbDecl, size_t nDecl );
bool IsValid( const D3D12_INPUT_LAYOUT_DESC& vbDecl );
Header
#include "DirectXMesh.h"
By default, the library supports Direct3D 11. If you want to support Direct3D 12, then you need to
#include <d3d12.h>
before you do#include "DirectXMesh.h"
.
Parameters
vbDecl: Input layout description, which is nDecl elements long.
Remark
This performs many but not all of the same checks that the Direct3D debug layer performs.
Example
Direct3D 11
const D3D11_INPUT_ELEMENT_DESC inputLayout[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TANGENT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BLENDINDICES",0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BLENDWEIGHT", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
if (!IsValid(inputLayout, std::size(inputLayout)))
// error
Direct3D 12
const D3D12_INPUT_ELEMENT_DESC inputLayout[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "TANGENT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "BLENDINDICES",0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "BLENDWEIGHT", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
};
D3D12_INPUT_LAYOUT_DESC desc = { inputLayout, static_cast<UINT>(std::size(inputLayout)) };
if (!IsValid(desc))
// error
For Use
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Windows 7 Service Pack 1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
Architecture
- x86
- x64
- ARM64
For Development
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- GCC 10.5, 11.4, 12.3
- MinGW 12.2, 13.2
- CMake 3.20
Related Projects
DirectX Tool Kit for DirectX 11
DirectX Tool Kit for DirectX 12
Tools
See also
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.