webgpu embedding
This commit is contained in:
parent
47bd4da0e3
commit
a879c834c7
4 changed files with 86 additions and 4 deletions
|
|
@ -568,6 +568,12 @@ void Device::Initialize() {
|
|||
// https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12103
|
||||
// Per spencer-lunarg (LunarG) that was fixed in the next SDK release.
|
||||
// The validation layer is now 1.4.350 (> 1.4.341), so re-enable it.
|
||||
// Validation (incl. GPU-Assisted Validation) is a DEVELOPER tool and is OFF
|
||||
// by default: GPU-AV instruments shaders and has crashed vendor SPIR-V
|
||||
// compilers (observed: NVIDIA libnvidia-glvkspirv segfault on the
|
||||
// descriptor-heap compute pipelines). Opt in by setting the environment
|
||||
// variable CRAFTER_GRAPHICS_VALIDATION.
|
||||
bool enableValidation = std::getenv("CRAFTER_GRAPHICS_VALIDATION") != nullptr;
|
||||
VkValidationFeatureEnableEXT enabledValidationFeatures[] = {
|
||||
VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT,
|
||||
};
|
||||
|
|
@ -579,7 +585,7 @@ void Device::Initialize() {
|
|||
|
||||
VkInstanceCreateInfo instanceCreateInfo = {};
|
||||
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
instanceCreateInfo.pNext = &validationFeatures;
|
||||
instanceCreateInfo.pNext = enableValidation ? (const void*)&validationFeatures : nullptr;
|
||||
instanceCreateInfo.pApplicationInfo = &app;
|
||||
instanceCreateInfo.enabledExtensionCount = sizeof(instanceExtensionNames) / sizeof(const char*);
|
||||
instanceCreateInfo.ppEnabledExtensionNames = instanceExtensionNames;
|
||||
|
|
@ -603,7 +609,7 @@ void Device::Initialize() {
|
|||
}
|
||||
}
|
||||
|
||||
if (foundInstanceLayers >= sizeof(layerNames) / sizeof(const char*))
|
||||
if (enableValidation && foundInstanceLayers >= sizeof(layerNames) / sizeof(const char*))
|
||||
{
|
||||
instanceCreateInfo.enabledLayerCount = sizeof(layerNames) / sizeof(const char*);
|
||||
instanceCreateInfo.ppEnabledLayerNames = layerNames;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue