diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-07 06:07:56 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-07 07:33:46 +0300 |
commit | 9f5a27c5be0a0f6a9f36360e618dcf5254ae689e (patch) | |
tree | fc1a5ba0614e96eb1d9aca93e34549264d88c80e /source/blender/gpu | |
parent | fe20aa1edf2515d64863476641f10ce7ad65b947 (diff) |
GPU: Remove EXT and add assert
Some drivers accept shaders with only vertex stage, but some just silently
fails.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index bae7520803d..5aec6b17218 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -357,12 +357,15 @@ GPUShader *GPU_shader_create_ex( UNUSED_VARS(shname); #endif + /* At least a vertex shader and a fragment shader are required. */ + BLI_assert((fragcode != NULL) && (vertexcode != NULL)); + if (vertexcode) shader->vertex = glCreateShader(GL_VERTEX_SHADER); if (fragcode) shader->fragment = glCreateShader(GL_FRAGMENT_SHADER); if (geocode) - shader->geometry = glCreateShader(GL_GEOMETRY_SHADER_EXT); + shader->geometry = glCreateShader(GL_GEOMETRY_SHADER); shader->program = glCreateProgram(); |