Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when a geometry shader uses the same struct for input and output #1761

Closed
tristanlabelle opened this issue Dec 11, 2018 · 1 comment
Closed
Labels
bug Bug, regression, crash

Comments

@tristanlabelle
Copy link
Contributor

Repro:

struct GSInOut { float value : TEXCOORD0; };

[maxvertexcount(1)]
void main(point GSInOut input[1], inout PointStream<GSInOut> output)
{
    output.Append(input[0]);
}

Call stack:

>	dxcompiler.dll!llvm_assert(const char * _Message, const char * _File, unsigned int _Line, const char * _Function) Line 23	C++
 	dxcompiler.dll!llvm::StoreInst::AssertOK() Line 993	C++
 	dxcompiler.dll!llvm::StoreInst::StoreInst(llvm::Value * val, llvm::Value * addr, bool isVolatile, unsigned int Align, llvm::AtomicOrdering Order, llvm::SynchronizationScope SynchScope, llvm::Instruction * InsertBefore) Line 1037	C++
 	dxcompiler.dll!llvm::StoreInst::StoreInst(llvm::Value * val, llvm::Value * addr, bool isVolatile, unsigned int Align, llvm::Instruction * InsertBefore) Line 1017	C++
 	dxcompiler.dll!llvm::StoreInst::StoreInst(llvm::Value * val, llvm::Value * addr, bool isVolatile, llvm::Instruction * InsertBefore) Line 1008	C++
 	dxcompiler.dll!llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> >::CreateStore(llvm::Value * Val, llvm::Value * Ptr, bool isVolatile) Line 986	C++
 	dxcompiler.dll!SimplePtrCopy(llvm::Value * DestPtr, llvm::Value * SrcPtr, llvm::SmallVector<llvm::Value *,16> & idxList, llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> > & Builder) Line 2200	C++
 	dxcompiler.dll!SimpleCopy(llvm::Value * Dest, llvm::Value * Src, llvm::SmallVector<llvm::Value *,16> & idxList, llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> > & Builder) Line 2225	C++
 	dxcompiler.dll!SplitCpy(llvm::Type * Ty, llvm::Value * Dest, llvm::Value * Src, llvm::SmallVector<llvm::Value *,16> & idxList, llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> > & Builder, const llvm::DataLayout & DL, hlsl::DxilTypeSystem & typeSys, hlsl::DxilFieldAnnotation * fieldAnnotation, const bool bEltMemCpy) Line 2366	C++
 	dxcompiler.dll!SplitCpy(llvm::Type * Ty, llvm::Value * Dest, llvm::Value * Src, llvm::SmallVector<llvm::Value *,16> & idxList, llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> > & Builder, const llvm::DataLayout & DL, hlsl::DxilTypeSystem & typeSys, hlsl::DxilFieldAnnotation * fieldAnnotation, const bool bEltMemCpy) Line 2284	C++
 	dxcompiler.dll!`anonymous namespace'::SROA_Parameter_HLSL::flattenArgument(llvm::Function * F, llvm::Value * Arg, bool bForParam, hlsl::DxilParameterAnnotation & paramAnnotation, std::vector<llvm::Value *,std::allocator<llvm::Value *> > & FlatParamList, std::vector<hlsl::DxilParameterAnnotation,std::allocator<hlsl::DxilParameterAnnotation> > & FlatAnnotationList, llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> > & Builder, llvm::DbgDeclareInst * DDI) Line 5606	C++
 	dxcompiler.dll!`anonymous namespace'::SROA_Parameter_HLSL::createFlattenedFunction(llvm::Function * F) Line 6072	C++
 	dxcompiler.dll!`anonymous namespace'::SROA_Parameter_HLSL::runOnModule(llvm::Module & M) Line 4284	C++
@tristanlabelle
Copy link
Contributor Author

This is an SROA issue, note that reversing the order of the parameters works around the bug:

void main(inout PointStream<GSInOut> output, point GSInOut input[1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
None yet
Development

No branches or pull requests

2 participants