Merge branch 'development-gg' into epoxy

This commit is contained in:
Jeff Hutchinson 2016-04-17 23:59:42 -04:00
commit fddc00b39b
1321 changed files with 92005 additions and 42431 deletions

View file

@ -513,9 +513,6 @@ inline GLsizei GFXGLDevice::primCountToIndexCount(GFXPrimitiveType primType, U32
case GFXTriangleStrip :
return 2 + primitiveCount;
break;
case GFXTriangleFan :
return 2 + primitiveCount;
break;
default:
AssertFatal(false, "GFXGLDevice::primCountToIndexCount - unrecognized prim type");
break;
@ -789,7 +786,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
shaderData->registerObject();
mGenericShader[GSColor] = shaderData->getShader();
mGenericShaderBuffer[GSColor] = mGenericShader[GSColor]->allocConstBuffer();
mModelViewProjSC[GSColor] = mGenericShader[GSColor]->getShaderConstHandle( "$modelView" );
mModelViewProjSC[GSColor] = mGenericShader[GSColor]->getShaderConstHandle( "$modelView" );
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/modColorTextureV.glsl");
@ -799,7 +797,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
shaderData->registerObject();
mGenericShader[GSModColorTexture] = shaderData->getShader();
mGenericShaderBuffer[GSModColorTexture] = mGenericShader[GSModColorTexture]->allocConstBuffer();
mModelViewProjSC[GSModColorTexture] = mGenericShader[GSModColorTexture]->getShaderConstHandle( "$modelView" );
mModelViewProjSC[GSModColorTexture] = mGenericShader[GSModColorTexture]->getShaderConstHandle( "$modelView" );
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/addColorTextureV.glsl");
@ -809,7 +808,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
shaderData->registerObject();
mGenericShader[GSAddColorTexture] = shaderData->getShader();
mGenericShaderBuffer[GSAddColorTexture] = mGenericShader[GSAddColorTexture]->allocConstBuffer();
mModelViewProjSC[GSAddColorTexture] = mGenericShader[GSAddColorTexture]->getShaderConstHandle( "$modelView" );
mModelViewProjSC[GSAddColorTexture] = mGenericShader[GSAddColorTexture]->getShaderConstHandle( "$modelView" );
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/textureV.glsl");
@ -820,6 +820,7 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
mGenericShader[GSTexture] = shaderData->getShader();
mGenericShaderBuffer[GSTexture] = mGenericShader[GSTexture]->allocConstBuffer();
mModelViewProjSC[GSTexture] = mGenericShader[GSTexture]->getShaderConstHandle( "$modelView" );
Sim::getRootGroup()->addObject(shaderData);
}
MatrixF tempMatrix = mProjectionMatrix * mViewMatrix * mWorldMatrix[mWorldStackSize];

View file

@ -53,7 +53,6 @@ void GFXGLEnumTranslate::init()
GFXGLPrimType[GFXLineStrip] = GL_LINE_STRIP;
GFXGLPrimType[GFXTriangleList] = GL_TRIANGLES;
GFXGLPrimType[GFXTriangleStrip] = GL_TRIANGLE_STRIP;
GFXGLPrimType[GFXTriangleFan] = GL_TRIANGLE_FAN;
// Blend
GFXGLBlend[GFXBlendZero] = GL_ZERO;
@ -191,51 +190,33 @@ void GFXGLEnumTranslate::init()
GFXGLTextureType[GFXFormatDXT4] = GL_ZERO;
GFXGLTextureType[GFXFormatDXT5] = GL_UNSIGNED_BYTE;
GFXGLTextureType[GFXFormatR8G8B8A8_SRGB] = GL_SRGB8_ALPHA8;
static GLint Swizzle_GFXFormatA8[] = { GL_NONE, GL_NONE, GL_NONE, GL_RED };
static GLint Swizzle_GFXFormatL[] = { GL_RED, GL_RED, GL_RED, GL_ALPHA };
GFXGLTextureSwizzle[GFXFormatA8] = Swizzle_GFXFormatA8; // old GL_ALPHA8
GFXGLTextureSwizzle[GFXFormatL8] = Swizzle_GFXFormatL; // old GL_LUMINANCE8
GFXGLTextureSwizzle[GFXFormatL16] = Swizzle_GFXFormatL; // old GL_LUMINANCE16
if( gglHasExtension(ARB_texture_float) )
{
GFXGLTextureInternalFormat[GFXFormatR32F] = GL_R32F;
GFXGLTextureFormat[GFXFormatR32F] = GL_RED;
GFXGLTextureType[GFXFormatR32F] = GL_FLOAT;
GFXGLTextureInternalFormat[GFXFormatR32F] = GL_R32F;
GFXGLTextureFormat[GFXFormatR32F] = GL_RED;
GFXGLTextureType[GFXFormatR32F] = GL_FLOAT;
GFXGLTextureInternalFormat[GFXFormatR32G32B32A32F] = GL_RGBA32F_ARB;
GFXGLTextureFormat[GFXFormatR32G32B32A32F] = GL_RGBA;
GFXGLTextureType[GFXFormatR32G32B32A32F] = GL_FLOAT;
GFXGLTextureInternalFormat[GFXFormatR32G32B32A32F] = GL_RGBA32F_ARB;
GFXGLTextureFormat[GFXFormatR32G32B32A32F] = GL_RGBA;
GFXGLTextureType[GFXFormatR32G32B32A32F] = GL_FLOAT;
if( gglHasExtension(ARB_half_float_pixel) )
{
GFXGLTextureInternalFormat[GFXFormatR16F] = GL_R16F;
GFXGLTextureFormat[GFXFormatR16F] = GL_RED;
GFXGLTextureType[GFXFormatR16F] = GL_HALF_FLOAT_ARB;
GFXGLTextureInternalFormat[GFXFormatR16F] = GL_R16F;
GFXGLTextureFormat[GFXFormatR16F] = GL_RED;
GFXGLTextureType[GFXFormatR16F] = GL_HALF_FLOAT_ARB;
GFXGLTextureInternalFormat[GFXFormatR16G16F] = GL_RG16F;
GFXGLTextureFormat[GFXFormatR16G16F] = GL_RG;
GFXGLTextureType[GFXFormatR16G16F] = GL_HALF_FLOAT_ARB;
GFXGLTextureInternalFormat[GFXFormatR16G16F] = GL_RG16F;
GFXGLTextureFormat[GFXFormatR16G16F] = GL_RG;
GFXGLTextureType[GFXFormatR16G16F] = GL_HALF_FLOAT_ARB;
GFXGLTextureInternalFormat[GFXFormatR16G16B16A16F] = GL_RGBA16F_ARB;
GFXGLTextureFormat[GFXFormatR16G16B16A16F] = GL_RGBA;
GFXGLTextureType[GFXFormatR16G16B16A16F] = GL_HALF_FLOAT_ARB;
}
else
{
GFXGLTextureInternalFormat[GFXFormatR16F] = GL_R32F;
GFXGLTextureFormat[GFXFormatR16F] = GL_RED;
GFXGLTextureType[GFXFormatR16F] = GL_FLOAT;
GFXGLTextureInternalFormat[GFXFormatR16G16F] = GL_RG32F;
GFXGLTextureFormat[GFXFormatR16G16F] = GL_RG;
GFXGLTextureType[GFXFormatR16G16F] = GL_FLOAT;
GFXGLTextureInternalFormat[GFXFormatR16G16B16A16F] = GL_RGBA32F_ARB;
GFXGLTextureFormat[GFXFormatR16G16B16A16F] = GL_RGBA;
GFXGLTextureType[GFXFormatR16G16B16A16F] = GL_FLOAT;
}
}
GFXGLTextureInternalFormat[GFXFormatR16G16B16A16F] = GL_RGBA16F_ARB;
GFXGLTextureFormat[GFXFormatR16G16B16A16F] = GL_RGBA;
GFXGLTextureType[GFXFormatR16G16B16A16F] = GL_HALF_FLOAT_ARB;
if( gglHasExtension(ARB_ES2_compatibility) )
{

View file

@ -664,10 +664,14 @@ void GFXGLShader::initHandles()
glUseProgram(0);
//instancing
if (!mInstancingFormat)
return;
U32 offset = 0;
for ( U32 i=0; i < mInstancingFormat.getElementCount(); i++ )
for ( U32 i=0; i < mInstancingFormat->getElementCount(); i++ )
{
const GFXVertexElement &element = mInstancingFormat.getElement( i );
const GFXVertexElement &element = mInstancingFormat->getElement( i );
String constName = String::ToString( "$%s", element.getSemantic().c_str() );
@ -702,9 +706,9 @@ void GFXGLShader::initHandles()
// If this is a matrix we will have 2 or 3 more of these
// semantics with the same name after it.
for ( ; i < mInstancingFormat.getElementCount(); i++ )
for ( ; i < mInstancingFormat->getElementCount(); i++ )
{
const GFXVertexElement &nextElement = mInstancingFormat.getElement( i );
const GFXVertexElement &nextElement = mInstancingFormat->getElement( i );
if ( nextElement.getSemantic() != element.getSemantic() )
{
i--;