Merge branch 'origin' into glsl-compiler-1
[mesa.git] / src / mesa / main / shaders.c
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.5.3
4 *
5 * Copyright (C) 2004-2007 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
26 #include "glheader.h"
27 #include "context.h"
28 #include "shaders.h"
29
30
31 /**
32 * These are basically just wrappers/adaptors for calling the
33 * ctx->Driver.foobar() GLSL-related functions.
34 *
35 * Things are biased toward the OpenGL 2.0 functions rather than the
36 * ARB extensions (i.e. the ARB functions are layered on the 2.0 functions).
37 *
38 * The general idea here is to allow enough modularity such that a
39 * completely different GLSL implemenation can be plugged in and co-exist
40 * with Mesa's native GLSL code.
41 */
42
43
44
45 void GLAPIENTRY
46 _mesa_AttachObjectARB(GLhandleARB program, GLhandleARB shader)
47 {
48 GET_CURRENT_CONTEXT(ctx);
49 ctx->Driver.AttachShader(ctx, program, shader);
50 }
51
52
53 void GLAPIENTRY
54 _mesa_AttachShader(GLuint program, GLuint shader)
55 {
56 GET_CURRENT_CONTEXT(ctx);
57 ctx->Driver.AttachShader(ctx, program, shader);
58 }
59
60
61 void GLAPIENTRY
62 _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
63 const GLcharARB *name)
64 {
65 GET_CURRENT_CONTEXT(ctx);
66 ctx->Driver.BindAttribLocation(ctx, program, index, name);
67 }
68
69
70 void GLAPIENTRY
71 _mesa_CompileShaderARB(GLhandleARB shaderObj)
72 {
73 GET_CURRENT_CONTEXT(ctx);
74 ctx->Driver.CompileShader(ctx, shaderObj);
75 }
76
77
78 GLuint GLAPIENTRY
79 _mesa_CreateShader(GLenum type)
80 {
81 GET_CURRENT_CONTEXT(ctx);
82 return ctx->Driver.CreateShader(ctx, type);
83 }
84
85
86 GLhandleARB APIENTRY
87 _mesa_CreateShaderObjectARB(GLenum type)
88 {
89 GET_CURRENT_CONTEXT(ctx);
90 return ctx->Driver.CreateShader(ctx, type);
91 }
92
93
94 GLuint GLAPIENTRY
95 _mesa_CreateProgram(void)
96 {
97 GET_CURRENT_CONTEXT(ctx);
98 return ctx->Driver.CreateProgram(ctx);
99 }
100
101
102 GLhandleARB APIENTRY
103 _mesa_CreateProgramObjectARB(void)
104 {
105 GET_CURRENT_CONTEXT(ctx);
106 return ctx->Driver.CreateProgram(ctx);
107 }
108
109
110 void GLAPIENTRY
111 _mesa_DeleteObjectARB(GLhandleARB obj)
112 {
113 GET_CURRENT_CONTEXT(ctx);
114 if (ctx->Driver.IsProgram(ctx, obj)) {
115 ctx->Driver.DeleteProgram2(ctx, obj);
116 }
117 else if (ctx->Driver.IsShader(ctx, obj)) {
118 ctx->Driver.DeleteShader(ctx, obj);
119 }
120 else {
121 /* error? */
122 }
123 }
124
125
126 void GLAPIENTRY
127 _mesa_DeleteProgram(GLuint name)
128 {
129 GET_CURRENT_CONTEXT(ctx);
130 ctx->Driver.DeleteProgram2(ctx, name);
131 }
132
133
134 void GLAPIENTRY
135 _mesa_DeleteShader(GLuint name)
136 {
137 GET_CURRENT_CONTEXT(ctx);
138 ctx->Driver.DeleteShader(ctx, name);
139 }
140
141
142 void GLAPIENTRY
143 _mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
144 {
145 GET_CURRENT_CONTEXT(ctx);
146 ctx->Driver.DetachShader(ctx, program, shader);
147 }
148
149
150 void GLAPIENTRY
151 _mesa_DetachShader(GLuint program, GLuint shader)
152 {
153 GET_CURRENT_CONTEXT(ctx);
154 ctx->Driver.DetachShader(ctx, program, shader);
155 }
156
157
158 void GLAPIENTRY
159 _mesa_GetActiveAttribARB(GLhandleARB program, GLuint index,
160 GLsizei maxLength, GLsizei * length, GLint * size,
161 GLenum * type, GLcharARB * name)
162 {
163 GET_CURRENT_CONTEXT(ctx);
164 ctx->Driver.GetActiveAttrib(ctx, program, index, maxLength, length, size,
165 type, name);
166 }
167
168
169 void GLAPIENTRY
170 _mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
171 GLsizei maxLength, GLsizei * length, GLint * size,
172 GLenum * type, GLcharARB * name)
173 {
174 GET_CURRENT_CONTEXT(ctx);
175 ctx->Driver.GetActiveUniform(ctx, program, index, maxLength, length, size,
176 type, name);
177 }
178
179
180 void GLAPIENTRY
181 _mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount,
182 GLsizei * count, GLhandleARB * obj)
183 {
184 GET_CURRENT_CONTEXT(ctx);
185 ctx->Driver.GetAttachedShaders(ctx, container, maxCount, count, obj);
186 }
187
188
189 void GLAPIENTRY
190 _mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
191 GLsizei *count, GLuint *obj)
192 {
193 GET_CURRENT_CONTEXT(ctx);
194 ctx->Driver.GetAttachedShaders(ctx, program, maxCount, count, obj);
195 }
196
197
198 GLint GLAPIENTRY
199 _mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
200 {
201 GET_CURRENT_CONTEXT(ctx);
202 return ctx->Driver.GetAttribLocation(ctx, program, name);
203 }
204
205
206 void GLAPIENTRY
207 _mesa_GetInfoLogARB(GLhandleARB object, GLsizei maxLength, GLsizei * length,
208 GLcharARB * infoLog)
209 {
210 GET_CURRENT_CONTEXT(ctx);
211 /* Implement in terms of GetProgramInfoLog, GetShaderInfoLog */
212 if (ctx->Driver.IsProgram(ctx, object)) {
213 ctx->Driver.GetProgramInfoLog(ctx, object, maxLength, length, infoLog);
214 }
215 else if (ctx->Driver.IsShader(ctx, object)) {
216 ctx->Driver.GetShaderInfoLog(ctx, object, maxLength, length, infoLog);
217 }
218 else {
219 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetInfoLogARB");
220 }
221 }
222
223
224 void GLAPIENTRY
225 _mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params)
226 {
227 GET_CURRENT_CONTEXT(ctx);
228 /* Implement in terms of GetProgramiv, GetShaderiv */
229 if (ctx->Driver.IsProgram(ctx, object)) {
230 ctx->Driver.GetProgramiv(ctx, object, pname, params);
231 }
232 else if (ctx->Driver.IsShader(ctx, object)) {
233 ctx->Driver.GetShaderiv(ctx, object, pname, params);
234 }
235 else {
236 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
237 }
238 }
239
240
241 void GLAPIENTRY
242 _mesa_GetObjectParameterfvARB(GLhandleARB object, GLenum pname,
243 GLfloat *params)
244 {
245 GLint iparams[1]; /* XXX is one element enough? */
246 _mesa_GetObjectParameterivARB(object, pname, iparams);
247 params[0] = (GLfloat) iparams[0];
248 }
249
250
251 void GLAPIENTRY
252 _mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params)
253 {
254 GET_CURRENT_CONTEXT(ctx);
255 ctx->Driver.GetProgramiv(ctx, program, pname, params);
256 }
257
258
259 void GLAPIENTRY
260 _mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
261 {
262 GET_CURRENT_CONTEXT(ctx);
263 ctx->Driver.GetShaderiv(ctx, shader, pname, params);
264 }
265
266
267 void GLAPIENTRY
268 _mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
269 GLsizei *length, GLchar *infoLog)
270 {
271 GET_CURRENT_CONTEXT(ctx);
272 ctx->Driver.GetProgramInfoLog(ctx, program, bufSize, length, infoLog);
273 }
274
275
276 void GLAPIENTRY
277 _mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
278 GLsizei *length, GLchar *infoLog)
279 {
280 GET_CURRENT_CONTEXT(ctx);
281 ctx->Driver.GetShaderInfoLog(ctx, shader, bufSize, length, infoLog);
282 }
283
284
285 void GLAPIENTRY
286 _mesa_GetShaderSourceARB(GLhandleARB shader, GLsizei maxLength,
287 GLsizei *length, GLcharARB *sourceOut)
288 {
289 GET_CURRENT_CONTEXT(ctx);
290 ctx->Driver.GetShaderSource(ctx, shader, maxLength, length, sourceOut);
291 }
292
293
294 void GLAPIENTRY
295 _mesa_GetUniformfvARB(GLhandleARB program, GLint location, GLfloat * params)
296 {
297 GET_CURRENT_CONTEXT(ctx);
298 ctx->Driver.GetUniformfv(ctx, program, location, params);
299 }
300
301
302 void GLAPIENTRY
303 _mesa_GetUniformivARB(GLhandleARB program, GLint location, GLint * params)
304 {
305 GET_CURRENT_CONTEXT(ctx);
306 GLfloat fparams[16]; /* XXX is 16 enough? */
307 GLuint i;
308 ctx->Driver.GetUniformfv(ctx, program, location, fparams);
309 for (i = 0; i < 16; i++)
310 params[i] = (GLint) fparams[i]; /* XXX correct? */
311 }
312
313
314
315 #if 0
316 GLint APIENTRY
317 _mesa_GetUniformLocation(GLuint program, const GLcharARB *name)
318 {
319 GET_CURRENT_CONTEXT(ctx);
320 return ctx->Driver.GetUniformLocation(ctx, program, name);
321 }
322 #endif
323
324
325 GLhandleARB GLAPIENTRY
326 _mesa_GetHandleARB(GLenum pname)
327 {
328 GET_CURRENT_CONTEXT(ctx);
329 return ctx->Driver.GetHandle(ctx, pname);
330 }
331
332
333 GLint APIENTRY
334 _mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name)
335 {
336 GET_CURRENT_CONTEXT(ctx);
337 return ctx->Driver.GetUniformLocation(ctx, programObj, name);
338 }
339
340
341 GLboolean GLAPIENTRY
342 _mesa_IsProgram(GLuint name)
343 {
344 GET_CURRENT_CONTEXT(ctx);
345 return ctx->Driver.IsProgram(ctx, name);
346 }
347
348
349 GLboolean GLAPIENTRY
350 _mesa_IsShader(GLuint name)
351 {
352 GET_CURRENT_CONTEXT(ctx);
353 return ctx->Driver.IsShader(ctx, name);
354 }
355
356
357 void GLAPIENTRY
358 _mesa_LinkProgramARB(GLhandleARB programObj)
359 {
360 GET_CURRENT_CONTEXT(ctx);
361 ctx->Driver.LinkProgram(ctx, programObj);
362 }
363
364
365 /**
366 * Called via glShaderSource() and glShaderSourceARB() API functions.
367 * Basically, concatenate the source code strings into one long string
368 * and pass it to ctx->Driver.ShaderSource().
369 */
370 void GLAPIENTRY
371 _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
372 const GLcharARB ** string, const GLint * length)
373 {
374 GET_CURRENT_CONTEXT(ctx);
375 GLint *offsets;
376 GLsizei i;
377 GLcharARB *source;
378
379 if (string == NULL) {
380 _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
381 return;
382 }
383
384 /*
385 * This array holds offsets of where the appropriate string ends, thus the
386 * last element will be set to the total length of the source code.
387 */
388 offsets = (GLint *) _mesa_malloc(count * sizeof(GLint));
389 if (offsets == NULL) {
390 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
391 return;
392 }
393
394 for (i = 0; i < count; i++) {
395 if (string[i] == NULL) {
396 _mesa_free((GLvoid *) offsets);
397 _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB(null string)");
398 return;
399 }
400 if (length == NULL || length[i] < 0)
401 offsets[i] = _mesa_strlen(string[i]);
402 else
403 offsets[i] = length[i];
404 /* accumulate string lengths */
405 if (i > 0)
406 offsets[i] += offsets[i - 1];
407 }
408
409 source = (GLcharARB *) _mesa_malloc((offsets[count - 1] + 1) *
410 sizeof(GLcharARB));
411 if (source == NULL) {
412 _mesa_free((GLvoid *) offsets);
413 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
414 return;
415 }
416
417 for (i = 0; i < count; i++) {
418 GLint start = (i > 0) ? offsets[i - 1] : 0;
419 _mesa_memcpy(source + start, string[i],
420 (offsets[i] - start) * sizeof(GLcharARB));
421 }
422 source[offsets[count - 1]] = '\0';
423
424 ctx->Driver.ShaderSource(ctx, shaderObj, source);
425 }
426
427
428 void GLAPIENTRY
429 _mesa_Uniform1fARB(GLint location, GLfloat v0)
430 {
431 GET_CURRENT_CONTEXT(ctx);
432 ctx->Driver.Uniform(ctx, location, 1, &v0, GL_FLOAT);
433 }
434
435 void GLAPIENTRY
436 _mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1)
437 {
438 GET_CURRENT_CONTEXT(ctx);
439 GLfloat v[2];
440 v[0] = v0;
441 v[1] = v1;
442 ctx->Driver.Uniform(ctx, location, 1, v, GL_FLOAT_VEC2);
443 }
444
445 void GLAPIENTRY
446 _mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
447 {
448 GET_CURRENT_CONTEXT(ctx);
449 GLfloat v[3];
450 v[0] = v0;
451 v[1] = v1;
452 v[2] = v2;
453 ctx->Driver.Uniform(ctx, location, 1, v, GL_FLOAT_VEC3);
454 }
455
456 void GLAPIENTRY
457 _mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
458 GLfloat v3)
459 {
460 GET_CURRENT_CONTEXT(ctx);
461 GLfloat v[4];
462 v[0] = v0;
463 v[1] = v1;
464 v[2] = v2;
465 v[3] = v3;
466 ctx->Driver.Uniform(ctx, location, 1, v, GL_FLOAT_VEC4);
467 }
468
469 void GLAPIENTRY
470 _mesa_Uniform1iARB(GLint location, GLint v0)
471 {
472 GET_CURRENT_CONTEXT(ctx);
473 ctx->Driver.Uniform(ctx, location, 1, &v0, GL_INT);
474 }
475
476 void GLAPIENTRY
477 _mesa_Uniform2iARB(GLint location, GLint v0, GLint v1)
478 {
479 GET_CURRENT_CONTEXT(ctx);
480 GLint v[2];
481 v[0] = v0;
482 v[1] = v1;
483 ctx->Driver.Uniform(ctx, location, 1, v, GL_INT_VEC2);
484 }
485
486 void GLAPIENTRY
487 _mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2)
488 {
489 GET_CURRENT_CONTEXT(ctx);
490 GLint v[3];
491 v[0] = v0;
492 v[1] = v1;
493 v[2] = v2;
494 ctx->Driver.Uniform(ctx, location, 1, v, GL_INT_VEC3);
495 }
496
497 void GLAPIENTRY
498 _mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
499 {
500 GET_CURRENT_CONTEXT(ctx);
501 GLint v[4];
502 v[0] = v0;
503 v[1] = v1;
504 v[2] = v2;
505 v[3] = v3;
506 ctx->Driver.Uniform(ctx, location, 1, v, GL_INT_VEC4);
507 }
508
509 void GLAPIENTRY
510 _mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value)
511 {
512 GET_CURRENT_CONTEXT(ctx);
513 ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT);
514 }
515
516 void GLAPIENTRY
517 _mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value)
518 {
519 GET_CURRENT_CONTEXT(ctx);
520 ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT_VEC2);
521 }
522
523 void GLAPIENTRY
524 _mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value)
525 {
526 GET_CURRENT_CONTEXT(ctx);
527 ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT_VEC3);
528 }
529
530 void GLAPIENTRY
531 _mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value)
532 {
533 GET_CURRENT_CONTEXT(ctx);
534 ctx->Driver.Uniform(ctx, location, count, value, GL_FLOAT_VEC4);
535 }
536
537 void GLAPIENTRY
538 _mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value)
539 {
540 GET_CURRENT_CONTEXT(ctx);
541 ctx->Driver.Uniform(ctx, location, count, value, GL_INT);
542 }
543
544 void GLAPIENTRY
545 _mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value)
546 {
547 GET_CURRENT_CONTEXT(ctx);
548 ctx->Driver.Uniform(ctx, location, count, value, GL_INT_VEC2);
549 }
550
551 void GLAPIENTRY
552 _mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value)
553 {
554 GET_CURRENT_CONTEXT(ctx);
555 ctx->Driver.Uniform(ctx, location, count, value, GL_INT_VEC3);
556 }
557
558 void GLAPIENTRY
559 _mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value)
560 {
561 GET_CURRENT_CONTEXT(ctx);
562 ctx->Driver.Uniform(ctx, location, count, value, GL_INT_VEC4);
563 }
564
565
566 void GLAPIENTRY
567 _mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
568 const GLfloat * value)
569 {
570 GET_CURRENT_CONTEXT(ctx);
571 ctx->Driver.UniformMatrix(ctx, 2, 2, GL_FLOAT_MAT2,
572 location, count, transpose, value);
573 }
574
575 void GLAPIENTRY
576 _mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
577 const GLfloat * value)
578 {
579 GET_CURRENT_CONTEXT(ctx);
580 ctx->Driver.UniformMatrix(ctx, 3, 3, GL_FLOAT_MAT3,
581 location, count, transpose, value);
582 }
583
584 void GLAPIENTRY
585 _mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
586 const GLfloat * value)
587 {
588 GET_CURRENT_CONTEXT(ctx);
589 ctx->Driver.UniformMatrix(ctx, 4, 4, GL_FLOAT_MAT4,
590 location, count, transpose, value);
591 }
592
593
594 /**
595 * Non-square UniformMatrix are OpenGL 2.1
596 */
597 void GLAPIENTRY
598 _mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
599 const GLfloat *value)
600 {
601 GET_CURRENT_CONTEXT(ctx);
602 ctx->Driver.UniformMatrix(ctx, 2, 3, GL_FLOAT_MAT2x3,
603 location, count, transpose, value);
604 }
605
606 void GLAPIENTRY
607 _mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
608 const GLfloat *value)
609 {
610 GET_CURRENT_CONTEXT(ctx);
611 ctx->Driver.UniformMatrix(ctx, 3, 2, GL_FLOAT_MAT3x2,
612 location, count, transpose, value);
613 }
614
615 void GLAPIENTRY
616 _mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
617 const GLfloat *value)
618 {
619 GET_CURRENT_CONTEXT(ctx);
620 ctx->Driver.UniformMatrix(ctx, 2, 4, GL_FLOAT_MAT2x4,
621 location, count, transpose, value);
622 }
623
624 void GLAPIENTRY
625 _mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
626 const GLfloat *value)
627 {
628 GET_CURRENT_CONTEXT(ctx);
629 ctx->Driver.UniformMatrix(ctx, 4, 2, GL_FLOAT_MAT4x2,
630 location, count, transpose, value);
631 }
632
633 void GLAPIENTRY
634 _mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
635 const GLfloat *value)
636 {
637 GET_CURRENT_CONTEXT(ctx);
638 ctx->Driver.UniformMatrix(ctx, 3, 4, GL_FLOAT_MAT3x4,
639 location, count, transpose, value);
640 }
641
642 void GLAPIENTRY
643 _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
644 const GLfloat *value)
645 {
646 GET_CURRENT_CONTEXT(ctx);
647 ctx->Driver.UniformMatrix(ctx, 4, 3, GL_FLOAT_MAT4x3,
648 location, count, transpose, value);
649 }
650
651
652 void GLAPIENTRY
653 _mesa_UseProgramObjectARB(GLhandleARB program)
654 {
655 GET_CURRENT_CONTEXT(ctx);
656 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
657 ctx->Driver.UseProgram(ctx, program);
658 }
659
660
661 void GLAPIENTRY
662 _mesa_ValidateProgramARB(GLhandleARB program)
663 {
664 GET_CURRENT_CONTEXT(ctx);
665 ctx->Driver.ValidateProgram(ctx, program);
666 }
667