diff options
| author | Charles Giessen <charles@lunarg.com> | 2025-03-08 12:44:55 -0600 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2025-03-08 12:59:52 -0700 |
| commit | 072c8124dc6721df9b9c47f48830319b3218227a (patch) | |
| tree | e67a45569a670761aae91561839597d285287216 /cube/cube.cpp | |
| parent | 4d5e1f892f87c735559db1fa1eb478c117f4933e (diff) | |
| download | usermoji-072c8124dc6721df9b9c47f48830319b3218227a.tar.xz | |
cube: Fix protected memory pNext chains
The chains were including the structs even when protected memory isn't
desired, triggering validation errors.
Diffstat (limited to 'cube/cube.cpp')
| -rw-r--r-- | cube/cube.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cube/cube.cpp b/cube/cube.cpp index 8f1e0a19..fafd1746 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -812,7 +812,7 @@ void Demo::create_device() { } auto const protected_memory_features = vk::PhysicalDeviceProtectedMemoryFeatures().setProtectedMemory(protected_output); - auto deviceInfo = vk::DeviceCreateInfo().setPNext(&protected_memory_features).setQueueCreateInfos(queues).setPEnabledExtensionNames(enabled_device_extensions); + auto deviceInfo = vk::DeviceCreateInfo().setPNext(protected_output ? &protected_memory_features : nullptr).setQueueCreateInfos(queues).setPEnabledExtensionNames(enabled_device_extensions); auto device_return = gpu.createDevice(deviceInfo); VERIFY(device_return.result == vk::Result::eSuccess); device = device_return.value; @@ -863,7 +863,7 @@ void Demo::draw() { auto protected_submit_info = vk::ProtectedSubmitInfo().setProtectedSubmit(protected_output); auto submit_result = graphics_queue.submit(vk::SubmitInfo() - .setPNext(&protected_submit_info) + .setPNext(protected_output ? &protected_submit_info : nullptr) .setWaitDstStageMask(pipe_stage_flags) .setWaitSemaphores(image_acquired_semaphores[frame_index]) .setCommandBuffers(swapchain_image_resources[current_buffer].cmd) @@ -1021,7 +1021,7 @@ void Demo::flush_init_cmd() { auto fence = fence_return.value; auto const protected_submit_info = vk::ProtectedSubmitInfo().setProtectedSubmit(protected_output); - result = graphics_queue.submit(vk::SubmitInfo().setPNext(&protected_submit_info).setCommandBuffers(cmd), fence); + result = graphics_queue.submit(vk::SubmitInfo().setPNext(protected_output ? &protected_submit_info : nullptr).setCommandBuffers(cmd), fence); VERIFY(result == vk::Result::eSuccess); result = device.waitForFences(fence, VK_TRUE, UINT64_MAX); |
