Fix for struct with undound members
This commit is contained in:
5
expr.cpp
5
expr.cpp
@@ -6784,9 +6784,12 @@ lUniformValueToVarying(FunctionEmitContext *ctx, llvm::Value *value,
|
||||
type->GetAsVaryingType()->LLVMType(g->ctx);
|
||||
llvm::Value *retValue = llvm::UndefValue::get(llvmType);
|
||||
|
||||
const StructType *structType = CastType<StructType>(type->GetAsVaryingType());
|
||||
|
||||
for (int i = 0; i < collectionType->GetElementCount(); ++i) {
|
||||
llvm::Value *v = ctx->ExtractInst(value, i, "get_element");
|
||||
if (collectionType->GetElementType(i)->IsVaryingType())
|
||||
// If struct has "bound uniform" member, we don't need to cast it to varying
|
||||
if (!(structType != NULL && structType->GetElementType(i)->IsUniformType()))
|
||||
v = lUniformValueToVarying(ctx, v, collectionType->GetElementType(i));
|
||||
retValue = ctx->InsertInst(retValue, v, i, "set_element");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user