dEQP-VK.wsi.android.surface.query_support
dEQP-VK.wsi.android.surface.query_capabilities
dEQP-VK.wsi.android.surface.query_capabilities2
+dEQP-VK.wsi.android.surface.query_protected_capabilities
dEQP-VK.wsi.android.surface.query_formats
dEQP-VK.wsi.android.surface.query_formats2
dEQP-VK.wsi.android.surface.query_present_modes
dEQP-VK.wsi.macos.surface.query_support
dEQP-VK.wsi.macos.surface.query_capabilities
dEQP-VK.wsi.macos.surface.query_capabilities2
+dEQP-VK.wsi.macos.surface.query_protected_capabilities
dEQP-VK.wsi.macos.surface.query_formats
dEQP-VK.wsi.macos.surface.query_formats2
dEQP-VK.wsi.macos.surface.query_present_modes
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = 1000199001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = 1000221000,
+ VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR = 1000239000,
};
enum VkSystemAllocationScope
#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1
#define VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION 1
#define VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION 1
+#define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION 1
#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9
#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT
#define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR;
}
+template<> VkStructureType getStructureType<VkSurfaceProtectedCapabilitiesKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR;
+}
+
template<> VkStructureType getStructureType<VkDebugReportCallbackCreateInfoEXT> (void)
{
return VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceFloatControlsPropertiesKHR& value);
std::ostream& operator<< (std::ostream& s, const VkSubpassDescriptionDepthStencilResolveKHR& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceDepthStencilResolvePropertiesKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkSurfaceProtectedCapabilitiesKHR& value);
std::ostream& operator<< (std::ostream& s, const VkDebugReportCallbackCreateInfoEXT& value);
std::ostream& operator<< (std::ostream& s, const VkPipelineRasterizationStateRasterizationOrderAMD& value);
std::ostream& operator<< (std::ostream& s, const VkDebugMarkerObjectNameInfoEXT& value);
case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR: return "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: return "VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR";
default: return DE_NULL;
}
}
return s;
}
+std::ostream& operator<< (std::ostream& s, const VkSurfaceProtectedCapabilitiesKHR& value)
+{
+ s << "VkSurfaceProtectedCapabilitiesKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tsupportsProtected = " << value.supportsProtected << '\n';
+ s << '}';
+ return s;
+}
+
std::ostream& operator<< (std::ostream& s, const VkDebugReportCallbackCreateInfoEXT& value)
{
s << "VkDebugReportCallbackCreateInfoEXT = {\n";
VkBool32 independentResolve;
};
+struct VkSurfaceProtectedCapabilitiesKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 supportsProtected;
+};
+
struct VkDebugReportCallbackCreateInfoEXT
{
VkStructureType sType;
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = 1000199001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = 1000221000,
+ VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR = 1000239000,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT,
VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
} VkPhysicalDeviceDepthStencilResolvePropertiesKHR;
+#define VK_KHR_surface_protected_capabilities 1
+#define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION 1
+#define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_EXTENSION_NAME "VK_KHR_surface_protected_capabilities"
+
+typedef struct VkSurfaceProtectedCapabilitiesKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 supportsProtected;
+} VkSurfaceProtectedCapabilitiesKHR;
+
+
#define VK_EXT_debug_report 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT)
"VK_KHR_external_fence_capabilities",
"VK_KHR_device_group_creation",
"VK_KHR_get_display_properties2",
+ "VK_KHR_surface_protected_capabilities",
};
checkKhrExtensions(results, extensions, DE_LENGTH_OF_ARRAY(s_allowedInstanceKhrExtensions), s_allowedInstanceKhrExtensions);
if (isExtensionSupported(supportedExtensions, vk::RequiredExtension("VK_EXT_swapchain_colorspace")))
extensions.push_back("VK_EXT_swapchain_colorspace");
+ // VK_KHR_surface_protected_capabilities adds a way to check if swapchain can be
+ // created for protected VkSurface, so if this extension is enabled then we can
+ // check for that capability.
+ // To check this capability, vkGetPhysicalDeviceSurfaceCapabilities2KHR needs
+ // to be called so add VK_KHR_get_surface_capabilities2 for this.
+ if (isExtensionSupported(supportedExtensions, vk::RequiredExtension("VK_KHR_surface_protected_capabilities")))
+ {
+ extensions.push_back("VK_KHR_get_surface_capabilities2");
+ extensions.push_back("VK_KHR_surface_protected_capabilities");
+ }
+
checkAllSupported(supportedExtensions, extensions);
return extensions;
vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY,
maxQueuedFrames));
+ if (isExtensionSupported(supportedExtensions, vk::RequiredExtension("VK_KHR_surface_protected_capabilities")))
+ {
+ // Check if swapchain can be created for protected surface
+ const vk::InstanceInterface& vki = context.getInstanceDriver();
+ vk::VkSurfaceCapabilities2KHR extCapabilities;
+ vk::VkSurfaceProtectedCapabilitiesKHR extProtectedCapabilities;
+ const vk::VkPhysicalDeviceSurfaceInfo2KHR surfaceInfo =
+ {
+ vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
+ DE_NULL,
+ surface
+ };
+
+ extProtectedCapabilities.sType = vk::VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR;
+ extProtectedCapabilities.pNext = DE_NULL;
+ extProtectedCapabilities.supportsProtected = DE_FALSE;
+
+ extCapabilities.sType = vk::VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR;
+ extCapabilities.pNext = &extProtectedCapabilities;
+
+ VK_CHECK(vki.getPhysicalDeviceSurfaceCapabilities2KHR(context.getPhysicalDevice(), &surfaceInfo, &extCapabilities));
+
+ if (extProtectedCapabilities.supportsProtected == DE_FALSE)
+ TCU_THROW(NotSupportedError, "Swapchain creation for Protected VkSurface is not Supported.");
+ }
+
try
{
const deUint32 numFramesToRender = 60*10;
return tcu::TestStatus(results.getResult(), results.getMessage());
}
+tcu::TestStatus querySurfaceProtectedCapabilitiesTest (Context& context, Type wsiType)
+{
+ tcu::TestLog& log = context.getTestContext().getLog();
+ tcu::ResultCollector results (log);
+
+ vector<string> requiredExtensions;
+ requiredExtensions.push_back("VK_KHR_get_surface_capabilities2");
+ requiredExtensions.push_back("VK_KHR_surface_protected_capabilities");
+ const InstanceHelper instHelper (context, wsiType, requiredExtensions);
+ const NativeObjects native (context, instHelper.supportedExtensions, wsiType);
+ const Unique<VkSurfaceKHR> surface (createSurface(instHelper.vki, *instHelper.instance, wsiType, *native.display, *native.window));
+ const vector<VkPhysicalDevice> physicalDevices = enumeratePhysicalDevices(instHelper.vki, *instHelper.instance);
+
+ for (size_t deviceNdx = 0; deviceNdx < physicalDevices.size(); ++deviceNdx)
+ {
+ if (isSupportedByAnyQueue(instHelper.vki, physicalDevices[deviceNdx], *surface))
+ {
+ VkSurfaceCapabilities2KHR extCapabilities;
+ VkSurfaceProtectedCapabilitiesKHR extProtectedCapabilities;
+
+ deMemset(&extProtectedCapabilities, 0xcd, sizeof(VkSurfaceProtectedCapabilitiesKHR));
+ extProtectedCapabilities.sType = VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR;
+ extProtectedCapabilities.pNext = DE_NULL;
+
+ deMemset(&extCapabilities, 0xcd, sizeof(VkSurfaceCapabilities2KHR));
+ extCapabilities.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR;
+ extCapabilities.pNext = &extProtectedCapabilities;
+
+ {
+ VkPhysicalDeviceSurfaceInfo2KHR infoCopy;
+ const VkPhysicalDeviceSurfaceInfo2KHR surfaceInfo =
+ {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
+ DE_NULL,
+ *surface
+ };
+
+
+ deMemcpy(&infoCopy, &surfaceInfo, sizeof(VkPhysicalDeviceSurfaceInfo2KHR));
+
+ VK_CHECK(instHelper.vki.getPhysicalDeviceSurfaceCapabilities2KHR(physicalDevices[deviceNdx], &surfaceInfo, &extCapabilities));
+
+ results.check(deMemoryEqual(&surfaceInfo, &infoCopy, sizeof(VkPhysicalDeviceSurfaceInfo2KHR)) == DE_TRUE, "Driver wrote into input struct");
+ }
+
+ results.check(extCapabilities.sType == VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR &&
+ extCapabilities.pNext == &extProtectedCapabilities,
+ "sType/pNext modified");
+
+ results.check(extProtectedCapabilities.sType == VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR &&
+ extProtectedCapabilities.pNext == DE_NULL,
+ "sType/pNext modified");
+
+ results.check(extProtectedCapabilities.supportsProtected == 0 ||
+ extProtectedCapabilities.supportsProtected == 1,
+ "supportsProtected ");
+ }
+ }
+
+ return tcu::TestStatus(results.getResult(), results.getMessage());
+}
+
void validateSurfaceFormats (tcu::ResultCollector& results, Type wsiType, const vector<VkSurfaceFormatKHR>& formats)
{
const VkSurfaceFormatKHR* requiredFormats = DE_NULL;
addFunctionCase(testGroup, "query_support", "Query surface support", querySurfaceSupportTest, wsiType);
addFunctionCase(testGroup, "query_capabilities", "Query surface capabilities", querySurfaceCapabilitiesTest, wsiType);
addFunctionCase(testGroup, "query_capabilities2", "Query extended surface capabilities", querySurfaceCapabilities2Test, wsiType);
+ addFunctionCase(testGroup, "query_protected_capabilities", "Query protected surface capabilities", querySurfaceProtectedCapabilitiesTest, wsiType);
addFunctionCase(testGroup, "query_formats", "Query surface formats", querySurfaceFormatsTest, wsiType);
addFunctionCase(testGroup, "query_formats2", "Query extended surface formats", querySurfaceFormats2Test, wsiType);
addFunctionCase(testGroup, "query_present_modes", "Query surface present modes", querySurfacePresentModesTest, wsiType);
dEQP-VK.wsi.xlib.surface.query_support
dEQP-VK.wsi.xlib.surface.query_capabilities
dEQP-VK.wsi.xlib.surface.query_capabilities2
+dEQP-VK.wsi.xlib.surface.query_protected_capabilities
dEQP-VK.wsi.xlib.surface.query_formats
dEQP-VK.wsi.xlib.surface.query_formats2
dEQP-VK.wsi.xlib.surface.query_present_modes
dEQP-VK.wsi.xcb.surface.query_support
dEQP-VK.wsi.xcb.surface.query_capabilities
dEQP-VK.wsi.xcb.surface.query_capabilities2
+dEQP-VK.wsi.xcb.surface.query_protected_capabilities
dEQP-VK.wsi.xcb.surface.query_formats
dEQP-VK.wsi.xcb.surface.query_formats2
dEQP-VK.wsi.xcb.surface.query_present_modes
dEQP-VK.wsi.wayland.surface.query_support
dEQP-VK.wsi.wayland.surface.query_capabilities
dEQP-VK.wsi.wayland.surface.query_capabilities2
+dEQP-VK.wsi.wayland.surface.query_protected_capabilities
dEQP-VK.wsi.wayland.surface.query_formats
dEQP-VK.wsi.wayland.surface.query_formats2
dEQP-VK.wsi.wayland.surface.query_present_modes
dEQP-VK.wsi.mir.surface.query_support
dEQP-VK.wsi.mir.surface.query_capabilities
dEQP-VK.wsi.mir.surface.query_capabilities2
+dEQP-VK.wsi.mir.surface.query_protected_capabilities
dEQP-VK.wsi.mir.surface.query_formats
dEQP-VK.wsi.mir.surface.query_formats2
dEQP-VK.wsi.mir.surface.query_present_modes
dEQP-VK.wsi.android.surface.query_support
dEQP-VK.wsi.android.surface.query_capabilities
dEQP-VK.wsi.android.surface.query_capabilities2
+dEQP-VK.wsi.android.surface.query_protected_capabilities
dEQP-VK.wsi.android.surface.query_formats
dEQP-VK.wsi.android.surface.query_formats2
dEQP-VK.wsi.android.surface.query_present_modes
dEQP-VK.wsi.win32.surface.query_support
dEQP-VK.wsi.win32.surface.query_capabilities
dEQP-VK.wsi.win32.surface.query_capabilities2
+dEQP-VK.wsi.win32.surface.query_protected_capabilities
dEQP-VK.wsi.win32.surface.query_formats
dEQP-VK.wsi.win32.surface.query_formats2
dEQP-VK.wsi.win32.surface.query_present_modes
dEQP-VK.wsi.macos.surface.query_support
dEQP-VK.wsi.macos.surface.query_capabilities
dEQP-VK.wsi.macos.surface.query_capabilities2
+dEQP-VK.wsi.macos.surface.query_protected_capabilities
dEQP-VK.wsi.macos.surface.query_formats
dEQP-VK.wsi.macos.surface.query_formats2
dEQP-VK.wsi.macos.surface.query_present_modes
dEQP-VK.wsi.xlib.surface.query_support
dEQP-VK.wsi.xlib.surface.query_capabilities
dEQP-VK.wsi.xlib.surface.query_capabilities2
+dEQP-VK.wsi.xlib.surface.query_protected_capabilities
dEQP-VK.wsi.xlib.surface.query_formats
dEQP-VK.wsi.xlib.surface.query_formats2
dEQP-VK.wsi.xlib.surface.query_present_modes
dEQP-VK.wsi.xcb.surface.query_support
dEQP-VK.wsi.xcb.surface.query_capabilities
dEQP-VK.wsi.xcb.surface.query_capabilities2
+dEQP-VK.wsi.xcb.surface.query_protected_capabilities
dEQP-VK.wsi.xcb.surface.query_formats
dEQP-VK.wsi.xcb.surface.query_formats2
dEQP-VK.wsi.xcb.surface.query_present_modes
dEQP-VK.wsi.wayland.surface.query_support
dEQP-VK.wsi.wayland.surface.query_capabilities
dEQP-VK.wsi.wayland.surface.query_capabilities2
+dEQP-VK.wsi.wayland.surface.query_protected_capabilities
dEQP-VK.wsi.wayland.surface.query_formats
dEQP-VK.wsi.wayland.surface.query_formats2
dEQP-VK.wsi.wayland.surface.query_present_modes
dEQP-VK.wsi.mir.surface.query_support
dEQP-VK.wsi.mir.surface.query_capabilities
dEQP-VK.wsi.mir.surface.query_capabilities2
+dEQP-VK.wsi.mir.surface.query_protected_capabilities
dEQP-VK.wsi.mir.surface.query_formats
dEQP-VK.wsi.mir.surface.query_formats2
dEQP-VK.wsi.mir.surface.query_present_modes
dEQP-VK.wsi.android.surface.query_support
dEQP-VK.wsi.android.surface.query_capabilities
dEQP-VK.wsi.android.surface.query_capabilities2
+dEQP-VK.wsi.android.surface.query_protected_capabilities
dEQP-VK.wsi.android.surface.query_formats
dEQP-VK.wsi.android.surface.query_formats2
dEQP-VK.wsi.android.surface.query_present_modes
dEQP-VK.wsi.win32.surface.query_support
dEQP-VK.wsi.win32.surface.query_capabilities
dEQP-VK.wsi.win32.surface.query_capabilities2
+dEQP-VK.wsi.win32.surface.query_protected_capabilities
dEQP-VK.wsi.win32.surface.query_formats
dEQP-VK.wsi.win32.surface.query_formats2
dEQP-VK.wsi.win32.surface.query_present_modes
dEQP-VK.wsi.macos.surface.query_support
dEQP-VK.wsi.macos.surface.query_capabilities
dEQP-VK.wsi.macos.surface.query_capabilities2
+dEQP-VK.wsi.macos.surface.query_protected_capabilities
dEQP-VK.wsi.macos.surface.query_formats
dEQP-VK.wsi.macos.surface.query_formats2
dEQP-VK.wsi.macos.surface.query_present_modes
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = 1000199001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = 1000221000,
+ VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR = 1000239000,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT,
VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
} VkPhysicalDeviceDepthStencilResolvePropertiesKHR;
+#define VK_KHR_surface_protected_capabilities 1
+#define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION 1
+#define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_EXTENSION_NAME "VK_KHR_surface_protected_capabilities"
+
+typedef struct VkSurfaceProtectedCapabilitiesKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 supportsProtected;
+} VkSurfaceProtectedCapabilitiesKHR;
+
+
#define VK_EXT_debug_report 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT)