Skip to content

Commit

Permalink
Inject shader preambular for task/mesh shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Aug 18, 2024
1 parent 80694a7 commit 1007d8a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lvk/vulkan/VulkanClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4345,6 +4345,17 @@ lvk::ShaderModuleState lvk::VulkanContext::createShaderModuleFromGLSL(ShaderStag
}

if (strstr(source, "#version ") == nullptr) {
if (vkStage == VK_SHADER_STAGE_TASK_BIT_EXT || vkStage == VK_SHADER_STAGE_MESH_BIT_EXT) {
sourcePatched += R"(
#version 460
#extension GL_EXT_buffer_reference : require
#extension GL_EXT_buffer_reference_uvec2 : require
#extension GL_EXT_debug_printf : enable
#extension GL_EXT_nonuniform_qualifier : require
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require
#extension GL_EXT_mesh_shader : require
)";
}
if (vkStage == VK_SHADER_STAGE_VERTEX_BIT || vkStage == VK_SHADER_STAGE_COMPUTE_BIT ||
vkStage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT || vkStage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) {
sourcePatched += R"(
Expand Down

0 comments on commit 1007d8a

Please sign in to comment.