Add some initial uniform buffer related code

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 10 years ago
parent 916683ed2a
commit 5b59e6ba95

@ -0,0 +1,38 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2014 by authors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "driver_opengl.h"
#include "driver_opengl_uniform_buffer.h"
#include <nel/misc/debug.h>
namespace NL3D {
namespace NLDRIVERGL3 {
const char *GLSLHeaderUniformBuffer =
"#define NL_BUILTIN_CAMERA_BIND " NL_MACRO_TO_STR(NL_BUILTIN_CAMERA_BIND) "\n"
"#define NL_BUILTIN_MODEL_BIND " NL_MACRO_TO_STR(NL_BUILTIN_MODEL_BIND) "\n"
"#define NL_BUILTIN_MATERIAL_BIND " NL_MACRO_TO_STR(NL_BUILTIN_MATERIAL_BIND) "\n"
"#define NL_USER_ENV_BIND " NL_MACRO_TO_STR(NL_USER_ENV_BIND) "\n"
"#define NL_USER_VERTEX_PROGRAM_BIND " NL_MACRO_TO_STR(NL_USER_VERTEX_PROGRAM_BIND) "\n"
"#define NL_USER_GEOMETRY_PROGRAM_BIND " NL_MACRO_TO_STR(NL_USER_GEOMETRY_PROGRAM_BIND) "\n"
"#define NL_USER_PIXEL_PROGRAM_BIND " NL_MACRO_TO_STR(NL_USER_PIXEL_PROGRAM_BIND) "\n"
"#define NL_USER_MATERIAL_BIND " NL_MACRO_TO_STR(NL_USER_MATERIAL_BIND) "\n";
} // NLDRIVERGL3
} // NL3D
/* end of file */

@ -0,0 +1,43 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2014 by authors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef NL_DRIVER_OPENGL_UNIFORM_BUFFER_H
#define NL_DRIVER_OPENGL_UNIFORM_BUFFER_H
#include "nel/misc/types_nl.h"
namespace NL3D {
namespace NLDRIVERGL3 {
// NOTE: It is completely safe to reorder these indices.
// Always use the defines.
#define NL_BUILTIN_CAMERA_BIND 0 // Builtin uniform buffer bound by driver, set by camera transformation
#define NL_BUILTIN_MODEL_BIND 1 // Builtin uniform buffer bound by driver, set by model transformation
#define NL_BUILTIN_MATERIAL_BIND 2 // Builtin uniform buffer bound by material
#define NL_USER_ENV_BIND 3 // User-specified uniform buffer bound by user
#define NL_USER_VERTEX_PROGRAM_BIND 4 // User-specified uniform buffer bound by vertex program
#define NL_USER_GEOMETRY_PROGRAM_BIND 5 // User-specified uniform buffer bound by geometry program
#define NL_USER_PIXEL_PROGRAM_BIND 6 // User-specified uniform buffer bound by pixel program
#define NL_USER_MATERIAL_BIND 7 // User-specified uniform buffer bound by material
extern const char *GLSLHeaderUniformBuffer;
} // NLDRIVERGL3
} // NL3D
#endif // NL_DRIVER_OPENGL_UNIFORM_BUFFER_H
/* end of file */
Loading…
Cancel
Save