/usr/share/psychtoolbox-3/PsychOneliners/AssertGLSL.m is in psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | function AssertGLSL
% AssertGLSL
%
% Break and issue an error message if the given combination of graphics
% hardware and graphics hardware driver does not support the OpenGL Shading
% Language (GLSL). This command needs to be executed after opening an
% onscreen window, because it needs a valid OpenGL context to work.
%
% HISTORY
% 3/29/06 mk wrote it.
% 6/12/12 dn findstr is deprecated, changed to strfind
persistent alreadycalled;
global GL
if isempty(GL)
InitializeMatlabOpenGL([], [], 1);
end;
if isempty(alreadycalled)
alreadycalled=1;
else
return;
end;
try
extensions = glGetString(GL.EXTENSIONS);
catch %#ok<*CTCH>
error('AssertGLSL called before opening an Onscreen window! This will not work...');
end;
if isempty(extensions)
error('AssertGLSL called before opening an Onscreen window! This will not work...');
end;
if isempty(strfind(extensions, 'GL_ARB_shading_language')) || isempty(strfind(extensions, 'GL_ARB_shader_objects'))
Screen('CloseAll');
error('Sorry, this M-File cannot execute on your combination of graphics hardware and driver due to complete lack of GLSL support.');
end;
if isempty(strfind(extensions, 'GL_ARB_fragment_shader'))
fprintf('AssertGLSL: Warning! Your graphics hardware does not support fragment shaders. This will severely limit the use of GLSL.\n');
fprintf('AssertGLSL: Many image processing functions will fail with MOGL errors about unsupported functions.\n');
end;
|