dEQP-VK.wsi.android.swapchain.modify.resize
dEQP-VK.wsi.android.swapchain.destroy.null_handle
dEQP-VK.wsi.android.swapchain.get_images.incomplete
+dEQP-VK.wsi.android.swapchain.get_images.count
dEQP-VK.wsi.android.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.android.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.android.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.macos.swapchain.render.basic
dEQP-VK.wsi.macos.swapchain.destroy.null_handle
dEQP-VK.wsi.macos.swapchain.get_images.incomplete
+dEQP-VK.wsi.macos.swapchain.get_images.count
dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.macos.incremental_present.scale_none.mailbox.reference
{
if (isSupportedByAnyQueue(instHelper.vki, physicalDevices[deviceNdx], *surface))
{
- const vector<VkSurfaceFormatKHR> formats = getPhysicalDeviceSurfaceFormats(instHelper.vki,
- physicalDevices[deviceNdx],
- *surface);
+ deUint32 numFormats = 0;
+
+ VK_CHECK(instHelper.vki.getPhysicalDeviceSurfaceFormatsKHR(physicalDevices[deviceNdx], *surface, &numFormats, DE_NULL));
+
+ std::vector<VkSurfaceFormatKHR> formats (numFormats + 1);
+
+ if (numFormats > 0)
+ {
+ const deUint32 numFormatsOrig = numFormats;
+
+ // check if below call properly overwrites formats count
+ numFormats++;
+
+ VK_CHECK(instHelper.vki.getPhysicalDeviceSurfaceFormatsKHR(physicalDevices[deviceNdx], *surface, &numFormats, &formats[0]));
+
+ if (numFormats != numFormatsOrig)
+ results.fail("Format count changed between calls");
+ }
+
+ formats.pop_back();
log << TestLog::Message << "Device " << deviceNdx << ": " << tcu::formatArray(formats.begin(), formats.end()) << TestLog::EndMessage;
if (numFormats > 0)
{
- vector<VkSurfaceFormat2KHR> formats (numFormats);
+ vector<VkSurfaceFormat2KHR> formats (numFormats + 1);
for (size_t ndx = 0; ndx < formats.size(); ++ndx)
{
formats[ndx].pNext = DE_NULL;
}
+ const deUint32 numFormatsOrig = numFormats;
+
+ // check if below call properly overwrites formats count
+ numFormats++;
+
VK_CHECK(instHelper.vki.getPhysicalDeviceSurfaceFormats2KHR(physicalDevices[deviceNdx], &surfaceInfo, &numFormats, &formats[0]));
- if ((size_t)numFormats != formats.size())
+ if ((size_t)numFormats != numFormatsOrig)
results.fail("Format count changed between calls");
+ formats.pop_back();
+
{
vector<VkSurfaceFormatKHR> extFormats (formats.size());
{
if (isSupportedByAnyQueue(instHelper.vki, physicalDevices[deviceNdx], *surface))
{
- const vector<VkPresentModeKHR> modes = getPhysicalDeviceSurfacePresentModes(instHelper.vki, physicalDevices[deviceNdx], *surface);
+ deUint32 numModes = 0;
+
+ VK_CHECK(instHelper.vki.getPhysicalDeviceSurfacePresentModesKHR(physicalDevices[deviceNdx], *surface, &numModes, DE_NULL));
+
+ vector<VkPresentModeKHR> modes (numModes + 1);
+
+ if (numModes > 0)
+ {
+ const deUint32 numModesOrig = numModes;
+
+ // check if below call properly overwrites mode count
+ numModes++;
+
+ VK_CHECK(instHelper.vki.getPhysicalDeviceSurfacePresentModesKHR(physicalDevices[deviceNdx], *surface, &numModes, &modes[0]));
+
+ if ((size_t)numModes != numModesOrig)
+ TCU_FAIL("Mode count changed between calls");
+ }
+
+ modes.pop_back();
log << TestLog::Message << "Device " << deviceNdx << ": " << tcu::formatArray(modes.begin(), modes.end()) << TestLog::EndMessage;
return tcu::TestStatus::pass("Get swapchain images tests succeeded");
}
+tcu::TestStatus getImagesResultsCountTest (Context& context, Type wsiType)
+{
+ const tcu::UVec2 desiredSize(256, 256);
+ const InstanceHelper instHelper(context, wsiType);
+ const NativeObjects native(context, instHelper.supportedExtensions, wsiType, tcu::just(desiredSize));
+ const Unique<VkSurfaceKHR> surface(createSurface(instHelper.vki, *instHelper.instance, wsiType, *native.display, *native.window));
+ const DeviceHelper devHelper(context, instHelper.vki, *instHelper.instance, *surface);
+ const VkSwapchainCreateInfoKHR swapchainInfo = getBasicSwapchainParameters(wsiType, instHelper.vki, devHelper.physicalDevice, *surface, desiredSize, 2);
+ const Unique<VkSwapchainKHR> swapchain(createSwapchainKHR(devHelper.vkd, *devHelper.device, &swapchainInfo));
+
+ deUint32 numImages = 0;
+
+ VK_CHECK(devHelper.vkd.getSwapchainImagesKHR(*devHelper.device, *swapchain, &numImages, DE_NULL));
+
+ if (numImages > 0)
+ {
+ std::vector<VkImage> images (numImages + 1);
+ const deUint32 numImagesOrig = numImages;
+
+ // check if below call properly overwrites formats count
+ numImages++;
+
+ VK_CHECK(devHelper.vkd.getSwapchainImagesKHR(*devHelper.device, *swapchain, &numImages, &images[0]));
+
+ if ((size_t)numImages != numImagesOrig)
+ TCU_FAIL("Image count changed between calls");
+ }
+ return tcu::TestStatus::pass("Get swapchain images tests succeeded");
+}
+
tcu::TestStatus destroyNullHandleSwapchainTest (Context& context, Type wsiType)
{
const InstanceHelper instHelper (context, wsiType);
void populateGetImagesGroup (tcu::TestCaseGroup* testGroup, Type wsiType)
{
addFunctionCase(testGroup, "incomplete", "Test VK_INCOMPLETE return code", getImagesIncompleteResultTest, wsiType);
+ addFunctionCase(testGroup, "count", "Test proper count of images", getImagesResultsCountTest, wsiType);
}
void populateModifyGroup (tcu::TestCaseGroup* testGroup, Type wsiType)
dEQP-VK.wsi.xlib.swapchain.render.basic
dEQP-VK.wsi.xlib.swapchain.destroy.null_handle
dEQP-VK.wsi.xlib.swapchain.get_images.incomplete
+dEQP-VK.wsi.xlib.swapchain.get_images.count
dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.xlib.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.xcb.swapchain.render.basic
dEQP-VK.wsi.xcb.swapchain.destroy.null_handle
dEQP-VK.wsi.xcb.swapchain.get_images.incomplete
+dEQP-VK.wsi.xcb.swapchain.get_images.count
dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.xcb.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.wayland.swapchain.modify.resize
dEQP-VK.wsi.wayland.swapchain.destroy.null_handle
dEQP-VK.wsi.wayland.swapchain.get_images.incomplete
+dEQP-VK.wsi.wayland.swapchain.get_images.count
dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.wayland.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.mir.swapchain.modify.resize
dEQP-VK.wsi.mir.swapchain.destroy.null_handle
dEQP-VK.wsi.mir.swapchain.get_images.incomplete
+dEQP-VK.wsi.mir.swapchain.get_images.count
dEQP-VK.wsi.mir.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.mir.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.mir.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.android.swapchain.modify.resize
dEQP-VK.wsi.android.swapchain.destroy.null_handle
dEQP-VK.wsi.android.swapchain.get_images.incomplete
+dEQP-VK.wsi.android.swapchain.get_images.count
dEQP-VK.wsi.android.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.android.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.android.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.win32.swapchain.render.basic
dEQP-VK.wsi.win32.swapchain.destroy.null_handle
dEQP-VK.wsi.win32.swapchain.get_images.incomplete
+dEQP-VK.wsi.win32.swapchain.get_images.count
dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.win32.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.macos.swapchain.render.basic
dEQP-VK.wsi.macos.swapchain.destroy.null_handle
dEQP-VK.wsi.macos.swapchain.get_images.incomplete
+dEQP-VK.wsi.macos.swapchain.get_images.count
dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.macos.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.xlib.swapchain.render.basic
dEQP-VK.wsi.xlib.swapchain.destroy.null_handle
dEQP-VK.wsi.xlib.swapchain.get_images.incomplete
+dEQP-VK.wsi.xlib.swapchain.get_images.count
dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.xlib.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.xcb.swapchain.render.basic
dEQP-VK.wsi.xcb.swapchain.destroy.null_handle
dEQP-VK.wsi.xcb.swapchain.get_images.incomplete
+dEQP-VK.wsi.xcb.swapchain.get_images.count
dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.xcb.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.wayland.swapchain.modify.resize
dEQP-VK.wsi.wayland.swapchain.destroy.null_handle
dEQP-VK.wsi.wayland.swapchain.get_images.incomplete
+dEQP-VK.wsi.wayland.swapchain.get_images.count
dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.wayland.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.mir.swapchain.modify.resize
dEQP-VK.wsi.mir.swapchain.destroy.null_handle
dEQP-VK.wsi.mir.swapchain.get_images.incomplete
+dEQP-VK.wsi.mir.swapchain.get_images.count
dEQP-VK.wsi.mir.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.mir.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.mir.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.android.swapchain.modify.resize
dEQP-VK.wsi.android.swapchain.destroy.null_handle
dEQP-VK.wsi.android.swapchain.get_images.incomplete
+dEQP-VK.wsi.android.swapchain.get_images.count
dEQP-VK.wsi.android.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.android.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.android.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.win32.swapchain.render.basic
dEQP-VK.wsi.win32.swapchain.destroy.null_handle
dEQP-VK.wsi.win32.swapchain.get_images.incomplete
+dEQP-VK.wsi.win32.swapchain.get_images.count
dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.win32.incremental_present.scale_none.mailbox.reference
dEQP-VK.wsi.macos.swapchain.render.basic
dEQP-VK.wsi.macos.swapchain.destroy.null_handle
dEQP-VK.wsi.macos.swapchain.get_images.incomplete
+dEQP-VK.wsi.macos.swapchain.get_images.count
dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.reference
dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.incremental_present
dEQP-VK.wsi.macos.incremental_present.scale_none.mailbox.reference