mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-02-01 14:10:59 +00:00
Removed ARB endings from OpenGL calls
This commit is contained in:
parent
f9ff46d03d
commit
7e49606cc8
8 changed files with 173 additions and 119 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
Doom 3 BFG Edition GPL Source Code
|
||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 2012 Robert Beckebans
|
||||
Copyright (C) 2013 Robert Beckebans
|
||||
|
||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||
|
||||
|
@ -33,8 +33,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
idCVar r_showBuffers( "r_showBuffers", "0", CVAR_INTEGER, "" );
|
||||
|
||||
|
||||
//static const GLenum bufferUsage = GL_STATIC_DRAW_ARB;
|
||||
static const GLenum bufferUsage = GL_DYNAMIC_DRAW_ARB;
|
||||
//static const GLenum bufferUsage = GL_STATIC_DRAW;
|
||||
static const GLenum bufferUsage = GL_DYNAMIC_DRAW;
|
||||
|
||||
// RB begin
|
||||
#if defined(_WIN32)
|
||||
|
@ -75,8 +75,8 @@ UnbindBufferObjects
|
|||
*/
|
||||
void UnbindBufferObjects()
|
||||
{
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
|
||||
glBindBuffer( GL_ARRAY_BUFFER, 0 );
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 );
|
||||
}
|
||||
|
||||
#if defined(USE_INTRINSICS)
|
||||
|
@ -190,15 +190,15 @@ bool idVertexBuffer::AllocBufferObject( const void* data, int allocSize )
|
|||
glGetError();
|
||||
|
||||
GLuint bufferObject = 0xFFFF;
|
||||
glGenBuffersARB( 1, & bufferObject );
|
||||
glGenBuffers( 1, & bufferObject );
|
||||
if( bufferObject == 0xFFFF )
|
||||
{
|
||||
idLib::FatalError( "idVertexBuffer::AllocBufferObject: failed" );
|
||||
}
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, bufferObject );
|
||||
glBindBuffer( GL_ARRAY_BUFFER, bufferObject );
|
||||
|
||||
// these are rewritten every frame
|
||||
glBufferDataARB( GL_ARRAY_BUFFER_ARB, numBytes, NULL, bufferUsage );
|
||||
glBufferData( GL_ARRAY_BUFFER, numBytes, NULL, bufferUsage );
|
||||
apiObject = reinterpret_cast< void* >( bufferObject );
|
||||
|
||||
GLenum err = glGetError();
|
||||
|
@ -253,8 +253,8 @@ void idVertexBuffer::FreeBufferObject()
|
|||
}
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
glDeleteBuffersARB( 1, ( const unsigned int* ) & bufferObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
glDeleteBuffers( 1, ( const unsigned int* ) & bufferObject );
|
||||
// RB end
|
||||
|
||||
ClearWithoutFreeing();
|
||||
|
@ -320,11 +320,11 @@ void idVertexBuffer::Update( const void* data, int updateSize ) const
|
|||
int numBytes = ( updateSize + 15 ) & ~15;
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
// RB end
|
||||
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, bufferObject );
|
||||
glBufferSubDataARB( GL_ARRAY_BUFFER_ARB, GetOffset(), ( GLsizeiptrARB )numBytes, data );
|
||||
glBindBuffer( GL_ARRAY_BUFFER, bufferObject );
|
||||
glBufferSubData( GL_ARRAY_BUFFER, GetOffset(), ( GLsizeiptr )numBytes, data );
|
||||
/*
|
||||
void * buffer = MapBuffer( BM_WRITE );
|
||||
CopyBuffer( (byte *)buffer + GetOffset(), (byte *)data, numBytes );
|
||||
|
@ -345,14 +345,18 @@ void* idVertexBuffer::MapBuffer( bufferMapType_t mapType ) const
|
|||
void* buffer = NULL;
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
// RB end
|
||||
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, bufferObject );
|
||||
glBindBuffer( GL_ARRAY_BUFFER, bufferObject );
|
||||
|
||||
if( mapType == BM_READ )
|
||||
{
|
||||
//buffer = glMapBufferARB( GL_ARRAY_BUFFER_ARB, GL_READ_ONLY_ARB );
|
||||
buffer = glMapBufferRange( GL_ARRAY_BUFFER_ARB, 0, GetAllocedSize(), GL_MAP_READ_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
#if 0 //defined(USE_GLES2)
|
||||
buffer = glMapBufferOES( GL_ARRAY_BUFFER, GL_READ_ONLY );
|
||||
#else
|
||||
buffer = glMapBufferRange( GL_ARRAY_BUFFER, 0, GetAllocedSize(), GL_MAP_READ_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
#endif
|
||||
if( buffer != NULL )
|
||||
{
|
||||
buffer = ( byte* )buffer + GetOffset();
|
||||
|
@ -360,8 +364,11 @@ void* idVertexBuffer::MapBuffer( bufferMapType_t mapType ) const
|
|||
}
|
||||
else if( mapType == BM_WRITE )
|
||||
{
|
||||
//buffer = glMapBufferARB( GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB );
|
||||
buffer = glMapBufferRange( GL_ARRAY_BUFFER_ARB, 0, GetAllocedSize(), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
#if 0 //defined(USE_GLES2)
|
||||
buffer = glMapBuffer( GL_ARRAY_BUFFER, GL_WRITE_ONLY );
|
||||
#else
|
||||
buffer = glMapBufferRange( GL_ARRAY_BUFFER, 0, GetAllocedSize(), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
#endif
|
||||
if( buffer != NULL )
|
||||
{
|
||||
buffer = ( byte* )buffer + GetOffset();
|
||||
|
@ -393,11 +400,11 @@ void idVertexBuffer::UnmapBuffer() const
|
|||
assert( IsMapped() );
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
// RB end
|
||||
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, bufferObject );
|
||||
if( !glUnmapBufferARB( GL_ARRAY_BUFFER_ARB ) )
|
||||
glBindBuffer( GL_ARRAY_BUFFER, bufferObject );
|
||||
if( !glUnmapBuffer( GL_ARRAY_BUFFER ) )
|
||||
{
|
||||
idLib::Printf( "idVertexBuffer::UnmapBuffer failed\n" );
|
||||
}
|
||||
|
@ -474,16 +481,16 @@ bool idIndexBuffer::AllocBufferObject( const void* data, int allocSize )
|
|||
glGetError();
|
||||
|
||||
GLuint bufferObject = 0xFFFF;
|
||||
glGenBuffersARB( 1, & bufferObject );
|
||||
glGenBuffers( 1, & bufferObject );
|
||||
if( bufferObject == 0xFFFF )
|
||||
{
|
||||
GLenum error = glGetError();
|
||||
idLib::FatalError( "idIndexBuffer::AllocBufferObject: failed - GL_Error %d", error );
|
||||
}
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, bufferObject );
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, bufferObject );
|
||||
|
||||
// these are rewritten every frame
|
||||
glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, numBytes, NULL, bufferUsage );
|
||||
glBufferData( GL_ELEMENT_ARRAY_BUFFER, numBytes, NULL, bufferUsage );
|
||||
apiObject = reinterpret_cast< void* >( bufferObject );
|
||||
|
||||
GLenum err = glGetError();
|
||||
|
@ -538,8 +545,8 @@ void idIndexBuffer::FreeBufferObject()
|
|||
}
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
glDeleteBuffersARB( 1, ( const unsigned int* )& bufferObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
glDeleteBuffers( 1, ( const unsigned int* )& bufferObject );
|
||||
// RB end
|
||||
|
||||
ClearWithoutFreeing();
|
||||
|
@ -606,11 +613,11 @@ void idIndexBuffer::Update( const void* data, int updateSize ) const
|
|||
int numBytes = ( updateSize + 15 ) & ~15;
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
// RB end
|
||||
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, bufferObject );
|
||||
glBufferSubDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, GetOffset(), ( GLsizeiptrARB )numBytes, data );
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, bufferObject );
|
||||
glBufferSubData( GL_ELEMENT_ARRAY_BUFFER, GetOffset(), ( GLsizeiptr )numBytes, data );
|
||||
/*
|
||||
void * buffer = MapBuffer( BM_WRITE );
|
||||
CopyBuffer( (byte *)buffer + GetOffset(), (byte *)data, numBytes );
|
||||
|
@ -632,14 +639,15 @@ void* idIndexBuffer::MapBuffer( bufferMapType_t mapType ) const
|
|||
void* buffer = NULL;
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
// RB end
|
||||
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, bufferObject );
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, bufferObject );
|
||||
|
||||
if( mapType == BM_READ )
|
||||
{
|
||||
//buffer = glMapBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, GL_READ_ONLY_ARB );
|
||||
buffer = glMapBufferRange( GL_ELEMENT_ARRAY_BUFFER_ARB, 0, GetAllocedSize(), GL_MAP_READ_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
buffer = glMapBufferRange( GL_ELEMENT_ARRAY_BUFFER, 0, GetAllocedSize(), GL_MAP_READ_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
if( buffer != NULL )
|
||||
{
|
||||
buffer = ( byte* )buffer + GetOffset();
|
||||
|
@ -648,7 +656,7 @@ void* idIndexBuffer::MapBuffer( bufferMapType_t mapType ) const
|
|||
else if( mapType == BM_WRITE )
|
||||
{
|
||||
//buffer = glMapBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB );
|
||||
buffer = glMapBufferRange( GL_ELEMENT_ARRAY_BUFFER_ARB, 0, GetAllocedSize(), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
buffer = glMapBufferRange( GL_ELEMENT_ARRAY_BUFFER, 0, GetAllocedSize(), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | GL_MAP_UNSYNCHRONIZED_BIT );
|
||||
if( buffer != NULL )
|
||||
{
|
||||
buffer = ( byte* )buffer + GetOffset();
|
||||
|
@ -680,11 +688,11 @@ void idIndexBuffer::UnmapBuffer() const
|
|||
assert( IsMapped() );
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB bufferObject = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr bufferObject = reinterpret_cast< GLintptr >( apiObject );
|
||||
// RB end
|
||||
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, bufferObject );
|
||||
if( !glUnmapBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB ) )
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, bufferObject );
|
||||
if( !glUnmapBuffer( GL_ELEMENT_ARRAY_BUFFER ) )
|
||||
{
|
||||
idLib::Printf( "idIndexBuffer::UnmapBuffer failed\n" );
|
||||
}
|
||||
|
@ -757,10 +765,10 @@ bool idJointBuffer::AllocBufferObject( const float* joints, int numAllocJoints )
|
|||
const int numBytes = GetAllocedSize();
|
||||
|
||||
GLuint buffer = 0;
|
||||
glGenBuffersARB( 1, &buffer );
|
||||
glBindBufferARB( GL_UNIFORM_BUFFER, buffer );
|
||||
glBufferDataARB( GL_UNIFORM_BUFFER, numBytes, NULL, GL_STREAM_DRAW_ARB );
|
||||
glBindBufferARB( GL_UNIFORM_BUFFER, 0 );
|
||||
glGenBuffers( 1, &buffer );
|
||||
glBindBuffer( GL_UNIFORM_BUFFER, buffer );
|
||||
glBufferData( GL_UNIFORM_BUFFER, numBytes, NULL, GL_STREAM_DRAW );
|
||||
glBindBuffer( GL_UNIFORM_BUFFER, 0 );
|
||||
apiObject = reinterpret_cast< void* >( buffer );
|
||||
|
||||
if( r_showBuffers.GetBool() )
|
||||
|
@ -807,10 +815,10 @@ void idJointBuffer::FreeBufferObject()
|
|||
}
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
GLintptrARB buffer = reinterpret_cast< GLintptrARB >( apiObject );
|
||||
GLintptr buffer = reinterpret_cast< GLintptr >( apiObject );
|
||||
|
||||
glBindBufferARB( GL_UNIFORM_BUFFER, 0 );
|
||||
glDeleteBuffersARB( 1, ( const GLuint* )& buffer );
|
||||
glBindBuffer( GL_UNIFORM_BUFFER, 0 );
|
||||
glDeleteBuffers( 1, ( const GLuint* )& buffer );
|
||||
// RB end
|
||||
|
||||
ClearWithoutFreeing();
|
||||
|
@ -877,10 +885,10 @@ void idJointBuffer::Update( const float* joints, int numUpdateJoints ) const
|
|||
const int numBytes = numUpdateJoints * 3 * 4 * sizeof( float );
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
glBindBufferARB( GL_UNIFORM_BUFFER, reinterpret_cast< GLintptrARB >( apiObject ) );
|
||||
glBindBuffer( GL_UNIFORM_BUFFER, reinterpret_cast< GLintptr >( apiObject ) );
|
||||
// RB end
|
||||
|
||||
glBufferSubDataARB( GL_UNIFORM_BUFFER, GetOffset(), ( GLsizeiptrARB )numBytes, joints );
|
||||
glBufferSubData( GL_UNIFORM_BUFFER, GetOffset(), ( GLsizeiptr )numBytes, joints );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -899,7 +907,7 @@ float* idJointBuffer::MapBuffer( bufferMapType_t mapType ) const
|
|||
void* buffer = NULL;
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
glBindBufferARB( GL_UNIFORM_BUFFER, reinterpret_cast< GLintptrARB >( apiObject ) );
|
||||
glBindBuffer( GL_UNIFORM_BUFFER, reinterpret_cast< GLintptr >( apiObject ) );
|
||||
// RB end
|
||||
|
||||
numBytes = numBytes;
|
||||
|
@ -931,10 +939,10 @@ void idJointBuffer::UnmapBuffer() const
|
|||
assert( IsMapped() );
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
glBindBufferARB( GL_UNIFORM_BUFFER, reinterpret_cast< GLintptrARB >( apiObject ) );
|
||||
glBindBuffer( GL_UNIFORM_BUFFER, reinterpret_cast< GLintptr >( apiObject ) );
|
||||
// RB end
|
||||
|
||||
if( !glUnmapBufferARB( GL_UNIFORM_BUFFER ) )
|
||||
if( !glUnmapBuffer( GL_UNIFORM_BUFFER ) )
|
||||
{
|
||||
idLib::Printf( "idJointBuffer::UnmapBuffer failed\n" );
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ void idImage::SubImageUpload( int mipLevel, int x, int y, int z, int width, int
|
|||
#endif
|
||||
if( IsCompressed() )
|
||||
{
|
||||
glCompressedTexSubImage2DARB( uploadTarget, mipLevel, x, y, width, height, internalFormat, compressedSize, pic );
|
||||
glCompressedTexSubImage2D( uploadTarget, mipLevel, x, y, width, height, internalFormat, compressedSize, pic );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -128,10 +128,10 @@ void PC_BeginNamedEvent( const char* szName, ... )
|
|||
GL_CheckErrors();
|
||||
if( timeQueryIds[0] == 0 )
|
||||
{
|
||||
glGenQueriesARB( MAX_PIX_EVENTS, timeQueryIds );
|
||||
glGenQueries( MAX_PIX_EVENTS, timeQueryIds );
|
||||
}
|
||||
glFinish();
|
||||
glBeginQueryARB( GL_TIME_ELAPSED_EXT, timeQueryIds[numPixEvents] );
|
||||
glBeginQuery( GL_TIME_ELAPSED_EXT, timeQueryIds[numPixEvents] );
|
||||
GL_CheckErrors();
|
||||
|
||||
pixEvent_t* ev = &pixEvents[numPixEvents++];
|
||||
|
@ -170,7 +170,7 @@ void PC_EndNamedEvent()
|
|||
ev->cpuTime = Sys_Microseconds() - ev->cpuTime;
|
||||
|
||||
GL_CheckErrors();
|
||||
glEndQueryARB( GL_TIME_ELAPSED_EXT );
|
||||
glEndQuery( GL_TIME_ELAPSED_EXT );
|
||||
GL_CheckErrors();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -126,18 +126,20 @@ void idRenderSystemLocal::RenderCommandBuffers( const emptyCommand_t* const cmdH
|
|||
// draw 2D graphics
|
||||
if( !r_skipBackEnd.GetBool() )
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(USE_GLES3)
|
||||
if( glConfig.timerQueryAvailable )
|
||||
{
|
||||
if( tr.timerQueryId == 0 )
|
||||
{
|
||||
glGenQueriesARB( 1, & tr.timerQueryId );
|
||||
glGenQueries( 1, & tr.timerQueryId );
|
||||
}
|
||||
glBeginQueryARB( GL_TIME_ELAPSED_EXT, tr.timerQueryId );
|
||||
glBeginQuery( GL_TIME_ELAPSED_EXT, tr.timerQueryId );
|
||||
RB_ExecuteBackEndCommands( cmdHead );
|
||||
glEndQueryARB( GL_TIME_ELAPSED_EXT );
|
||||
glEndQuery( GL_TIME_ELAPSED_EXT );
|
||||
glFlush();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
RB_ExecuteBackEndCommands( cmdHead );
|
||||
}
|
||||
|
@ -233,7 +235,6 @@ See if some cvars that we watch have changed
|
|||
*/
|
||||
static void R_CheckCvars()
|
||||
{
|
||||
|
||||
// gamma stuff
|
||||
if( r_gamma.IsModified() || r_brightness.IsModified() )
|
||||
{
|
||||
|
@ -297,11 +298,11 @@ static void R_CheckCvars()
|
|||
{
|
||||
if( r_multiSamples.GetInteger() > 0 )
|
||||
{
|
||||
glEnable( GL_MULTISAMPLE_ARB );
|
||||
glEnable( GL_MULTISAMPLE );
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable( GL_MULTISAMPLE_ARB );
|
||||
glDisable( GL_MULTISAMPLE );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -373,8 +373,8 @@ void idVertexCache::BeginBackEnd()
|
|||
|
||||
#if 0
|
||||
const int startBind = Sys_Milliseconds();
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, ( GLuint )frameData[drawListNum].vertexBuffer.GetAPIObject() );
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, ( GLuint )frameData[drawListNum].indexBuffer.GetAPIObject() );
|
||||
glBindBuffer( GL_ARRAY_BUFFER, ( GLuint )frameData[drawListNum].vertexBuffer.GetAPIObject() );
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ( GLuint )frameData[drawListNum].indexBuffer.GetAPIObject() );
|
||||
const int endBind = Sys_Milliseconds();
|
||||
if( endBind - startBind > 1 )
|
||||
{
|
||||
|
|
|
@ -173,8 +173,8 @@ void RB_DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
}
|
||||
indexBuffer = &vertexCache.frameData[vertexCache.drawListNum].indexBuffer;
|
||||
}
|
||||
// RB: 64 bit fixes, changed int to GLintptrARB
|
||||
const GLintptrARB indexOffset = ( GLintptrARB )( ibHandle >> VERTCACHE_OFFSET_SHIFT ) & VERTCACHE_OFFSET_MASK;
|
||||
// RB: 64 bit fixes, changed int to GLintptr
|
||||
const GLintptr indexOffset = ( GLintptr )( ibHandle >> VERTCACHE_OFFSET_SHIFT ) & VERTCACHE_OFFSET_MASK;
|
||||
// RB end
|
||||
|
||||
RENDERLOG_PRINTF( "Binding Buffers: %p:%i %p:%i\n", vertexBuffer, vertOffset, indexBuffer, indexOffset );
|
||||
|
@ -213,8 +213,8 @@ void RB_DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
}
|
||||
assert( ( jointBuffer.GetOffset() & ( glConfig.uniformBufferOffsetAlignment - 1 ) ) == 0 );
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
const GLintptrARB ubo = reinterpret_cast< GLintptrARB >( jointBuffer.GetAPIObject() );
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptr
|
||||
const GLintptr ubo = reinterpret_cast< GLintptr >( jointBuffer.GetAPIObject() );
|
||||
// RB end
|
||||
|
||||
glBindBufferRange( GL_UNIFORM_BUFFER, 0, ubo, jointBuffer.GetOffset(), jointBuffer.GetNumJoints() * sizeof( idJointMat ) );
|
||||
|
@ -222,43 +222,63 @@ void RB_DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
|
||||
renderProgManager.CommitUniforms();
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
if( backEnd.glState.currentIndexBuffer != ( GLintptrARB )indexBuffer->GetAPIObject() || !r_useStateCaching.GetBool() )
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptr
|
||||
if( backEnd.glState.currentIndexBuffer != ( GLintptr )indexBuffer->GetAPIObject() || !r_useStateCaching.GetBool() )
|
||||
{
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, ( GLintptrARB )indexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentIndexBuffer = ( GLintptrARB )indexBuffer->GetAPIObject();
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ( GLintptr )indexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentIndexBuffer = ( GLintptr )indexBuffer->GetAPIObject();
|
||||
}
|
||||
|
||||
if( ( backEnd.glState.vertexLayout != LAYOUT_DRAW_VERT ) || ( backEnd.glState.currentVertexBuffer != ( GLintptrARB )vertexBuffer->GetAPIObject() ) || !r_useStateCaching.GetBool() )
|
||||
if( ( backEnd.glState.vertexLayout != LAYOUT_DRAW_VERT ) || ( backEnd.glState.currentVertexBuffer != ( GLintptr )vertexBuffer->GetAPIObject() ) || !r_useStateCaching.GetBool() )
|
||||
{
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, ( GLintptrARB )vertexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentVertexBuffer = ( GLintptrARB )vertexBuffer->GetAPIObject();
|
||||
glBindBuffer( GL_ARRAY_BUFFER, ( GLintptr )vertexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentVertexBuffer = ( GLintptr )vertexBuffer->GetAPIObject();
|
||||
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_VERTEX );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_NORMAL );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_COLOR );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_COLOR2 );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_ST );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_TANGENT );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_VERTEX );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_NORMAL );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_COLOR );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_COLOR2 );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_ST );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_TANGENT );
|
||||
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof( idDrawVert ), ( void* )( DRAWVERT_XYZ_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_NORMAL, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_NORMAL_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_COLOR_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_COLOR2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_COLOR2_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_ST, 2, GL_HALF_FLOAT, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_ST_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_TANGENT, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_TANGENT_OFFSET ) );
|
||||
#if defined(USE_GLES2) || defined(USE_GLES3)
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_XYZ_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_NORMAL, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_NORMAL_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_COLOR_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_COLOR2_OFFSET ) );
|
||||
#if defined(USE_ANGLE)
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_ST, 2, GL_HALF_FLOAT_OES, GL_TRUE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_ST_OFFSET ) );
|
||||
#else
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_ST, 2, GL_HALF_FLOAT, GL_TRUE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_ST_OFFSET ) );
|
||||
#endif
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_TANGENT, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( vertOffset + DRAWVERT_TANGENT_OFFSET ) );
|
||||
|
||||
#else
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_VERTEX, 3, GL_FLOAT, GL_FALSE, sizeof( idDrawVert ), ( void* )( DRAWVERT_XYZ_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_NORMAL, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_NORMAL_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_COLOR_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_COLOR2_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_ST, 2, GL_HALF_FLOAT, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_ST_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_TANGENT, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idDrawVert ), ( void* )( DRAWVERT_TANGENT_OFFSET ) );
|
||||
#endif // #if defined(USE_GLES2) || defined(USE_GLES3)
|
||||
|
||||
backEnd.glState.vertexLayout = LAYOUT_DRAW_VERT;
|
||||
}
|
||||
// RB end
|
||||
|
||||
#if defined(USE_GLES3) //defined(USE_GLES2)
|
||||
glDrawElements( GL_TRIANGLES,
|
||||
r_singleTriangle.GetBool() ? 3 : surf->numIndexes,
|
||||
GL_INDEX_TYPE,
|
||||
( triIndex_t* )indexOffset );
|
||||
#else
|
||||
glDrawElementsBaseVertex( GL_TRIANGLES,
|
||||
r_singleTriangle.GetBool() ? 3 : surf->numIndexes,
|
||||
GL_INDEX_TYPE,
|
||||
( triIndex_t* )indexOffset,
|
||||
vertOffset / sizeof( idDrawVert ) );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// RB: added stats
|
||||
backEnd.pc.c_drawElements++;
|
||||
backEnd.pc.c_drawIndexes += surf->numIndexes;
|
||||
|
@ -1944,11 +1964,11 @@ static void RB_StencilShadowPass( const drawSurf_t* drawSurfs, const viewLight_t
|
|||
|
||||
RENDERLOG_PRINTF( "Binding Buffers: %p %p\n", vertexBuffer, indexBuffer );
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
if( backEnd.glState.currentIndexBuffer != ( GLintptrARB )indexBuffer->GetAPIObject() || !r_useStateCaching.GetBool() )
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptr
|
||||
if( backEnd.glState.currentIndexBuffer != ( GLintptr )indexBuffer->GetAPIObject() || !r_useStateCaching.GetBool() )
|
||||
{
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, ( GLintptrARB )indexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentIndexBuffer = ( GLintptrARB )indexBuffer->GetAPIObject();
|
||||
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ( GLintptr )indexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentIndexBuffer = ( GLintptr )indexBuffer->GetAPIObject();
|
||||
}
|
||||
|
||||
if( drawSurf->jointCache )
|
||||
|
@ -1963,24 +1983,30 @@ static void RB_StencilShadowPass( const drawSurf_t* drawSurfs, const viewLight_t
|
|||
}
|
||||
assert( ( jointBuffer.GetOffset() & ( glConfig.uniformBufferOffsetAlignment - 1 ) ) == 0 );
|
||||
|
||||
const GLintptrARB ubo = reinterpret_cast< GLintptrARB >( jointBuffer.GetAPIObject() );
|
||||
const GLintptr ubo = reinterpret_cast< GLintptr >( jointBuffer.GetAPIObject() );
|
||||
glBindBufferRange( GL_UNIFORM_BUFFER, 0, ubo, jointBuffer.GetOffset(), jointBuffer.GetNumJoints() * sizeof( idJointMat ) );
|
||||
|
||||
if( ( backEnd.glState.vertexLayout != LAYOUT_DRAW_SHADOW_VERT_SKINNED ) || ( backEnd.glState.currentVertexBuffer != ( GLintptrARB )vertexBuffer->GetAPIObject() ) || !r_useStateCaching.GetBool() )
|
||||
if( ( backEnd.glState.vertexLayout != LAYOUT_DRAW_SHADOW_VERT_SKINNED ) || ( backEnd.glState.currentVertexBuffer != ( GLintptr )vertexBuffer->GetAPIObject() ) || !r_useStateCaching.GetBool() )
|
||||
{
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, ( GLintptrARB )vertexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentVertexBuffer = ( GLintptrARB )vertexBuffer->GetAPIObject();
|
||||
glBindBuffer( GL_ARRAY_BUFFER, ( GLintptr )vertexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentVertexBuffer = ( GLintptr )vertexBuffer->GetAPIObject();
|
||||
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_VERTEX );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_NORMAL );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_COLOR );
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_COLOR2 );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_ST );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_TANGENT );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_VERTEX );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_NORMAL );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_COLOR );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_COLOR2 );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_ST );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_TANGENT );
|
||||
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_VERTEX, 4, GL_FLOAT, GL_FALSE, sizeof( idShadowVertSkinned ), ( void* )( SHADOWVERTSKINNED_XYZW_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idShadowVertSkinned ), ( void* )( SHADOWVERTSKINNED_COLOR_OFFSET ) );
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_COLOR2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idShadowVertSkinned ), ( void* )( SHADOWVERTSKINNED_COLOR2_OFFSET ) );
|
||||
#if defined(USE_GLES2) || defined(USE_GLES3)
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_VERTEX, 4, GL_FLOAT, GL_FALSE, sizeof( idShadowVertSkinned ), ( void* )( vertOffset + SHADOWVERTSKINNED_XYZW_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idShadowVertSkinned ), ( void* )( vertOffset + SHADOWVERTSKINNED_COLOR_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idShadowVertSkinned ), ( void* )( vertOffset + SHADOWVERTSKINNED_COLOR2_OFFSET ) );
|
||||
#else
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_VERTEX, 4, GL_FLOAT, GL_FALSE, sizeof( idShadowVertSkinned ), ( void* )( SHADOWVERTSKINNED_XYZW_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idShadowVertSkinned ), ( void* )( SHADOWVERTSKINNED_COLOR_OFFSET ) );
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_COLOR2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof( idShadowVertSkinned ), ( void* )( SHADOWVERTSKINNED_COLOR2_OFFSET ) );
|
||||
#endif
|
||||
|
||||
backEnd.glState.vertexLayout = LAYOUT_DRAW_SHADOW_VERT_SKINNED;
|
||||
}
|
||||
|
@ -1988,20 +2014,23 @@ static void RB_StencilShadowPass( const drawSurf_t* drawSurfs, const viewLight_t
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( ( backEnd.glState.vertexLayout != LAYOUT_DRAW_SHADOW_VERT ) || ( backEnd.glState.currentVertexBuffer != ( GLintptrARB )vertexBuffer->GetAPIObject() ) || !r_useStateCaching.GetBool() )
|
||||
if( ( backEnd.glState.vertexLayout != LAYOUT_DRAW_SHADOW_VERT ) || ( backEnd.glState.currentVertexBuffer != ( GLintptr )vertexBuffer->GetAPIObject() ) || !r_useStateCaching.GetBool() )
|
||||
{
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, ( GLintptrARB )vertexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentVertexBuffer = ( GLintptrARB )vertexBuffer->GetAPIObject();
|
||||
glBindBuffer( GL_ARRAY_BUFFER, ( GLintptr )vertexBuffer->GetAPIObject() );
|
||||
backEnd.glState.currentVertexBuffer = ( GLintptr )vertexBuffer->GetAPIObject();
|
||||
|
||||
glEnableVertexAttribArrayARB( PC_ATTRIB_INDEX_VERTEX );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_NORMAL );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_COLOR );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_COLOR2 );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_ST );
|
||||
glDisableVertexAttribArrayARB( PC_ATTRIB_INDEX_TANGENT );
|
||||
glEnableVertexAttribArray( PC_ATTRIB_INDEX_VERTEX );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_NORMAL );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_COLOR );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_COLOR2 );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_ST );
|
||||
glDisableVertexAttribArray( PC_ATTRIB_INDEX_TANGENT );
|
||||
|
||||
glVertexAttribPointerARB( PC_ATTRIB_INDEX_VERTEX, 4, GL_FLOAT, GL_FALSE, sizeof( idShadowVert ), ( void* )( SHADOWVERT_XYZW_OFFSET ) );
|
||||
#if defined(USE_GLES2) || defined(USE_GLES3)
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_VERTEX, 4, GL_FLOAT, GL_FALSE, sizeof( idShadowVert ), ( void* )( vertOffset + SHADOWVERT_XYZW_OFFSET ) );
|
||||
#else
|
||||
glVertexAttribPointer( PC_ATTRIB_INDEX_VERTEX, 4, GL_FLOAT, GL_FALSE, sizeof( idShadowVert ), ( void* )( SHADOWVERT_XYZW_OFFSET ) );
|
||||
#endif
|
||||
|
||||
backEnd.glState.vertexLayout = LAYOUT_DRAW_SHADOW_VERT;
|
||||
}
|
||||
|
@ -2012,11 +2041,19 @@ static void RB_StencilShadowPass( const drawSurf_t* drawSurfs, const viewLight_t
|
|||
|
||||
if( drawSurf->jointCache )
|
||||
{
|
||||
#if defined(USE_GLES3) //defined(USE_GLES2)
|
||||
glDrawElements( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset );
|
||||
#else
|
||||
glDrawElementsBaseVertex( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset, vertOffset / sizeof( idShadowVertSkinned ) );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(USE_GLES3)
|
||||
glDrawElements( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset );
|
||||
#else
|
||||
glDrawElementsBaseVertex( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset, vertOffset / sizeof( idShadowVert ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
// RB: added stats
|
||||
|
@ -2032,11 +2069,19 @@ static void RB_StencilShadowPass( const drawSurf_t* drawSurfs, const viewLight_t
|
|||
|
||||
if( drawSurf->jointCache )
|
||||
{
|
||||
#if defined(USE_GLES3)
|
||||
glDrawElements( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset );
|
||||
#else
|
||||
glDrawElementsBaseVertex( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset, vertOffset / sizeof( idShadowVertSkinned ) );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(USE_GLES3)
|
||||
glDrawElements( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset );
|
||||
#else
|
||||
glDrawElementsBaseVertex( GL_TRIANGLES, r_singleTriangle.GetBool() ? 3 : drawSurf->numIndexes, GL_INDEX_TYPE, ( triIndex_t* )indexOffset, vertOffset / sizeof( idShadowVert ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
// RB: added stats
|
||||
|
@ -3809,7 +3854,7 @@ void RB_DrawViewInternal( const viewDef_t* viewDef, const int stereoEye )
|
|||
// normal face culling
|
||||
GL_Cull( CT_FRONT_SIDED );
|
||||
|
||||
#ifdef USE_CORE_PROFILE
|
||||
#if defined(USE_CORE_PROFILE) && !defined(USE_GLES2) && !defined(USE_GLES3)
|
||||
// bind one global Vertex Array Object (VAO)
|
||||
glBindVertexArray( glConfig.global_vao );
|
||||
#endif
|
||||
|
|
|
@ -827,9 +827,9 @@ static void RB_ShowSilhouette()
|
|||
continue;
|
||||
}
|
||||
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptrARB
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, ( GLintptrARB )vertexBuffer.GetAPIObject() );
|
||||
GLintptrARB vertOffset = vertexBuffer.GetOffset();
|
||||
// RB: 64 bit fixes, changed GLuint to GLintptr
|
||||
glBindBuffer( GL_ARRAY_BUFFER, ( GLintptr )vertexBuffer.GetAPIObject() );
|
||||
GLintptr vertOffset = vertexBuffer.GetOffset();
|
||||
// RB end
|
||||
|
||||
glVertexPointer( 3, GL_FLOAT, sizeof( idShadowVert ), ( void* )vertOffset );
|
||||
|
|
|
@ -996,7 +996,7 @@ void Posix_LateInit()
|
|||
com_pid.SetInteger( getpid() );
|
||||
common->Printf( "pid: %d\n", com_pid.GetInteger() );
|
||||
// common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() );
|
||||
|
||||
|
||||
//#ifndef ID_DEDICATED
|
||||
//common->Printf( "%d MB Video Memory\n", Sys_GetVideoRam() );
|
||||
//#endif
|
||||
|
|
Loading…
Reference in a new issue