From 7384cdd10ac50ef74e20dd747209dde7062849bc Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 18 Aug 2013 02:44:34 +0200 Subject: [PATCH] Added offset enum. --HG-- branch : gsoc2013-dfighter --- .../OpenGL3/driver_glsl_shader_generator.cpp | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp index 3837741e2..04b622a69 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp @@ -27,6 +27,27 @@ namespace else return false; } + + enum AttribOffset + { + Position, + Weight, + Normal, + PrimaryColor, + SecondaryColor, + Fog, + PaletteSkin, + Empty, + TexCoord0, + TexCoord1, + TexCoord2, + TexCoord3, + TexCoord4, + TexCoord5, + TexCoord6, + TexCoord7, + NumOffsets + }; } namespace NL3D @@ -96,7 +117,7 @@ namespace NL3D ss << "uniform mat4 mvpMatrix;" << std::endl; ss << std::endl; - for( int i = 0; i < CVertexBuffer::NumValue; i++ ) + for( int i = Position; i < NumOffsets; i++ ) { if( hasFlag( vbFormat, vertexFlags[ i ] ) ) { @@ -111,7 +132,7 @@ namespace NL3D } ss << std::endl; - for( int i = 1; i < CVertexBuffer::NumValue; i++ ) + for( int i = Weight; i < NumOffsets; i++ ) { if( hasFlag( vbFormat, vertexFlags[ i ] ) ) { @@ -125,7 +146,7 @@ namespace NL3D ss << "{" << std::endl; ss << "gl_Position = mvpMatrix * " << "v" << attribNames[ 0 ] << ";" << std::endl; - for( int i = 1; i < CVertexBuffer::NumValue; i++ ) + for( int i = Weight; i < NumOffsets; i++ ) { if( hasFlag( vbFormat, vertexFlags[ i ] ) ) { @@ -149,7 +170,7 @@ namespace NL3D ss << "out vec4 fragColor;" << std::endl; - for( int i = 1; i < CVertexBuffer::NumValue; i++ ) + for( int i = Weight; i < NumOffsets; i++ ) { if( hasFlag( vbFormat, vertexFlags[ i ] ) ) {