Added structure alignment in headers; extended the test system to support alignment tests

This commit is contained in:
Andrey Guskov
2015-02-17 17:58:34 +03:00
parent 7477a95a59
commit ef9315200c
5 changed files with 118 additions and 22 deletions

22
tests/align1.ispc Normal file
View 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
View 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);
}