Skip to content
Merged
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
3 changes: 3 additions & 0 deletions devsim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ add_library(DevSimLayer MODULE)
set_target_properties(DevSimLayer PROPERTIES FOLDER "Vulkan SC device simulation layer")
set_target_properties(DevSimLayer PROPERTIES OUTPUT_NAME ${LAYER_NAME})

# Force dynamic MSVC runtime
set_property(TARGET DevSimLayer PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

if (MSVC)
target_compile_options(DevSimLayer PRIVATE "$<$<CONFIG:Release>:/Zi>")
target_link_options(DevSimLayer PRIVATE /DEF:${CMAKE_CURRENT_SOURCE_DIR}/${LAYER_NAME}.def)
Expand Down
89 changes: 88 additions & 1 deletion devsim/VkSCLayer_khronos_device_simulation.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,93 @@
"implementation_version": "1.0.0",
"status": "STABLE",
"description": "Khronos Vulkan SC device simulation layer",
"introduction": "The Khronos device simulation layer helps test across a wide range of hardware capabilities without requiring a physical copy of every device."
"introduction": "The Khronos device simulation layer helps test across a wide range of hardware capabilities without requiring a physical copy of every device.",
"instance_extensions": [
{
"name": "VK_EXT_layer_settings",
"spec_version": "2"
}
],
"features": {
"settings": [
{
"key": "simulate_capabilities",
"label": "Simulate Profile Capabilities",
"description": "Control of the simulated capabilities of the Vulkan SC physical device from the selected Vulkan SC Profile.",
"status": "STABLE",
"type": "FLAGS",
"flags": [
{
"key": "SIMULATE_API_VERSION_BIT",
"label": "Version",
"description": "The Vulkan SC device will report the API version from the selected Profile. It also overrides the `api-version` set in VkPhysicalDeviceProperties."
},
{
"key": "SIMULATE_FEATURES_BIT",
"label": "Features",
"description": "The Vulkan SC device will report the features from the selected Profile.",
"settings": [
{
"key": "default_feature_values",
"label": "Unspecified Features",
"description": "Feature values when not specified in the select Vulkan SC profiles.",
"status": "STABLE",
"type": "ENUM",
"default": "DEFAULT_FEATURE_VALUES_DEVICE",
"flags": [
{
"key": "DEFAULT_FEATURE_VALUES_DEVICE",
"label": "Use Device Values",
"description": "When a feature is not mentioned in the select Vulkan SC profiles, set is to the physical device value."
},
{
"key": "DEFAULT_FEATURE_VALUES_FALSE",
"label": "Use False",
"description": "When a feature is not mentioned in the select Vulkan SC profiles, set it to false."
}
]
},
{
"key": "unknown_feature_values",
"label": "Unknown Features",
"description": "Feature values when unrecongnized by Vulkan SC profiles.",
"status": "STABLE",
"type": "ENUM",
"default": "UNKNOWN_FEATURE_VALUES_UNCHANGED",
"flags": [
{
"key": "UNKNOWN_FEATURE_VALUES_UNCHANGED",
"label": "Unmodified",
"description": "When a feature is not recognized by Vulkan SC profiles, skip it."
},
{
"key": "UNKNOWN_FEATURE_VALUES_DEVICE",
"label": "Use Device Values",
"description": "When a feature is not recognized by Vulkan SC profiles, attempt to load device values."
}
]
}
]
},
{
"key": "SIMULATE_PROPERTIES_BIT",
"label": "Properties",
"description": "The Vulkan SC device will report the properties from the selected Profile."
},
{
"key": "SIMULATE_EXTENSIONS_BIT",
"label": "Device Extensions",
"description": "The Vulkan SC device will report the extensions from the selected Profile."
},
{
"key": "SIMULATE_FORMATS_BIT",
"label": "Formats",
"description": "The Vulkan SC device will report the formats from the selected Profile."
}
],
"default": [ "SIMULATE_API_VERSION_BIT", "SIMULATE_FEATURES_BIT", "SIMULATE_PROPERTIES_BIT" ]
}
]
}
}
}
6 changes: 0 additions & 6 deletions devsim/profiles_generated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1637,12 +1637,10 @@ const VkLayerProperties kLayerProperties[] = {{
}};
const uint32_t kLayerPropertiesCount = (sizeof(kLayerProperties) / sizeof(kLayerProperties[0]));

#ifndef VULKANSC
// Instance extensions that this layer provides:
const VkExtensionProperties kInstanceExtensionProperties[] = {
VkExtensionProperties{VK_EXT_LAYER_SETTINGS_EXTENSION_NAME, VK_EXT_LAYER_SETTINGS_SPEC_VERSION}};
const uint32_t kInstanceExtensionPropertiesCount = static_cast<uint32_t>(std::size(kInstanceExtensionProperties));
#endif

// Device extensions that this layer provides:
#ifdef VULKANSC
Expand Down Expand Up @@ -8222,11 +8220,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount
VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount,
VkExtensionProperties *pProperties) {
if (pLayerName && !strcmp(pLayerName, kLayerName)) {
#ifdef VULKANSC
return EnumerateProperties(0, (VkExtensionProperties*)nullptr, pCount, pProperties);
#else
return EnumerateProperties(kInstanceExtensionPropertiesCount, kInstanceExtensionProperties, pCount, pProperties);
#endif
}
return VK_ERROR_LAYER_NOT_PRESENT;
}
Expand Down
9 changes: 3 additions & 6 deletions devsim/profiles_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ void InitProfilesLayerSettings(const VkInstanceCreateInfo *pCreateInfo, const Vk
ProfileLayerSettings *layer_settings) {
assert(layer_settings != nullptr);

#ifdef VULKANSC // We use a simplified configuration interface for Vulkan SC
(void)pCreateInfo;
(void)pAllocator;

#ifdef VULKANSC // We provide a simplified configuration interface for Vulkan SC
const char *devsim_profile_file = std::getenv("VKSC_DEVSIM_PROFILE_FILE");

if (devsim_profile_file) {
Expand All @@ -213,7 +210,8 @@ void InitProfilesLayerSettings(const VkInstanceCreateInfo *pCreateInfo, const Vk
layer_settings->simulate.emulate_portability = false;
layer_settings->log.debug_reports = DEBUG_REPORT_ERROR_BIT;
}
#else
#endif // VULKANSC

const VkLayerSettingsCreateInfoEXT *create_info = vkuFindLayerSettingsCreateInfo(pCreateInfo);

VkuLayerSettingSet layerSettingSet = VK_NULL_HANDLE;
Expand Down Expand Up @@ -519,5 +517,4 @@ void InitProfilesLayerSettings(const VkInstanceCreateInfo *pCreateInfo, const Vk
LogMessage(layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "Profile Layers Settings: {\n%s}\n", settings_log.c_str());

vkuDestroyLayerSettingSet(layerSettingSet, pAllocator);
#endif // VULKANSC
}
1 change: 0 additions & 1 deletion scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF",
"-DJSONCPP_WITH_WARNING_AS_ERROR=OFF",
"-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF",
"-DJSONCPP_STATIC_WINDOWS_RUNTIME=ON",
"-DBUILD_SHARED_LIBS=OFF",
"-DBUILD_STATIC_LIBS=ON",
"-DBUILD_OBJECT_LIBS=OFF"
Expand Down
Loading