Skip to content

Commit 4b1afde

Browse files
authored
Fix /analyze warning (#244)
1 parent 5627c77 commit 4b1afde

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

DirectXMesh/DirectXMeshUtil.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ void DirectX::ComputeInputLayout(
270270
{
271271
assert(IsValid(vbDecl, nDecl));
272272

273-
if (!vbDecl || !nDecl)
274-
return;
275-
276273
if (offsets)
277274
memset(offsets, 0, sizeof(uint32_t) * nDecl);
278275

279276
if (strides)
280277
memset(strides, 0, sizeof(uint32_t) * D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT);
281278

279+
if (!vbDecl || !nDecl)
280+
return;
281+
282282
uint32_t prevABO[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
283283
memset(prevABO, 0, sizeof(uint32_t) * D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT);
284284

@@ -337,15 +337,15 @@ void DirectX::ComputeInputLayout(const D3D12_INPUT_LAYOUT_DESC& vbDecl,
337337
{
338338
assert(IsValid(vbDecl));
339339

340-
if (!vbDecl.pInputElementDescs || !vbDecl.NumElements)
341-
return;
342-
343340
if (offsets)
344341
memset(offsets, 0, sizeof(uint32_t) * vbDecl.NumElements);
345342

346343
if (strides)
347344
memset(strides, 0, sizeof(uint32_t) * D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT);
348345

346+
if (!vbDecl.pInputElementDescs || !vbDecl.NumElements)
347+
return;
348+
349349
uint32_t prevABO[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT] = {};
350350

351351
for (size_t j = 0; j < vbDecl.NumElements; ++j)

0 commit comments

Comments
 (0)