mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
6.7 KiB
125 lines
6.7 KiB
|
8 years ago
|
#ifndef Magnum_GL_Implementation_ShaderProgramState_h
|
||
|
|
#define Magnum_GL_Implementation_ShaderProgramState_h
|
||
|
14 years ago
|
/*
|
||
|
|
This file is part of Magnum.
|
||
|
|
|
||
|
8 years ago
|
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
|
||
|
12 years ago
|
Vladimír Vondruš <mosra@centrum.cz>
|
||
|
13 years ago
|
|
||
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
|
copy of this software and associated documentation files (the "Software"),
|
||
|
|
to deal in the Software without restriction, including without limitation
|
||
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
||
|
|
Software is furnished to do so, subject to the following conditions:
|
||
|
|
|
||
|
|
The above copyright notice and this permission notice shall be included
|
||
|
|
in all copies or substantial portions of the Software.
|
||
|
|
|
||
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||
|
|
DEALINGS IN THE SOFTWARE.
|
||
|
14 years ago
|
*/
|
||
|
|
|
||
|
12 years ago
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
8 years ago
|
#include "Magnum/GL/GL.h"
|
||
|
|
#include "Magnum/GL/OpenGL.h"
|
||
|
10 years ago
|
#include "Magnum/Math/Vector3.h"
|
||
|
14 years ago
|
|
||
|
10 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
8 years ago
|
#include "Magnum/GL/AbstractShaderProgram.h"
|
||
|
11 years ago
|
#endif
|
||
|
|
|
||
|
14 years ago
|
namespace Magnum { namespace Implementation {
|
||
|
|
|
||
|
|
struct ShaderProgramState {
|
||
|
12 years ago
|
explicit ShaderProgramState(Context& context, std::vector<std::string>& extensions);
|
||
|
|
|
||
|
12 years ago
|
void reset();
|
||
|
|
|
||
|
10 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
|
void(AbstractShaderProgram::*transformFeedbackVaryingsImplementation)(Containers::ArrayView<const std::string>, AbstractShaderProgram::TransformFeedbackBufferMode);
|
||
|
|
#endif
|
||
|
|
|
||
|
12 years ago
|
void(AbstractShaderProgram::*uniform1fvImplementation)(GLint, GLsizei, const GLfloat*);
|
||
|
|
void(AbstractShaderProgram::*uniform2fvImplementation)(GLint, GLsizei, const Math::Vector<2, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniform3fvImplementation)(GLint, GLsizei, const Math::Vector<3, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniform4fvImplementation)(GLint, GLsizei, const Math::Vector<4, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniform1ivImplementation)(GLint, GLsizei, const GLint*);
|
||
|
|
void(AbstractShaderProgram::*uniform2ivImplementation)(GLint, GLsizei, const Math::Vector<2, GLint>*);
|
||
|
|
void(AbstractShaderProgram::*uniform3ivImplementation)(GLint, GLsizei, const Math::Vector<3, GLint>*);
|
||
|
|
void(AbstractShaderProgram::*uniform4ivImplementation)(GLint, GLsizei, const Math::Vector<4, GLint>*);
|
||
|
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
|
void(AbstractShaderProgram::*uniform1uivImplementation)(GLint, GLsizei, const GLuint*);
|
||
|
|
void(AbstractShaderProgram::*uniform2uivImplementation)(GLint, GLsizei, const Math::Vector<2, GLuint>*);
|
||
|
|
void(AbstractShaderProgram::*uniform3uivImplementation)(GLint, GLsizei, const Math::Vector<3, GLuint>*);
|
||
|
|
void(AbstractShaderProgram::*uniform4uivImplementation)(GLint, GLsizei, const Math::Vector<4, GLuint>*);
|
||
|
|
#endif
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
|
void(AbstractShaderProgram::*uniform1dvImplementation)(GLint, GLsizei, const GLdouble*);
|
||
|
|
void(AbstractShaderProgram::*uniform2dvImplementation)(GLint, GLsizei, const Math::Vector<2, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniform3dvImplementation)(GLint, GLsizei, const Math::Vector<3, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniform4dvImplementation)(GLint, GLsizei, const Math::Vector<4, GLdouble>*);
|
||
|
|
#endif
|
||
|
|
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix2fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<2, 2, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix3fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<3, 3, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix4fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<4, 4, GLfloat>*);
|
||
|
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix2x3fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<2, 3, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix3x2fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<3, 2, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix2x4fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<2, 4, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix4x2fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<4, 2, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix3x4fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<3, 4, GLfloat>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix4x3fvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<4, 3, GLfloat>*);
|
||
|
|
#endif
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix2dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<2, 2, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix3dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<3, 3, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix4dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<4, 4, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix2x3dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<2, 3, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix3x2dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<3, 2, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix2x4dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<2, 4, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix4x2dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<4, 2, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix3x4dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<3, 4, GLdouble>*);
|
||
|
|
void(AbstractShaderProgram::*uniformMatrix4x3dvImplementation)(GLint, GLsizei, const Math::RectangularMatrix<4, 3, GLdouble>*);
|
||
|
|
#endif
|
||
|
14 years ago
|
|
||
|
|
/* Currently used program */
|
||
|
|
GLuint current;
|
||
|
13 years ago
|
|
||
|
|
GLint maxVertexAttributes;
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
11 years ago
|
#ifndef MAGNUM_TARGET_WEBGL
|
||
|
13 years ago
|
GLint maxAtomicCounterBufferSize,
|
||
|
|
maxComputeSharedMemorySize,
|
||
|
|
maxComputeWorkGroupInvocations,
|
||
|
|
maxImageUnits,
|
||
|
|
maxCombinedShaderOutputResources,
|
||
|
11 years ago
|
maxUniformLocations;
|
||
|
10 years ago
|
Vector3i maxComputeWorkGroupCount,
|
||
|
|
maxComputeWorkGroupSize;
|
||
|
11 years ago
|
#endif
|
||
|
|
GLint minTexelOffset,
|
||
|
12 years ago
|
maxTexelOffset,
|
||
|
|
maxUniformBlockSize;
|
||
|
11 years ago
|
#ifndef MAGNUM_TARGET_WEBGL
|
||
|
13 years ago
|
GLint64 maxShaderStorageBlockSize;
|
||
|
|
#endif
|
||
|
11 years ago
|
#endif
|
||
|
13 years ago
|
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
|
GLint maxImageSamples;
|
||
|
13 years ago
|
#endif
|
||
|
14 years ago
|
};
|
||
|
|
|
||
|
|
}}
|
||
|
|
|
||
|
|
#endif
|