diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-08-20 16:05:24 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-08-20 16:05:24 +0300 |
commit | 3fd89df6e7f3cecb108bb604100218e1bea85c63 (patch) | |
tree | bd28e24aa4084a2baceadee05a3357382d949fe0 /source/blender | |
parent | f9791155e4821d235e864be40a9c39d58e7e5f8a (diff) |
Fix T45491 not all GPUs support those extensions, use check for
opensubdiv to enable.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index d9112acfdaa..93966eb28ec 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -1550,16 +1550,19 @@ static const char *gpu_shader_version(bool use_opensubdiv) } -static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH]) +static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH], bool use_opensubdiv) { #ifdef WITH_OPENSUBDIV - strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n" - "#extension GL_ARB_gpu_shader5 : enable\n" - "#extension GL_ARB_explicit_attrib_location : require\n"); + if (use_opensubdiv) { + strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n" + "#extension GL_ARB_gpu_shader5 : enable\n" + "#extension GL_ARB_explicit_attrib_location : require\n"); + } #else /* need this extension for high quality bump mapping */ if (GPU_bicubic_bump_support()) strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n"); + (void) use_opensubdiv; #endif if (GPU_geometry_shader_support()) @@ -1719,7 +1722,7 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, const } gpu_shader_standard_defines(use_opensubdiv, standard_defines); - gpu_shader_standard_extensions(standard_extensions); + gpu_shader_standard_extensions(standard_extensions, use_opensubdiv); if (vertexcode) { const char *source[5]; |