Merge branch 'glsl-1.20-v2'
This commit is contained in:
@@ -705,7 +705,7 @@ _mesa_execute_program(GLcontext * ctx,
|
||||
{
|
||||
GLfloat t[4];
|
||||
fetch_vector4(&inst->SrcReg[0], machine, t);
|
||||
machine->AddressReg[0][0] = (GLint) FLOORF(t[0]);
|
||||
machine->AddressReg[0][0] = IFLOOR(t[0]);
|
||||
}
|
||||
break;
|
||||
case OPCODE_BGNLOOP:
|
||||
|
||||
@@ -187,7 +187,6 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
|
||||
return pos;
|
||||
}
|
||||
#endif
|
||||
size = 4; /** XXX fix */
|
||||
return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name,
|
||||
size, GL_NONE, values, NULL, 0x0);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,106 +2,107 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
|
||||
/* slang_builtin_120_common.gc */
|
||||
|
||||
4,1,90,95,0,0,26,221,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,26,109,0,0,1,
|
||||
0,0,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,
|
||||
18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,28,221,0,109,97,116,114,105,
|
||||
120,67,111,109,112,77,117,108,116,0,1,0,0,0,28,109,0,0,1,0,0,0,28,110,0,0,0,1,8,58,109,97,116,50,
|
||||
120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
|
||||
0,57,48,0,0,0,0,1,90,95,0,0,27,221,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,
|
||||
0,27,109,0,0,1,0,0,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,
|
||||
5,1,90,95,0,0,26,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,26,0,109,0,0,1,
|
||||
0,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,
|
||||
48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,28,0,0,109,97,116,114,
|
||||
105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,28,0,109,0,0,1,0,0,0,28,0,110,0,0,0,1,8,58,109,97,
|
||||
116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,
|
||||
16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,27,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,
|
||||
1,0,0,0,27,0,109,0,0,1,0,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,
|
||||
18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,
|
||||
57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,30,0,0,109,97,116,114,105,120,67,111,109,112,77,
|
||||
117,108,116,0,1,0,0,0,30,0,109,0,0,1,0,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,
|
||||
16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,
|
||||
0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,29,0,0,109,97,116,114,105,120,67,111,
|
||||
109,112,77,117,108,116,0,1,0,0,0,29,0,109,0,0,1,0,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,
|
||||
0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
|
||||
48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,
|
||||
57,48,0,0,0,0,1,90,95,0,0,31,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,31,
|
||||
0,109,0,0,1,0,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,
|
||||
8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,
|
||||
16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,30,221,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,
|
||||
0,1,0,0,0,30,109,0,0,1,0,0,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,
|
||||
110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,
|
||||
18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,29,221,0,109,97,116,114,105,120,67,111,109,112,77,
|
||||
117,108,116,0,1,0,0,0,29,109,0,0,1,0,0,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,
|
||||
48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,
|
||||
10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,
|
||||
90,95,0,0,31,221,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,31,109,0,0,1,0,0,
|
||||
0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,
|
||||
109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,
|
||||
18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0,0,13,221,0,111,117,116,101,114,
|
||||
80,114,111,100,117,99,116,0,1,0,0,0,10,99,0,0,1,0,0,0,10,114,0,0,0,1,8,58,109,97,116,50,0,18,99,0,
|
||||
59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,
|
||||
59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,14,221,0,111,117,116,101,
|
||||
114,80,114,111,100,117,99,116,0,1,0,0,0,11,99,0,0,1,0,0,0,11,114,0,0,0,1,8,58,109,97,116,51,0,18,
|
||||
99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,
|
||||
114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,
|
||||
0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,
|
||||
18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,15,221,0,111,117,
|
||||
116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,99,0,0,1,0,0,0,12,114,0,0,0,1,8,58,109,97,116,
|
||||
52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,
|
||||
122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,
|
||||
121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,
|
||||
59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,
|
||||
59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,18,
|
||||
99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,
|
||||
114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,26,221,0,111,117,116,
|
||||
101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,99,0,0,1,0,0,0,10,114,0,0,0,1,8,58,109,97,116,50,
|
||||
120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,
|
||||
59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,
|
||||
59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,27,221,0,111,117,116,101,
|
||||
114,80,114,111,100,117,99,116,0,1,0,0,0,10,99,0,0,1,0,0,0,11,114,0,0,0,1,8,58,109,97,116,51,120,50,
|
||||
16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0,0,13,0,0,111,
|
||||
117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109,
|
||||
97,116,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,
|
||||
99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,14,
|
||||
0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,
|
||||
58,109,97,116,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,
|
||||
0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,
|
||||
18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,
|
||||
48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,
|
||||
0,0,15,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,12,0,114,0,
|
||||
0,0,1,8,58,109,97,116,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,
|
||||
120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,
|
||||
59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,
|
||||
59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,
|
||||
99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,
|
||||
114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,
|
||||
0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,
|
||||
0,26,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,10,0,114,0,0,
|
||||
0,1,8,58,109,97,116,50,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,
|
||||
0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,
|
||||
99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,27,
|
||||
0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,
|
||||
58,109,97,116,51,120,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,
|
||||
120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,
|
||||
59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,28,0,0,
|
||||
111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,
|
||||
109,97,116,50,120,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,
|
||||
0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,
|
||||
120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,
|
||||
121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,29,0,0,111,117,116,101,114,80,
|
||||
114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97,116,52,120,50,0,
|
||||
0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,
|
||||
18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,
|
||||
48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,28,221,0,111,117,116,101,114,80,114,
|
||||
111,100,117,99,116,0,1,0,0,0,12,99,0,0,1,0,0,0,10,114,0,0,0,1,8,58,109,97,116,50,120,52,0,18,99,0,
|
||||
59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,
|
||||
59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,
|
||||
99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,
|
||||
114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,29,221,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,
|
||||
0,0,10,99,0,0,1,0,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,50,0,18,99,0,59,120,0,18,114,0,59,120,
|
||||
0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,
|
||||
121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,
|
||||
122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,0,0,0,1,
|
||||
90,95,0,0,30,221,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,99,0,0,1,0,0,0,11,
|
||||
114,0,0,0,1,8,58,109,97,116,51,120,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,
|
||||
18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,
|
||||
48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,
|
||||
122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,
|
||||
48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,
|
||||
121,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,30,0,0,111,117,116,101,114,80,114,111,100,117,99,
|
||||
116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,99,0,59,120,0,
|
||||
18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,
|
||||
48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,
|
||||
121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,
|
||||
121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,
|
||||
59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,31,0,0,
|
||||
111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,
|
||||
109,97,116,52,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,
|
||||
0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,
|
||||
121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,
|
||||
122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,
|
||||
59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,31,221,0,111,117,116,101,114,80,114,111,100,117,
|
||||
99,116,0,1,0,0,0,11,99,0,0,1,0,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,51,0,18,99,0,59,120,0,18,
|
||||
114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,
|
||||
0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,
|
||||
18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,
|
||||
48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,
|
||||
121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,13,221,0,
|
||||
116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,
|
||||
0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,
|
||||
49,0,57,59,121,0,0,0,0,0,1,90,95,0,0,14,221,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,14,109,
|
||||
0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,
|
||||
59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,
|
||||
59,119,0,48,0,0,0,0,1,90,95,0,0,13,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,0,109,0,0,0,
|
||||
1,8,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,
|
||||
0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,90,95,0,0,14,0,0,116,114,97,
|
||||
110,115,112,111,115,101,0,1,0,0,0,14,0,109,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,59,
|
||||
120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,
|
||||
59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,
|
||||
57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,90,95,0,
|
||||
0,15,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,15,0,109,0,0,0,1,8,58,109,97,116,52,0,0,18,
|
||||
109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,
|
||||
18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,
|
||||
0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,
|
||||
0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,
|
||||
122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,
|
||||
59,119,0,0,18,109,0,16,10,51,0,57,59,119,0,0,0,0,0,1,90,95,0,0,26,0,0,116,114,97,110,115,112,111,
|
||||
115,101,0,1,0,0,0,27,0,109,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,
|
||||
18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,
|
||||
0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,0,0,1,90,95,0,0,27,0,0,116,
|
||||
114,97,110,115,112,111,115,101,0,1,0,0,0,26,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,
|
||||
16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,
|
||||
0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,0,0,
|
||||
0,1,90,95,0,0,28,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,29,0,109,0,0,0,1,8,58,109,97,116,
|
||||
50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,
|
||||
0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,
|
||||
49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,0,0,0,1,90,
|
||||
95,0,0,29,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,28,0,109,0,0,0,1,8,58,109,97,116,52,120,
|
||||
50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,
|
||||
121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,
|
||||
59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,0,0,0,1,90,95,0,0,30,
|
||||
0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,31,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,
|
||||
109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,
|
||||
18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,
|
||||
0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,
|
||||
0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,
|
||||
122,0,0,0,0,0,1,90,95,0,0,31,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,30,0,109,0,0,0,1,8,
|
||||
58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,
|
||||
109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,
|
||||
18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,
|
||||
0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,90,95,0,0,15,221,0,116,114,97,110,115,112,111,115,101,
|
||||
0,1,0,0,0,15,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,
|
||||
57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,
|
||||
0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,
|
||||
51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,
|
||||
10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,
|
||||
16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,0,18,109,0,16,10,51,0,57,59,119,0,0,0,0,0,
|
||||
1,90,95,0,0,26,221,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,27,109,0,0,0,1,8,58,109,97,116,
|
||||
50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,
|
||||
57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,
|
||||
0,57,59,121,0,0,0,0,0,1,90,95,0,0,27,221,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,26,109,0,0,
|
||||
0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,
|
||||
18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,
|
||||
0,18,109,0,16,10,49,0,57,59,122,0,0,0,0,0,1,90,95,0,0,28,221,0,116,114,97,110,115,112,111,115,101,
|
||||
0,1,0,0,0,29,109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,
|
||||
10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,
|
||||
16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,
|
||||
0,16,10,51,0,57,59,121,0,0,0,0,0,1,90,95,0,0,29,221,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,
|
||||
28,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,
|
||||
59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,
|
||||
57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,
|
||||
0,57,59,119,0,0,0,0,0,1,90,95,0,0,30,221,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,31,109,0,0,
|
||||
0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,
|
||||
18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,
|
||||
0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,
|
||||
121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,
|
||||
59,122,0,0,18,109,0,16,10,51,0,57,59,122,0,0,0,0,0,1,90,95,0,0,31,221,0,116,114,97,110,115,112,111,
|
||||
115,101,0,1,0,0,0,30,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,
|
||||
109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,
|
||||
18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,
|
||||
0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,
|
||||
0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0
|
||||
0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,
|
||||
0,0,18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
|
||||
/* slang_builtin_120_fragment.gc */
|
||||
|
||||
4,2,2,90,95,3,0,10,221,1,103,108,95,80,111,105,110,116,67,111,111,114,100,0,0,0,0
|
||||
5,2,2,90,95,3,0,10,0,1,103,108,95,80,111,105,110,116,67,111,111,114,100,0,0,0,0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,105 +2,106 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
|
||||
/* slang_fragment_builtin.gc */
|
||||
|
||||
4,2,2,90,95,6,0,12,221,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,90,95,6,0,1,221,1,
|
||||
103,108,95,70,114,111,110,116,70,97,99,105,110,103,0,0,0,2,2,90,95,5,0,12,221,1,103,108,95,70,114,
|
||||
97,103,67,111,108,111,114,0,0,0,2,2,90,95,5,0,12,221,1,103,108,95,70,114,97,103,68,97,116,97,0,3,
|
||||
18,103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,0,0,2,2,90,95,5,0,9,221,1,103,
|
||||
108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,90,95,3,0,12,221,1,103,108,95,67,111,108,111,114,
|
||||
0,0,0,2,2,90,95,3,0,12,221,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,
|
||||
2,2,90,95,3,0,12,221,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,
|
||||
120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,3,0,9,221,1,103,108,95,70,111,103,70,
|
||||
114,97,103,67,111,111,114,100,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,49,68,0,1,1,0,
|
||||
0,16,115,97,109,112,108,101,114,0,0,1,1,0,0,9,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,
|
||||
1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,
|
||||
111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,
|
||||
52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,
|
||||
18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,49,68,80,114,111,
|
||||
106,0,1,1,0,0,16,115,97,109,112,108,101,114,0,0,1,1,0,0,10,99,111,111,114,100,0,0,1,1,0,0,9,98,105,
|
||||
97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,
|
||||
59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,
|
||||
111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,
|
||||
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,
|
||||
95,0,0,12,221,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,115,97,109,112,108,
|
||||
101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,
|
||||
1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,
|
||||
120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,
|
||||
115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,
|
||||
109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,
|
||||
114,101,50,68,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,0,10,99,111,111,114,100,0,0,1,1,0,
|
||||
0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,
|
||||
100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,
|
||||
119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,
|
||||
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,
|
||||
116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,
|
||||
0,11,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,
|
||||
114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,
|
||||
5,2,2,90,95,6,0,12,0,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,90,95,6,0,1,0,1,103,
|
||||
108,95,70,114,111,110,116,70,97,99,105,110,103,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,70,114,97,103,
|
||||
67,111,108,111,114,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,
|
||||
95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,0,0,2,2,90,95,5,0,9,0,1,103,108,95,70,114,
|
||||
97,103,68,101,112,116,104,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95,
|
||||
3,0,12,0,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,
|
||||
1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,
|
||||
67,111,111,114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111,
|
||||
114,100,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,
|
||||
108,101,114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,
|
||||
12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,
|
||||
20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,
|
||||
98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
|
||||
100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,
|
||||
115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,
|
||||
1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,
|
||||
111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,
|
||||
59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,
|
||||
86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,
|
||||
0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,
|
||||
1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,
|
||||
111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,
|
||||
99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,
|
||||
0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
|
||||
108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,
|
||||
50,68,80,114,111,106,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,
|
||||
1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,
|
||||
111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,
|
||||
0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,
|
||||
101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,
|
||||
111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,115,97,
|
||||
109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,
|
||||
95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,
|
||||
111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,
|
||||
20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,
|
||||
112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,
|
||||
101,51,68,80,114,111,106,0,1,1,0,0,18,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,
|
||||
0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,
|
||||
99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,
|
||||
100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,
|
||||
52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,
|
||||
18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,67,117,98,101,0,
|
||||
1,1,0,0,19,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,
|
||||
115,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,
|
||||
121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,
|
||||
0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,
|
||||
112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,115,104,97,100,111,119,
|
||||
49,68,0,1,1,0,0,20,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,98,
|
||||
105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,
|
||||
59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,
|
||||
115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,
|
||||
109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,115,104,97,100,111,
|
||||
119,49,68,80,114,111,106,0,1,1,0,0,20,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,
|
||||
0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,
|
||||
99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,
|
||||
20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,
|
||||
111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,
|
||||
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,
|
||||
95,0,0,12,221,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,115,97,109,112,108,101,114,0,0,1,1,0,0,
|
||||
11,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,
|
||||
100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,
|
||||
111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,
|
||||
18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,
|
||||
0,0,1,90,95,0,0,12,221,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,115,97,109,112,
|
||||
108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,
|
||||
221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,
|
||||
100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,
|
||||
18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,
|
||||
0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
|
||||
108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,221,0,100,70,100,120,0,1,1,0,0,9,
|
||||
112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,
|
||||
59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,221,0,100,70,100,120,0,1,1,0,0,10,112,0,0,0,1,4,118,101,
|
||||
99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,
|
||||
0,0,0,0,1,90,95,0,0,11,221,0,100,70,100,120,0,1,1,0,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,
|
||||
120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,90,
|
||||
95,0,0,12,221,0,100,70,100,120,0,1,1,0,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,
|
||||
114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,221,0,100,70,100,121,0,1,1,0,0,9,112,0,0,0,
|
||||
1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,
|
||||
120,120,0,0,0,0,1,90,95,0,0,10,221,0,100,70,100,121,0,1,1,0,0,10,112,0,0,0,1,4,118,101,99,52,95,
|
||||
100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,
|
||||
1,90,95,0,0,11,221,0,100,70,100,121,0,1,1,0,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,
|
||||
95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,
|
||||
12,221,0,100,70,100,121,0,1,1,0,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,
|
||||
116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,221,0,102,119,105,100,116,104,0,1,1,0,0,9,112,0,0,0,
|
||||
1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,
|
||||
0,0,0,0,0,46,0,0,1,90,95,0,0,10,221,0,102,119,105,100,116,104,0,1,1,0,0,10,112,0,0,0,1,8,58,97,98,
|
||||
115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,
|
||||
0,0,1,90,95,0,0,11,221,0,102,119,105,100,116,104,0,1,1,0,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,
|
||||
70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,
|
||||
0,12,221,0,102,119,105,100,116,104,0,1,1,0,0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,
|
||||
18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0
|
||||
0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
|
||||
108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,
|
||||
50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,
|
||||
0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,
|
||||
52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,
|
||||
18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,
|
||||
0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,
|
||||
120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,
|
||||
0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,
|
||||
100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,
|
||||
111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,
|
||||
4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
|
||||
108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,
|
||||
50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,
|
||||
0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,
|
||||
99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,
|
||||
119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,
|
||||
116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
|
||||
112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,
|
||||
115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,
|
||||
1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,
|
||||
18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,
|
||||
115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,
|
||||
109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,
|
||||
114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,
|
||||
114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,
|
||||
18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111,
|
||||
111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,
|
||||
118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,
|
||||
101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,
|
||||
117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,
|
||||
0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,
|
||||
100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,
|
||||
105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,
|
||||
0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,
|
||||
100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,
|
||||
0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,
|
||||
111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,
|
||||
0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,
|
||||
108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,
|
||||
104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,
|
||||
99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,
|
||||
100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,
|
||||
114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,
|
||||
20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,
|
||||
98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,
|
||||
114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,
|
||||
101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,
|
||||
0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,
|
||||
100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,
|
||||
101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
|
||||
111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,
|
||||
0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,
|
||||
0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,
|
||||
18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,
|
||||
114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,
|
||||
98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,
|
||||
18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100,
|
||||
120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,
|
||||
120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,120,0,1,1,0,0,10,0,112,0,
|
||||
0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,
|
||||
120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99,
|
||||
52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,
|
||||
122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100,
|
||||
100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100,121,0,1,1,
|
||||
0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,
|
||||
18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0,0,10,0,112,0,0,0,1,4,
|
||||
118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,
|
||||
121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99,52,95,
|
||||
100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,
|
||||
0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,
|
||||
18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119,105,100,116,104,0,1,1,
|
||||
0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,
|
||||
100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105,100,116,104,0,1,1,0,0,10,
|
||||
0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,
|
||||
100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100,116,104,0,1,1,0,0,11,0,112,
|
||||
0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,100,
|
||||
121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116,104,0,1,1,0,0,12,0,112,0,0,
|
||||
0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,100,121,0,
|
||||
0,18,112,0,0,0,0,0,46,0,0,0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 2004-2006 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 2008 VMware, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -59,7 +59,7 @@
|
||||
.syntax translation_unit;
|
||||
|
||||
/* revision number - increment after each change affecting emitted output */
|
||||
.emtcode REVISION 4
|
||||
.emtcode REVISION 5
|
||||
|
||||
/* external declaration (or precision or invariant stmt) */
|
||||
.emtcode EXTERNAL_NULL 0
|
||||
@@ -83,6 +83,10 @@
|
||||
.emtcode FUNCTION_CONSTRUCTOR 1
|
||||
.emtcode FUNCTION_OPERATOR 2
|
||||
|
||||
/* function call type */
|
||||
.emtcode FUNCTION_CALL_NONARRAY 0
|
||||
.emtcode FUNCTION_CALL_ARRAY 1
|
||||
|
||||
/* operator type */
|
||||
.emtcode OPERATOR_ADDASSIGN 1
|
||||
.emtcode OPERATOR_SUBASSIGN 2
|
||||
@@ -178,9 +182,9 @@
|
||||
.emtcode TYPE_SPECIFIER_MAT34 30
|
||||
.emtcode TYPE_SPECIFIER_MAT43 31
|
||||
|
||||
/* optional array size. Ex: "float[6] myarray;" */
|
||||
.emtcode TYPE_ARRAY_SIZE 220
|
||||
.emtcode TYPE_NO_ARRAY_SIZE 221
|
||||
/* type specifier array */
|
||||
.emtcode TYPE_SPECIFIER_NONARRAY 0
|
||||
.emtcode TYPE_SPECIFIER_ARRAY 1
|
||||
|
||||
/* structure field */
|
||||
.emtcode FIELD_NONE 0
|
||||
@@ -403,11 +407,17 @@ function_call_header
|
||||
/*
|
||||
* <function_identifier> ::= <constructor_identifier>
|
||||
* | <identifier>
|
||||
* | <type_specifier>
|
||||
*
|
||||
* note: <constructor_identifier> has been deleted
|
||||
* note: <constructor_identifier> and <type_specifier> have been deleted
|
||||
*/
|
||||
function_identifier
|
||||
identifier;
|
||||
identifier .and function_identifier_opt_array;
|
||||
function_identifier_opt_array
|
||||
function_identifier_array .emit FUNCTION_CALL_ARRAY .or
|
||||
.true .emit FUNCTION_CALL_NONARRAY;
|
||||
function_identifier_array
|
||||
lbracket .and constant_expression .and rbracket;
|
||||
|
||||
/*
|
||||
* <unary_expression> ::= <postfix_expression>
|
||||
@@ -908,22 +918,14 @@ single_declaration_6
|
||||
constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;
|
||||
|
||||
/*
|
||||
* <fully_specified_type> ::= <opt_invariant> <opt_centroid> <opt_qualifer> <opt_precision> <type_specifier> <opt_array_size>
|
||||
* <fully_specified_type> ::= <opt_invariant> <opt_centroid> <opt_qualifer> <opt_precision> <type_specifier>
|
||||
*
|
||||
* Example: "invariant varying highp vec3 [4]"
|
||||
*
|
||||
* Note that the *_space version doesn't parse the array size, make sure it is being invoked after the *_nospace version.
|
||||
* Example: "invariant varying highp vec3"
|
||||
*/
|
||||
fully_specified_type_space
|
||||
fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space .and .true .emit TYPE_NO_ARRAY_SIZE;
|
||||
fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;
|
||||
fully_specified_type_nospace
|
||||
fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_array;
|
||||
type_specifier_array
|
||||
type_specifier_array_1 .or type_specifier_array_2;
|
||||
type_specifier_array_1
|
||||
type_specifier_space .and array_size;
|
||||
type_specifier_array_2
|
||||
type_specifier_nospace .and opt_array_size;
|
||||
fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;
|
||||
fully_specified_type_optinvariant
|
||||
fully_specified_type_invariant .or .true .emit TYPE_VARIANT;
|
||||
fully_specified_type_invariant
|
||||
@@ -940,11 +942,6 @@ fully_specified_type_optprec
|
||||
fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;
|
||||
fully_specified_type_prec
|
||||
precision .and space;
|
||||
opt_array_size
|
||||
array_size .or .true .emit TYPE_NO_ARRAY_SIZE;
|
||||
array_size
|
||||
lbracket .emit TYPE_ARRAY_SIZE .and constant_expression .and rbracket;
|
||||
|
||||
|
||||
/*
|
||||
* <invariant_qualifier> ::= "invariant"
|
||||
@@ -976,40 +973,40 @@ type_qualifier
|
||||
.if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT;
|
||||
|
||||
/*
|
||||
* <type_specifier> ::= "void"
|
||||
* | "float"
|
||||
* | "int"
|
||||
* | "bool"
|
||||
* | "vec2"
|
||||
* | "vec3"
|
||||
* | "vec4"
|
||||
* | "bvec2"
|
||||
* | "bvec3"
|
||||
* | "bvec4"
|
||||
* | "ivec2"
|
||||
* | "ivec3"
|
||||
* | "ivec4"
|
||||
* | "mat2"
|
||||
* | "mat3"
|
||||
* | "mat4"
|
||||
* | "mat2x3"
|
||||
* | "mat3x2"
|
||||
* | "mat2x4"
|
||||
* | "mat4x2"
|
||||
* | "mat3x4"
|
||||
* | "mat4x3"
|
||||
* | "sampler1D"
|
||||
* | "sampler2D"
|
||||
* | "sampler3D"
|
||||
* | "samplerCube"
|
||||
* | "sampler1DShadow"
|
||||
* | "sampler2DShadow"
|
||||
* | "sampler2DRect"
|
||||
* | "sampler2DRectShadow"
|
||||
* | <struct_specifier>
|
||||
* | <type_name>
|
||||
* <type_specifier_nonarray> ::= "void"
|
||||
* | "float"
|
||||
* | "int"
|
||||
* | "bool"
|
||||
* | "vec2"
|
||||
* | "vec3"
|
||||
* | "vec4"
|
||||
* | "bvec2"
|
||||
* | "bvec3"
|
||||
* | "bvec4"
|
||||
* | "ivec2"
|
||||
* | "ivec3"
|
||||
* | "ivec4"
|
||||
* | "mat2"
|
||||
* | "mat3"
|
||||
* | "mat4"
|
||||
* | "mat2x3"
|
||||
* | "mat3x2"
|
||||
* | "mat2x4"
|
||||
* | "mat4x2"
|
||||
* | "mat3x4"
|
||||
* | "mat4x3"
|
||||
* | "sampler1D"
|
||||
* | "sampler2D"
|
||||
* | "sampler3D"
|
||||
* | "samplerCube"
|
||||
* | "sampler1DShadow"
|
||||
* | "sampler2DShadow"
|
||||
* | "sampler2DRect"
|
||||
* | "sampler2DRectShadow"
|
||||
* | <struct_specifier>
|
||||
* | <type_name>
|
||||
*/
|
||||
type_specifier_space
|
||||
type_specifier_nonarray_space
|
||||
"void" .emit TYPE_SPECIFIER_VOID .or
|
||||
"float" .emit TYPE_SPECIFIER_FLOAT .or
|
||||
"int" .emit TYPE_SPECIFIER_INT .or
|
||||
@@ -1041,8 +1038,23 @@ type_specifier_space
|
||||
"sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or
|
||||
"sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or
|
||||
type_name .emit TYPE_SPECIFIER_TYPENAME;
|
||||
type_specifier_nospace
|
||||
type_specifier_nonarray_nospace
|
||||
struct_specifier .emit TYPE_SPECIFIER_STRUCT;
|
||||
type_specifier_nonarray
|
||||
type_specifier_nonarray_nospace .or type_specifier_nonarray_space;
|
||||
|
||||
/*
|
||||
* <type_specifier> ::= <type_specifier_nonarray>
|
||||
* | <type_specifier_nonarray> "[" <constant_expression> "]"
|
||||
*/
|
||||
type_specifier_space
|
||||
type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY;
|
||||
type_specifier_nospace
|
||||
type_specifier_nospace_array .or type_specifier_nospace_1;
|
||||
type_specifier_nospace_1
|
||||
type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY;
|
||||
type_specifier_nospace_array
|
||||
type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket;
|
||||
|
||||
/*
|
||||
* <struct_specifier> ::= "struct" <identifier> "{" <struct_declaration_list> "}"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */
|
||||
|
||||
".syntax translation_unit;\n"
|
||||
".emtcode REVISION 4\n"
|
||||
".emtcode REVISION 5\n"
|
||||
".emtcode EXTERNAL_NULL 0\n"
|
||||
".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n"
|
||||
".emtcode EXTERNAL_DECLARATION 2\n"
|
||||
@@ -17,6 +17,8 @@
|
||||
".emtcode FUNCTION_ORDINARY 0\n"
|
||||
".emtcode FUNCTION_CONSTRUCTOR 1\n"
|
||||
".emtcode FUNCTION_OPERATOR 2\n"
|
||||
".emtcode FUNCTION_CALL_NONARRAY 0\n"
|
||||
".emtcode FUNCTION_CALL_ARRAY 1\n"
|
||||
".emtcode OPERATOR_ADDASSIGN 1\n"
|
||||
".emtcode OPERATOR_SUBASSIGN 2\n"
|
||||
".emtcode OPERATOR_MULASSIGN 3\n"
|
||||
@@ -83,8 +85,8 @@
|
||||
".emtcode TYPE_SPECIFIER_MAT42 29\n"
|
||||
".emtcode TYPE_SPECIFIER_MAT34 30\n"
|
||||
".emtcode TYPE_SPECIFIER_MAT43 31\n"
|
||||
".emtcode TYPE_ARRAY_SIZE 220\n"
|
||||
".emtcode TYPE_NO_ARRAY_SIZE 221\n"
|
||||
".emtcode TYPE_SPECIFIER_NONARRAY 0\n"
|
||||
".emtcode TYPE_SPECIFIER_ARRAY 1\n"
|
||||
".emtcode FIELD_NONE 0\n"
|
||||
".emtcode FIELD_NEXT 1\n"
|
||||
".emtcode FIELD_ARRAY 2\n"
|
||||
@@ -201,7 +203,12 @@
|
||||
"function_call_header\n"
|
||||
" function_identifier .and lparen;\n"
|
||||
"function_identifier\n"
|
||||
" identifier;\n"
|
||||
" identifier .and function_identifier_opt_array;\n"
|
||||
"function_identifier_opt_array\n"
|
||||
" function_identifier_array .emit FUNCTION_CALL_ARRAY .or\n"
|
||||
" .true .emit FUNCTION_CALL_NONARRAY;\n"
|
||||
"function_identifier_array\n"
|
||||
" lbracket .and constant_expression .and rbracket;\n"
|
||||
"unary_expression\n"
|
||||
" postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n"
|
||||
" unary_expression_4 .or unary_expression_5;\n"
|
||||
@@ -434,15 +441,9 @@
|
||||
"single_declaration_6\n"
|
||||
" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"
|
||||
"fully_specified_type_space\n"
|
||||
" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space .and .true .emit TYPE_NO_ARRAY_SIZE;\n"
|
||||
" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;\n"
|
||||
"fully_specified_type_nospace\n"
|
||||
" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_array;\n"
|
||||
"type_specifier_array\n"
|
||||
" type_specifier_array_1 .or type_specifier_array_2;\n"
|
||||
"type_specifier_array_1\n"
|
||||
" type_specifier_space .and array_size;\n"
|
||||
"type_specifier_array_2\n"
|
||||
" type_specifier_nospace .and opt_array_size;\n"
|
||||
" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;\n"
|
||||
"fully_specified_type_optinvariant\n"
|
||||
" fully_specified_type_invariant .or .true .emit TYPE_VARIANT;\n"
|
||||
"fully_specified_type_invariant\n"
|
||||
@@ -459,10 +460,6 @@
|
||||
" fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;\n"
|
||||
"fully_specified_type_prec\n"
|
||||
" precision .and space;\n"
|
||||
"opt_array_size\n"
|
||||
" array_size .or .true .emit TYPE_NO_ARRAY_SIZE;\n"
|
||||
"array_size\n"
|
||||
" lbracket .emit TYPE_ARRAY_SIZE .and constant_expression .and rbracket;\n"
|
||||
"invariant_qualifier\n"
|
||||
" \"invariant\" .emit TYPE_INVARIANT;\n"
|
||||
"centroid_qualifier\n"
|
||||
@@ -474,7 +471,7 @@
|
||||
" \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n"
|
||||
" .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n"
|
||||
" .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n"
|
||||
"type_specifier_space\n"
|
||||
"type_specifier_nonarray_space\n"
|
||||
" \"void\" .emit TYPE_SPECIFIER_VOID .or\n"
|
||||
" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n"
|
||||
" \"int\" .emit TYPE_SPECIFIER_INT .or\n"
|
||||
@@ -506,8 +503,18 @@
|
||||
" \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n"
|
||||
" \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or\n"
|
||||
" type_name .emit TYPE_SPECIFIER_TYPENAME;\n"
|
||||
"type_specifier_nospace\n"
|
||||
"type_specifier_nonarray_nospace\n"
|
||||
" struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n"
|
||||
"type_specifier_nonarray\n"
|
||||
" type_specifier_nonarray_nospace .or type_specifier_nonarray_space;\n"
|
||||
"type_specifier_space\n"
|
||||
" type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY;\n"
|
||||
"type_specifier_nospace\n"
|
||||
" type_specifier_nospace_array .or type_specifier_nospace_1;\n"
|
||||
"type_specifier_nospace_1\n"
|
||||
" type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY;\n"
|
||||
"type_specifier_nospace_array\n"
|
||||
" type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket;\n"
|
||||
"struct_specifier\n"
|
||||
" \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n"
|
||||
" struct_declaration_list .and rbrace .emit FIELD_NONE;\n"
|
||||
|
||||
@@ -2,104 +2,104 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
|
||||
/* slang_vertex_builtin.gc */
|
||||
|
||||
4,2,2,90,95,5,0,12,221,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,90,95,5,0,9,221,1,103,
|
||||
108,95,80,111,105,110,116,83,105,122,101,0,0,0,2,2,90,95,5,0,12,221,1,103,108,95,67,108,105,112,86,
|
||||
101,114,116,101,120,0,0,0,2,2,90,95,2,0,12,221,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95,2,0,
|
||||
12,221,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,2,0,11,221,
|
||||
1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,90,95,2,0,12,221,1,103,108,95,86,101,114,116,101,120,
|
||||
0,0,0,2,2,90,95,2,0,12,221,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,48,0,0,0,
|
||||
2,2,90,95,2,0,12,221,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,90,
|
||||
95,2,0,12,221,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,90,95,2,0,
|
||||
12,221,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,90,95,2,0,12,221,
|
||||
1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,52,0,0,0,2,2,90,95,2,0,12,221,1,103,
|
||||
108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,53,0,0,0,2,2,90,95,2,0,12,221,1,103,108,95,
|
||||
77,117,108,116,105,84,101,120,67,111,111,114,100,54,0,0,0,2,2,90,95,2,0,12,221,1,103,108,95,77,117,
|
||||
108,116,105,84,101,120,67,111,111,114,100,55,0,0,0,2,2,90,95,2,0,9,221,1,103,108,95,70,111,103,67,
|
||||
111,111,114,100,0,0,0,2,2,90,95,3,0,12,221,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,0,
|
||||
0,2,2,90,95,3,0,12,221,1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,221,1,
|
||||
103,108,95,70,114,111,110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,
|
||||
3,0,12,221,1,103,108,95,66,97,99,107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,
|
||||
90,95,3,0,12,221,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,
|
||||
116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,3,0,9,221,1,103,108,95,70,111,103,70,114,97,
|
||||
103,67,111,111,114,100,0,0,0,1,90,95,0,0,12,221,0,102,116,114,97,110,115,102,111,114,109,0,0,1,9,
|
||||
18,95,95,114,101,116,86,97,108,0,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,
|
||||
101,99,116,105,111,110,77,97,116,114,105,120,0,16,8,48,0,57,18,103,108,95,86,101,114,116,101,120,0,
|
||||
59,120,120,120,120,0,48,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,
|
||||
105,111,110,77,97,116,114,105,120,0,16,10,49,0,57,18,103,108,95,86,101,114,116,101,120,0,59,121,
|
||||
121,121,121,0,48,46,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,
|
||||
111,110,77,97,116,114,105,120,0,16,10,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,
|
||||
122,122,0,48,46,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,
|
||||
110,77,97,116,114,105,120,0,16,10,51,0,57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,
|
||||
119,0,48,46,20,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,
|
||||
115,97,109,112,108,101,114,0,0,1,1,0,0,9,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,
|
||||
90,95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,
|
||||
114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,
|
||||
101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
|
||||
111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,
|
||||
111,100,0,1,1,0,0,16,115,97,109,112,108,101,114,0,0,1,1,0,0,10,99,111,111,114,100,0,0,1,1,0,0,9,
|
||||
108,111,100,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,
|
||||
100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,
|
||||
99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,
|
||||
95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,
|
||||
0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,
|
||||
115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,
|
||||
90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,
|
||||
111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,
|
||||
119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,
|
||||
108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,0,
|
||||
116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,0,
|
||||
10,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,
|
||||
52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,
|
||||
99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,
|
||||
18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,
|
||||
0,0,1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,
|
||||
115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,
|
||||
90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,
|
||||
111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,
|
||||
100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,
|
||||
116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,
|
||||
12,221,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,115,97,109,112,
|
||||
108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,95,0,0,12,
|
||||
221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,
|
||||
100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,
|
||||
18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,
|
||||
0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,0,116,101,
|
||||
120,116,117,114,101,51,68,76,111,100,0,1,1,0,0,18,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,
|
||||
111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,
|
||||
18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,
|
||||
111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,
|
||||
95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,
|
||||
1,90,95,0,0,12,221,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,115,
|
||||
97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,
|
||||
95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,
|
||||
5,2,2,90,95,5,0,12,0,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,90,95,5,0,9,0,1,103,108,
|
||||
95,80,111,105,110,116,83,105,122,101,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,67,108,105,112,86,101,
|
||||
114,116,101,120,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95,2,0,12,0,
|
||||
1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,2,0,11,0,1,103,
|
||||
108,95,78,111,114,109,97,108,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,86,101,114,116,101,120,0,0,0,2,
|
||||
2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,48,0,0,0,2,2,90,95,
|
||||
2,0,12,0,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,90,95,2,0,12,0,
|
||||
1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,90,95,2,0,12,0,1,103,
|
||||
108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,
|
||||
77,117,108,116,105,84,101,120,67,111,111,114,100,52,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,
|
||||
108,116,105,84,101,120,67,111,111,114,100,53,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,
|
||||
105,84,101,120,67,111,111,114,100,54,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,105,84,
|
||||
101,120,67,111,111,114,100,55,0,0,0,2,2,90,95,2,0,9,0,1,103,108,95,70,111,103,67,111,111,114,100,0,
|
||||
0,0,2,2,90,95,3,0,12,0,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,
|
||||
1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,70,114,111,110,
|
||||
116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,66,
|
||||
97,99,107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,
|
||||
95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,
|
||||
114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0,
|
||||
1,90,95,0,0,12,0,0,102,116,114,97,110,115,102,111,114,109,0,0,1,9,18,95,95,114,101,116,86,97,108,0,
|
||||
18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,
|
||||
114,105,120,0,16,8,48,0,57,18,103,108,95,86,101,114,116,101,120,0,59,120,120,120,120,0,48,18,103,
|
||||
108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,
|
||||
120,0,16,10,49,0,57,18,103,108,95,86,101,114,116,101,120,0,59,121,121,121,121,0,48,46,18,103,108,
|
||||
95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,
|
||||
16,10,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,122,122,0,48,46,18,103,108,95,77,
|
||||
111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16,10,
|
||||
51,0,57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0,
|
||||
0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,
|
||||
0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,
|
||||
100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,
|
||||
114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,
|
||||
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,
|
||||
95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97,
|
||||
109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,
|
||||
95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,
|
||||
114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,
|
||||
18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,
|
||||
0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,
|
||||
120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,
|
||||
1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,
|
||||
111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,
|
||||
99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,
|
||||
4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
|
||||
108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,
|
||||
50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,
|
||||
1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,
|
||||
114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,
|
||||
59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,
|
||||
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,
|
||||
116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,
|
||||
114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,
|
||||
112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,
|
||||
120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,
|
||||
111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,
|
||||
115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,
|
||||
116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,
|
||||
0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,
|
||||
111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,
|
||||
18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,
|
||||
20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,
|
||||
112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,
|
||||
101,51,68,76,111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,
|
||||
0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,
|
||||
111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,
|
||||
114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,
|
||||
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,
|
||||
95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97,
|
||||
109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,
|
||||
95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,
|
||||
111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,
|
||||
114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,
|
||||
101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,
|
||||
0,0,12,221,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,115,97,109,112,108,
|
||||
101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,95,0,0,12,221,1,
|
||||
99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,
|
||||
20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,99,
|
||||
117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,
|
||||
114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,115,
|
||||
97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,
|
||||
95,0,0,12,221,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,
|
||||
0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115,97,109,112,108,
|
||||
101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,
|
||||
1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,
|
||||
0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,
|
||||
99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,
|
||||
114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,0,115,
|
||||
97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,
|
||||
90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,
|
||||
111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,
|
||||
95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
|
||||
99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,221,0,115,104,97,100,111,119,49,68,80,114,111,106,76,
|
||||
111,100,0,1,1,0,0,20,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,
|
||||
108,111,100,0,0,0,1,3,2,90,95,0,0,12,221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,
|
||||
99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,76,
|
||||
111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,
|
||||
9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,
|
||||
100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,
|
||||
99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,
|
||||
59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,
|
||||
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,221,
|
||||
0,115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,21,115,97,109,112,108,101,114,0,0,1,1,0,0,11,
|
||||
99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,95,0,0,12,221,1,99,111,111,114,100,52,
|
||||
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,
|
||||
115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,
|
||||
99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,
|
||||
0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,
|
||||
114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,
|
||||
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,
|
||||
95,0,0,12,221,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,0,21,115,97,109,112,
|
||||
108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,90,95,0,0,12,
|
||||
221,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,
|
||||
95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112,
|
||||
108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,
|
||||
12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,
|
||||
100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,
|
||||
18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,
|
||||
4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.1
|
||||
*
|
||||
* Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 2008 VMware, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -61,6 +61,20 @@ static slang_ir_node *
|
||||
_slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves type information about an operation.
|
||||
* Returns GL_TRUE on success.
|
||||
* Returns GL_FALSE otherwise.
|
||||
*/
|
||||
static GLboolean
|
||||
typeof_operation(const struct slang_assemble_ctx_ *A,
|
||||
slang_operation *op,
|
||||
slang_typeinfo *ti)
|
||||
{
|
||||
return _slang_typeof_operation(op, &A->space, ti, A->atoms, A->log);
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
is_sampler_type(const slang_fully_specified_type *t)
|
||||
{
|
||||
@@ -653,23 +667,11 @@ new_if(slang_ir_node *cond, slang_ir_node *ifPart, slang_ir_node *elsePart)
|
||||
* New IR_VAR node - a reference to a previously declared variable.
|
||||
*/
|
||||
static slang_ir_node *
|
||||
new_var(slang_assemble_ctx *A, slang_operation *oper, slang_atom name)
|
||||
new_var(slang_assemble_ctx *A, slang_variable *var)
|
||||
{
|
||||
slang_ir_node *n;
|
||||
slang_variable *var = _slang_locate_variable(oper->locals, name, GL_TRUE);
|
||||
if (!var)
|
||||
return NULL;
|
||||
|
||||
assert(var->declared);
|
||||
|
||||
assert(!oper->var || oper->var == var);
|
||||
|
||||
n = new_node0(IR_VAR);
|
||||
slang_ir_node *n = new_node0(IR_VAR);
|
||||
if (n) {
|
||||
_slang_attach_storage(n, var);
|
||||
/*
|
||||
printf("new_var %s store=%p\n", (char*)name, (void*) n->Store);
|
||||
*/
|
||||
}
|
||||
return n;
|
||||
}
|
||||
@@ -783,7 +785,7 @@ static void
|
||||
slang_resolve_variable(slang_operation *oper)
|
||||
{
|
||||
if (oper->type == SLANG_OPER_IDENTIFIER && !oper->var) {
|
||||
oper->var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE);
|
||||
oper->var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -799,7 +801,7 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper,
|
||||
switch (oper->type) {
|
||||
case SLANG_OPER_VARIABLE_DECL:
|
||||
{
|
||||
slang_variable *v = _slang_locate_variable(oper->locals,
|
||||
slang_variable *v = _slang_variable_locate(oper->locals,
|
||||
oper->a_id, GL_TRUE);
|
||||
assert(v);
|
||||
if (v->initializer && oper->num_children == 0) {
|
||||
@@ -821,7 +823,7 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper,
|
||||
slang_atom id = oper->a_id;
|
||||
slang_variable *v;
|
||||
GLuint i;
|
||||
v = _slang_locate_variable(oper->locals, id, GL_TRUE);
|
||||
v = _slang_variable_locate(oper->locals, id, GL_TRUE);
|
||||
if (!v) {
|
||||
_mesa_problem(NULL, "var %s not found!\n", (char *) oper->a_id);
|
||||
return;
|
||||
@@ -1760,18 +1762,12 @@ _slang_find_function_by_max_argc(slang_function_scope *scope,
|
||||
* struct type.
|
||||
*/
|
||||
static slang_function *
|
||||
_slang_make_constructor(slang_assemble_ctx *A, slang_struct *str)
|
||||
_slang_make_struct_constructor(slang_assemble_ctx *A, slang_struct *str)
|
||||
{
|
||||
const GLint numFields = str->fields->num_variables;
|
||||
|
||||
slang_function *fun = (slang_function *) _mesa_malloc(sizeof(slang_function));
|
||||
if (!fun)
|
||||
return NULL;
|
||||
|
||||
slang_function_construct(fun);
|
||||
slang_function *fun = slang_function_new(SLANG_FUNC_CONSTRUCTOR);
|
||||
|
||||
/* function header (name, return type) */
|
||||
fun->kind = SLANG_FUNC_CONSTRUCTOR;
|
||||
fun->header.a_name = str->a_name;
|
||||
fun->header.type.qualifier = SLANG_QUAL_NONE;
|
||||
fun->header.type.specifier.type = SLANG_SPEC_STRUCT;
|
||||
@@ -1785,7 +1781,7 @@ _slang_make_constructor(slang_assemble_ctx *A, slang_struct *str)
|
||||
printf("Field %d: %s\n", i, (char*) str->fields->variables[i]->a_name);
|
||||
*/
|
||||
slang_variable *p = slang_variable_scope_grow(fun->parameters);
|
||||
*p = *str->fields->variables[i]; /* copy the type */
|
||||
*p = *str->fields->variables[i]; /* copy the variable and type */
|
||||
p->type.qualifier = SLANG_QUAL_CONST;
|
||||
}
|
||||
fun->param_count = fun->parameters->num_variables;
|
||||
@@ -1890,7 +1886,6 @@ _slang_make_constructor(slang_assemble_ctx *A, slang_struct *str)
|
||||
ret->children[0].type = SLANG_OPER_IDENTIFIER;
|
||||
ret->children[0].a_id = var->a_name;
|
||||
ret->children[0].locals = _slang_variable_scope_new(scope);
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -1913,7 +1908,7 @@ _slang_locate_struct_constructor(slang_assemble_ctx *A, const char *name)
|
||||
/* found a structure type that matches the function name */
|
||||
if (!str->constructor) {
|
||||
/* create the constructor function now */
|
||||
str->constructor = _slang_make_constructor(A, str);
|
||||
str->constructor = _slang_make_struct_constructor(A, str);
|
||||
}
|
||||
return str->constructor;
|
||||
}
|
||||
@@ -1922,6 +1917,156 @@ _slang_locate_struct_constructor(slang_assemble_ctx *A, const char *name)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a new slang_function to satisfy a call to an array constructor.
|
||||
* Ex: float[3](1., 2., 3.)
|
||||
*/
|
||||
static slang_function *
|
||||
_slang_make_array_constructor(slang_assemble_ctx *A, slang_operation *oper)
|
||||
{
|
||||
slang_type_specifier_type baseType;
|
||||
slang_function *fun;
|
||||
int num_elements;
|
||||
|
||||
fun = slang_function_new(SLANG_FUNC_CONSTRUCTOR);
|
||||
if (!fun)
|
||||
return NULL;
|
||||
|
||||
baseType = slang_type_specifier_type_from_string((char *) oper->a_id);
|
||||
|
||||
num_elements = oper->num_children;
|
||||
|
||||
/* function header, return type */
|
||||
{
|
||||
fun->header.a_name = oper->a_id;
|
||||
fun->header.type.qualifier = SLANG_QUAL_NONE;
|
||||
fun->header.type.specifier.type = SLANG_SPEC_ARRAY;
|
||||
fun->header.type.specifier._array =
|
||||
slang_type_specifier_new(baseType, NULL, NULL);
|
||||
fun->header.type.array_len = num_elements;
|
||||
}
|
||||
|
||||
/* function parameters (= number of elements) */
|
||||
{
|
||||
GLint i;
|
||||
for (i = 0; i < num_elements; i++) {
|
||||
/*
|
||||
printf("Field %d: %s\n", i, (char*) str->fields->variables[i]->a_name);
|
||||
*/
|
||||
slang_variable *p = slang_variable_scope_grow(fun->parameters);
|
||||
char name[10];
|
||||
snprintf(name, sizeof(name), "p%d", i);
|
||||
p->a_name = slang_atom_pool_atom(A->atoms, name);
|
||||
p->type.qualifier = SLANG_QUAL_CONST;
|
||||
p->type.specifier.type = baseType;
|
||||
}
|
||||
fun->param_count = fun->parameters->num_variables;
|
||||
}
|
||||
|
||||
/* Add __retVal to params */
|
||||
{
|
||||
slang_variable *p = slang_variable_scope_grow(fun->parameters);
|
||||
slang_atom a_retVal = slang_atom_pool_atom(A->atoms, "__retVal");
|
||||
assert(a_retVal);
|
||||
p->a_name = a_retVal;
|
||||
p->type = fun->header.type;
|
||||
p->type.qualifier = SLANG_QUAL_OUT;
|
||||
p->type.specifier.type = baseType;
|
||||
fun->param_count++;
|
||||
}
|
||||
|
||||
/* function body is:
|
||||
* block:
|
||||
* declare T;
|
||||
* T[0] = p0;
|
||||
* T[1] = p1;
|
||||
* ...
|
||||
* T[n] = pn;
|
||||
* return T;
|
||||
*/
|
||||
{
|
||||
slang_variable_scope *scope;
|
||||
slang_variable *var;
|
||||
GLint i;
|
||||
|
||||
fun->body = slang_operation_new(1);
|
||||
fun->body->type = SLANG_OPER_BLOCK_NEW_SCOPE;
|
||||
fun->body->num_children = num_elements + 2;
|
||||
fun->body->children = slang_operation_new(num_elements + 2);
|
||||
|
||||
scope = fun->body->locals;
|
||||
scope->outer_scope = fun->parameters;
|
||||
|
||||
/* create local var 't' */
|
||||
var = slang_variable_scope_grow(scope);
|
||||
var->a_name = slang_atom_pool_atom(A->atoms, "ttt");
|
||||
var->type = fun->header.type;/*XXX copy*/
|
||||
|
||||
/* declare t */
|
||||
{
|
||||
slang_operation *decl;
|
||||
|
||||
decl = &fun->body->children[0];
|
||||
decl->type = SLANG_OPER_VARIABLE_DECL;
|
||||
decl->locals = _slang_variable_scope_new(scope);
|
||||
decl->a_id = var->a_name;
|
||||
}
|
||||
|
||||
/* assign params to elements of t */
|
||||
for (i = 0; i < num_elements; i++) {
|
||||
slang_operation *assign = &fun->body->children[1 + i];
|
||||
|
||||
assign->type = SLANG_OPER_ASSIGN;
|
||||
assign->locals = _slang_variable_scope_new(scope);
|
||||
assign->num_children = 2;
|
||||
assign->children = slang_operation_new(2);
|
||||
|
||||
{
|
||||
slang_operation *lhs = &assign->children[0];
|
||||
|
||||
lhs->type = SLANG_OPER_SUBSCRIPT;
|
||||
lhs->locals = _slang_variable_scope_new(scope);
|
||||
lhs->num_children = 2;
|
||||
lhs->children = slang_operation_new(2);
|
||||
|
||||
lhs->children[0].type = SLANG_OPER_IDENTIFIER;
|
||||
lhs->children[0].a_id = var->a_name;
|
||||
lhs->children[0].locals = _slang_variable_scope_new(scope);
|
||||
|
||||
lhs->children[1].type = SLANG_OPER_LITERAL_INT;
|
||||
lhs->children[1].literal[0] = (GLfloat) i;
|
||||
}
|
||||
|
||||
{
|
||||
slang_operation *rhs = &assign->children[1];
|
||||
|
||||
rhs->type = SLANG_OPER_IDENTIFIER;
|
||||
rhs->locals = _slang_variable_scope_new(scope);
|
||||
rhs->a_id = fun->parameters->variables[i]->a_name;
|
||||
}
|
||||
}
|
||||
|
||||
/* return t; */
|
||||
{
|
||||
slang_operation *ret = &fun->body->children[num_elements + 1];
|
||||
|
||||
ret->type = SLANG_OPER_RETURN;
|
||||
ret->locals = _slang_variable_scope_new(scope);
|
||||
ret->num_children = 1;
|
||||
ret->children = slang_operation_new(1);
|
||||
ret->children[0].type = SLANG_OPER_IDENTIFIER;
|
||||
ret->children[0].a_id = var->a_name;
|
||||
ret->children[0].locals = _slang_variable_scope_new(scope);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
slang_print_function(fun, 1);
|
||||
*/
|
||||
|
||||
return fun;
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
_slang_is_vec_mat_type(const char *name)
|
||||
@@ -1955,24 +2100,27 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name,
|
||||
const GLuint param_count = oper->num_children;
|
||||
slang_atom atom;
|
||||
slang_function *fun;
|
||||
GLboolean error;
|
||||
slang_ir_node *n;
|
||||
|
||||
atom = slang_atom_pool_atom(A->atoms, name);
|
||||
if (atom == SLANG_ATOM_NULL)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* First, try to find function by name and exact argument type matching.
|
||||
*/
|
||||
fun = _slang_locate_function(A->space.funcs, atom, params, param_count,
|
||||
&A->space, A->atoms, A->log, &error);
|
||||
|
||||
if (error) {
|
||||
slang_info_log_error(A->log,
|
||||
"Function '%s' not found (check argument types)",
|
||||
name);
|
||||
return NULL;
|
||||
if (oper->array_constructor) {
|
||||
/* this needs special handling */
|
||||
fun = _slang_make_array_constructor(A, oper);
|
||||
}
|
||||
else {
|
||||
/* Try to find function by name and exact argument type matching */
|
||||
GLboolean error = GL_FALSE;
|
||||
fun = _slang_function_locate(A->space.funcs, atom, params, param_count,
|
||||
&A->space, A->atoms, A->log, &error);
|
||||
if (error) {
|
||||
slang_info_log_error(A->log,
|
||||
"Function '%s' not found (check argument types)",
|
||||
name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fun) {
|
||||
@@ -2033,7 +2181,7 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name,
|
||||
slang_typeinfo t0;
|
||||
|
||||
slang_typeinfo_construct(&t0);
|
||||
_slang_typeof_operation(A, dest, &t0);
|
||||
typeof_operation(A, dest, &t0);
|
||||
|
||||
if (!slang_type_specifier_equal(&t0.spec, &fun->header.type.specifier)) {
|
||||
slang_info_log_error(A->log,
|
||||
@@ -2053,6 +2201,11 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name,
|
||||
/*printf("Alloc storage for function result, size %d \n", size);*/
|
||||
}
|
||||
|
||||
if (oper->array_constructor) {
|
||||
/* free the temporary array constructor function now */
|
||||
slang_function_destruct(fun);
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -2080,7 +2233,7 @@ _slang_gen_method_call(slang_assemble_ctx *A, slang_operation *oper)
|
||||
}
|
||||
|
||||
/* lookup the object/variable */
|
||||
var = _slang_locate_variable(oper->locals, oper->a_obj, GL_TRUE);
|
||||
var = _slang_variable_locate(oper->locals, oper->a_obj, GL_TRUE);
|
||||
if (!var || var->type.specifier.type != SLANG_SPEC_ARRAY) {
|
||||
slang_info_log_error(A->log,
|
||||
"Undefined object '%s'", (char *) oper->a_obj);
|
||||
@@ -2127,7 +2280,7 @@ _slang_is_scalar_or_boolean(slang_assemble_ctx *A, slang_operation *oper)
|
||||
GLint size;
|
||||
|
||||
slang_typeinfo_construct(&type);
|
||||
_slang_typeof_operation(A, oper, &type);
|
||||
typeof_operation(A, oper, &type);
|
||||
size = _slang_sizeof_type_specifier(&type.spec);
|
||||
slang_typeinfo_destruct(&type);
|
||||
return size == 1;
|
||||
@@ -2144,7 +2297,7 @@ _slang_is_boolean(slang_assemble_ctx *A, slang_operation *oper)
|
||||
GLboolean isBool;
|
||||
|
||||
slang_typeinfo_construct(&type);
|
||||
_slang_typeof_operation(A, oper, &type);
|
||||
typeof_operation(A, oper, &type);
|
||||
isBool = (type.spec.type == SLANG_SPEC_BOOL);
|
||||
slang_typeinfo_destruct(&type);
|
||||
return isBool;
|
||||
@@ -2479,80 +2632,252 @@ _slang_gen_temporary(GLint size)
|
||||
|
||||
|
||||
/**
|
||||
* Generate IR node for allocating/declaring a variable.
|
||||
* Generate program constants for an array.
|
||||
* Ex: const vec2[3] v = vec2[3](vec2(1,1), vec2(2,2), vec2(3,3));
|
||||
* This will allocate and initialize three vector constants, storing
|
||||
* the array in constant memory, not temporaries like a non-const array.
|
||||
* This can also be used for uniform array initializers.
|
||||
* \return GL_TRUE for success, GL_FALSE if failure (semantic error, etc).
|
||||
*/
|
||||
static GLboolean
|
||||
make_constant_array(slang_assemble_ctx *A,
|
||||
slang_variable *var,
|
||||
slang_operation *initializer)
|
||||
{
|
||||
struct gl_program *prog = A->program;
|
||||
const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier);
|
||||
const char *varName = (char *) var->a_name;
|
||||
const GLuint numElements = initializer->num_children;
|
||||
GLint size;
|
||||
GLuint i, j;
|
||||
GLfloat *values;
|
||||
|
||||
if (!var->store) {
|
||||
var->store = _slang_new_ir_storage(PROGRAM_UNDEFINED, -6, -6);
|
||||
}
|
||||
size = var->store->Size;
|
||||
|
||||
assert(var->type.qualifier == SLANG_QUAL_CONST ||
|
||||
var->type.qualifier == SLANG_QUAL_UNIFORM);
|
||||
assert(initializer->type == SLANG_OPER_CALL);
|
||||
assert(initializer->array_constructor);
|
||||
|
||||
values = (GLfloat *) _mesa_malloc(numElements * 4 * sizeof(GLfloat));
|
||||
|
||||
/* convert constructor params into ordinary floats */
|
||||
for (i = 0; i < numElements; i++) {
|
||||
const slang_operation *op = &initializer->children[i];
|
||||
if (op->type != SLANG_OPER_LITERAL_FLOAT) {
|
||||
/* unsupported type for this optimization */
|
||||
free(values);
|
||||
return GL_FALSE;
|
||||
}
|
||||
for (j = 0; j < op->literal_size; j++) {
|
||||
values[i * 4 + j] = op->literal[j];
|
||||
}
|
||||
for ( ; j < 4; j++) {
|
||||
values[i * 4 + j] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
/* slightly different paths for constants vs. uniforms */
|
||||
if (var->type.qualifier == SLANG_QUAL_UNIFORM) {
|
||||
var->store->File = PROGRAM_UNIFORM;
|
||||
var->store->Index = _mesa_add_uniform(prog->Parameters, varName,
|
||||
size, datatype, values);
|
||||
}
|
||||
else {
|
||||
var->store->File = PROGRAM_CONSTANT;
|
||||
var->store->Index = _mesa_add_named_constant(prog->Parameters, varName,
|
||||
values, size);
|
||||
}
|
||||
assert(var->store->Size == size);
|
||||
|
||||
_mesa_free(values);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generate IR node for allocating/declaring a variable (either a local or
|
||||
* a global).
|
||||
* Generally, this involves allocating an slang_ir_storage instance for the
|
||||
* variable, choosing a register file (temporary, constant, etc).
|
||||
* For ordinary variables we do not yet allocate storage though. We do that
|
||||
* when we find the first actual use of the variable to avoid allocating temp
|
||||
* regs that will never get used.
|
||||
* At this time, uniforms are always allocated space in this function.
|
||||
*
|
||||
* \param initializer Optional initializer expression for the variable.
|
||||
*/
|
||||
static slang_ir_node *
|
||||
_slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
|
||||
_slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var,
|
||||
slang_operation *initializer)
|
||||
{
|
||||
slang_ir_node *n;
|
||||
const char *varName = (const char *) var->a_name;
|
||||
const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier);
|
||||
slang_ir_node *varDecl, *n;
|
||||
slang_ir_storage *store;
|
||||
GLint size, totalSize; /* if array then totalSize > size */
|
||||
enum register_file file;
|
||||
|
||||
/*assert(!var->declared);*/
|
||||
var->declared = GL_TRUE;
|
||||
|
||||
n = new_node0(IR_VAR_DECL);
|
||||
if (n) {
|
||||
_slang_attach_storage(n, var);
|
||||
assert(var->store);
|
||||
assert(n->Store == var->store);
|
||||
assert(n->Store);
|
||||
assert(n->Store->Index < 0);
|
||||
/* determine GPU register file for simple cases */
|
||||
if (is_sampler_type(&var->type)) {
|
||||
file = PROGRAM_SAMPLER;
|
||||
}
|
||||
else if (var->type.qualifier == SLANG_QUAL_UNIFORM) {
|
||||
file = PROGRAM_UNIFORM;
|
||||
}
|
||||
else {
|
||||
file = PROGRAM_TEMPORARY;
|
||||
}
|
||||
|
||||
if (is_sampler_type(&var->type)) {
|
||||
n->Store->File = PROGRAM_SAMPLER;
|
||||
}
|
||||
else {
|
||||
n->Store->File = PROGRAM_TEMPORARY;
|
||||
}
|
||||
size = _slang_sizeof_type_specifier(&var->type.specifier);
|
||||
if (size <= 0) {
|
||||
slang_info_log_error(A->log, "invalid declaration for '%s'", varName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n->Store->Size = _slang_sizeof_type_specifier(&n->Var->type.specifier);
|
||||
totalSize = size;
|
||||
if (var->type.array_len > 0) {
|
||||
/* the type is an array, ex: float[4] x; */
|
||||
GLint sz = (totalSize + 3) & ~3;
|
||||
/* total size = element size * array length */
|
||||
sz *= var->type.array_len;
|
||||
totalSize = sz;
|
||||
}
|
||||
|
||||
if (n->Store->Size <= 0) {
|
||||
slang_info_log_error(A->log, "invalid declaration for '%s'",
|
||||
(char*) var->a_name);
|
||||
return NULL;
|
||||
}
|
||||
if (var->array_len > 0) {
|
||||
/* this is an array, ex: float x[4]; */
|
||||
/* round up the element size to a multiple of 4 */
|
||||
GLint sz = (totalSize + 3) & ~3;
|
||||
/* total size = element size * array length */
|
||||
sz *= var->array_len;
|
||||
totalSize = sz;
|
||||
}
|
||||
|
||||
/* Allocate IR node for the declaration */
|
||||
varDecl = new_node0(IR_VAR_DECL);
|
||||
if (!varDecl)
|
||||
return NULL;
|
||||
|
||||
_slang_attach_storage(varDecl, var); /* undefined storage at first */
|
||||
assert(var->store);
|
||||
assert(varDecl->Store == var->store);
|
||||
assert(varDecl->Store);
|
||||
assert(varDecl->Store->Index < 0);
|
||||
store = var->store;
|
||||
|
||||
assert(store == varDecl->Store);
|
||||
|
||||
|
||||
/* Fill in storage fields which we now know. store->Index/Swizzle may be
|
||||
* set for some cases below. Otherwise, store->Index/Swizzle will be set
|
||||
* during code emit.
|
||||
*/
|
||||
store->File = file;
|
||||
store->Size = totalSize;
|
||||
|
||||
/* if there's an initializer, generate IR for the expression */
|
||||
if (initializer) {
|
||||
slang_ir_node *varRef, *init;
|
||||
|
||||
if (var->type.qualifier == SLANG_QUAL_CONST) {
|
||||
/* if the variable is const, the initializer must be a const
|
||||
* expression as well.
|
||||
*/
|
||||
#if 0
|
||||
printf("%s var %p %s store=%p index=%d size=%d\n",
|
||||
__FUNCTION__, (void *) var, (char *) var->a_name,
|
||||
(void *) n->Store, n->Store->Index, n->Store->Size);
|
||||
#endif
|
||||
|
||||
if (var->array_len > 0) {
|
||||
/* this is an array */
|
||||
/* cannot be const-qualified */
|
||||
if (var->type.qualifier == SLANG_QUAL_CONST) {
|
||||
slang_info_log_error(A->log, "array '%s' cannot be const",
|
||||
(char*) var->a_name);
|
||||
if (!_slang_is_constant_expr(initializer)) {
|
||||
slang_info_log_error(A->log,
|
||||
"initializer for %s not constant", varName);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
/* round up element size to mult of 4 */
|
||||
GLint sz = (n->Store->Size + 3) & ~3;
|
||||
/* mult by array size */
|
||||
sz *= var->array_len;
|
||||
n->Store->Size = sz;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* IR for the variable we're initializing */
|
||||
varRef = new_var(A, var);
|
||||
if (!varRef) {
|
||||
slang_info_log_error(A->log, "out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* constant-folding, etc here */
|
||||
_slang_simplify(initializer, &A->space, A->atoms);
|
||||
|
||||
/* look for simple constant-valued variables and uniforms */
|
||||
if (var->type.qualifier == SLANG_QUAL_CONST ||
|
||||
var->type.qualifier == SLANG_QUAL_UNIFORM) {
|
||||
|
||||
if (initializer->type == SLANG_OPER_CALL &&
|
||||
initializer->array_constructor) {
|
||||
/* array initializer */
|
||||
if (make_constant_array(A, var, initializer))
|
||||
return varRef;
|
||||
}
|
||||
else if (initializer->type == SLANG_OPER_LITERAL_FLOAT ||
|
||||
initializer->type == SLANG_OPER_LITERAL_INT) {
|
||||
/* simple float/vector initializer */
|
||||
if (store->File == PROGRAM_UNIFORM) {
|
||||
store->Index = _mesa_add_uniform(A->program->Parameters,
|
||||
varName,
|
||||
totalSize, datatype,
|
||||
initializer->literal);
|
||||
store->Swizzle = _slang_var_swizzle(size, 0);
|
||||
return varRef;
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
store->File = PROGRAM_CONSTANT;
|
||||
store->Index = _mesa_add_named_constant(A->program->Parameters,
|
||||
varName,
|
||||
initializer->literal,
|
||||
totalSize);
|
||||
store->Swizzle = _slang_var_swizzle(size, 0);
|
||||
return varRef;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
assert(n->Store->Size > 0);
|
||||
/* IR for initializer */
|
||||
init = _slang_gen_operation(A, initializer);
|
||||
if (!init)
|
||||
return NULL;
|
||||
|
||||
/* setup default swizzle for storing the variable */
|
||||
switch (n->Store->Size) {
|
||||
case 2:
|
||||
n->Store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y,
|
||||
SWIZZLE_NIL, SWIZZLE_NIL);
|
||||
break;
|
||||
case 3:
|
||||
n->Store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y,
|
||||
SWIZZLE_Z, SWIZZLE_NIL);
|
||||
break;
|
||||
default:
|
||||
/* Note that float-sized vars may be allocated in any x/y/z/w
|
||||
* slot, but that won't be determined until code emit time.
|
||||
*/
|
||||
n->Store->Swizzle = SWIZZLE_NOOP;
|
||||
/* XXX remove this when type checking is added above */
|
||||
if (init->Store && init->Store->Size != totalSize) {
|
||||
slang_info_log_error(A->log, "invalid assignment (wrong types)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* assign RHS to LHS */
|
||||
n = new_node2(IR_COPY, varRef, init);
|
||||
n = new_seq(varDecl, n);
|
||||
}
|
||||
else {
|
||||
/* no initializer */
|
||||
n = varDecl;
|
||||
}
|
||||
|
||||
if (store->File == PROGRAM_UNIFORM && store->Index < 0) {
|
||||
/* always need to allocate storage for uniforms at this point */
|
||||
store->Index = _mesa_add_uniform(A->program->Parameters, varName,
|
||||
totalSize, datatype, NULL);
|
||||
store->Swizzle = _slang_var_swizzle(size, 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("%s var %p %s store=%p index=%d size=%d\n",
|
||||
__FUNCTION__, (void *) var, (char *) varName,
|
||||
(void *) store, store->Index, store->Size);
|
||||
#endif
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -2576,7 +2901,7 @@ _slang_gen_select(slang_assemble_ctx *A, slang_operation *oper)
|
||||
|
||||
/* type of children[0] must be boolean */
|
||||
slang_typeinfo_construct(&type0);
|
||||
_slang_typeof_operation(A, &oper->children[0], &type0);
|
||||
typeof_operation(A, &oper->children[0], &type0);
|
||||
isBool = (type0.spec.type == SLANG_SPEC_BOOL);
|
||||
slang_typeinfo_destruct(&type0);
|
||||
if (!isBool) {
|
||||
@@ -2586,8 +2911,8 @@ _slang_gen_select(slang_assemble_ctx *A, slang_operation *oper)
|
||||
|
||||
slang_typeinfo_construct(&type1);
|
||||
slang_typeinfo_construct(&type2);
|
||||
_slang_typeof_operation(A, &oper->children[1], &type1);
|
||||
_slang_typeof_operation(A, &oper->children[2], &type2);
|
||||
typeof_operation(A, &oper->children[1], &type1);
|
||||
typeof_operation(A, &oper->children[2], &type2);
|
||||
isEqual = slang_type_specifier_equal(&type1.spec, &type2.spec);
|
||||
slang_typeinfo_destruct(&type1);
|
||||
slang_typeinfo_destruct(&type2);
|
||||
@@ -2727,8 +3052,8 @@ _slang_gen_return(slang_assemble_ctx * A, slang_operation *oper)
|
||||
|
||||
#if 1 /* DEBUG */
|
||||
{
|
||||
slang_variable *v
|
||||
= _slang_locate_variable(oper->locals, a_retVal, GL_TRUE);
|
||||
slang_variable *v =
|
||||
_slang_variable_locate(oper->locals, a_retVal, GL_TRUE);
|
||||
if (!v) {
|
||||
/* trying to return a value in a void-valued function */
|
||||
return NULL;
|
||||
@@ -2769,7 +3094,7 @@ _slang_is_constant_expr(const slang_operation *oper)
|
||||
|
||||
switch (oper->type) {
|
||||
case SLANG_OPER_IDENTIFIER:
|
||||
var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE);
|
||||
var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE);
|
||||
if (var && var->type.qualifier == SLANG_QUAL_CONST)
|
||||
return GL_TRUE;
|
||||
return GL_FALSE;
|
||||
@@ -2801,10 +3126,10 @@ _slang_assignment_compatible(slang_assemble_ctx *A,
|
||||
}
|
||||
|
||||
slang_typeinfo_construct(&t0);
|
||||
_slang_typeof_operation(A, op0, &t0);
|
||||
typeof_operation(A, op0, &t0);
|
||||
|
||||
slang_typeinfo_construct(&t1);
|
||||
_slang_typeof_operation(A, op1, &t1);
|
||||
typeof_operation(A, op1, &t1);
|
||||
|
||||
sz0 = _slang_sizeof_type_specifier(&t0.spec);
|
||||
sz1 = _slang_sizeof_type_specifier(&t1.spec);
|
||||
@@ -2843,29 +3168,29 @@ _slang_assignment_compatible(slang_assemble_ctx *A,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generate IR tree for a variable declaration.
|
||||
* Generate IR tree for a local variable declaration.
|
||||
* Basically do some error checking and call _slang_gen_var_decl().
|
||||
*/
|
||||
static slang_ir_node *
|
||||
_slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper)
|
||||
{
|
||||
slang_ir_node *n;
|
||||
slang_ir_node *varDecl;
|
||||
slang_variable *v;
|
||||
const char *varName = (char *) oper->a_id;
|
||||
slang_variable *var;
|
||||
slang_ir_node *varDecl;
|
||||
slang_operation *initializer;
|
||||
|
||||
assert(oper->type == SLANG_OPER_VARIABLE_DECL);
|
||||
assert(oper->num_children <= 1);
|
||||
|
||||
v = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE);
|
||||
if (!v)
|
||||
/* lookup the variable by name */
|
||||
var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE);
|
||||
if (!var)
|
||||
return NULL; /* "shouldn't happen" */
|
||||
|
||||
if (v->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
|
||||
v->type.qualifier == SLANG_QUAL_VARYING ||
|
||||
v->type.qualifier == SLANG_QUAL_UNIFORM) {
|
||||
if (var->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
|
||||
var->type.qualifier == SLANG_QUAL_VARYING ||
|
||||
var->type.qualifier == SLANG_QUAL_UNIFORM) {
|
||||
/* can't declare attribute/uniform vars inside functions */
|
||||
slang_info_log_error(A->log,
|
||||
"local variable '%s' cannot be an attribute/uniform/varying",
|
||||
@@ -2880,85 +3205,46 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper)
|
||||
}
|
||||
#endif
|
||||
|
||||
varDecl = _slang_gen_var_decl(A, v);
|
||||
if (!varDecl)
|
||||
return NULL;
|
||||
|
||||
/* check if the var has an initializer */
|
||||
if (oper->num_children > 0) {
|
||||
assert(oper->num_children == 1);
|
||||
initializer = &oper->children[0];
|
||||
}
|
||||
else if (v->initializer) {
|
||||
initializer = v->initializer;
|
||||
else if (var->initializer) {
|
||||
initializer = var->initializer;
|
||||
}
|
||||
else {
|
||||
initializer = NULL;
|
||||
}
|
||||
|
||||
if (v->type.qualifier == SLANG_QUAL_CONST && !initializer) {
|
||||
slang_info_log_error(A->log,
|
||||
"const-qualified variable '%s' requires initializer",
|
||||
varName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (initializer) {
|
||||
slang_ir_node *var, *init;
|
||||
|
||||
/* type check/compare var and initializer */
|
||||
/* check/compare var type and initializer type */
|
||||
if (!_slang_assignment_compatible(A, oper, initializer)) {
|
||||
slang_info_log_error(A->log, "incompatible types in assignment");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
var = new_var(A, oper, oper->a_id);
|
||||
if (!var) {
|
||||
slang_info_log_error(A->log, "undefined variable '%s'", varName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (v->type.qualifier == SLANG_QUAL_CONST) {
|
||||
/* if the variable is const, the initializer must be a const
|
||||
* expression as well.
|
||||
*/
|
||||
#if 0
|
||||
if (!_slang_is_constant_expr(initializer)) {
|
||||
slang_info_log_error(A->log,
|
||||
"initializer for %s not constant", varName);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
_slang_simplify(initializer, &A->space, A->atoms);
|
||||
|
||||
init = _slang_gen_operation(A, initializer);
|
||||
if (!init)
|
||||
return NULL;
|
||||
|
||||
/*assert(init->Store);*/
|
||||
|
||||
/* XXX remove this when type checking is added above */
|
||||
if (init->Store && var->Store->Size != init->Store->Size) {
|
||||
slang_info_log_error(A->log, "invalid assignment (wrong types)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n = new_node2(IR_COPY, var, init);
|
||||
n = new_seq(varDecl, n);
|
||||
}
|
||||
else {
|
||||
n = varDecl;
|
||||
if (var->type.qualifier == SLANG_QUAL_CONST) {
|
||||
slang_info_log_error(A->log,
|
||||
"const-qualified variable '%s' requires initializer",
|
||||
varName);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return n;
|
||||
/* Generate IR node */
|
||||
varDecl = _slang_gen_var_decl(A, var, initializer);
|
||||
if (!varDecl)
|
||||
return NULL;
|
||||
|
||||
return varDecl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate IR tree for a variable (such as in an expression).
|
||||
* Generate IR tree for a reference to a variable (such as in an expression).
|
||||
* This is different from a variable declaration.
|
||||
*/
|
||||
static slang_ir_node *
|
||||
_slang_gen_variable(slang_assemble_ctx * A, slang_operation *oper)
|
||||
@@ -2966,12 +3252,15 @@ _slang_gen_variable(slang_assemble_ctx * A, slang_operation *oper)
|
||||
/* If there's a variable associated with this oper (from inlining)
|
||||
* use it. Otherwise, use the oper's var id.
|
||||
*/
|
||||
slang_atom aVar = oper->var ? oper->var->a_name : oper->a_id;
|
||||
slang_ir_node *n = new_var(A, oper, aVar);
|
||||
if (!n) {
|
||||
slang_info_log_error(A->log, "undefined variable '%s'", (char *) aVar);
|
||||
slang_atom name = oper->var ? oper->var->a_name : oper->a_id;
|
||||
slang_variable *var = _slang_variable_locate(oper->locals, name, GL_TRUE);
|
||||
slang_ir_node *n;
|
||||
if (!var) {
|
||||
slang_info_log_error(A->log, "undefined variable '%s'", (char *) name);
|
||||
return NULL;
|
||||
}
|
||||
assert(var->declared);
|
||||
n = new_var(A, var);
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -3036,7 +3325,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
|
||||
if (oper->children[0].type == SLANG_OPER_IDENTIFIER) {
|
||||
/* Check that var is writeable */
|
||||
slang_variable *var
|
||||
= _slang_locate_variable(oper->children[0].locals,
|
||||
= _slang_variable_locate(oper->children[0].locals,
|
||||
oper->children[0].a_id, GL_TRUE);
|
||||
if (!var) {
|
||||
slang_info_log_error(A->log, "undefined variable '%s'",
|
||||
@@ -3130,7 +3419,7 @@ _slang_gen_struct_field(slang_assemble_ctx * A, slang_operation *oper)
|
||||
|
||||
/* type of struct */
|
||||
slang_typeinfo_construct(&ti);
|
||||
_slang_typeof_operation(A, &oper->children[0], &ti);
|
||||
typeof_operation(A, &oper->children[0], &ti);
|
||||
|
||||
if (_slang_type_is_vector(ti.spec.type)) {
|
||||
/* the field should be a swizzle */
|
||||
@@ -3182,7 +3471,7 @@ _slang_gen_struct_field(slang_assemble_ctx * A, slang_operation *oper)
|
||||
|
||||
/* type of field */
|
||||
slang_typeinfo_construct(&field_ti);
|
||||
_slang_typeof_operation(A, oper, &field_ti);
|
||||
typeof_operation(A, oper, &field_ti);
|
||||
|
||||
fieldSize = _slang_sizeof_type_specifier(&field_ti.spec);
|
||||
if (fieldSize > 0)
|
||||
@@ -3233,7 +3522,7 @@ _slang_gen_array_element(slang_assemble_ctx * A, slang_operation *oper)
|
||||
|
||||
/* get array's type info */
|
||||
slang_typeinfo_construct(&array_ti);
|
||||
_slang_typeof_operation(A, &oper->children[0], &array_ti);
|
||||
typeof_operation(A, &oper->children[0], &array_ti);
|
||||
|
||||
if (_slang_type_is_vector(array_ti.spec.type)) {
|
||||
/* indexing a simple vector type: "vec4 v; v[0]=p;" */
|
||||
@@ -3269,7 +3558,7 @@ _slang_gen_array_element(slang_assemble_ctx * A, slang_operation *oper)
|
||||
|
||||
/* size of array element */
|
||||
slang_typeinfo_construct(&elem_ti);
|
||||
_slang_typeof_operation(A, oper, &elem_ti);
|
||||
typeof_operation(A, oper, &elem_ti);
|
||||
elemSize = _slang_sizeof_type_specifier(&elem_ti.spec);
|
||||
|
||||
if (_slang_type_is_matrix(array_ti.spec.type))
|
||||
@@ -3334,10 +3623,10 @@ _slang_gen_compare(slang_assemble_ctx *A, slang_operation *oper,
|
||||
slang_ir_node *n;
|
||||
|
||||
slang_typeinfo_construct(&t0);
|
||||
_slang_typeof_operation(A, &oper->children[0], &t0);
|
||||
typeof_operation(A, &oper->children[0], &t0);
|
||||
|
||||
slang_typeinfo_construct(&t1);
|
||||
_slang_typeof_operation(A, &oper->children[0], &t1);
|
||||
typeof_operation(A, &oper->children[0], &t1);
|
||||
|
||||
if (t0.spec.type == SLANG_SPEC_ARRAY ||
|
||||
t1.spec.type == SLANG_SPEC_ARRAY) {
|
||||
@@ -3783,27 +4072,10 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLint uniformLoc;
|
||||
const GLfloat *initialValues = NULL;
|
||||
if (var->initializer) {
|
||||
_slang_simplify(var->initializer, &A->space, A->atoms);
|
||||
if (var->initializer->type == SLANG_OPER_LITERAL_FLOAT ||
|
||||
var->initializer->type == SLANG_OPER_LITERAL_INT) {
|
||||
/* simple float/vector initializer */
|
||||
initialValues = var->initializer->literal;
|
||||
}
|
||||
else {
|
||||
/* complex initializer */
|
||||
slang_info_log_error(A->log,
|
||||
"unsupported initializer for uniform '%s'", varName);
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
uniformLoc = _mesa_add_uniform(prog->Parameters, varName,
|
||||
totalSize, datatype, initialValues);
|
||||
store = _slang_new_ir_storage_swz(PROGRAM_UNIFORM, uniformLoc,
|
||||
totalSize, swizzle);
|
||||
/* non-struct uniform */
|
||||
if (!_slang_gen_var_decl(A, var, var->initializer))
|
||||
return GL_FALSE;
|
||||
store = var->store;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -3936,26 +4208,9 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
|
||||
slang_ir_node *n;
|
||||
|
||||
/* IR node to declare the variable */
|
||||
n = _slang_gen_var_decl(A, var);
|
||||
|
||||
/* IR code for the var's initializer, if present */
|
||||
if (var->initializer) {
|
||||
slang_ir_node *lhs, *rhs, *init;
|
||||
|
||||
/* Generate IR_COPY instruction to initialize the variable */
|
||||
lhs = new_node0(IR_VAR);
|
||||
lhs->Var = var;
|
||||
lhs->Store = n->Store;
|
||||
|
||||
/* constant folding, etc */
|
||||
_slang_simplify(var->initializer, &A->space, A->atoms);
|
||||
|
||||
rhs = _slang_gen_operation(A, var->initializer);
|
||||
assert(rhs);
|
||||
init = new_node2(IR_COPY, lhs, rhs);
|
||||
n = new_seq(n, init);
|
||||
}
|
||||
n = _slang_gen_var_decl(A, var, var->initializer);
|
||||
|
||||
/* emit GPU instructions */
|
||||
success = _slang_emit_code(n, A->vartable, A->program, GL_FALSE, A->log);
|
||||
|
||||
_slang_free_ir_tree(n);
|
||||
|
||||
@@ -31,6 +31,19 @@
|
||||
#include "slang_compile.h"
|
||||
|
||||
|
||||
typedef struct slang_assemble_ctx_
|
||||
{
|
||||
slang_atom_pool *atoms;
|
||||
slang_name_space space;
|
||||
struct gl_program *program;
|
||||
slang_var_table *vartable;
|
||||
slang_info_log *log;
|
||||
struct slang_label_ *curFuncEndLabel;
|
||||
struct slang_ir_node_ *CurLoop;
|
||||
struct slang_function_ *CurFunction;
|
||||
} slang_assemble_ctx;
|
||||
|
||||
|
||||
extern GLuint
|
||||
_slang_sizeof_type_specifier(const slang_type_specifier *spec);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5.2
|
||||
*
|
||||
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 2008 VMware, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -74,18 +74,6 @@ legal_identifier(slang_atom name)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allocate storage for a variable of 'size' bytes from given pool.
|
||||
* Return the allocated address for the variable.
|
||||
*/
|
||||
static GLuint
|
||||
slang_var_pool_alloc(slang_var_pool * pool, unsigned int size)
|
||||
{
|
||||
const GLuint addr = pool->next_addr;
|
||||
pool->next_addr += size;
|
||||
return addr;
|
||||
}
|
||||
|
||||
/*
|
||||
* slang_code_unit
|
||||
*/
|
||||
@@ -120,7 +108,6 @@ _slang_code_object_ctr(slang_code_object * self)
|
||||
for (i = 0; i < SLANG_BUILTIN_TOTAL; i++)
|
||||
_slang_code_unit_ctr(&self->builtin[i], self);
|
||||
_slang_code_unit_ctr(&self->unit, self);
|
||||
self->varpool.next_addr = 0;
|
||||
slang_atom_pool_construct(&self->atompool);
|
||||
}
|
||||
|
||||
@@ -156,7 +143,6 @@ typedef struct slang_output_ctx_
|
||||
slang_variable_scope *vars;
|
||||
slang_function_scope *funs;
|
||||
slang_struct_scope *structs;
|
||||
slang_var_pool *global_pool;
|
||||
struct gl_program *program;
|
||||
slang_var_table *vartable;
|
||||
GLuint default_precision[TYPE_SPECIFIER_COUNT];
|
||||
@@ -251,7 +237,7 @@ parse_float(slang_parse_ctx * C, float *number)
|
||||
}
|
||||
|
||||
/* revision number - increment after each change affecting emitted output */
|
||||
#define REVISION 4
|
||||
#define REVISION 5
|
||||
|
||||
static int
|
||||
check_revision(slang_parse_ctx * C)
|
||||
@@ -270,6 +256,10 @@ static int parse_expression(slang_parse_ctx *, slang_output_ctx *,
|
||||
slang_operation *);
|
||||
static int parse_type_specifier(slang_parse_ctx *, slang_output_ctx *,
|
||||
slang_type_specifier *);
|
||||
static int
|
||||
parse_type_array_size(slang_parse_ctx *C,
|
||||
slang_output_ctx *O,
|
||||
GLint *array_len);
|
||||
|
||||
static GLboolean
|
||||
parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len)
|
||||
@@ -296,7 +286,7 @@ parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len)
|
||||
result = GL_TRUE;
|
||||
*len = (GLint) array_size.literal[0];
|
||||
} else if (array_size.type == SLANG_OPER_IDENTIFIER) {
|
||||
slang_variable *var = _slang_locate_variable(array_size.locals, array_size.a_id, GL_TRUE);
|
||||
slang_variable *var = _slang_variable_locate(array_size.locals, array_size.a_id, GL_TRUE);
|
||||
if (!var) {
|
||||
slang_info_log_error(C->L, "undefined variable '%s'",
|
||||
(char *) array_size.a_id);
|
||||
@@ -341,6 +331,20 @@ calculate_var_size(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
promote_type_to_array(slang_parse_ctx *C,
|
||||
slang_fully_specified_type *type,
|
||||
GLint array_len)
|
||||
{
|
||||
slang_type_specifier *baseType =
|
||||
slang_type_specifier_new(type->specifier.type, NULL, NULL);
|
||||
|
||||
type->specifier.type = SLANG_SPEC_ARRAY;
|
||||
type->specifier._array = baseType;
|
||||
type->array_len = array_len;
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
convert_to_array(slang_parse_ctx * C, slang_variable * var,
|
||||
const slang_type_specifier * sp)
|
||||
@@ -366,7 +370,8 @@ convert_to_array(slang_parse_ctx * C, slang_variable * var,
|
||||
static GLboolean
|
||||
parse_struct_field_var(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
slang_variable * var, slang_atom a_name,
|
||||
const slang_type_specifier * sp)
|
||||
const slang_type_specifier * sp,
|
||||
GLuint array_len)
|
||||
{
|
||||
var->a_name = a_name;
|
||||
if (var->a_name == SLANG_ATOM_NULL)
|
||||
@@ -374,10 +379,19 @@ parse_struct_field_var(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
|
||||
switch (*C->I++) {
|
||||
case FIELD_NONE:
|
||||
if (!slang_type_specifier_copy(&var->type.specifier, sp))
|
||||
return GL_FALSE;
|
||||
if (array_len != -1) {
|
||||
if (!convert_to_array(C, var, sp))
|
||||
return GL_FALSE;
|
||||
var->array_len = array_len;
|
||||
}
|
||||
else {
|
||||
if (!slang_type_specifier_copy(&var->type.specifier, sp))
|
||||
return GL_FALSE;
|
||||
}
|
||||
break;
|
||||
case FIELD_ARRAY:
|
||||
if (array_len != -1)
|
||||
return GL_FALSE;
|
||||
if (!convert_to_array(C, var, sp))
|
||||
return GL_FALSE;
|
||||
if (!parse_array_len(C, O, &var->array_len))
|
||||
@@ -395,10 +409,13 @@ parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
slang_struct * st, slang_type_specifier * sp)
|
||||
{
|
||||
slang_output_ctx o = *O;
|
||||
GLint array_len;
|
||||
|
||||
o.structs = st->structs;
|
||||
if (!parse_type_specifier(C, &o, sp))
|
||||
RETURN0;
|
||||
if (!parse_type_array_size(C, &o, &array_len))
|
||||
RETURN0;
|
||||
|
||||
do {
|
||||
slang_atom a_name;
|
||||
@@ -408,12 +425,12 @@ parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
RETURN0;
|
||||
}
|
||||
a_name = parse_identifier(C);
|
||||
if (_slang_locate_variable(st->fields, a_name, GL_FALSE)) {
|
||||
if (_slang_variable_locate(st->fields, a_name, GL_FALSE)) {
|
||||
slang_info_log_error(C->L, "duplicate field '%s'", (char *) a_name);
|
||||
RETURN0;
|
||||
}
|
||||
|
||||
if (!parse_struct_field_var(C, &o, var, a_name, sp))
|
||||
if (!parse_struct_field_var(C, &o, var, a_name, sp, array_len))
|
||||
RETURN0;
|
||||
}
|
||||
while (*C->I++ != FIELD_NONE);
|
||||
@@ -748,6 +765,31 @@ parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define TYPE_SPECIFIER_NONARRAY 0
|
||||
#define TYPE_SPECIFIER_ARRAY 1
|
||||
|
||||
static int
|
||||
parse_type_array_size(slang_parse_ctx *C,
|
||||
slang_output_ctx *O,
|
||||
GLint *array_len)
|
||||
{
|
||||
GLuint size;
|
||||
|
||||
switch (*C->I++) {
|
||||
case TYPE_SPECIFIER_NONARRAY:
|
||||
*array_len = -1; /* -1 = not an array */
|
||||
break;
|
||||
case TYPE_SPECIFIER_ARRAY:
|
||||
if (!parse_array_len(C, O, &size))
|
||||
RETURN0;
|
||||
*array_len = (GLint) size;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
RETURN0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define PRECISION_DEFAULT 0
|
||||
#define PRECISION_LOW 1
|
||||
@@ -777,36 +819,6 @@ parse_type_precision(slang_parse_ctx *C,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define TYPE_ARRAY_SIZE 220
|
||||
#define TYPE_NO_ARRAY_SIZE 221
|
||||
|
||||
|
||||
/*
|
||||
* Parse array size (if present) in something like "uniform float [6] var;".
|
||||
*/
|
||||
static int
|
||||
parse_type_array_size(slang_parse_ctx *C, slang_output_ctx * O,
|
||||
GLint *size)
|
||||
{
|
||||
GLint arr = *C->I++;
|
||||
GLuint sz;
|
||||
|
||||
switch (arr) {
|
||||
case TYPE_ARRAY_SIZE:
|
||||
if (!parse_array_len(C, O, &sz))
|
||||
RETURN0;
|
||||
*size = sz;
|
||||
return 1;
|
||||
case TYPE_NO_ARRAY_SIZE:
|
||||
*size = -1; /* -1 = not an array */
|
||||
return 1;
|
||||
default:
|
||||
assert(0);
|
||||
RETURN0;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
slang_fully_specified_type * type)
|
||||
@@ -877,6 +889,11 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
RETURN0;
|
||||
}
|
||||
|
||||
if (type->array_len >= 0) {
|
||||
/* convert type to array type (ex: convert "int" to "array of int" */
|
||||
promote_type_to_array(C, type, type->array_len);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -978,8 +995,12 @@ static int
|
||||
parse_statement(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
slang_operation * oper)
|
||||
{
|
||||
int op;
|
||||
|
||||
oper->locals->outer_scope = O->vars;
|
||||
switch (*C->I++) {
|
||||
|
||||
op = *C->I++;
|
||||
switch (op) {
|
||||
case OP_BLOCK_BEGIN_NO_NEW_SCOPE:
|
||||
/* parse child statements, do not create new variable scope */
|
||||
oper->type = SLANG_OPER_BLOCK_NO_NEW_SCOPE;
|
||||
@@ -1132,6 +1153,7 @@ parse_statement(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("Unexpected operation %d\n", op);
|
||||
RETURN0;
|
||||
}
|
||||
return 1;
|
||||
@@ -1179,6 +1201,9 @@ is_constructor_name(const char *name, slang_atom a_name,
|
||||
return slang_struct_scope_find(structs, a_name, 1) != NULL;
|
||||
}
|
||||
|
||||
#define FUNCTION_CALL_NONARRAY 0
|
||||
#define FUNCTION_CALL_ARRAY 1
|
||||
|
||||
static int
|
||||
parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
slang_operation * oper)
|
||||
@@ -1419,23 +1444,73 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
#endif
|
||||
break;
|
||||
case OP_CALL:
|
||||
op->type = SLANG_OPER_CALL;
|
||||
op->a_id = parse_identifier(C);
|
||||
if (op->a_id == SLANG_ATOM_NULL)
|
||||
RETURN0;
|
||||
while (*C->I != OP_END)
|
||||
if (!parse_child_operation(C, O, op, 0))
|
||||
RETURN0;
|
||||
C->I++;
|
||||
{
|
||||
GLboolean array_constructor = GL_FALSE;
|
||||
GLint array_constructor_size;
|
||||
|
||||
if (!C->parsing_builtin
|
||||
&& !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) {
|
||||
const char *id;
|
||||
|
||||
id = slang_atom_pool_id(C->atoms, op->a_id);
|
||||
if (!is_constructor_name(id, op->a_id, O->structs)) {
|
||||
slang_info_log_error(C->L, "%s: undeclared function name.", id);
|
||||
op->type = SLANG_OPER_CALL;
|
||||
op->a_id = parse_identifier(C);
|
||||
if (op->a_id == SLANG_ATOM_NULL)
|
||||
RETURN0;
|
||||
switch (*C->I++) {
|
||||
case FUNCTION_CALL_NONARRAY:
|
||||
/* Nothing to do. */
|
||||
break;
|
||||
case FUNCTION_CALL_ARRAY:
|
||||
/* Calling an array constructor. For example:
|
||||
* float[3](1.1, 2.2, 3.3);
|
||||
*/
|
||||
if (!O->allow_array_types) {
|
||||
slang_info_log_error(C->L,
|
||||
"array constructors not allowed "
|
||||
"in this GLSL version");
|
||||
RETURN0;
|
||||
}
|
||||
else {
|
||||
array_constructor = GL_TRUE;
|
||||
/* parse the array constructor size */
|
||||
slang_operation array_size;
|
||||
slang_operation_construct(&array_size);
|
||||
if (!parse_expression(C, O, &array_size)) {
|
||||
slang_operation_destruct(&array_size);
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (array_size.type != SLANG_OPER_LITERAL_INT) {
|
||||
slang_info_log_error(C->L,
|
||||
"constructor array size is not an integer");
|
||||
slang_operation_destruct(&array_size);
|
||||
RETURN0;
|
||||
}
|
||||
array_constructor_size = (int) array_size.literal[0];
|
||||
op->array_constructor = GL_TRUE;
|
||||
slang_operation_destruct(&array_size);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
RETURN0;
|
||||
}
|
||||
while (*C->I != OP_END)
|
||||
if (!parse_child_operation(C, O, op, 0))
|
||||
RETURN0;
|
||||
C->I++;
|
||||
|
||||
if (array_constructor &&
|
||||
array_constructor_size != op->num_children) {
|
||||
slang_info_log_error(C->L, "number of parameters to array"
|
||||
" constructor does not match array size");
|
||||
RETURN0;
|
||||
}
|
||||
|
||||
if (!C->parsing_builtin
|
||||
&& !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) {
|
||||
const char *id;
|
||||
|
||||
id = slang_atom_pool_id(C->atoms, op->a_id);
|
||||
if (!is_constructor_name(id, op->a_id, O->structs)) {
|
||||
slang_info_log_error(C->L, "%s: undeclared function name.", id);
|
||||
RETURN0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1528,34 +1603,59 @@ parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
/* parse parameter's type specifier and name */
|
||||
if (!parse_type_specifier(C, O, ¶m->type.specifier))
|
||||
RETURN0;
|
||||
if (!parse_type_array_size(C, O, ¶m->type.array_len))
|
||||
RETURN0;
|
||||
param->a_name = parse_identifier(C);
|
||||
if (param->a_name == SLANG_ATOM_NULL)
|
||||
RETURN0;
|
||||
|
||||
/* first-class array
|
||||
*/
|
||||
if (param->type.array_len >= 0) {
|
||||
slang_type_specifier p;
|
||||
|
||||
slang_type_specifier_ctr(&p);
|
||||
if (!slang_type_specifier_copy(&p, ¶m->type.specifier)) {
|
||||
slang_type_specifier_dtr(&p);
|
||||
RETURN0;
|
||||
}
|
||||
if (!convert_to_array(C, param, &p)) {
|
||||
slang_type_specifier_dtr(&p);
|
||||
RETURN0;
|
||||
}
|
||||
slang_type_specifier_dtr(&p);
|
||||
param->array_len = param->type.array_len;
|
||||
}
|
||||
|
||||
/* if the parameter is an array, parse its size (the size must be
|
||||
* explicitly defined
|
||||
*/
|
||||
if (*C->I++ == PARAMETER_ARRAY_PRESENT) {
|
||||
slang_type_specifier p;
|
||||
|
||||
if (param->type.array_len >= 0) {
|
||||
slang_info_log_error(C->L, "multi-dimensional arrays not allowed");
|
||||
RETURN0;
|
||||
}
|
||||
slang_type_specifier_ctr(&p);
|
||||
if (!slang_type_specifier_copy(&p, ¶m->type.specifier)) {
|
||||
slang_type_specifier_dtr(&p);
|
||||
return GL_FALSE;
|
||||
RETURN0;
|
||||
}
|
||||
if (!convert_to_array(C, param, &p)) {
|
||||
slang_type_specifier_dtr(&p);
|
||||
return GL_FALSE;
|
||||
RETURN0;
|
||||
}
|
||||
slang_type_specifier_dtr(&p);
|
||||
if (!parse_array_len(C, O, ¶m->array_len))
|
||||
return GL_FALSE;
|
||||
RETURN0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* calculate the parameter size */
|
||||
if (!calculate_var_size(C, O, param))
|
||||
return GL_FALSE;
|
||||
|
||||
RETURN0;
|
||||
#endif
|
||||
/* TODO: allocate the local address here? */
|
||||
return 1;
|
||||
}
|
||||
@@ -1858,7 +1958,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
a_name = parse_identifier(C);
|
||||
|
||||
/* check if name is already in this scope */
|
||||
if (_slang_locate_variable(O->vars, a_name, GL_FALSE)) {
|
||||
if (_slang_variable_locate(O->vars, a_name, GL_FALSE)) {
|
||||
slang_info_log_error(C->L,
|
||||
"declaration of '%s' conflicts with previous declaration",
|
||||
(char *) a_name);
|
||||
@@ -1889,8 +1989,15 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
break;
|
||||
case VARIABLE_INITIALIZER:
|
||||
/* initialized variable - copy the specifier and parse the expression */
|
||||
if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
|
||||
RETURN0;
|
||||
if (type->array_len >= 0) {
|
||||
/* The type was something like "float[4]" */
|
||||
convert_to_array(C, var, &type->specifier);
|
||||
var->array_len = type->array_len;
|
||||
}
|
||||
else {
|
||||
if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
|
||||
RETURN0;
|
||||
}
|
||||
var->initializer =
|
||||
(slang_operation *) _slang_alloc(sizeof(slang_operation));
|
||||
if (var->initializer == NULL) {
|
||||
@@ -1908,12 +2015,20 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
break;
|
||||
case VARIABLE_ARRAY_UNKNOWN:
|
||||
/* unsized array - mark it as array and copy the specifier to
|
||||
the array element
|
||||
*/
|
||||
* the array element
|
||||
*/
|
||||
if (type->array_len >= 0) {
|
||||
slang_info_log_error(C->L, "multi-dimensional arrays not allowed");
|
||||
RETURN0;
|
||||
}
|
||||
if (!convert_to_array(C, var, &type->specifier))
|
||||
return GL_FALSE;
|
||||
break;
|
||||
case VARIABLE_ARRAY_EXPLICIT:
|
||||
if (type->array_len >= 0) {
|
||||
slang_info_log_error(C->L, "multi-dimensional arrays not allowed");
|
||||
RETURN0;
|
||||
}
|
||||
if (!convert_to_array(C, var, &type->specifier))
|
||||
return GL_FALSE;
|
||||
if (!parse_array_len(C, O, &var->array_len))
|
||||
@@ -1923,23 +2038,12 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
|
||||
RETURN0;
|
||||
}
|
||||
|
||||
if (type->array_len >= 0) {
|
||||
/* The type was something like "float[4]" */
|
||||
if (var->array_len != 0) {
|
||||
slang_info_log_error(C->L, "multi-dimensional arrays not allowed");
|
||||
RETURN0;
|
||||
}
|
||||
convert_to_array(C, var, &type->specifier);
|
||||
var->array_len = type->array_len;
|
||||
}
|
||||
|
||||
/* allocate global address space for a variable with a known size */
|
||||
if (C->global_scope
|
||||
&& !(var->type.specifier.type == SLANG_SPEC_ARRAY
|
||||
&& var->array_len == 0)) {
|
||||
if (!calculate_var_size(C, O, var))
|
||||
return GL_FALSE;
|
||||
var->address = slang_var_pool_alloc(O->global_pool, var->size);
|
||||
}
|
||||
|
||||
/* emit code for global var decl */
|
||||
@@ -2072,10 +2176,8 @@ parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition,
|
||||
}
|
||||
|
||||
/* destroy the existing function declaration and replace it
|
||||
* with the new one, remember to save the fixup table
|
||||
* with the new one
|
||||
*/
|
||||
parsed_func.fixups = found_func->fixups;
|
||||
slang_fixup_table_init(&found_func->fixups);
|
||||
slang_function_destruct(found_func);
|
||||
*found_func = parsed_func;
|
||||
}
|
||||
@@ -2241,7 +2343,6 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
|
||||
o.funs = &unit->funs;
|
||||
o.structs = &unit->structs;
|
||||
o.vars = &unit->vars;
|
||||
o.global_pool = &unit->object->varpool;
|
||||
o.program = shader ? shader->Program : NULL;
|
||||
o.vartable = _slang_new_var_table(maxRegs);
|
||||
_slang_push_var_table(o.vartable);
|
||||
|
||||
@@ -37,6 +37,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct slang_name_space_
|
||||
{
|
||||
struct slang_function_scope_ *funcs;
|
||||
struct slang_struct_scope_ *structs;
|
||||
struct slang_variable_scope_ *vars;
|
||||
} slang_name_space;
|
||||
|
||||
typedef enum slang_unit_type_
|
||||
{
|
||||
SLANG_UNIT_FRAGMENT_SHADER,
|
||||
@@ -46,12 +53,6 @@ typedef enum slang_unit_type_
|
||||
} slang_unit_type;
|
||||
|
||||
|
||||
typedef struct slang_var_pool_
|
||||
{
|
||||
GLuint next_addr;
|
||||
} slang_var_pool;
|
||||
|
||||
|
||||
typedef struct slang_code_unit_
|
||||
{
|
||||
slang_variable_scope vars;
|
||||
@@ -79,7 +80,6 @@ typedef struct slang_code_object_
|
||||
{
|
||||
slang_code_unit builtin[SLANG_BUILTIN_TOTAL];
|
||||
slang_code_unit unit;
|
||||
slang_var_pool varpool;
|
||||
slang_atom_pool atompool;
|
||||
} slang_code_object;
|
||||
|
||||
|
||||
@@ -32,42 +32,6 @@
|
||||
#include "slang_compile.h"
|
||||
#include "slang_mem.h"
|
||||
|
||||
/* slang_fixup_table */
|
||||
|
||||
void
|
||||
slang_fixup_table_init(slang_fixup_table * fix)
|
||||
{
|
||||
fix->table = NULL;
|
||||
fix->count = 0;
|
||||
}
|
||||
|
||||
void
|
||||
slang_fixup_table_free(slang_fixup_table * fix)
|
||||
{
|
||||
_slang_free(fix->table);
|
||||
slang_fixup_table_init(fix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new fixup address to the table.
|
||||
*/
|
||||
GLboolean
|
||||
slang_fixup_save(slang_fixup_table *fixups, GLuint address)
|
||||
{
|
||||
fixups->table = (GLuint *)
|
||||
_slang_realloc(fixups->table,
|
||||
fixups->count * sizeof(GLuint),
|
||||
(fixups->count + 1) * sizeof(GLuint));
|
||||
if (fixups->table == NULL)
|
||||
return GL_FALSE;
|
||||
fixups->table[fixups->count] = address;
|
||||
fixups->count++;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* slang_function */
|
||||
|
||||
int
|
||||
slang_function_construct(slang_function * func)
|
||||
@@ -86,8 +50,6 @@ slang_function_construct(slang_function * func)
|
||||
_slang_variable_scope_ctr(func->parameters);
|
||||
func->param_count = 0;
|
||||
func->body = NULL;
|
||||
func->address = ~0;
|
||||
slang_fixup_table_init(&func->fixups);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -101,9 +63,22 @@ slang_function_destruct(slang_function * func)
|
||||
slang_operation_destruct(func->body);
|
||||
_slang_free(func->body);
|
||||
}
|
||||
slang_fixup_table_free(&func->fixups);
|
||||
}
|
||||
|
||||
|
||||
slang_function *
|
||||
slang_function_new(slang_function_kind kind)
|
||||
{
|
||||
slang_function *fun = (slang_function *)
|
||||
_slang_alloc(sizeof(slang_function));
|
||||
if (fun) {
|
||||
slang_function_construct(fun);
|
||||
fun->kind = kind;
|
||||
}
|
||||
return fun;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* slang_function_scope
|
||||
*/
|
||||
@@ -214,3 +189,74 @@ slang_function_scope_find(slang_function_scope * funcs, slang_function * fun,
|
||||
return slang_function_scope_find(funcs->outer_scope, fun, 1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lookup a function according to name and parameter count/types.
|
||||
*/
|
||||
slang_function *
|
||||
_slang_function_locate(const slang_function_scope * funcs, slang_atom a_name,
|
||||
slang_operation * args, GLuint num_args,
|
||||
const slang_name_space * space, slang_atom_pool * atoms,
|
||||
slang_info_log *log, GLboolean *error)
|
||||
{
|
||||
slang_typeinfo arg_ti[100];
|
||||
GLuint i;
|
||||
|
||||
*error = GL_FALSE;
|
||||
|
||||
/* determine type of each argument */
|
||||
assert(num_args < 100);
|
||||
for (i = 0; i < num_args; i++) {
|
||||
if (!slang_typeinfo_construct(&arg_ti[i]))
|
||||
return NULL;
|
||||
if (!_slang_typeof_operation(&args[i], space, &arg_ti[i], atoms, log)) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* loop over function scopes */
|
||||
while (funcs) {
|
||||
|
||||
/* look for function with matching name and argument/param types */
|
||||
for (i = 0; i < funcs->num_functions; i++) {
|
||||
slang_function *f = &funcs->functions[i];
|
||||
const GLuint haveRetValue = _slang_function_has_return_value(f);
|
||||
GLuint j;
|
||||
|
||||
if (a_name != f->header.a_name)
|
||||
continue;
|
||||
if (f->param_count - haveRetValue != num_args)
|
||||
continue;
|
||||
|
||||
/* compare parameter / argument types */
|
||||
for (j = 0; j < num_args; j++) {
|
||||
if (!slang_type_specifier_compatible(&arg_ti[j].spec,
|
||||
&f->parameters->variables[j]->type.specifier)) {
|
||||
/* param/arg types don't match */
|
||||
break;
|
||||
}
|
||||
|
||||
/* "out" and "inout" formal parameter requires the actual
|
||||
* argument to be an l-value.
|
||||
*/
|
||||
if (!arg_ti[j].can_be_referenced &&
|
||||
(f->parameters->variables[j]->type.qualifier == SLANG_QUAL_OUT ||
|
||||
f->parameters->variables[j]->type.qualifier == SLANG_QUAL_INOUT)) {
|
||||
/* param is not an lvalue! */
|
||||
*error = GL_TRUE;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == num_args) {
|
||||
/* name and args match! */
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
funcs = funcs->outer_scope;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#define SLANG_COMPILE_FUNCTION_H
|
||||
|
||||
|
||||
struct slang_code_unit_;
|
||||
|
||||
/**
|
||||
* Types of functions.
|
||||
*/
|
||||
@@ -39,21 +37,6 @@ typedef enum slang_function_kind_
|
||||
} slang_function_kind;
|
||||
|
||||
|
||||
/**
|
||||
* When we need to fill in addresses which we won't know until the future,
|
||||
* we keep track of them with a fix-up table.
|
||||
*/
|
||||
typedef struct slang_fixup_table_
|
||||
{
|
||||
GLuint *table; /**< array[count] of addresses */
|
||||
GLuint count;
|
||||
} slang_fixup_table;
|
||||
|
||||
extern void slang_fixup_table_init(slang_fixup_table *);
|
||||
extern void slang_fixup_table_free(slang_fixup_table *);
|
||||
extern GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address);
|
||||
|
||||
|
||||
/**
|
||||
* Description of a compiled shader function.
|
||||
*/
|
||||
@@ -64,12 +47,14 @@ typedef struct slang_function_
|
||||
slang_variable_scope *parameters; /**< formal parameters AND local vars */
|
||||
unsigned int param_count; /**< number of formal params (no locals) */
|
||||
slang_operation *body; /**< The instruction tree */
|
||||
unsigned int address; /**< Address of this func in memory */
|
||||
slang_fixup_table fixups; /**< Mem locations which need func's address */
|
||||
} slang_function;
|
||||
|
||||
extern int slang_function_construct(slang_function *);
|
||||
extern void slang_function_destruct(slang_function *);
|
||||
extern slang_function *slang_function_new(slang_function_kind kind);
|
||||
|
||||
extern GLboolean
|
||||
_slang_function_has_return_value(const slang_function *fun);
|
||||
|
||||
|
||||
/**
|
||||
@@ -89,13 +74,19 @@ _slang_function_scope_ctr(slang_function_scope *);
|
||||
extern void
|
||||
slang_function_scope_destruct(slang_function_scope *);
|
||||
|
||||
extern GLboolean
|
||||
_slang_function_has_return_value(const slang_function *fun);
|
||||
|
||||
extern int
|
||||
slang_function_scope_find_by_name(slang_function_scope *, slang_atom, int);
|
||||
|
||||
extern slang_function *
|
||||
slang_function_scope_find(slang_function_scope *, slang_function *, int);
|
||||
|
||||
extern struct slang_function_ *
|
||||
_slang_function_locate(const struct slang_function_scope_ *funcs,
|
||||
slang_atom name, struct slang_operation_ *params,
|
||||
GLuint num_params,
|
||||
const struct slang_name_space_ *space,
|
||||
slang_atom_pool *atoms, slang_info_log *log,
|
||||
GLboolean *error);
|
||||
|
||||
|
||||
#endif /* SLANG_COMPILE_FUNCTION_H */
|
||||
|
||||
@@ -44,6 +44,7 @@ slang_operation_construct(slang_operation * oper)
|
||||
oper->num_children = 0;
|
||||
oper->literal[0] = 0.0;
|
||||
oper->literal_size = 1;
|
||||
oper->array_constructor = GL_FALSE;
|
||||
oper->a_id = SLANG_ATOM_NULL;
|
||||
oper->locals = _slang_variable_scope_new(NULL);
|
||||
if (oper->locals == NULL)
|
||||
@@ -90,7 +91,7 @@ slang_replace_scope(slang_operation *oper,
|
||||
if (oper->type == SLANG_OPER_VARIABLE_DECL) {
|
||||
/* search/replace in the initializer */
|
||||
slang_variable *var;
|
||||
var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE);
|
||||
var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE);
|
||||
if (var && var->initializer) {
|
||||
slang_replace_scope(var->initializer, oldScope, newScope);
|
||||
}
|
||||
|
||||
@@ -121,6 +121,12 @@ typedef struct slang_operation_
|
||||
struct slang_function_ *fun; /**< If type == SLANG_OPER_CALL */
|
||||
struct slang_variable_ *var; /**< If type == slang_oper_identier */
|
||||
struct slang_label_ *label; /**< If type == SLANG_OPER_LABEL */
|
||||
/** If type==SLANG_OPER_CALL and we're calling an array constructor,
|
||||
* for which there's no real function, we need to have a flag to
|
||||
* indicate such. num_children indicates number of elements.
|
||||
*/
|
||||
GLboolean array_constructor;
|
||||
double x;
|
||||
} slang_operation;
|
||||
|
||||
|
||||
|
||||
@@ -33,108 +33,6 @@
|
||||
#include "slang_mem.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
slang_type_specifier_type type;
|
||||
} type_specifier_type_name;
|
||||
|
||||
static const type_specifier_type_name type_specifier_type_names[] = {
|
||||
{"void", SLANG_SPEC_VOID},
|
||||
{"bool", SLANG_SPEC_BOOL},
|
||||
{"bvec2", SLANG_SPEC_BVEC2},
|
||||
{"bvec3", SLANG_SPEC_BVEC3},
|
||||
{"bvec4", SLANG_SPEC_BVEC4},
|
||||
{"int", SLANG_SPEC_INT},
|
||||
{"ivec2", SLANG_SPEC_IVEC2},
|
||||
{"ivec3", SLANG_SPEC_IVEC3},
|
||||
{"ivec4", SLANG_SPEC_IVEC4},
|
||||
{"float", SLANG_SPEC_FLOAT},
|
||||
{"vec2", SLANG_SPEC_VEC2},
|
||||
{"vec3", SLANG_SPEC_VEC3},
|
||||
{"vec4", SLANG_SPEC_VEC4},
|
||||
{"mat2", SLANG_SPEC_MAT2},
|
||||
{"mat3", SLANG_SPEC_MAT3},
|
||||
{"mat4", SLANG_SPEC_MAT4},
|
||||
{"mat2x3", SLANG_SPEC_MAT23},
|
||||
{"mat3x2", SLANG_SPEC_MAT32},
|
||||
{"mat2x4", SLANG_SPEC_MAT24},
|
||||
{"mat4x2", SLANG_SPEC_MAT42},
|
||||
{"mat3x4", SLANG_SPEC_MAT34},
|
||||
{"mat4x3", SLANG_SPEC_MAT43},
|
||||
{"sampler1D", SLANG_SPEC_SAMPLER1D},
|
||||
{"sampler2D", SLANG_SPEC_SAMPLER2D},
|
||||
{"sampler3D", SLANG_SPEC_SAMPLER3D},
|
||||
{"samplerCube", SLANG_SPEC_SAMPLERCUBE},
|
||||
{"sampler1DShadow", SLANG_SPEC_SAMPLER1DSHADOW},
|
||||
{"sampler2DShadow", SLANG_SPEC_SAMPLER2DSHADOW},
|
||||
{"sampler2DRect", SLANG_SPEC_SAMPLER2DRECT},
|
||||
{"sampler2DRectShadow", SLANG_SPEC_SAMPLER2DRECTSHADOW},
|
||||
{NULL, SLANG_SPEC_VOID}
|
||||
};
|
||||
|
||||
slang_type_specifier_type
|
||||
slang_type_specifier_type_from_string(const char *name)
|
||||
{
|
||||
const type_specifier_type_name *p = type_specifier_type_names;
|
||||
while (p->name != NULL) {
|
||||
if (slang_string_compare(p->name, name) == 0)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
return p->type;
|
||||
}
|
||||
|
||||
const char *
|
||||
slang_type_specifier_type_to_string(slang_type_specifier_type type)
|
||||
{
|
||||
const type_specifier_type_name *p = type_specifier_type_names;
|
||||
while (p->name != NULL) {
|
||||
if (p->type == type)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
return p->name;
|
||||
}
|
||||
|
||||
/* slang_fully_specified_type */
|
||||
|
||||
int
|
||||
slang_fully_specified_type_construct(slang_fully_specified_type * type)
|
||||
{
|
||||
type->qualifier = SLANG_QUAL_NONE;
|
||||
slang_type_specifier_ctr(&type->specifier);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
slang_fully_specified_type_destruct(slang_fully_specified_type * type)
|
||||
{
|
||||
slang_type_specifier_dtr(&type->specifier);
|
||||
}
|
||||
|
||||
int
|
||||
slang_fully_specified_type_copy(slang_fully_specified_type * x,
|
||||
const slang_fully_specified_type * y)
|
||||
{
|
||||
slang_fully_specified_type z;
|
||||
|
||||
if (!slang_fully_specified_type_construct(&z))
|
||||
return 0;
|
||||
z.qualifier = y->qualifier;
|
||||
z.precision = y->precision;
|
||||
z.variant = y->variant;
|
||||
z.centroid = y->centroid;
|
||||
if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) {
|
||||
slang_fully_specified_type_destruct(&z);
|
||||
return 0;
|
||||
}
|
||||
slang_fully_specified_type_destruct(x);
|
||||
*x = z;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static slang_variable *
|
||||
slang_variable_new(void)
|
||||
{
|
||||
@@ -266,7 +164,6 @@ slang_variable_construct(slang_variable * var)
|
||||
var->a_name = SLANG_ATOM_NULL;
|
||||
var->array_len = 0;
|
||||
var->initializer = NULL;
|
||||
var->address = ~0;
|
||||
var->size = 0;
|
||||
var->isTemp = GL_FALSE;
|
||||
var->store = NULL;
|
||||
@@ -321,7 +218,6 @@ slang_variable_copy(slang_variable * x, const slang_variable * y)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
z.address = y->address;
|
||||
z.size = y->size;
|
||||
slang_variable_destruct(x);
|
||||
*x = z;
|
||||
@@ -334,7 +230,7 @@ slang_variable_copy(slang_variable * x, const slang_variable * y)
|
||||
* \param all if true, search parent scopes too.
|
||||
*/
|
||||
slang_variable *
|
||||
_slang_locate_variable(const slang_variable_scope * scope,
|
||||
_slang_variable_locate(const slang_variable_scope * scope,
|
||||
const slang_atom a_name, GLboolean all)
|
||||
{
|
||||
while (scope) {
|
||||
|
||||
@@ -25,79 +25,10 @@
|
||||
#ifndef SLANG_COMPILE_VARIABLE_H
|
||||
#define SLANG_COMPILE_VARIABLE_H
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
struct slang_ir_storage_;
|
||||
|
||||
|
||||
typedef enum slang_type_variant_
|
||||
{
|
||||
SLANG_VARIANT, /* the default */
|
||||
SLANG_INVARIANT /* indicates the "invariant" keyword */
|
||||
} slang_type_variant;
|
||||
|
||||
|
||||
typedef enum slang_type_centroid_
|
||||
{
|
||||
SLANG_CENTER, /* the default */
|
||||
SLANG_CENTROID /* indicates the "centroid" keyword */
|
||||
} slang_type_centroid;
|
||||
|
||||
|
||||
typedef enum slang_type_qualifier_
|
||||
{
|
||||
SLANG_QUAL_NONE,
|
||||
SLANG_QUAL_CONST,
|
||||
SLANG_QUAL_ATTRIBUTE,
|
||||
SLANG_QUAL_VARYING,
|
||||
SLANG_QUAL_UNIFORM,
|
||||
SLANG_QUAL_OUT,
|
||||
SLANG_QUAL_INOUT,
|
||||
SLANG_QUAL_FIXEDOUTPUT, /* internal */
|
||||
SLANG_QUAL_FIXEDINPUT /* internal */
|
||||
} slang_type_qualifier;
|
||||
|
||||
extern slang_type_specifier_type
|
||||
slang_type_specifier_type_from_string(const char *);
|
||||
|
||||
extern const char *
|
||||
slang_type_specifier_type_to_string(slang_type_specifier_type);
|
||||
|
||||
|
||||
|
||||
typedef enum slang_type_precision_
|
||||
{
|
||||
SLANG_PREC_DEFAULT,
|
||||
SLANG_PREC_LOW,
|
||||
SLANG_PREC_MEDIUM,
|
||||
SLANG_PREC_HIGH
|
||||
} slang_type_precision;
|
||||
|
||||
|
||||
typedef struct slang_fully_specified_type_
|
||||
{
|
||||
slang_type_qualifier qualifier;
|
||||
slang_type_specifier specifier;
|
||||
slang_type_precision precision;
|
||||
slang_type_variant variant;
|
||||
slang_type_centroid centroid;
|
||||
GLint array_len; /**< -1 if not an array type */
|
||||
} slang_fully_specified_type;
|
||||
|
||||
extern int
|
||||
slang_fully_specified_type_construct(slang_fully_specified_type *);
|
||||
|
||||
extern void
|
||||
slang_fully_specified_type_destruct(slang_fully_specified_type *);
|
||||
|
||||
extern int
|
||||
slang_fully_specified_type_copy(slang_fully_specified_type *,
|
||||
const slang_fully_specified_type *);
|
||||
|
||||
|
||||
/**
|
||||
* A shading language program variable.
|
||||
*/
|
||||
@@ -107,7 +38,6 @@ typedef struct slang_variable_
|
||||
slang_atom a_name; /**< The variable's name (char *) */
|
||||
GLuint array_len; /**< only if type == SLANG_SPEC_ARRAy */
|
||||
struct slang_operation_ *initializer; /**< Optional initializer code */
|
||||
GLuint address; /**< Storage location */
|
||||
GLuint size; /**< Variable's size in bytes */
|
||||
GLboolean isTemp; /**< a named temporary (__resultTmp) */
|
||||
GLboolean declared; /**< for debug */
|
||||
@@ -152,12 +82,8 @@ extern int
|
||||
slang_variable_copy(slang_variable *, const slang_variable *);
|
||||
|
||||
extern slang_variable *
|
||||
_slang_locate_variable(const slang_variable_scope *, const slang_atom a_name,
|
||||
_slang_variable_locate(const slang_variable_scope *, const slang_atom a_name,
|
||||
GLboolean all);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SLANG_COMPILE_VARIABLE_H */
|
||||
|
||||
@@ -278,7 +278,7 @@ slang_print_tree(const slang_operation *op, int indent)
|
||||
assert(op->num_children == 0 || op->num_children == 1);
|
||||
{
|
||||
slang_variable *v;
|
||||
v = _slang_locate_variable(op->locals, op->a_id, GL_TRUE);
|
||||
v = _slang_variable_locate(op->locals, op->a_id, GL_TRUE);
|
||||
if (v) {
|
||||
const slang_variable_scope *scope;
|
||||
spaces(indent);
|
||||
@@ -636,7 +636,7 @@ slang_print_tree(const slang_operation *op, int indent)
|
||||
case SLANG_OPER_CALL:
|
||||
#if 0
|
||||
slang_function *fun
|
||||
= _slang_locate_function(A->space.funcs, oper->a_id,
|
||||
= _slang_function_locate(A->space.funcs, oper->a_id,
|
||||
oper->children,
|
||||
oper->num_children, &A->space, A->atoms);
|
||||
#endif
|
||||
|
||||
@@ -135,7 +135,7 @@ _slang_simplify(slang_operation *oper,
|
||||
/* look for user-defined constant */
|
||||
{
|
||||
slang_variable *var;
|
||||
var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE);
|
||||
var = _slang_variable_locate(oper->locals, oper->a_id, GL_TRUE);
|
||||
if (var) {
|
||||
if (var->type.qualifier == SLANG_QUAL_CONST &&
|
||||
var->initializer &&
|
||||
@@ -380,7 +380,7 @@ _slang_cast_func_params(slang_operation *callOper, const slang_function *fun,
|
||||
/* Get type of arg[i] */
|
||||
if (!slang_typeinfo_construct(&argType))
|
||||
return GL_FALSE;
|
||||
if (!_slang_typeof_operation_(&callOper->children[i], space,
|
||||
if (!_slang_typeof_operation(&callOper->children[i], space,
|
||||
&argType, atoms, log)) {
|
||||
slang_typeinfo_destruct(&argType);
|
||||
return GL_FALSE;
|
||||
@@ -464,7 +464,7 @@ _slang_adapt_call(slang_operation *callOper, const slang_function *fun,
|
||||
/* Get type of arg[i] */
|
||||
if (!slang_typeinfo_construct(&argType))
|
||||
return GL_FALSE;
|
||||
if (!_slang_typeof_operation_(&callOper->children[i], space,
|
||||
if (!_slang_typeof_operation(&callOper->children[i], space,
|
||||
&argType, atoms, log)) {
|
||||
slang_typeinfo_destruct(&argType);
|
||||
return GL_FALSE;
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#define SLANG_STORAGE_H
|
||||
|
||||
#include "slang_compile.h"
|
||||
#include "slang_typeinfo.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -130,7 +130,7 @@ _slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz)
|
||||
* do not have duplicated fields. Returns GL_TRUE if this is a
|
||||
* swizzle mask. Returns GL_FALSE otherwise
|
||||
*/
|
||||
GLboolean
|
||||
static GLboolean
|
||||
_slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows)
|
||||
{
|
||||
GLuint i, c = 0;
|
||||
@@ -154,7 +154,7 @@ _slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows)
|
||||
* Combines (multiplies) two swizzles to form single swizzle.
|
||||
* Example: "vec.wzyx.yx" --> "vec.zw".
|
||||
*/
|
||||
GLvoid
|
||||
static void
|
||||
_slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left,
|
||||
const slang_swizzle * right)
|
||||
{
|
||||
@@ -166,6 +166,110 @@ _slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left,
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
slang_type_specifier_type type;
|
||||
} type_specifier_type_name;
|
||||
|
||||
static const type_specifier_type_name type_specifier_type_names[] = {
|
||||
{"void", SLANG_SPEC_VOID},
|
||||
{"bool", SLANG_SPEC_BOOL},
|
||||
{"bvec2", SLANG_SPEC_BVEC2},
|
||||
{"bvec3", SLANG_SPEC_BVEC3},
|
||||
{"bvec4", SLANG_SPEC_BVEC4},
|
||||
{"int", SLANG_SPEC_INT},
|
||||
{"ivec2", SLANG_SPEC_IVEC2},
|
||||
{"ivec3", SLANG_SPEC_IVEC3},
|
||||
{"ivec4", SLANG_SPEC_IVEC4},
|
||||
{"float", SLANG_SPEC_FLOAT},
|
||||
{"vec2", SLANG_SPEC_VEC2},
|
||||
{"vec3", SLANG_SPEC_VEC3},
|
||||
{"vec4", SLANG_SPEC_VEC4},
|
||||
{"mat2", SLANG_SPEC_MAT2},
|
||||
{"mat3", SLANG_SPEC_MAT3},
|
||||
{"mat4", SLANG_SPEC_MAT4},
|
||||
{"mat2x3", SLANG_SPEC_MAT23},
|
||||
{"mat3x2", SLANG_SPEC_MAT32},
|
||||
{"mat2x4", SLANG_SPEC_MAT24},
|
||||
{"mat4x2", SLANG_SPEC_MAT42},
|
||||
{"mat3x4", SLANG_SPEC_MAT34},
|
||||
{"mat4x3", SLANG_SPEC_MAT43},
|
||||
{"sampler1D", SLANG_SPEC_SAMPLER1D},
|
||||
{"sampler2D", SLANG_SPEC_SAMPLER2D},
|
||||
{"sampler3D", SLANG_SPEC_SAMPLER3D},
|
||||
{"samplerCube", SLANG_SPEC_SAMPLERCUBE},
|
||||
{"sampler1DShadow", SLANG_SPEC_SAMPLER1DSHADOW},
|
||||
{"sampler2DShadow", SLANG_SPEC_SAMPLER2DSHADOW},
|
||||
{"sampler2DRect", SLANG_SPEC_SAMPLER2DRECT},
|
||||
{"sampler2DRectShadow", SLANG_SPEC_SAMPLER2DRECTSHADOW},
|
||||
{NULL, SLANG_SPEC_VOID}
|
||||
};
|
||||
|
||||
slang_type_specifier_type
|
||||
slang_type_specifier_type_from_string(const char *name)
|
||||
{
|
||||
const type_specifier_type_name *p = type_specifier_type_names;
|
||||
while (p->name != NULL) {
|
||||
if (slang_string_compare(p->name, name) == 0)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
return p->type;
|
||||
}
|
||||
|
||||
const char *
|
||||
slang_type_specifier_type_to_string(slang_type_specifier_type type)
|
||||
{
|
||||
const type_specifier_type_name *p = type_specifier_type_names;
|
||||
while (p->name != NULL) {
|
||||
if (p->type == type)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
return p->name;
|
||||
}
|
||||
|
||||
/* slang_fully_specified_type */
|
||||
|
||||
int
|
||||
slang_fully_specified_type_construct(slang_fully_specified_type * type)
|
||||
{
|
||||
type->qualifier = SLANG_QUAL_NONE;
|
||||
slang_type_specifier_ctr(&type->specifier);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
slang_fully_specified_type_destruct(slang_fully_specified_type * type)
|
||||
{
|
||||
slang_type_specifier_dtr(&type->specifier);
|
||||
}
|
||||
|
||||
int
|
||||
slang_fully_specified_type_copy(slang_fully_specified_type * x,
|
||||
const slang_fully_specified_type * y)
|
||||
{
|
||||
slang_fully_specified_type z;
|
||||
|
||||
if (!slang_fully_specified_type_construct(&z))
|
||||
return 0;
|
||||
z.qualifier = y->qualifier;
|
||||
z.precision = y->precision;
|
||||
z.variant = y->variant;
|
||||
z.centroid = y->centroid;
|
||||
z.array_len = y->array_len;
|
||||
if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) {
|
||||
slang_fully_specified_type_destruct(&z);
|
||||
return 0;
|
||||
}
|
||||
slang_fully_specified_type_destruct(x);
|
||||
*x = z;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
GLvoid
|
||||
slang_type_specifier_ctr(slang_type_specifier * self)
|
||||
{
|
||||
@@ -187,6 +291,21 @@ slang_type_specifier_dtr(slang_type_specifier * self)
|
||||
}
|
||||
}
|
||||
|
||||
slang_type_specifier *
|
||||
slang_type_specifier_new(slang_type_specifier_type type,
|
||||
struct slang_struct_ *_struct,
|
||||
struct slang_type_specifier_ *_array)
|
||||
{
|
||||
slang_type_specifier *spec =
|
||||
(slang_type_specifier *) _slang_alloc(sizeof(slang_type_specifier));
|
||||
if (spec) {
|
||||
spec->type = type;
|
||||
spec->_struct = _struct;
|
||||
spec->_array = _array;
|
||||
}
|
||||
return spec;
|
||||
}
|
||||
|
||||
GLboolean
|
||||
slang_type_specifier_copy(slang_type_specifier * x,
|
||||
const slang_type_specifier * y)
|
||||
@@ -250,7 +369,7 @@ slang_type_specifier_equal(const slang_type_specifier * x,
|
||||
/**
|
||||
* As above, but allow float/int casting.
|
||||
*/
|
||||
static GLboolean
|
||||
GLboolean
|
||||
slang_type_specifier_compatible(const slang_type_specifier * x,
|
||||
const slang_type_specifier * y)
|
||||
{
|
||||
@@ -307,7 +426,7 @@ _slang_typeof_function(slang_atom a_name,
|
||||
{
|
||||
GLboolean error;
|
||||
|
||||
*funFound = _slang_locate_function(space->funcs, a_name, params,
|
||||
*funFound = _slang_function_locate(space->funcs, a_name, params,
|
||||
num_params, space, atoms, log, &error);
|
||||
if (error)
|
||||
return GL_FALSE;
|
||||
@@ -362,14 +481,6 @@ typeof_math_call(const char *name, slang_operation *call,
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean
|
||||
_slang_typeof_operation(const slang_assemble_ctx * A,
|
||||
slang_operation * op,
|
||||
slang_typeinfo * ti)
|
||||
{
|
||||
return _slang_typeof_operation_(op, &A->space, ti, A->atoms, A->log);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine the return type of an operation.
|
||||
@@ -380,7 +491,7 @@ _slang_typeof_operation(const slang_assemble_ctx * A,
|
||||
* \return GL_TRUE for success, GL_FALSE if failure
|
||||
*/
|
||||
GLboolean
|
||||
_slang_typeof_operation_(slang_operation * op,
|
||||
_slang_typeof_operation(slang_operation * op,
|
||||
const slang_name_space * space,
|
||||
slang_typeinfo * ti,
|
||||
slang_atom_pool * atoms,
|
||||
@@ -412,7 +523,7 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
case SLANG_OPER_DIVASSIGN:
|
||||
case SLANG_OPER_PREINCREMENT:
|
||||
case SLANG_OPER_PREDECREMENT:
|
||||
if (!_slang_typeof_operation_(op->children, space, ti, atoms, log))
|
||||
if (!_slang_typeof_operation(op->children, space, ti, atoms, log))
|
||||
return GL_FALSE;
|
||||
break;
|
||||
case SLANG_OPER_LITERAL_BOOL:
|
||||
@@ -479,7 +590,7 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
case SLANG_OPER_VARIABLE_DECL:
|
||||
{
|
||||
slang_variable *var;
|
||||
var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE);
|
||||
var = _slang_variable_locate(op->locals, op->a_id, GL_TRUE);
|
||||
if (!var) {
|
||||
slang_info_log_error(log, "undefined variable '%s'",
|
||||
(char *) op->a_id);
|
||||
@@ -490,12 +601,20 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
return GL_FALSE;
|
||||
}
|
||||
ti->can_be_referenced = GL_TRUE;
|
||||
ti->array_len = var->array_len;
|
||||
if (var->type.specifier.type == SLANG_SPEC_ARRAY &&
|
||||
var->type.array_len >= 1) {
|
||||
/* the datatype is an array, ex: float[3] x; */
|
||||
ti->array_len = var->type.array_len;
|
||||
}
|
||||
else {
|
||||
/* the variable is an array, ex: float x[3]; */
|
||||
ti->array_len = var->array_len;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SLANG_OPER_SEQUENCE:
|
||||
/* TODO: check [0] and [1] if they match */
|
||||
if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms, log)) {
|
||||
if (!_slang_typeof_operation(&op->children[1], space, ti, atoms, log)) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
ti->can_be_referenced = GL_FALSE;
|
||||
@@ -509,7 +628,7 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
/*case SLANG_OPER_ANDASSIGN: */
|
||||
case SLANG_OPER_SELECT:
|
||||
/* TODO: check [1] and [2] if they match */
|
||||
if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms, log)) {
|
||||
if (!_slang_typeof_operation(&op->children[1], space, ti, atoms, log)) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
ti->can_be_referenced = GL_FALSE;
|
||||
@@ -542,7 +661,7 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
break;
|
||||
/*case SLANG_OPER_MODULUS: */
|
||||
case SLANG_OPER_PLUS:
|
||||
if (!_slang_typeof_operation_(op->children, space, ti, atoms, log))
|
||||
if (!_slang_typeof_operation(op->children, space, ti, atoms, log))
|
||||
return GL_FALSE;
|
||||
ti->can_be_referenced = GL_FALSE;
|
||||
ti->is_swizzled = GL_FALSE;
|
||||
@@ -559,7 +678,7 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
|
||||
if (!slang_typeinfo_construct(&_ti))
|
||||
return GL_FALSE;
|
||||
if (!_slang_typeof_operation_(op->children, space, &_ti, atoms, log)) {
|
||||
if (!_slang_typeof_operation(op->children, space, &_ti, atoms, log)) {
|
||||
slang_typeinfo_destruct(&_ti);
|
||||
return GL_FALSE;
|
||||
}
|
||||
@@ -583,7 +702,18 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
}
|
||||
break;
|
||||
case SLANG_OPER_CALL:
|
||||
if (op->fun) {
|
||||
if (op->array_constructor) {
|
||||
/* build array typeinfo */
|
||||
ti->spec.type = SLANG_SPEC_ARRAY;
|
||||
ti->spec._array = (slang_type_specifier *)
|
||||
_slang_alloc(sizeof(slang_type_specifier));
|
||||
slang_type_specifier_ctr(ti->spec._array);
|
||||
|
||||
ti->spec._array->type =
|
||||
slang_type_specifier_type_from_string((char *) op->a_id);
|
||||
ti->array_len = op->num_children;
|
||||
}
|
||||
else if (op->fun) {
|
||||
/* we've resolved this call before */
|
||||
slang_type_specifier_copy(&ti->spec, &op->fun->header.type.specifier);
|
||||
}
|
||||
@@ -642,14 +772,14 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
|
||||
if (!slang_typeinfo_construct(&_ti))
|
||||
return GL_FALSE;
|
||||
if (!_slang_typeof_operation_(op->children, space, &_ti, atoms, log)) {
|
||||
if (!_slang_typeof_operation(op->children, space, &_ti, atoms, log)) {
|
||||
slang_typeinfo_destruct(&_ti);
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (_ti.spec.type == SLANG_SPEC_STRUCT) {
|
||||
slang_variable *field;
|
||||
|
||||
field = _slang_locate_variable(_ti.spec._struct->fields, op->a_id,
|
||||
field = _slang_variable_locate(_ti.spec._struct->fields, op->a_id,
|
||||
GL_FALSE);
|
||||
if (field == NULL) {
|
||||
slang_typeinfo_destruct(&_ti);
|
||||
@@ -748,7 +878,7 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
break;
|
||||
case SLANG_OPER_POSTINCREMENT:
|
||||
case SLANG_OPER_POSTDECREMENT:
|
||||
if (!_slang_typeof_operation_(op->children, space, ti, atoms, log))
|
||||
if (!_slang_typeof_operation(op->children, space, ti, atoms, log))
|
||||
return GL_FALSE;
|
||||
ti->can_be_referenced = GL_FALSE;
|
||||
ti->is_swizzled = GL_FALSE;
|
||||
@@ -761,77 +891,6 @@ _slang_typeof_operation_(slang_operation * op,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lookup a function according to name and parameter count/types.
|
||||
*/
|
||||
slang_function *
|
||||
_slang_locate_function(const slang_function_scope * funcs, slang_atom a_name,
|
||||
slang_operation * args, GLuint num_args,
|
||||
const slang_name_space * space, slang_atom_pool * atoms,
|
||||
slang_info_log *log, GLboolean *error)
|
||||
{
|
||||
slang_typeinfo arg_ti[100];
|
||||
GLuint i;
|
||||
|
||||
*error = GL_FALSE;
|
||||
|
||||
/* determine type of each argument */
|
||||
assert(num_args < 100);
|
||||
for (i = 0; i < num_args; i++) {
|
||||
if (!slang_typeinfo_construct(&arg_ti[i]))
|
||||
return NULL;
|
||||
if (!_slang_typeof_operation_(&args[i], space, &arg_ti[i], atoms, log)) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* loop over function scopes */
|
||||
while (funcs) {
|
||||
|
||||
/* look for function with matching name and argument/param types */
|
||||
for (i = 0; i < funcs->num_functions; i++) {
|
||||
slang_function *f = &funcs->functions[i];
|
||||
const GLuint haveRetValue = _slang_function_has_return_value(f);
|
||||
GLuint j;
|
||||
|
||||
if (a_name != f->header.a_name)
|
||||
continue;
|
||||
if (f->param_count - haveRetValue != num_args)
|
||||
continue;
|
||||
|
||||
/* compare parameter / argument types */
|
||||
for (j = 0; j < num_args; j++) {
|
||||
if (!slang_type_specifier_compatible(&arg_ti[j].spec,
|
||||
&f->parameters->variables[j]->type.specifier)) {
|
||||
/* param/arg types don't match */
|
||||
break;
|
||||
}
|
||||
|
||||
/* "out" and "inout" formal parameter requires the actual
|
||||
* argument to be an l-value.
|
||||
*/
|
||||
if (!arg_ti[j].can_be_referenced &&
|
||||
(f->parameters->variables[j]->type.qualifier == SLANG_QUAL_OUT ||
|
||||
f->parameters->variables[j]->type.qualifier == SLANG_QUAL_INOUT)) {
|
||||
/* param is not an lvalue! */
|
||||
*error = GL_TRUE;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == num_args) {
|
||||
/* name and args match! */
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
funcs = funcs->outer_scope;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if a type is a matrix.
|
||||
* \return GL_TRUE if is a matrix, GL_FALSE otherwise.
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
|
||||
struct slang_operation_;
|
||||
|
||||
struct slang_name_space_;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Holds complete information about vector swizzle - the <swizzle>
|
||||
@@ -47,45 +50,45 @@ typedef struct slang_swizzle_
|
||||
GLuint swizzle[4];
|
||||
} slang_swizzle;
|
||||
|
||||
typedef struct slang_name_space_
|
||||
{
|
||||
struct slang_function_scope_ *funcs;
|
||||
struct slang_struct_scope_ *structs;
|
||||
struct slang_variable_scope_ *vars;
|
||||
} slang_name_space;
|
||||
|
||||
|
||||
typedef struct slang_assemble_ctx_
|
||||
{
|
||||
slang_atom_pool *atoms;
|
||||
slang_name_space space;
|
||||
struct gl_program *program;
|
||||
slang_var_table *vartable;
|
||||
slang_info_log *log;
|
||||
struct slang_label_ *curFuncEndLabel;
|
||||
struct slang_ir_node_ *CurLoop;
|
||||
struct slang_function_ *CurFunction;
|
||||
} slang_assemble_ctx;
|
||||
|
||||
|
||||
extern struct slang_function_ *
|
||||
_slang_locate_function(const struct slang_function_scope_ *funcs,
|
||||
slang_atom name, struct slang_operation_ *params,
|
||||
GLuint num_params,
|
||||
const slang_name_space *space,
|
||||
slang_atom_pool *atoms, slang_info_log *log,
|
||||
GLboolean *error);
|
||||
|
||||
|
||||
extern GLboolean
|
||||
_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz);
|
||||
|
||||
extern GLboolean
|
||||
_slang_is_swizzle_mask(const slang_swizzle *swz, GLuint rows);
|
||||
|
||||
extern GLvoid
|
||||
_slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *,
|
||||
const slang_swizzle *);
|
||||
typedef enum slang_type_variant_
|
||||
{
|
||||
SLANG_VARIANT, /* the default */
|
||||
SLANG_INVARIANT /* indicates the "invariant" keyword */
|
||||
} slang_type_variant;
|
||||
|
||||
|
||||
typedef enum slang_type_centroid_
|
||||
{
|
||||
SLANG_CENTER, /* the default */
|
||||
SLANG_CENTROID /* indicates the "centroid" keyword */
|
||||
} slang_type_centroid;
|
||||
|
||||
|
||||
typedef enum slang_type_qualifier_
|
||||
{
|
||||
SLANG_QUAL_NONE,
|
||||
SLANG_QUAL_CONST,
|
||||
SLANG_QUAL_ATTRIBUTE,
|
||||
SLANG_QUAL_VARYING,
|
||||
SLANG_QUAL_UNIFORM,
|
||||
SLANG_QUAL_OUT,
|
||||
SLANG_QUAL_INOUT,
|
||||
SLANG_QUAL_FIXEDOUTPUT, /* internal */
|
||||
SLANG_QUAL_FIXEDINPUT /* internal */
|
||||
} slang_type_qualifier;
|
||||
|
||||
|
||||
typedef enum slang_type_precision_
|
||||
{
|
||||
SLANG_PREC_DEFAULT,
|
||||
SLANG_PREC_LOW,
|
||||
SLANG_PREC_MEDIUM,
|
||||
SLANG_PREC_HIGH
|
||||
} slang_type_precision;
|
||||
|
||||
|
||||
/**
|
||||
@@ -128,14 +131,21 @@ typedef enum slang_type_specifier_type_
|
||||
} slang_type_specifier_type;
|
||||
|
||||
|
||||
extern slang_type_specifier_type
|
||||
slang_type_specifier_type_from_string(const char *);
|
||||
|
||||
extern const char *
|
||||
slang_type_specifier_type_to_string(slang_type_specifier_type);
|
||||
|
||||
|
||||
/**
|
||||
* Describes more sophisticated types, like structs and arrays.
|
||||
*/
|
||||
typedef struct slang_type_specifier_
|
||||
{
|
||||
slang_type_specifier_type type;
|
||||
struct slang_struct_ *_struct; /**< used if type == spec_struct */
|
||||
struct slang_type_specifier_ *_array; /**< used if type == spec_array */
|
||||
struct slang_struct_ *_struct; /**< if type == SLANG_SPEC_STRUCT */
|
||||
struct slang_type_specifier_ *_array; /**< if type == SLANG_SPEC_ARRAY */
|
||||
} slang_type_specifier;
|
||||
|
||||
|
||||
@@ -145,6 +155,12 @@ slang_type_specifier_ctr(slang_type_specifier *);
|
||||
extern GLvoid
|
||||
slang_type_specifier_dtr(slang_type_specifier *);
|
||||
|
||||
extern slang_type_specifier *
|
||||
slang_type_specifier_new(slang_type_specifier_type type,
|
||||
struct slang_struct_ *_struct,
|
||||
struct slang_type_specifier_ *_array);
|
||||
|
||||
|
||||
extern GLboolean
|
||||
slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *);
|
||||
|
||||
@@ -153,6 +169,33 @@ slang_type_specifier_equal(const slang_type_specifier *,
|
||||
const slang_type_specifier *);
|
||||
|
||||
|
||||
extern GLboolean
|
||||
slang_type_specifier_compatible(const slang_type_specifier * x,
|
||||
const slang_type_specifier * y);
|
||||
|
||||
|
||||
typedef struct slang_fully_specified_type_
|
||||
{
|
||||
slang_type_qualifier qualifier;
|
||||
slang_type_specifier specifier;
|
||||
slang_type_precision precision;
|
||||
slang_type_variant variant;
|
||||
slang_type_centroid centroid;
|
||||
GLint array_len; /**< -1 if not an array type */
|
||||
} slang_fully_specified_type;
|
||||
|
||||
extern int
|
||||
slang_fully_specified_type_construct(slang_fully_specified_type *);
|
||||
|
||||
extern void
|
||||
slang_fully_specified_type_destruct(slang_fully_specified_type *);
|
||||
|
||||
extern int
|
||||
slang_fully_specified_type_copy(slang_fully_specified_type *,
|
||||
const slang_fully_specified_type *);
|
||||
|
||||
|
||||
|
||||
typedef struct slang_typeinfo_
|
||||
{
|
||||
GLboolean can_be_referenced;
|
||||
@@ -169,19 +212,9 @@ extern GLvoid
|
||||
slang_typeinfo_destruct(slang_typeinfo *);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves type information about an operation.
|
||||
* Returns GL_TRUE on success.
|
||||
* Returns GL_FALSE otherwise.
|
||||
*/
|
||||
extern GLboolean
|
||||
_slang_typeof_operation(const slang_assemble_ctx *,
|
||||
struct slang_operation_ *,
|
||||
slang_typeinfo *);
|
||||
|
||||
extern GLboolean
|
||||
_slang_typeof_operation_(struct slang_operation_ *,
|
||||
const slang_name_space *,
|
||||
_slang_typeof_operation(struct slang_operation_ *,
|
||||
const struct slang_name_space_ *,
|
||||
slang_typeinfo *, slang_atom_pool *,
|
||||
slang_info_log *log);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user