Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Vulkan 1.1 Subgroup Tests
Vulkan 1.1 has subgroup functionality that these tests verify.

Affects:

deQP-VK.subgroups.*

Components: Vulkan

VK-GL-CTS issue: 120
Vulkan issue: 423

Change-Id: I2ff925cc9647718d7e4c4218efbc3b08f773c250
  • Loading branch information
Neil Henning authored and alegal-arm committed Sep 7, 2017
1 parent 3230043 commit 69593fc
Show file tree
Hide file tree
Showing 42 changed files with 19,903 additions and 10 deletions.
15 changes: 15 additions & 0 deletions AndroidGen.mk
Expand Up @@ -224,6 +224,20 @@ LOCAL_SRC_FILES := \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmVariablePointersTests.cpp \
external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp \
external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBasicTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTests.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp \
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp \
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicEventTests.cpp \
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicFenceTests.cpp \
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicSemaphoreTests.cpp \
Expand Down Expand Up @@ -990,6 +1004,7 @@ LOCAL_C_INCLUDES := \
$(deqp_dir)/external/vulkancts/modules/vulkan/sparse_resources \
$(deqp_dir)/external/vulkancts/modules/vulkan/spirv_assembly \
$(deqp_dir)/external/vulkancts/modules/vulkan/ssbo \
$(deqp_dir)/external/vulkancts/modules/vulkan/subgroups \
$(deqp_dir)/external/vulkancts/modules/vulkan/synchronization \
$(deqp_dir)/external/vulkancts/modules/vulkan/tessellation \
$(deqp_dir)/external/vulkancts/modules/vulkan/texture \
Expand Down
4,227 changes: 4,227 additions & 0 deletions android/cts/master/vk-master.txt

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions external/fetch_sources.py
Expand Up @@ -241,19 +241,19 @@ def postExtractLibpng (path):
"libpng",
postExtract = postExtractLibpng),
GitRepo(
"https://github.com/KhronosGroup/SPIRV-Tools.git",
None,
"0b0454c42c6b6f6746434bd5c78c5c70f65d9c51",
"https://gitlab.khronos.org/spirv/spirv-tools.git",
"git@gitlab.khronos.org:spirv/spirv-tools.git",
"5ef1440f3ec5a5fc6e5cf368383c4b1ae323f0f8",
"spirv-tools"),
GitRepo(
"https://github.com/KhronosGroup/glslang.git",
None,
"a5c5fb61180e8703ca85f36d618f98e16dc317e2",
"https://gitlab.khronos.org/GLSL/glslang.git",
"git@gitlab.khronos.org:GLSL/glslang.git",
"bac5d60bdf5df38bc4d3d58379aa6efc45f1ea83",
"glslang"),
GitRepo(
"https://github.com/KhronosGroup/SPIRV-Headers.git",
None,
"2bf02308656f97898c5f7e433712f21737c61e4e",
"https://gitlab.khronos.org/spirv/SPIRV-Headers.git",
"git@gitlab.khronos.org:spirv/SPIRV-Headers.git",
"73a7a9e467b42ca696e9c1f1b4ea37776c79b9f8",
"spirv-headers"),
]

Expand Down
14 changes: 14 additions & 0 deletions external/vulkancts/framework/vulkan/vkBasicTypes.inl
Expand Up @@ -211,6 +211,7 @@ enum VkStructureType
VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000,
VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000093000,
VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = 1000112000,
VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = 1000112001,
Expand Down Expand Up @@ -1358,6 +1359,19 @@ enum VkDisplayPlaneAlphaFlagBitsKHR
};
typedef deUint32 VkDisplayPlaneAlphaFlagsKHR;

enum VkSubgroupFeatureFlagBits
{
VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001,
VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002,
VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004,
VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008,
VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010,
VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020,
VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040,
VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080,
};
typedef deUint32 VkSubgroupFeatureFlags;

enum VkExternalFenceHandleTypeFlagBitsKHR
{
VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001,
Expand Down
Expand Up @@ -336,6 +336,11 @@ template<> VkStructureType getStructureType<VkPhysicalDeviceSparseImageFormatInf
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR;
}

template<> VkStructureType getStructureType<VkPhysicalDeviceSubgroupProperties> (void)
{
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
}

template<> VkStructureType getStructureType<VkPhysicalDevicePushDescriptorPropertiesKHR> (void)
{
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR;
Expand Down
2 changes: 1 addition & 1 deletion external/vulkancts/framework/vulkan/vkSpirVAsm.cpp
Expand Up @@ -39,7 +39,7 @@ using std::vector;

#if defined(DEQP_HAVE_SPIRV_TOOLS)

static const spv_target_env s_defaultEnvironment = SPV_ENV_VULKAN_1_0;
static const spv_target_env s_defaultEnvironment = SPV_ENV_VULKAN_1_1;

bool assembleSpirV (const SpirVAsmSource* program, std::vector<deUint32>* dst, SpirVProgramInfo* buildInfo)
{
Expand Down
2 changes: 2 additions & 0 deletions external/vulkancts/framework/vulkan/vkStrUtil.inl
Expand Up @@ -178,6 +178,7 @@ tcu::Format::Bitfield<32> getSurfaceTransformFlagsKHRStr (VkSurfaceTransform
tcu::Format::Bitfield<32> getCompositeAlphaFlagsKHRStr (VkCompositeAlphaFlagsKHR value);
tcu::Format::Bitfield<32> getSwapchainCreateFlagsKHRStr (VkSwapchainCreateFlagsKHR value);
tcu::Format::Bitfield<32> getDisplayPlaneAlphaFlagsKHRStr (VkDisplayPlaneAlphaFlagsKHR value);
tcu::Format::Bitfield<32> getSubgroupFeatureFlagsStr (VkSubgroupFeatureFlags value);
tcu::Format::Bitfield<32> getExternalFenceHandleTypeFlagsKHRStr (VkExternalFenceHandleTypeFlagsKHR value);
tcu::Format::Bitfield<32> getExternalFenceFeatureFlagsKHRStr (VkExternalFenceFeatureFlagsKHR value);
tcu::Format::Bitfield<32> getFenceImportFlagsKHRStr (VkFenceImportFlagsKHR value);
Expand Down Expand Up @@ -361,6 +362,7 @@ std::ostream& operator<< (std::ostream& s, const VkQueueFamilyProperties2KHR& va
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceMemoryProperties2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkSparseImageFormatProperties2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceSparseImageFormatInfo2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceSubgroupProperties& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDevicePushDescriptorPropertiesKHR& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDevice16BitStorageFeaturesKHR& value);
std::ostream& operator<< (std::ostream& s, const VkRectLayerKHR& value);
Expand Down
30 changes: 30 additions & 0 deletions external/vulkancts/framework/vulkan/vkStrUtilImpl.inl
Expand Up @@ -222,6 +222,7 @@ const char* getStructureTypeName (VkStructureType value)
case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: return "VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR";
case VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR: return "VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR";
case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: return "VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES";
case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: return "VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR";
case VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR: return "VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR";
Expand Down Expand Up @@ -1577,6 +1578,22 @@ tcu::Format::Bitfield<32> getDisplayPlaneAlphaFlagsKHRStr (VkDisplayPlaneAlphaFl
return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
}

tcu::Format::Bitfield<32> getSubgroupFeatureFlagsStr (VkSubgroupFeatureFlags value)
{
static const tcu::Format::BitDesc s_desc[] =
{
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_BASIC_BIT, "VK_SUBGROUP_FEATURE_BASIC_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_VOTE_BIT, "VK_SUBGROUP_FEATURE_VOTE_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_ARITHMETIC_BIT, "VK_SUBGROUP_FEATURE_ARITHMETIC_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_BALLOT_BIT, "VK_SUBGROUP_FEATURE_BALLOT_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_SHUFFLE_BIT, "VK_SUBGROUP_FEATURE_SHUFFLE_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT, "VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_CLUSTERED_BIT, "VK_SUBGROUP_FEATURE_CLUSTERED_BIT"),
tcu::Format::BitDesc(VK_SUBGROUP_FEATURE_QUAD_BIT, "VK_SUBGROUP_FEATURE_QUAD_BIT"),
};
return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
}

tcu::Format::Bitfield<32> getExternalFenceHandleTypeFlagsKHRStr (VkExternalFenceHandleTypeFlagsKHR value)
{
static const tcu::Format::BitDesc s_desc[] =
Expand Down Expand Up @@ -3728,6 +3745,19 @@ std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceSparseImageForm
return s;
}

std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceSubgroupProperties& value)
{
s << "VkPhysicalDeviceSubgroupProperties = {\n";
s << "\tsType = " << value.sType << '\n';
s << "\tpNext = " << value.pNext << '\n';
s << "\tsubgroupSize = " << value.subgroupSize << '\n';
s << "\tsupportedStages = " << getShaderStageFlagsStr(value.supportedStages) << '\n';
s << "\tsupportedOperations = " << getSubgroupFeatureFlagsStr(value.supportedOperations) << '\n';
s << "\tquadOperationsInAllStages = " << value.quadOperationsInAllStages << '\n';
s << '}';
return s;
}

std::ostream& operator<< (std::ostream& s, const VkPhysicalDevicePushDescriptorPropertiesKHR& value)
{
s << "VkPhysicalDevicePushDescriptorPropertiesKHR = {\n";
Expand Down
10 changes: 10 additions & 0 deletions external/vulkancts/framework/vulkan/vkStructTypes.inl
Expand Up @@ -1434,6 +1434,16 @@ struct VkPhysicalDeviceSparseImageFormatInfo2KHR
VkImageTiling tiling;
};

struct VkPhysicalDeviceSubgroupProperties
{
VkStructureType sType;
void* pNext;
deUint32 subgroupSize;
VkShaderStageFlags supportedStages;
VkSubgroupFeatureFlags supportedOperations;
VkBool32 quadOperationsInAllStages;
};

struct VkPhysicalDevicePushDescriptorPropertiesKHR
{
VkStructureType sType;
Expand Down
3 changes: 3 additions & 0 deletions external/vulkancts/modules/vulkan/CMakeLists.txt
Expand Up @@ -26,6 +26,7 @@ add_subdirectory(texture)
add_subdirectory(robustness)
add_subdirectory(renderpass)
add_subdirectory(multiview)
add_subdirectory(subgroups)
add_subdirectory(ycbcr)

include_directories(
Expand Down Expand Up @@ -55,6 +56,7 @@ include_directories(
robustness
renderpass
multiview
subgroups
ycbcr
)

Expand Down Expand Up @@ -109,6 +111,7 @@ set(DEQP_VK_LIBS
deqp-vk-robustness
deqp-vk-render-pass
deqp-vk-multiview
deqp-vk-subgroups
deqp-vk-ycbcr
)

Expand Down
40 changes: 40 additions & 0 deletions external/vulkancts/modules/vulkan/subgroups/CMakeLists.txt
@@ -0,0 +1,40 @@
include_directories(..)

set(DEQP_VK_SUBGROUPS_SRCS
vktSubgroupsTests.cpp
vktSubgroupsTests.hpp
vktSubgroupsBuiltinVarTests.cpp
vktSubgroupsBuiltinVarTests.hpp
vktSubgroupsBuiltinMaskVarTests.cpp
vktSubgroupsBuiltinMaskVarTests.hpp
vktSubgroupsBasicTests.cpp
vktSubgroupsBasicTests.hpp
vktSubgroupsVoteTests.cpp
vktSubgroupsVoteTests.hpp
vktSubgroupsBallotTests.cpp
vktSubgroupsBallotTests.hpp
vktSubgroupsBallotBroadcastTests.cpp
vktSubgroupsBallotBroadcastTests.hpp
vktSubgroupsBallotOtherTests.cpp
vktSubgroupsBallotOtherTests.hpp
vktSubgroupsArithmeticTests.cpp
vktSubgroupsArithmeticTests.hpp
vktSubgroupsClusteredTests.cpp
vktSubgroupsClusteredTests.hpp
vktSubgroupsShuffleTests.cpp
vktSubgroupsShuffleTests.hpp
vktSubgroupsQuadTests.cpp
vktSubgroupsQuadTests.hpp
vktSubgroupsShapeTests.cpp
vktSubgroupsShapeTests.hpp
vktSubgroupsTestsUtils.cpp
vktSubgroupsTestsUtils.hpp
)

set(DEQP_VK_SUBGROUPS_LIBS
tcutil
vkutil
)

add_library(deqp-vk-subgroups STATIC ${DEQP_VK_SUBGROUPS_SRCS})
target_link_libraries(deqp-vk-subgroups ${DEQP_VK_SUBGROUPS_LIBS})

0 comments on commit 69593fc

Please sign in to comment.