Skip to content
Snippets Groups Projects
Verified Commit 77b856c7 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Adjust shader compiler for cross compatible extension

parent 0f5cbc46
No related branches found
No related tags found
1 merge request!111Resolve "Cross vendor mesh shader support"
......@@ -55,9 +55,9 @@ namespace vkcv::shader {
case ShaderStage::COMPUTE:
return EShLangCompute;
case ShaderStage::TASK:
return EShLangTaskNV;
return EShLangTask;
case ShaderStage::MESH:
return EShLangMeshNV;
return EShLangMesh;
case ShaderStage::RAY_GEN:
return EShLangRayGen;
case ShaderStage::RAY_CLOSEST_HIT:
......@@ -159,24 +159,24 @@ namespace vkcv::shader {
resources.maxCullDistances = 8;
resources.maxCombinedClipAndCullDistances = 8;
resources.maxSamples = 4;
resources.maxMeshOutputVerticesNV = 256;
resources.maxMeshOutputPrimitivesNV = 512;
resources.maxMeshWorkGroupSizeX_NV = 32;
resources.maxMeshWorkGroupSizeY_NV = 1;
resources.maxMeshWorkGroupSizeZ_NV = 1;
resources.maxTaskWorkGroupSizeX_NV = 32;
resources.maxTaskWorkGroupSizeY_NV = 1;
resources.maxTaskWorkGroupSizeZ_NV = 1;
resources.maxMeshViewCountNV = 4;
resources.limits.nonInductiveForLoops = 1;
resources.limits.whileLoops = 1;
resources.limits.doWhileLoops = 1;
resources.limits.generalUniformIndexing = 1;
resources.limits.generalAttributeMatrixVectorIndexing = 1;
resources.limits.generalVaryingIndexing = 1;
resources.limits.generalSamplerIndexing = 1;
resources.limits.generalVariableIndexing = 1;
resources.limits.generalConstantMatrixVectorIndexing = 1;
resources.maxMeshOutputVerticesEXT = 256;
resources.maxMeshOutputPrimitivesEXT = 512;
resources.maxMeshWorkGroupSizeX_EXT = 32;
resources.maxMeshWorkGroupSizeY_EXT = 1;
resources.maxMeshWorkGroupSizeZ_EXT = 1;
resources.maxTaskWorkGroupSizeX_EXT = 32;
resources.maxTaskWorkGroupSizeY_EXT = 1;
resources.maxTaskWorkGroupSizeZ_EXT = 1;
resources.maxMeshViewCountEXT = 4;
resources.limits.nonInductiveForLoops = true;
resources.limits.whileLoops = true;
resources.limits.doWhileLoops = true;
resources.limits.generalUniformIndexing = true;
resources.limits.generalAttributeMatrixVectorIndexing = true;
resources.limits.generalVaryingIndexing = true;
resources.limits.generalSamplerIndexing = true;
resources.limits.generalVariableIndexing = true;
resources.limits.generalConstantMatrixVectorIndexing = true;
}
static std::vector<char> readShaderCode(const std::filesystem::path &shaderPath) {
......
......@@ -83,10 +83,12 @@ int main(int argc, const char** argv) {
vkcv::Features features;
features.requireExtension(VK_EXT_MESH_SHADER_EXTENSION_NAME);
features.requireExtensionFeature<vk::PhysicalDeviceMeshShaderFeaturesEXT>(
VK_EXT_MESH_SHADER_EXTENSION_NAME, [](vk::PhysicalDeviceMeshShaderFeaturesEXT& features) {
features.setTaskShader(true);
features.setMeshShader(true);
});
VK_EXT_MESH_SHADER_EXTENSION_NAME,
[](vk::PhysicalDeviceMeshShaderFeaturesEXT& features) {
features.setTaskShader(true);
features.setMeshShader(true);
}
);
vkcv::Core core = vkcv::Core::create(
applicationName,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment