Add support for spirv1.6

Add command line support which enables the following behavior:

- Remap discard

  Map discard to DemoteToHelperInvocation for HLSL shaders. Map to
  OpTerminateInvocation for GLSL shaders.

- Decorate HelperInvocation with Volatile

- Use localSizeId for execution mode

  WorkGroupSize is deprecated in spirv1.6

Also update known goods to SPIRV 1.6
This commit is contained in:
Greg Fischer
2021-09-02 17:37:39 -06:00
parent a0f98ad401
commit 7a49192d23
19 changed files with 556 additions and 218 deletions

View File

@@ -68,6 +68,26 @@ spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLog
}
case glslang::EShTargetVulkan_1_2:
return spv_target_env::SPV_ENV_VULKAN_1_2;
case glslang::EShTargetUniversal:
switch (spvVersion.spv) {
case EShTargetSpv_1_0:
return spv_target_env::SPV_ENV_UNIVERSAL_1_0;
case EShTargetSpv_1_1:
return spv_target_env::SPV_ENV_UNIVERSAL_1_1;
case EShTargetSpv_1_2:
return spv_target_env::SPV_ENV_UNIVERSAL_1_2;
case EShTargetSpv_1_3:
return spv_target_env::SPV_ENV_UNIVERSAL_1_3;
case EShTargetSpv_1_4:
return spv_target_env::SPV_ENV_UNIVERSAL_1_4;
case EShTargetSpv_1_5:
return spv_target_env::SPV_ENV_UNIVERSAL_1_5;
case EShTargetSpv_1_6:
return spv_target_env::SPV_ENV_UNIVERSAL_1_6;
default:
logger->missingFunctionality("Target version for SPIRV-Tools validator");
return spv_target_env::SPV_ENV_UNIVERSAL_1_6;
}
default:
break;
}