Added structure alignment in headers; extended the test system to support alignment tests
This commit is contained in:
22
tests/align1.ispc
Normal file
22
tests/align1.ispc
Normal file
@@ -0,0 +1,22 @@
|
||||
struct InnerUniform {
|
||||
uniform int i;
|
||||
};
|
||||
|
||||
struct f_sz {
|
||||
uniform int type, temp[5];
|
||||
int k[3];
|
||||
InnerUniform u;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export void keep_struct_declared(varying f_sz * uniform s) {
|
||||
}
|
||||
|
||||
export uniform int width() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[0] = sizeof(f_sz);
|
||||
}
|
||||
21
tests/align2.ispc
Normal file
21
tests/align2.ispc
Normal file
@@ -0,0 +1,21 @@
|
||||
struct InnerVec {
|
||||
int i;
|
||||
};
|
||||
|
||||
struct f_sz {
|
||||
InnerVec u;
|
||||
uniform int tail;
|
||||
};
|
||||
|
||||
|
||||
|
||||
export void keep_struct_declared(varying f_sz * uniform s) {
|
||||
}
|
||||
|
||||
export uniform int width() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[0] = sizeof(f_sz);
|
||||
}
|
||||
Reference in New Issue
Block a user