Ignore:
Timestamp:
05/06/16 19:25:05 (9 years ago)
Author:
epyon
Message:
  • program validation moved to first use - fixes validation errors on Intel and AMD cards
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_context.cc

    r492 r493  
    317317                glUseProgram( info->glid );
    318318                gdevice->update_uniforms( info );
    319         }
    320 }
     319                if ( !info->validated )
     320                {
     321                        validate_program( p );
     322                }
     323        }
     324}
     325
     326bool nv::gl_context::validate_program( program p )
     327{
     328        gl_device* gdevice = static_cast<gl_device*>( m_device );
     329        gl_program_info* info = gdevice->m_programs.get( p );
     330        if ( info )
     331        {
     332                info->validated = true;
     333                const uint32 buffer_size = 1024;
     334                char buffer[buffer_size] = { 0 };
     335                int length;
     336                int status;
     337                glValidateProgram( info->glid );
     338                glGetProgramiv( info->glid, GL_VALIDATE_STATUS, &status );
     339
     340                if ( status == GL_FALSE )
     341                {
     342                        glGetProgramInfoLog( info->glid, buffer_size, &length, buffer );
     343                        NV_LOG_ERROR( "Program #", info->glid, " validation error : ", buffer );
     344                        return false;
     345                }
     346                return true;
     347        }
     348        return false;
     349}
     350
    321351
    322352// void nv::gl_context::bind( buffer b )
Note: See TracChangeset for help on using the changeset viewer.