-
Notifications
You must be signed in to change notification settings - Fork 82
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
Support Vulkan-Profiles #133
Comments
Me providing custom profiles as a JSON string makes sense. Different platforms have different filesystem APIs, no need for you to handle all that |
I don't know if this is worth doing, but LunarG provides some default profiles. Instead of having to write a JSON parser for your library, you can probably use a python script to read the provided json files and generate C++ functions which would return the I'm doing something similar, but I didn't write the code generator. I manually created the function that returns the profile information. See below: struct VulkanProfile
{
std::vector<char const*> extensions;
VkPhysicalDeviceFeatures f10 = {};
VkPhysicalDeviceVulkan11Features f11 = {};
VkPhysicalDeviceVulkan12Features f12 = {};
VkPhysicalDeviceVulkan13Features f13 = {};
};
// code-generated from VK_KHR_Roadman_2022.json
VulkanProfile VK_KHR_Roadmap_2022()
{
VulkanProfile pro;
{
auto & req = pro.f10;
req.robustBufferAccess = true;
req.fullDrawIndexUint32 = true;
req.imageCubeArray = true;
req.independentBlend = true;
req.sampleRateShading = true;
req.drawIndirectFirstInstance = true;
req.depthClamp = true;
req.depthBiasClamp = true;
req.samplerAnisotropy = true;
req.occlusionQueryPrecise = true;
req.fragmentStoresAndAtomics = true;
req.shaderStorageImageExtendedFormats = true;
req.shaderUniformBufferArrayDynamicIndexing = true;
req.shaderSampledImageArrayDynamicIndexing = true;
req.shaderStorageBufferArrayDynamicIndexing = true;
req.shaderStorageImageArrayDynamicIndexing = true;
}
{
auto & req = pro.f11;
req.multiview = true;
req.samplerYcbcrConversion = true;
}
{
auto & req = pro.f12;
req.uniformBufferStandardLayout = true;
req.subgroupBroadcastDynamicId = true;
req.imagelessFramebuffer = true;
req.separateDepthStencilLayouts = true;
req.hostQueryReset = true;
req.timelineSemaphore = true;
req.shaderSubgroupExtendedTypes = true;
req.samplerMirrorClampToEdge = true;
req.descriptorIndexing = true;
req.shaderUniformTexelBufferArrayDynamicIndexing = true;
req.shaderStorageTexelBufferArrayDynamicIndexing = true;
req.shaderUniformBufferArrayNonUniformIndexing = true;
req.shaderSampledImageArrayNonUniformIndexing = true;
req.shaderStorageBufferArrayNonUniformIndexing = true;
req.shaderStorageImageArrayNonUniformIndexing = true;
req.shaderUniformTexelBufferArrayNonUniformIndexing = true;
req.shaderStorageTexelBufferArrayNonUniformIndexing = true;
req.descriptorBindingSampledImageUpdateAfterBind = true;
req.descriptorBindingStorageImageUpdateAfterBind = true;
req.descriptorBindingStorageBufferUpdateAfterBind = true;
req.descriptorBindingUniformTexelBufferUpdateAfterBind = true;
req.descriptorBindingStorageTexelBufferUpdateAfterBind = true;
req.descriptorBindingUpdateUnusedWhilePending = true;
req.descriptorBindingPartiallyBound = true;
req.descriptorBindingVariableDescriptorCount = true;
req.runtimeDescriptorArray = true;
req.scalarBlockLayout = true;
req.vulkanMemoryModel = true;
req.vulkanMemoryModelDeviceScope = true;
req.bufferDeviceAddress = true;
req.vulkanMemoryModel = true;
req.vulkanMemoryModelDeviceScope = true;
req.vulkanMemoryModelAvailabilityVisibilityChains = true;
req.bufferDeviceAddress = true;
}
{
auto & req = pro.f13;
req.robustImageAccess = true;
req.shaderTerminateInvocation = true;
req.shaderZeroInitializeWorkgroupMemory = true;
req.synchronization2 = true;
req.shaderIntegerDotProduct = true;
req.maintenance4 = true;
req.pipelineCreationCacheControl = true;
req.subgroupSizeControl = true;
req.computeFullSubgroups = true;
req.shaderDemoteToHelperInvocation = true;
req.inlineUniformBlock = true;
req.dynamicRendering = true;
req.robustImageAccess = true;
req.shaderTerminateInvocation = true;
req.shaderZeroInitializeWorkgroupMemory = true;
req.synchronization2 = true;
req.shaderIntegerDotProduct = true;
req.maintenance4 = true;
req.pipelineCreationCacheControl = true;
req.subgroupSizeControl = true;
req.computeFullSubgroups = true;
req.shaderDemoteToHelperInvocation = true;
req.inlineUniformBlock = true;
req.descriptorBindingInlineUniformBlockUpdateAfterBind = true;
req.descriptorBindingInlineUniformBlockUpdateAfterBind = true;
}
pro.extensions = {
"VK_EXT_image_robustness",
"VK_KHR_shader_non_semantic_info",
"VK_KHR_shader_terminate_invocation",
"VK_KHR_format_feature_flags2",
"VK_KHR_zero_initialize_workgroup_memory",
"VK_KHR_synchronization2",
"VK_KHR_shader_integer_dot_product",
"VK_KHR_maintenance4",
"VK_EXT_4444_formats",
"VK_EXT_extended_dynamic_state",
"VK_EXT_extended_dynamic_state2",
"VK_EXT_pipeline_creation_cache_control",
"VK_EXT_subgroup_size_control",
"VK_EXT_shader_demote_to_helper_invocation",
"VK_EXT_inline_uniform_block",
"VK_EXT_pipeline_creation_feedback",
"VK_EXT_texel_buffer_alignment",
"VK_EXT_ycbcr_2plane_444_formats",
"VK_EXT_texture_compression_astc_hdr",
"VK_EXT_tooling_info",
"VK_EXT_private_data",
"VK_KHR_dynamic_rendering",
"VK_KHR_global_priority",
"VK_EXT_inline_uniform_block"};
return pro;
}
|
While there are some interesting solutions using C++ directly, I do think a simple JSON parser that can consume profiles directly is the best bet. There seems to be a good open source json parser fit for this purpose: https://github.com/sheredom/json.h/tree/master The license is permissive, it only uses a single allocation, and should be straight forward to integrate. A definite requirement is generating the feature & properties struct parsing, as well as any other things profiles supports. |
Allow a user to use a profile to feed vk-bootstrap's instance/device creation process. This should be straight forward as vk-bootstrap already contains all the necessary code to do the vulkan code, what is missing is the profile definition (json) -> vk-bootstrap. How this is achieved is yet to be determined.
Solutions include:
Open Questions:
The text was updated successfully, but these errors were encountered: