mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-11 17:17:42 +03:00
Fixed VBOs for GLES 2 renderer.
Optimized a little bit GLES 2 pipeline shaders.
This commit is contained in:
@@ -112,8 +112,10 @@ void cVertexBufferVBO::Draw() {
|
||||
#endif
|
||||
if ( GLv_3 == GLi->Version() || GLv_ES2 == GLi->Version() ) {
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO );
|
||||
glBindVertexArray( mVAO );
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO );
|
||||
glBindVertexArray( mVAO );
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( !mTextured ) {
|
||||
@@ -172,7 +174,7 @@ void cVertexBufferVBO::SetVertexStates() {
|
||||
GLi->EnableClientState( GL_VERTEX_ARRAY );
|
||||
glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_POSITION ] );
|
||||
#ifdef EE_GL3_ENABLED
|
||||
if ( GLv_3 == GLi->Version() || GLv_ES2 == GLi->Version() ) {
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
index = GLi->GetRendererGL3()->GetStateIndex( EEGL_VERTEX_ARRAY );
|
||||
|
||||
if ( -1 != index ) {
|
||||
@@ -194,7 +196,7 @@ void cVertexBufferVBO::SetVertexStates() {
|
||||
glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_COLOR ] );
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
if ( GLv_3 == GLi->Version() || GLv_ES2 == GLi->Version() ) {
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
index = GLi->GetRendererGL3()->GetStateIndex( EEGL_COLOR_ARRAY );
|
||||
|
||||
if ( -1 != index )
|
||||
@@ -219,7 +221,7 @@ void cVertexBufferVBO::SetVertexStates() {
|
||||
glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_TEXTURE0 + i ] );
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
if ( GLv_3 == GLi->Version() || GLv_ES2 == GLi->Version() ) {
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
index = GLi->GetRendererGL3()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY );
|
||||
|
||||
if ( -1 != index && 0 == i )
|
||||
@@ -247,7 +249,7 @@ void cVertexBufferVBO::SetVertexStates() {
|
||||
glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_TEXTURE0 ] );
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
if ( GLv_3 == GLi->Version() || GLv_ES2 == GLi->Version() ) {
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
index = GLi->GetRendererGL3()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY );
|
||||
|
||||
if ( -1 != index )
|
||||
|
||||
@@ -20,7 +20,6 @@ void main(void)\n\
|
||||
{\n\
|
||||
dgl_Color = dgl_FrontColor;\n\
|
||||
dgl_TexCoord[0] = dgl_MultiTexCoord0;\n\
|
||||
vec4 vEye = dgl_ModelViewMatrix * dgl_Vertex;\n\
|
||||
gl_Position = dgl_ProjectionMatrix * vEye;\n\
|
||||
gl_Position = dgl_ProjectionMatrix * ( dgl_ModelViewMatrix * dgl_Vertex );\n\
|
||||
}\n\
|
||||
";
|
||||
|
||||
@@ -15,6 +15,5 @@ void main(void)\n\
|
||||
{\n\
|
||||
gl_PointSize = dgl_PointSize;\n\
|
||||
dgl_Color = dgl_FrontColor;\n\
|
||||
vec4 vEye = dgl_ModelViewMatrix * dgl_Vertex;\n\
|
||||
gl_Position = dgl_ProjectionMatrix * vEye;\n\
|
||||
gl_Position = dgl_ProjectionMatrix * ( dgl_ModelViewMatrix * dgl_Vertex );\n\
|
||||
}";
|
||||
|
||||
@@ -13,6 +13,5 @@ varying vec4 dgl_Color;\n\
|
||||
void main(void)\n\
|
||||
{\n\
|
||||
dgl_Color = dgl_FrontColor;\n\
|
||||
vec4 vEye = dgl_ModelViewMatrix * dgl_Vertex;\n\
|
||||
gl_Position = dgl_ProjectionMatrix * vEye;\n\
|
||||
gl_Position = dgl_ProjectionMatrix * ( dgl_ModelViewMatrix * dgl_Vertex );\n\
|
||||
}";
|
||||
|
||||
Reference in New Issue
Block a user