mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
util: check for frag/vertShader=0 before attaching
This commit is contained in:
parent
26b5e92c30
commit
7d41f10605
1 changed files with 7 additions and 2 deletions
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
|
@ -106,8 +107,12 @@ LinkShaders(GLuint vertShader, GLuint fragShader)
|
|||
{
|
||||
GLuint program = glCreateProgram_func();
|
||||
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
assert(vertShader || fragShader);
|
||||
|
||||
if (fragShader)
|
||||
glAttachShader_func(program, fragShader);
|
||||
if (vertShader)
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
|
||||
/* check link */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue