lib/HLSL/HLSignatureLower.cpp
// Generate DXIL stream output operations.
Generate DXIL stream output operations.
Generate DXIL stream output operations .
void HLSignatureLower::GenerateStreamOutputOperations() {
  DxilFunctionAnnotation *EntryAnnotation = HLM.GetFunctionAnnotation(Entry);
  DXASSERT(EntryAnnotation, "must find annotation for entry function");
  for (Argument &arg : Entry->getArgumentList()) {
    if (HLModule::IsStreamOutputPtrType(arg.getType())) {
      unsigned streamID = 0;
      DxilParameterAnnotation &paramAnnotation =
          EntryAnnotation->GetParameterAnnotation(arg.getArgNo());
      DxilParamInputQual inputQual = paramAnnotation.GetParamInputQual();
      switch (inputQual) {
      case DxilParamInputQual::OutStream0:
        streamID = 0;
        break;
      case DxilParamInputQual::OutStream1:
        streamID = 1;
        break;
      case DxilParamInputQual::OutStream2:
        streamID = 2;
        break;
      case DxilParamInputQual::OutStream3:
      default:
        DXASSERT(inputQual == DxilParamInputQual::OutStream3,
                 "invalid input qual.");
        streamID = 3;
        break;
      }
      GenerateStreamOutputOperation(&arg, streamID);
    }
  }
}
void HLSignatureLower :: GenerateStreamOutputOperations ( ) { DxilFunctionAnnotation * EntryAnnotation = HLM . GetFunctionAnnotation ( Entry ) ; DXASSERT ( EntryAnnotation , " " ) ; for ( Argument & arg : Entry -> getArgumentList ( ) ) { if ( HLModule :: IsStreamOutputPtrType ( arg . getType ( ) ) ) { unsigned streamID = 0 ; DxilParameterAnnotation & paramAnnotation = EntryAnnotation -> GetParameterAnnotation ( arg . getArgNo ( ) ) ; DxilParamInputQual inputQual = paramAnnotation . GetParamInputQual ( ) ; switch ( inputQual ) { case DxilParamInputQual :: OutStream0 : streamID = 0 ; break ; case DxilParamInputQual :: OutStream1 : streamID = 1 ; break ; case DxilParamInputQual :: OutStream2 : streamID = 2 ; break ; case DxilParamInputQual :: OutStream3 : default : DXASSERT ( inputQual == DxilParamInputQual :: OutStream3 , " " ) ; streamID = 3 ; break ; } GenerateStreamOutputOperation ( & arg , streamID ) ; } } }
Generate DXIL stream output operations.
Generate DXIL stream output operations .