mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 15:25:40 +00:00
Merge branch 'development-gg' into glpboimprovement
Conflicts: Engine/source/gfx/gl/gfxGLTextureManager.cpp
This commit is contained in:
commit
e43a0ba6e9
211 changed files with 18371 additions and 2429 deletions
|
|
@ -56,54 +56,32 @@ void GFXGLCardProfiler::setupCardCapabilities()
|
|||
{
|
||||
GLint maxTexSize;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize);
|
||||
|
||||
const char* versionString = reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
||||
F32 glVersion = dAtof(versionString);
|
||||
|
||||
// OpenGL doesn't have separate maximum width/height.
|
||||
setCapability("maxTextureWidth", maxTexSize);
|
||||
setCapability("maxTextureHeight", maxTexSize);
|
||||
setCapability("maxTextureSize", maxTexSize);
|
||||
|
||||
// If extensions haven't been inited, we're in trouble here.
|
||||
bool suppVBO = (gglHasExtension(ARB_vertex_buffer_object) || glVersion >= 1.499f);
|
||||
setCapability("GL::suppVertexBufferObject", suppVBO);
|
||||
|
||||
// check if render to texture supported is available
|
||||
bool suppRTT = gglHasExtension(EXT_framebuffer_object);
|
||||
setCapability("GL::suppRenderTexture", suppRTT);
|
||||
|
||||
bool suppBlit = gglHasExtension(EXT_framebuffer_blit);
|
||||
setCapability("GL::suppRTBlit", suppBlit);
|
||||
|
||||
bool suppFloatTex = gglHasExtension(ARB_texture_float);
|
||||
setCapability("GL::suppFloatTexture", suppFloatTex);
|
||||
|
||||
// Check for anisotropic filtering support.
|
||||
bool suppAnisotropic = gglHasExtension( EXT_texture_filter_anisotropic );
|
||||
setCapability( "GL::suppAnisotropic", suppAnisotropic );
|
||||
setCapability("GL_EXT_texture_filter_anisotropic", gglHasExtension(EXT_texture_filter_anisotropic));
|
||||
|
||||
// check to see if we have the fragment shader extension or the gl version is high enough for glsl to be core
|
||||
// also check to see if the language version is high enough
|
||||
F32 glslVersion = dAtof(reinterpret_cast<const char*>(glGetString( GL_SHADING_LANGUAGE_VERSION)));
|
||||
bool suppSPU = (gglHasExtension(ARB_fragment_shader) || glVersion >= 1.999f) && glslVersion >= 1.0999;
|
||||
setCapability("GL::suppFragmentShader", suppSPU);
|
||||
|
||||
bool suppAppleFence = gglHasExtension(APPLE_fence);
|
||||
setCapability("GL::APPLE::suppFence", suppAppleFence);
|
||||
|
||||
// When enabled, call glGenerateMipmapEXT() to generate mipmaps instead of relying on GL_GENERATE_MIPMAP
|
||||
setCapability("GL::Workaround::needsExplicitGenerateMipmap", false);
|
||||
// When enabled, binds and unbinds a texture target before doing the depth buffer copy. Failure to do
|
||||
// so will cause a hard freeze on Mac OS 10.4 with a Radeon X1600
|
||||
setCapability("GL::Workaround::X1600DepthBufferCopy", false);
|
||||
// When enabled, does not copy the last column and row of the depth buffer in a depth buffer copy. Failure
|
||||
// to do so will cause a kernel panic on Mac OS 10.5(.1) with a Radeon HD 2600 (fixed in 10.5.2)
|
||||
setCapability("GL::Workaround::HD2600DepthBufferCopy", false);
|
||||
|
||||
// Certain Intel drivers have a divide by 0 crash if mipmaps are specified with
|
||||
// glTexSubImage2D.
|
||||
setCapability("GL::Workaround::noManualMips", false);
|
||||
// Check for buffer storage
|
||||
setCapability("GL_ARB_buffer_storage", gglHasExtension(ARB_buffer_storage));
|
||||
|
||||
// Check for shader model 5.0
|
||||
setCapability("GL_ARB_gpu_shader5", gglHasExtension(ARB_gpu_shader5));
|
||||
|
||||
// Check for texture storage
|
||||
setCapability("GL_ARB_texture_storage", gglHasExtension(ARB_texture_storage));
|
||||
|
||||
// Check for sampler objects
|
||||
setCapability("GL_ARB_sampler_objects", gglHasExtension(ARB_sampler_objects));
|
||||
|
||||
// Check for copy image support
|
||||
setCapability("GL_ARB_copy_image", gglHasExtension(ARB_copy_image));
|
||||
|
||||
// Check for vertex attrib binding
|
||||
setCapability("GL_ARB_vertex_attrib_binding", gglHasExtension(ARB_vertex_attrib_binding));
|
||||
}
|
||||
|
||||
bool GFXGLCardProfiler::_queryCardCap(const String& query, U32& foundResult)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ public:
|
|||
}
|
||||
|
||||
void init(U32 start, U32 end)
|
||||
{
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLQueryFence_issue);
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
mSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
|
|
@ -35,7 +36,8 @@ public:
|
|||
}
|
||||
|
||||
void wait()
|
||||
{
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLQueryFence_block);
|
||||
GLbitfield waitFlags = 0;
|
||||
GLuint64 waitDuration = 0;
|
||||
while( 1 )
|
||||
|
|
@ -158,7 +160,7 @@ public:
|
|||
const U32 cSizeInMB = 10;
|
||||
mBufferSize = (cSizeInMB << 20);
|
||||
|
||||
if( gglHasExtension(ARB_buffer_storage) )
|
||||
if( GFXGL->mCapabilities.bufferStorage )
|
||||
{
|
||||
const GLbitfield flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT;
|
||||
glBufferStorage(mBinding, mBufferSize, NULL, flags);
|
||||
|
|
@ -198,7 +200,7 @@ public:
|
|||
|
||||
outOffset = mBufferFreePos;
|
||||
|
||||
if( gglHasExtension(ARB_buffer_storage) )
|
||||
if( GFXGL->mCapabilities.bufferStorage )
|
||||
{
|
||||
outPtr = (U8*)(mBufferPtr) + mBufferFreePos;
|
||||
}
|
||||
|
|
@ -227,7 +229,7 @@ public:
|
|||
|
||||
void unlock()
|
||||
{
|
||||
if( gglHasExtension(ARB_buffer_storage) )
|
||||
if( GFXGL->mCapabilities.bufferStorage )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,10 +140,18 @@ void GFXGLDevice::initGLState()
|
|||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
// [JTH 5/6/2016] GLSL 1.50 is really SM 4.0
|
||||
// Setting mPixelShaderVersion to 3.0 will allow Advanced Lighting to run.
|
||||
mPixelShaderVersion = 3.0;
|
||||
|
||||
mSupportsAnisotropic = mCardProfiler->queryProfile( "GL::suppAnisotropic" );
|
||||
// Set capability extensions.
|
||||
mCapabilities.anisotropicFiltering = mCardProfiler->queryProfile("GL_EXT_texture_filter_anisotropic");
|
||||
mCapabilities.bufferStorage = mCardProfiler->queryProfile("GL_ARB_buffer_storage");
|
||||
mCapabilities.shaderModel5 = mCardProfiler->queryProfile("GL_ARB_gpu_shader5");
|
||||
mCapabilities.textureStorage = mCardProfiler->queryProfile("GL_ARB_texture_storage");
|
||||
mCapabilities.samplerObjects = mCardProfiler->queryProfile("GL_ARB_sampler_objects");
|
||||
mCapabilities.copyImage = mCardProfiler->queryProfile("GL_ARB_copy_image");
|
||||
mCapabilities.vertexAttributeBinding = mCardProfiler->queryProfile("GL_ARB_vertex_attrib_binding");
|
||||
|
||||
String vendorStr = (const char*)glGetString( GL_VENDOR );
|
||||
if( vendorStr.find("NVIDIA", 0, String::NoCase | String::Left) != String::NPos)
|
||||
|
|
@ -216,6 +224,9 @@ GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
|
|||
mCurrentVB_Divisor[i] = 0;
|
||||
}
|
||||
|
||||
// Initiailize capabilities to false.
|
||||
memset(&mCapabilities, 0, sizeof(GLCapabilities));
|
||||
|
||||
loadGLCore();
|
||||
|
||||
GFXGLEnumTranslate::init();
|
||||
|
|
@ -325,6 +336,7 @@ void GFXGLDevice::resurrect()
|
|||
|
||||
GFXVertexBuffer* GFXGLDevice::findVolatileVBO(U32 numVerts, const GFXVertexFormat *vertexFormat, U32 vertSize)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLDevice_findVBPool);
|
||||
for(U32 i = 0; i < mVolatileVBs.size(); i++)
|
||||
if ( mVolatileVBs[i]->mNumVerts >= numVerts &&
|
||||
mVolatileVBs[i]->mVertexFormat.isEqual( *vertexFormat ) &&
|
||||
|
|
@ -333,6 +345,7 @@ GFXVertexBuffer* GFXGLDevice::findVolatileVBO(U32 numVerts, const GFXVertexForma
|
|||
return mVolatileVBs[i];
|
||||
|
||||
// No existing VB, so create one
|
||||
PROFILE_SCOPE(GFXGLDevice_createVBPool);
|
||||
StrongRefPtr<GFXGLVertexBuffer> buf(new GFXGLVertexBuffer(GFX, numVerts, vertexFormat, vertSize, GFXBufferTypeVolatile));
|
||||
buf->registerResourceWithDevice(this);
|
||||
mVolatileVBs.push_back(buf);
|
||||
|
|
@ -358,6 +371,7 @@ GFXVertexBuffer *GFXGLDevice::allocVertexBuffer( U32 numVerts,
|
|||
GFXBufferType bufferType,
|
||||
void* data )
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLDevice_allocVertexBuffer);
|
||||
if(bufferType == GFXBufferTypeVolatile)
|
||||
return findVolatileVBO(numVerts, vertexFormat, vertSize);
|
||||
|
||||
|
|
@ -523,6 +537,7 @@ inline GLsizei GFXGLDevice::primCountToIndexCount(GFXPrimitiveType primType, U32
|
|||
|
||||
GFXVertexDecl* GFXGLDevice::allocVertexDecl( const GFXVertexFormat *vertexFormat )
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLDevice_allocVertexDecl);
|
||||
typedef Map<void*, GFXGLVertexDecl> GFXGLVertexDeclMap;
|
||||
static GFXGLVertexDeclMap declMap;
|
||||
GFXGLVertexDeclMap::Iterator itr = declMap.find( (void*)vertexFormat->getDescription().c_str() ); // description string are interned, safe to use c_str()
|
||||
|
|
@ -855,6 +870,7 @@ void GFXGLDevice::setShader(GFXShader *shader, bool force)
|
|||
|
||||
void GFXGLDevice::setShaderConstBufferInternal(GFXShaderConstBuffer* buffer)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLDevice_setShaderConstBufferInternal);
|
||||
static_cast<GFXGLShaderConstBuffer*>(buffer)->activate();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,18 @@ class GFXGLVertexDecl;
|
|||
class GFXGLDevice : public GFXDevice
|
||||
{
|
||||
public:
|
||||
struct GLCapabilities
|
||||
{
|
||||
bool anisotropicFiltering;
|
||||
bool bufferStorage;
|
||||
bool shaderModel5;
|
||||
bool textureStorage;
|
||||
bool samplerObjects;
|
||||
bool copyImage;
|
||||
bool vertexAttributeBinding;
|
||||
};
|
||||
GLCapabilities mCapabilities;
|
||||
|
||||
void zombify();
|
||||
void resurrect();
|
||||
GFXGLDevice(U32 adapterIndex);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "platform/platform.h"
|
||||
#include "gfx/gl/gfxGLShader.h"
|
||||
#include "gfx/gl/gfxGLVertexAttribLocation.h"
|
||||
#include "gfx/gl/gfxGLDevice.h"
|
||||
|
||||
#include "core/frameAllocator.h"
|
||||
#include "core/stream/fileStream.h"
|
||||
|
|
@ -344,6 +345,7 @@ void GFXGLShaderConstBuffer::set(GFXShaderConstHandle* handle, const MatrixF* ma
|
|||
|
||||
void GFXGLShaderConstBuffer::activate()
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLShaderConstBuffer_activate);
|
||||
mShader->setConstantsFromBuffer(this);
|
||||
mWasLost = false;
|
||||
}
|
||||
|
|
@ -394,6 +396,7 @@ void GFXGLShader::clearShaders()
|
|||
|
||||
bool GFXGLShader::_init()
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLShader_Init);
|
||||
// Don't initialize empty shaders.
|
||||
if ( mVertexFile.isEmpty() && mPixelFile.isEmpty() )
|
||||
return false;
|
||||
|
|
@ -956,7 +959,7 @@ bool GFXGLShader::_loadShaderFromStream( GLuint shader,
|
|||
buffers.push_back( dStrdup( versionDecl ) );
|
||||
lengths.push_back( dStrlen( versionDecl ) );
|
||||
|
||||
if(gglHasExtension(ARB_gpu_shader5))
|
||||
if(GFXGL->mCapabilities.shaderModel5)
|
||||
{
|
||||
const char *extension = "#extension GL_ARB_gpu_shader5 : enable\r\n";
|
||||
buffers.push_back( dStrdup( extension ) );
|
||||
|
|
@ -1013,6 +1016,7 @@ bool GFXGLShader::initShader( const Torque::Path &file,
|
|||
bool isVertex,
|
||||
const Vector<GFXShaderMacro> ¯os )
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLShader_CompileShader);
|
||||
GLuint activeShader = glCreateShader(isVertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
|
||||
if(isVertex)
|
||||
mVertexShader = activeShader;
|
||||
|
|
@ -1072,6 +1076,7 @@ bool GFXGLShader::initShader( const Torque::Path &file,
|
|||
/// Returns our list of shader constants, the material can get this and just set the constants it knows about
|
||||
const Vector<GFXShaderConstDesc>& GFXGLShader::getShaderConstDesc() const
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLShader_GetShaderConstants);
|
||||
return mConstants;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ GFXGLStateBlock::GFXGLStateBlock(const GFXStateBlockDesc& desc) :
|
|||
mDesc(desc),
|
||||
mCachedHashValue(desc.getHashValue())
|
||||
{
|
||||
if( !gglHasExtension(ARB_sampler_objects) )
|
||||
if( !GFXGL->mCapabilities.samplerObjects )
|
||||
return;
|
||||
|
||||
static Map<GFXSamplerStateDesc, U32> mSamplersMap;
|
||||
|
|
@ -88,6 +88,7 @@ const GFXStateBlockDesc& GFXGLStateBlock::getDesc() const
|
|||
/// @param oldState The current state, used to make sure we don't set redundant states on the device. Pass NULL to reset all states.
|
||||
void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLStateBlock_Activate);
|
||||
// Big scary warning copied from Apple docs
|
||||
// http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_performance/chapter_13_section_2.html#//apple_ref/doc/uid/TP40001987-CH213-SW12
|
||||
// Don't set a state that's already set. Once a feature is enabled, it does not need to be enabled again.
|
||||
|
|
@ -165,7 +166,7 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState)
|
|||
#undef CHECK_TOGGLE_STATE
|
||||
|
||||
//sampler objects
|
||||
if( gglHasExtension(ARB_sampler_objects) )
|
||||
if( GFXGL->mCapabilities.samplerObjects )
|
||||
{
|
||||
for (U32 i = 0; i < getMin(getOwningDevice()->getNumSamplers(), (U32) TEXTURE_STAGE_COUNT); i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ void GFXGLTextureManager::innerCreateTexture( GFXGLTextureObject *retTex,
|
|||
|
||||
glTexParameteri(binding, GL_TEXTURE_MAX_LEVEL, retTex->mMipLevels-1 );
|
||||
|
||||
if( gglHasExtension(ARB_texture_storage) )
|
||||
if( GFXGL->mCapabilities.textureStorage )
|
||||
{
|
||||
if(binding == GL_TEXTURE_2D)
|
||||
glTexStorage2D( retTex->getBinding(), retTex->mMipLevels, GFXGLTextureInternalFormat[format], width, height );
|
||||
|
|
@ -234,6 +234,7 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|||
|
||||
if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8)
|
||||
{
|
||||
PROFILE_SCOPE(Swizzle32_Upload);
|
||||
FrameAllocatorMarker mem;
|
||||
U8* pboMemory = (U8*)mem.alloc(bufSize);
|
||||
GFX->getDeviceSwizzle32()->ToBuffer(pboMemory, pDL->getBits(0), bufSize);
|
||||
|
|
@ -241,6 +242,7 @@ static void _fastTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|||
}
|
||||
else
|
||||
{
|
||||
PROFILE_SCOPE(SwizzleNull_Upload);
|
||||
glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, bufSize, pDL->getBits(0) );
|
||||
}
|
||||
|
||||
|
|
@ -262,6 +264,7 @@ static void _slowTextureLoad(GFXGLTextureObject* texture, GBitmap* pDL)
|
|||
|
||||
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLTextureManager_loadTexture);
|
||||
GFXGLTextureObject *texture = static_cast<GFXGLTextureObject*>(aTexture);
|
||||
|
||||
AssertFatal(texture->getBinding() == GL_TEXTURE_1D || texture->getBinding() == GL_TEXTURE_2D,
|
||||
|
|
@ -291,6 +294,8 @@ bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL)
|
|||
|
||||
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLTextureManager_loadTextureDDS);
|
||||
|
||||
AssertFatal(!(dds->mFormat == GFXFormatDXT2 || dds->mFormat == GFXFormatDXT4), "GFXGLTextureManager::_loadTexture - OpenGL does not support DXT2 or DXT4 compressed textures");
|
||||
GFXGLTextureObject* texture = static_cast<GFXGLTextureObject*>(aTexture);
|
||||
|
||||
|
|
@ -304,10 +309,11 @@ bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
|||
glBindTexture(texture->getBinding(), texture->getHandle());
|
||||
texture->mFormat = dds->mFormat;
|
||||
U32 numMips = dds->mSurfaces[0]->mMips.size();
|
||||
if(GFX->getCardProfiler()->queryProfile("GL::Workaround::noManualMips"))
|
||||
numMips = 1;
|
||||
|
||||
for(U32 i = 0; i < numMips; i++)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLTexMan_loadSurface);
|
||||
|
||||
if(isCompressedFormat(dds->mFormat))
|
||||
{
|
||||
if((!isPow2(dds->getWidth()) || !isPow2(dds->getHeight())) && GFX->getCardProfiler()->queryProfile("GL::Workaround::noCompressedNPoTTextures"))
|
||||
|
|
@ -344,6 +350,7 @@ bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
|
|||
|
||||
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, void *raw)
|
||||
{
|
||||
PROFILE_SCOPE(GFXGLTextureManager_loadTextureRaw);
|
||||
if(aTexture->getDepth() < 1)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@ void GFXGLTextureObject::unlock(U32 mipLevel)
|
|||
if(!mLockedRect.bits)
|
||||
return;
|
||||
|
||||
// I know this is in unlock, but in GL we actually do our submission in unlock.
|
||||
PROFILE_SCOPE(GFXGLTextureObject_lockRT);
|
||||
|
||||
PRESERVE_TEXTURE(mBinding);
|
||||
glBindTexture(mBinding, mHandle);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, mBuffer);
|
||||
|
|
@ -175,6 +178,7 @@ bool GFXGLTextureObject::copyToBmp(GBitmap * bmp)
|
|||
|
||||
glGetTexImage(mBinding, 0, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], orig);
|
||||
|
||||
PROFILE_START(GFXGLTextureObject_copyToBmp_pixCopy);
|
||||
for(int i = 0; i < srcPixelCount; ++i)
|
||||
{
|
||||
dest[0] = orig[0];
|
||||
|
|
@ -186,6 +190,7 @@ bool GFXGLTextureObject::copyToBmp(GBitmap * bmp)
|
|||
orig += srcBytesPerPixel;
|
||||
dest += dstBytesPerPixel;
|
||||
}
|
||||
PROFILE_END();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -211,7 +216,7 @@ void GFXGLTextureObject::bind(U32 textureUnit)
|
|||
glBindTexture(mBinding, mHandle);
|
||||
GFXGL->getOpenglCache()->setCacheBindedTex(textureUnit, mBinding, mHandle);
|
||||
|
||||
if( gglHasExtension(ARB_sampler_objects) )
|
||||
if(GFXGL->mCapabilities.samplerObjects)
|
||||
return;
|
||||
|
||||
GFXGLStateBlockRef sb = mGLDevice->getCurrentStateBlock();
|
||||
|
|
@ -298,8 +303,8 @@ void GFXGLTextureObject::reloadFromCache()
|
|||
else if(mBinding == GL_TEXTURE_1D)
|
||||
glTexSubImage1D(mBinding, 0, 0, (mTextureSize.x > 1 ? mTextureSize.x : mTextureSize.y), GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], mZombieCache);
|
||||
|
||||
if(GFX->getCardProfiler()->queryProfile("GL::Workaround::needsExplicitGenerateMipmap") && mMipLevels != 1)
|
||||
glGenerateMipmapEXT(mBinding);
|
||||
if(mMipLevels != 1)
|
||||
glGenerateMipmap(mBinding);
|
||||
|
||||
delete[] mZombieCache;
|
||||
mZombieCache = NULL;
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ void GFXGLTextureTarget::resolveTo(GFXTextureObject* obj)
|
|||
AssertFatal(dynamic_cast<GFXGLTextureObject*>(obj), "GFXGLTextureTarget::resolveTo - Incorrect type of texture, expected a GFXGLTextureObject");
|
||||
GFXGLTextureObject* glTexture = static_cast<GFXGLTextureObject*>(obj);
|
||||
|
||||
if( gglHasExtension(ARB_copy_image) && mTargets[Color0]->isCompatible(glTexture) )
|
||||
if( GFXGL->mCapabilities.copyImage && mTargets[Color0]->isCompatible(glTexture) )
|
||||
{
|
||||
GLenum binding = mTargets[Color0]->getBinding();
|
||||
binding = (binding >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && binding <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ? GL_TEXTURE_CUBE_MAP : binding;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void GFXGLVertexBuffer::lock( U32 vertexStart, U32 vertexEnd, void **vertexPtr )
|
|||
if( mBufferType == GFXBufferTypeVolatile )
|
||||
{
|
||||
AssertFatal(vertexStart == 0, "");
|
||||
if( gglHasExtension(ARB_vertex_attrib_binding) )
|
||||
if( GFXGL->mCapabilities.vertexAttributeBinding )
|
||||
{
|
||||
getCircularVolatileVertexBuffer()->lock( mNumVerts * mVertexSize, 0, mBufferOffset, *vertexPtr );
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ void GFXGLVertexBuffer::prepare()
|
|||
|
||||
void GFXGLVertexBuffer::prepare(U32 stream, U32 divisor)
|
||||
{
|
||||
if( gglHasExtension(ARB_vertex_attrib_binding) )
|
||||
if( GFXGL->mCapabilities.vertexAttributeBinding )
|
||||
{
|
||||
glBindVertexBuffer( stream, mBuffer, mBufferOffset, mVertexSize );
|
||||
glVertexBindingDivisor( stream, divisor );
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ void GFXGLVertexDecl::init(const GFXVertexFormat *format)
|
|||
void GFXGLVertexDecl::prepareVertexFormat() const
|
||||
{
|
||||
AssertFatal(mFormat, "GFXGLVertexDecl - Not inited");
|
||||
if( gglHasExtension(ARB_vertex_attrib_binding) )
|
||||
if( GFXGL->mCapabilities.vertexAttributeBinding )
|
||||
{
|
||||
for ( U32 i=0; i < glVerticesFormat.size(); i++ )
|
||||
{
|
||||
|
|
@ -36,7 +36,7 @@ void GFXGLVertexDecl::prepareBuffer_old(U32 stream, GLint mBuffer, GLint mDiviso
|
|||
PROFILE_SCOPE(GFXGLVertexDecl_prepare);
|
||||
AssertFatal(mFormat, "GFXGLVertexDecl - Not inited");
|
||||
|
||||
if( gglHasExtension(ARB_vertex_attrib_binding) )
|
||||
if( GFXGL->mCapabilities.vertexAttributeBinding )
|
||||
return;
|
||||
|
||||
// Bind the buffer...
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void GFXGLWindowTarget::resolveTo(GFXTextureObject* obj)
|
|||
AssertFatal(dynamic_cast<GFXGLTextureObject*>(obj), "GFXGLTextureTarget::resolveTo - Incorrect type of texture, expected a GFXGLTextureObject");
|
||||
GFXGLTextureObject* glTexture = static_cast<GFXGLTextureObject*>(obj);
|
||||
|
||||
if( gglHasExtension(ARB_copy_image) )
|
||||
if( GFXGL->mCapabilities.copyImage )
|
||||
{
|
||||
if(mBackBufferColorTex.getWidth() == glTexture->getWidth()
|
||||
&& mBackBufferColorTex.getHeight() == glTexture->getHeight()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue