Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Tests for VK_KHR_vulkan_memory_model #123

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AndroidGen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ LOCAL_SRC_FILES := \
external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp \
external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp \
external/vulkancts/modules/vulkan/memory/vktMemoryTests.cpp \
external/vulkancts/modules/vulkan/memory_model/vktMemoryModelMessagePassing.cpp \
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderPassUtil.cpp \
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp \
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderUtil.cpp \
Expand Down Expand Up @@ -1051,6 +1052,7 @@ LOCAL_C_INCLUDES := \
$(deqp_dir)/external/vulkancts/modules/vulkan/geometry \
$(deqp_dir)/external/vulkancts/modules/vulkan/image \
$(deqp_dir)/external/vulkancts/modules/vulkan/memory \
$(deqp_dir)/external/vulkancts/modules/vulkan/memory_model \
$(deqp_dir)/external/vulkancts/modules/vulkan/multiview \
$(deqp_dir)/external/vulkancts/modules/vulkan/pipeline \
$(deqp_dir)/external/vulkancts/modules/vulkan/protected_memory \
Expand Down
6 changes: 3 additions & 3 deletions external/fetch_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ def postExtractLibpng (path):
GitRepo(
"https://github.com/KhronosGroup/SPIRV-Tools.git",
None,
"gitlab-spv-khr-8bit-storage",
"7600fc0e19c3a99bd3ef2c24515cc508ca1d3cfb",
"spirv-tools"),
GitRepo(
"https://github.com/KhronosGroup/glslang.git",
None,
"e7df8e0b76af2fb9f58124be6b95688e5dbcdb7a",
"ddfb4a8022767b93658c17bd26a01f6d6859eac9",
"glslang"),
GitRepo(
"https://github.com/KhronosGroup/SPIRV-Headers.git",
None,
"ff684ffc6a35d2a58f0f63108877d0064ea33feb",
"dcf23bdabacc3c54b83b1f9367e7a8adb27f8d87",
"spirv-headers"),
]

Expand Down
1 change: 1 addition & 0 deletions external/vulkancts/framework/vulkan/vkBasicTypes.inl
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ enum VkStructureType
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000,
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
};

enum VkSystemAllocationScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,3 +1136,8 @@ template<> VkStructureType getStructureType<VkPhysicalDeviceVertexAttributeDivis
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
}

template<> VkStructureType getStructureType<VkPhysicalDeviceVulkanMemoryModelFeaturesKHR> (void)
{
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR;
}

6 changes: 5 additions & 1 deletion external/vulkancts/framework/vulkan/vkMemUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const MemoryRequirement MemoryRequirement::LazilyAllocated = MemoryRequirement(M
const MemoryRequirement MemoryRequirement::Protected = MemoryRequirement(MemoryRequirement::FLAG_PROTECTED);
const MemoryRequirement MemoryRequirement::Local = MemoryRequirement(MemoryRequirement::FLAG_LOCAL);
const MemoryRequirement MemoryRequirement::Cached = MemoryRequirement(MemoryRequirement::FLAG_CACHED);

const MemoryRequirement MemoryRequirement::NonLocal = MemoryRequirement(MemoryRequirement::FLAG_NON_LOCAL);

bool MemoryRequirement::matchesHeap (VkMemoryPropertyFlags heapFlags) const
{
Expand Down Expand Up @@ -148,6 +148,10 @@ bool MemoryRequirement::matchesHeap (VkMemoryPropertyFlags heapFlags) const
if ((m_flags & FLAG_CACHED) && !(heapFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT))
return false;

// non-local
if ((m_flags & FLAG_NON_LOCAL) && (heapFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT))
return false;

return true;
}

Expand Down
2 changes: 2 additions & 0 deletions external/vulkancts/framework/vulkan/vkMemUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MemoryRequirement
static const MemoryRequirement Protected;
static const MemoryRequirement Local;
static const MemoryRequirement Cached;
static const MemoryRequirement NonLocal;

inline MemoryRequirement operator| (MemoryRequirement requirement) const
{
Expand Down Expand Up @@ -110,6 +111,7 @@ class MemoryRequirement
FLAG_PROTECTED = 1u << 3u,
FLAG_LOCAL = 1u << 4u,
FLAG_CACHED = 1u << 5u,
FLAG_NON_LOCAL = 1u << 6u,
};
};

Expand Down
1 change: 1 addition & 0 deletions external/vulkancts/framework/vulkan/vkStrUtil.inl
Original file line number Diff line number Diff line change
Expand Up @@ -595,3 +595,4 @@ std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceVertexAttribute
std::ostream& operator<< (std::ostream& s, const VkVertexInputBindingDivisorDescriptionEXT& value);
std::ostream& operator<< (std::ostream& s, const VkPipelineVertexInputDivisorStateCreateInfoEXT& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& value);
12 changes: 12 additions & 0 deletions external/vulkancts/framework/vulkan/vkStrUtilImpl.inl
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ const char* getStructureTypeName (VkStructureType value)
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT";
case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: return "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR";
default: return DE_NULL;
}
}
Expand Down Expand Up @@ -6234,3 +6235,14 @@ std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceVertexAttribute
s << '}';
return s;
}

std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& value)
{
s << "VkPhysicalDeviceVulkanMemoryModelFeaturesKHR = {\n";
s << "\tsType = " << value.sType << '\n';
s << "\tpNext = " << value.pNext << '\n';
s << "\tvulkanMemoryModel = " << value.vulkanMemoryModel << '\n';
s << "\tvulkanMemoryModelDeviceScope = " << value.vulkanMemoryModelDeviceScope << '\n';
s << '}';
return s;
}
8 changes: 8 additions & 0 deletions external/vulkancts/framework/vulkan/vkStructTypes.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2982,6 +2982,14 @@ struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT
VkBool32 vertexAttributeInstanceRateZeroDivisor;
};

struct VkPhysicalDeviceVulkanMemoryModelFeaturesKHR
{
VkStructureType sType;
void* pNext;
VkBool32 vulkanMemoryModel;
VkBool32 vulkanMemoryModelDeviceScope;
};




Expand Down
3 changes: 3 additions & 0 deletions external/vulkancts/modules/vulkan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_subdirectory(multiview)
add_subdirectory(subgroups)
add_subdirectory(ycbcr)
add_subdirectory(protected_memory)
add_subdirectory(memory_model)

include_directories(
api
Expand Down Expand Up @@ -62,6 +63,7 @@ include_directories(
subgroups
ycbcr
protected_memory
memory_model
)

set(DEQP_VK_SRCS
Expand Down Expand Up @@ -120,6 +122,7 @@ set(DEQP_VK_LIBS
deqp-vk-subgroups
deqp-vk-ycbcr
deqp-vk-protected-memory
deqp-vk-memory-model
)

if (DE_COMPILER_IS_MSC AND (DE_PTR_SIZE EQUAL 4))
Expand Down
14 changes: 14 additions & 0 deletions external/vulkancts/modules/vulkan/memory_model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include_directories(..)

set(DEQP_VK_DEVICE_GROUP_SRCS
vktMemoryModelTests.hpp
vktMemoryModelMessagePassing.cpp
)

set(DEQP_VK_DEVICE_GROUP_LIBS
tcutil
vkutil
)

add_library(deqp-vk-memory-model STATIC ${DEQP_VK_DEVICE_GROUP_SRCS})
target_link_libraries(deqp-vk-memory-model ${DEQP_VK_DEVICE_GROUP_LIBS})
Loading