Clean up exported varyings and add support for querying program count from C/C++
This commit is contained in:
@@ -607,6 +607,9 @@ lRecursiveCheckValidParamType(const Type *t, bool vectorOk) {
|
|||||||
return lRecursiveCheckValidParamType(pt->GetBaseType(), true);
|
return lRecursiveCheckValidParamType(pt->GetBaseType(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t->IsVaryingType() && !vectorOk)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2340,8 +2343,6 @@ lGetVaryingDispatchType(FunctionTargetVariants &funcs) {
|
|||||||
return resultFuncTy;
|
return resultFuncTy;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
/** Create the dispatch function for an exported ispc function.
|
/** Create the dispatch function for an exported ispc function.
|
||||||
This function checks to see which vector ISAs the system the
|
This function checks to see which vector ISAs the system the
|
||||||
code is running on supports and calls out to the best available
|
code is running on supports and calls out to the best available
|
||||||
|
|||||||
@@ -5158,3 +5158,12 @@ __declspec(safe)
|
|||||||
static unmasked inline int16 avg_down(int16 a, int16 b) {
|
static unmasked inline int16 avg_down(int16 a, int16 b) {
|
||||||
return __avg_down_int16(a, b);
|
return __avg_down_int16(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Added so programmers can query programCount
|
||||||
|
// at runtime from C/C++.
|
||||||
|
// This is useful for using varying
|
||||||
|
// structures with exported functions
|
||||||
|
export uniform int32 get_programCount() {
|
||||||
|
return programCount;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user