+ LLVMTypeRef main_function_type;
+ if(nir->info.stage == MESA_SHADER_VERTEX) {
+ LLVMTypeRef arg_types[32];
+ LLVMTypeRef floatType = LLVMFloatTypeInContext(llvm_ref->lc.context);
+ LLVMTypeRef float4 = LLVMVectorType(floatType, 4);
+ LLVMTypeRef f4arrayType = LLVMArrayType(float4, 10);
+ arg_types[0] = float4;
+ arg_types[1] = f4arrayType;
+ LLVMTypeRef vertexCacheType = LLVMStructTypeInContext(llvm_ref->lc.context, arg_types, 2, false);
+ LLVMTypeRef gpuStatePtrType = LLVMPointerType(LLVMStructCreateNamed(llvm_ref->lc.context, "GPUState"), 0);
+ arg_types[0] = gpuStatePtrType;
+ arg_types[1] = LLVMIntTypeInContext(llvm_ref->lc.context, 32);
+ arg_types[2] = LLVMPointerType(vertexCacheType, 0);
+ main_function_type = LLVMFunctionType(ret_type, arg_types, 3, 0);
+ } else {
+
+ LLVMTypeRef floatType = LLVMFloatTypeInContext(llvm_ref->lc.context);
+ LLVMTypeRef float4 = LLVMVectorType(floatType, 4);
+ LLVMTypeRef f4arrayType = LLVMArrayType(float4, 10);
+ arg_types[0] = float4;
+ arg_types[1] = f4arrayType;
+ LLVMTypeRef vertexCacheType = LLVMStructTypeInContext(llvm_ref->lc.context, arg_types, 2, false);
+ arg_types[3] = LLVMPointerType(vertexCacheType, 0);
+ LLVMTypeRef gpuStatePtrType = LLVMPointerType(LLVMStructCreateNamed(llvm_ref->lc.context, "GPUState"), 0);
+ arg_types[0] = gpuStatePtrType;
+ arg_types[1] = LLVMFloatTypeInContext(llvm_ref->lc.context);
+ arg_types[2] = LLVMPointerType(float4, 0);
+ arg_types[4] = LLVMPointerType(float4, 0);
+ main_function_type = LLVMFunctionType(ret_type, arg_types, 3, 0);
+ //TODO: this is zero argument function and returns void
+ main_function_type = LLVMFunctionType(ret_type, arg_types, 5, 0);
+ }