Skip to content
Open
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
39 changes: 34 additions & 5 deletions src/nbl/video/CVulkanPhysicalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
properties.limits.supportedDepthResolveModes = static_cast<nbl::hlsl::ResolveModeFlags>(vulkan12Properties.supportedDepthResolveModes);
properties.limits.supportedStencilResolveModes = static_cast<nbl::hlsl::ResolveModeFlags>(vulkan12Properties.supportedStencilResolveModes);

if (!vulkan12Properties.independentResolve || !vulkan12Properties.independentResolveNone)
RETURN_NULL_PHYSICAL_DEVICE;
//if (!vulkan12Properties.independentResolve || !vulkan12Properties.independentResolveNone)
// RETURN_NULL_PHYSICAL_DEVICE;

// not dealing with vulkan12Properties.filterMinmaxSingleComponentFormats, TODO report in usage
properties.limits.filterMinmaxImageComponentMapping = vulkan12Properties.filterMinmaxImageComponentMapping;
Expand Down Expand Up @@ -882,8 +882,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
// TODO sparse stuff

properties.limits.variableMultisampleRate = deviceFeatures.features.variableMultisampleRate;
if (!deviceFeatures.features.inheritedQueries)
RETURN_NULL_PHYSICAL_DEVICE;
//if (!deviceFeatures.features.inheritedQueries)
// RETURN_NULL_PHYSICAL_DEVICE;


/* Vulkan 1.1 Core */
Expand Down Expand Up @@ -1892,6 +1892,10 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
extensionStrings[i++] = feature.c_str();
}

// remove inheritedQueries since llvmpipe doesn't support it
vk_deviceFeatures2.features.inheritedQueries = VK_FALSE;
//vk_deviceFeatures2.features = VkPhysicalDeviceFeatures{};
Comment on lines +1895 to +1897
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we intend to downgrade Nabla permamently, then we need to bring inheritedQueries into the Nabla limits JSON

then check in commandbuffers that when someone is recording an execute secondary commandbuffers command in a primary cmdbuf, no queries are open unless inheritedQueries limit is true


// Create Device
VkDeviceCreateInfo vk_createInfo = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO };
vk_createInfo.pNext = &vk_deviceFeatures2;
Expand All @@ -1913,7 +1917,32 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
}
vk_createInfo.queueCreateInfoCount = queueCreateInfos.size();
vk_createInfo.pQueueCreateInfos = queueCreateInfos.data();


// erase extensions not supported by llvm
{
core::vector<const char*> llvmUnsupportedExtensions = {
"VK_NV_shader_image_footprint",
"VK_KHR_fragment_shader_barycentric",
"VK_EXT_conservative_rasterization",
"VK_KHR_external_memory_win32",
"VK_KHR_shader_subgroup_uniform_control_flow",
"VK_EXT_pci_bus_info",
"VK_KHR_external_fence_win32",
"VK_KHR_external_semaphore_win32",
"VK_KHR_win32_keyed_mutex",
"VK_EXT_discard_rectangles"
"VK_NV_compute_shader_derivatives",
"VK_NV_shader_sm_builtins"
};

for (const char* extension : llvmUnsupportedExtensions)
{
auto it = std::find_if(extensionStrings.begin(), extensionStrings.end(), [extension](const char* s) { return std::strcmp(s, extension) == 0; });
if(it != extensionStrings.end())
extensionStrings.erase(it);
}
}
Comment on lines +1921 to +1944
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can get removed, we achieve much better with Vulkan Configurator & Profile Layer


vk_createInfo.enabledExtensionCount = static_cast<uint32_t>(extensionStrings.size());
vk_createInfo.ppEnabledExtensionNames = extensionStrings.data();

Expand Down
8 changes: 4 additions & 4 deletions src/nbl/video/device_capabilities/device_limits.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"type": "uint32_t",
"name": "MinMaxSSBOSize",
"value": "(0x1u << 30u) - 4"
"value": "134217728"
},
{
"type": "uint16_t",
Expand Down Expand Up @@ -360,7 +360,7 @@
{
"type": "uint32_t",
"name": "maxFragmentCombinedOutputResources",
"value": 127
"value": 104
}
]
},
Expand Down Expand Up @@ -808,7 +808,7 @@
{
"type": "core::bitflag<asset::IShader::E_SHADER_STAGE>",
"name": "subgroupOpsShaderStages",
"value": "asset::IShader::E_SHADER_STAGE::ESS_COMPUTE | asset::IShader::E_SHADER_STAGE::ESS_ALL_GRAPHICS"
"value": "asset::IShader::E_SHADER_STAGE::ESS_UNKNOWN"
Comment on lines 810 to +811
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does llvm-pipe report here ?

},
{
"type": "bool",
Expand Down Expand Up @@ -1110,7 +1110,7 @@
{
"type": "core::bitflag<RESOLVE_MODE_FLAGS>",
"name": "supportedDepthResolveModes",
"value": "RESOLVE_MODE_FLAGS::SAMPLE_ZERO_BIT | RESOLVE_MODE_FLAGS::MIN_BIT | RESOLVE_MODE_FLAGS::MAX_BIT"
"value": "RESOLVE_MODE_FLAGS::SAMPLE_ZERO_BIT"
Comment on lines 1112 to +1113
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we intend to downgrade Nabla (by merging this PR) then we need to neatly handle this in renderpass creation

},
{
"type": "core::bitflag<RESOLVE_MODE_FLAGS>",
Expand Down
Loading