Skip to content

Commit

Permalink
igl | vulkan | GL_EXT_nonuniform_qualifier is required only for descr…
Browse files Browse the repository at this point in the history
…iptor indexing

Summary: If the descriptor indexing feature is disabled, we don't have to enable `GL_EXT_nonuniform_qualifier` in GLSL shaders.

Reviewed By: syeh1

Differential Revision: D48529047

fbshipit-source-id: 9b22f68f2f823f3be39bd6daba3a19beab9f7d29
  • Loading branch information
corporateshark authored and facebook-github-bot committed Aug 22, 2023
1 parent 7b7b3a5 commit 015c466
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/igl/vulkan/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ std::shared_ptr<VulkanShaderModule> Device::createShaderModule(ShaderStage stage
}

if (strstr(source, "#version ") == nullptr) {
std::string extraExtensions = "#extension GL_EXT_nonuniform_qualifier : require\n";
std::string extraExtensions = ctx_->config_.enableDescriptorIndexing
? "#extension GL_EXT_nonuniform_qualifier : require\n"
: "";

// GL_EXT_debug_printf extension
if (ctx_->extensions_.enabled(VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME)) {
Expand Down Expand Up @@ -319,9 +321,7 @@ std::shared_ptr<VulkanShaderModule> Device::createShaderModule(ShaderStage stage
sourcePatched += R"(
#version 460
)" + extraExtensions +
R"(
#extension GL_EXT_nonuniform_qualifier : require
)" + enhancedShaderDebuggingCode;
enhancedShaderDebuggingCode;
}
if (vkStage == VK_SHADER_STAGE_FRAGMENT_BIT) {
sourcePatched += R"(
Expand Down

0 comments on commit 015c466

Please sign in to comment.