diff --git a/decl.cpp b/decl.cpp index 852c0b5b..c91e60a7 100644 --- a/decl.cpp +++ b/decl.cpp @@ -456,7 +456,7 @@ Declarator::InitFromType(const Type *baseType, DeclSpecs *ds) { return; } - decl->type = PointerType::GetUniform(targetType); + decl->type = PointerType::GetUniform(targetType, at->IsSOAType()); // Make sure there are no unsized arrays (other than the // first dimension) in function parameter lists. diff --git a/module.cpp b/module.cpp index be6796af..0da5f720 100644 --- a/module.cpp +++ b/module.cpp @@ -808,7 +808,12 @@ Module::AddFunctionDeclaration(const std::string &name, // uniform pointers, since varying pointers are int vectors...) if (!functionType->isTask && ((CastType(argType) != NULL && - argType->IsUniformType()) || + argType->IsUniformType() && + // Exclude SOA argument because it is a pair {struct *, int} + // instead of pointer + !CastType(argType)->IsSlice()) + || + CastType(argType) != NULL)) { // NOTE: LLVM indexes function parameters starting from 1. diff --git a/type.cpp b/type.cpp index ffc84252..f8b0faee 100644 --- a/type.cpp +++ b/type.cpp @@ -874,8 +874,8 @@ PointerType::PointerType(const Type *t, Variability v, bool ic, bool is, PointerType * -PointerType::GetUniform(const Type *t) { - return new PointerType(t, Variability(Variability::Uniform), false); +PointerType::GetUniform(const Type *t, bool is) { + return new PointerType(t, Variability(Variability::Uniform), false, is); } diff --git a/type.h b/type.h index c5df6dd0..82b2e124 100644 --- a/type.h +++ b/type.h @@ -430,7 +430,7 @@ public: bool isSlice = false, bool frozen = false); /** Helper method to return a uniform pointer to the given type. */ - static PointerType *GetUniform(const Type *t); + static PointerType *GetUniform(const Type *t, bool isSlice = false); /** Helper method to return a varying pointer to the given type. */ static PointerType *GetVarying(const Type *t);