Skip to content

Commit af45c94

Browse files
Improved TestSmallBuffers to test whether a small buffer was created as committed
Which is expected unless tight alignment is enabled.
1 parent 2d541a9 commit af45c94

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/Tests.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,9 @@ static void TestSmallBuffers(const TestContext& ctx)
778778
CHECK_HR(ctx.allocator->CreateResource(&allocDesc, &resDesc, D3D12_RESOURCE_STATE_COMMON,
779779
nullptr, &resWithAlloc.allocation, IID_PPV_ARGS(&resWithAlloc.resource)));
780780
CHECK_BOOL(resWithAlloc.allocation && resWithAlloc.allocation->GetResource());
781-
// May or may not be committed, depending on the PREFER_SMALL_BUFFERS_COMMITTED
782-
// and TIGHT_ALIGNMENT settings.
781+
// Expected to be committed unless tight alignment is supported.
783782
const bool isCommitted = resWithAlloc.allocation->GetHeap() == NULL;
784-
if (isCommitted)
785-
wprintf(L" Small buffer %llu B inside a custom pool was created as committed.\n", resDesc.Width);
786-
else
787-
wprintf(L" Small buffer %llu B inside a custom pool was created as placed.\n", resDesc.Width);
783+
CHECK_BOOL(isCommitted != (ctx.allocator->IsTightAlignmentSupported() != FALSE));
788784
}
789785

790786
// Test 3: NEVER_ALLOCATE.

0 commit comments

Comments
 (0)