Skip to content

Commit

Permalink
tests: Test buffer in barrier is bound to memory
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg authored and spencer-lunarg committed Jan 9, 2025
1 parent ce7b835 commit 912a1a5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/unit/sync_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4413,6 +4413,30 @@ TEST_F(NegativeSyncObject, Sync2FeatureDisabled) {
m_command_buffer.End();
}

TEST_F(NegativeSyncObject, BufferMemoryBarrierUnbound) {
RETURN_IF_SKIP(Init());

VkBufferCreateInfo buffer_ci = vku::InitStructHelper();
buffer_ci.flags = 0u;
buffer_ci.size = 256u;
buffer_ci.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
vkt::Buffer buffer(*m_device, buffer_ci, vkt::no_mem);

m_command_buffer.Begin();
VkBufferMemoryBarrier bmb = vku::InitStructHelper();
bmb.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
bmb.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
bmb.buffer = buffer.handle();
bmb.offset = 0;
bmb.size = VK_WHOLE_SIZE;
m_errorMonitor->SetDesiredError("VUID-VkBufferMemoryBarrier-buffer-01931");
vk::CmdPipelineBarrier(m_command_buffer.handle(), VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0u, 0u,
nullptr, 1u, &bmb, 0u, nullptr);
m_errorMonitor->VerifyFound();

m_command_buffer.End();
}

TEST_F(NegativeSyncObject, BufferMemoryBarrierQueueFamilyExternal) {
RETURN_IF_SKIP(Init());

Expand Down

0 comments on commit 912a1a5

Please sign in to comment.