Merge branch 'development' of https://github.com/GarageGames/Torque3D into andOrMaybe

Conflicts:
	Engine/source/T3D/staticShape.cpp
This commit is contained in:
Azaezel 2016-12-20 22:50:28 -06:00
commit dd071484da
517 changed files with 87707 additions and 178465 deletions

View file

@ -176,7 +176,6 @@ bool GFXD3D9ShaderBufferLayout::setMatrix(const ParamDesc& pd, const GFXShaderCo
}
else if (pd.constType == GFXSCT_Float4x3)
{
F32 buffer[4*4];
const U32 csize = 48;
// Loop through and copy

View file

@ -88,7 +88,7 @@ class GFXOcclusionQueryHandle
public:
GFXOcclusionQueryHandle()
: mLastStatus(GFXOcclusionQuery::Unset), mLastData(0), mQuery(NULL), mWaiting(false)
: mLastStatus(GFXOcclusionQuery::Unset), mLastData(0), mWaiting(false) , mQuery(NULL)
{}
~GFXOcclusionQueryHandle()

View file

@ -64,11 +64,11 @@ public:
const GFXVertexFormat *vertexFormat,
U32 vertexSize,
GFXBufferType bufferType )
: mDevice( device ),
mVolatileStart( 0 ),
mNumVerts( numVerts ),
: mNumVerts( numVerts ),
mVertexSize( vertexSize ),
mBufferType( bufferType )
mBufferType( bufferType ),
mDevice( device ),
mVolatileStart( 0 )
{
if ( vertexFormat )
{

View file

@ -84,6 +84,10 @@ void loadGLExtensions(void *context)
void STDCALL glDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length,
const GLchar *message, const void *userParam)
{
// JTH [11/24/2016]: This is a temporary fix so that we do not get spammed for redundant fbo changes.
// This only happens on Intel cards. This should be looked into sometime in the near future.
if (dStrStartsWith(message, "API_ID_REDUNDANT_FBO"))
return;
if (severity == GL_DEBUG_SEVERITY_HIGH)
Con::errorf("OPENGL: %s", message);
else if (severity == GL_DEBUG_SEVERITY_MEDIUM)
@ -113,7 +117,8 @@ void GFXGLDevice::initGLState()
mCardProfiler = new GFXGLCardProfiler();
mCardProfiler->init();
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, (GLint*)&mMaxShaderTextures);
glGetIntegerv(GL_MAX_TEXTURE_UNITS, (GLint*)&mMaxFFTextures);
// JTH: Needs removed, ffp
//glGetIntegerv(GL_MAX_TEXTURE_UNITS, (GLint*)&mMaxFFTextures);
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, (GLint*)&mMaxTRColors);
mMaxTRColors = getMin( mMaxTRColors, (U32)(GFXTextureTarget::MaxRenderSlotId-1) );
@ -175,8 +180,10 @@ void GFXGLDevice::initGLState()
GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
mAdapterIndex(adapterIndex),
mNeedUpdateVertexAttrib(false),
mCurrentPB(NULL),
mDrawInstancesCount(0),
mCurrentShader( NULL ),
m_mCurrentWorld(true),
m_mCurrentView(true),
mContext(NULL),
@ -186,8 +193,6 @@ GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
mMaxFFTextures(2),
mMaxTRColors(1),
mClip(0, 0, 0, 0),
mCurrentShader( NULL ),
mNeedUpdateVertexAttrib(false),
mWindowRT(NULL),
mUseGlMap(true)
{
@ -617,7 +622,7 @@ void GFXGLDevice::setLightMaterialInternal(const GFXLightMaterial mat)
void GFXGLDevice::setGlobalAmbientInternal(ColorF color)
{
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, (GLfloat*)&color);
// ONLY NEEDED ON FFP
}
void GFXGLDevice::setTextureInternal(U32 textureUnit, const GFXTextureObject*texture)
@ -673,12 +678,12 @@ void GFXGLDevice::setClipRect( const RectI &inRect )
const F32 right = mClip.point.x + mClip.extent.x;
const F32 bottom = mClip.extent.y;
const F32 top = 0.0f;
const F32 near = 0.0f;
const F32 far = 1.0f;
const F32 nearPlane = 0.0f;
const F32 farPlane = 1.0f;
const F32 tx = -(right + left)/(right - left);
const F32 ty = -(top + bottom)/(top - bottom);
const F32 tz = -(far + near)/(far - near);
const F32 tz = -(farPlane + nearPlane)/(farPlane - nearPlane);
static Point4F pt;
pt.set(2.0f / (right - left), 0.0f, 0.0f, 0.0f);
@ -687,7 +692,7 @@ void GFXGLDevice::setClipRect( const RectI &inRect )
pt.set(0.0f, 2.0f/(top - bottom), 0.0f, 0.0f);
mProjectionMatrix.setColumn(1, pt);
pt.set(0.0f, 0.0f, -2.0f/(far - near), 0.0f);
pt.set(0.0f, 0.0f, -2.0f/(farPlane - nearPlane), 0.0f);
mProjectionMatrix.setColumn(2, pt);
pt.set(tx, ty, tz, 1.0f);

View file

@ -58,7 +58,7 @@ public:
glGenQueries(1, &mQueryId);
}
GLTimer() : mName(NULL), mQueryId(0), mData(NULL)
GLTimer() : mName(NULL), mData(NULL), mQueryId(0)
{
}

View file

@ -41,10 +41,11 @@ GFXGLVertexBuffer::GFXGLVertexBuffer( GFXDevice *device,
const GFXVertexFormat *vertexFormat,
U32 vertexSize,
GFXBufferType bufferType )
: GFXVertexBuffer( device, numVerts, vertexFormat, vertexSize, bufferType ),
mZombieCache(NULL),
: GFXVertexBuffer( device, numVerts, vertexFormat, vertexSize, bufferType ),
mBufferOffset(0),
mBufferVertexOffset(0)
mBufferVertexOffset(0),
mZombieCache(NULL)
{
if( mBufferType == GFXBufferTypeVolatile )
{

View file

@ -106,6 +106,10 @@ void GFXGLDevice::enumerateAdapters( Vector<GFXAdapter*> &adapterList )
AssertFatal(0, err );
}
// Init GL
loadGLCore();
loadGLExtensions(tempContext);
//check minimun Opengl 3.2
int major, minor;
glGetIntegerv(GL_MAJOR_VERSION, &major);
@ -114,8 +118,6 @@ void GFXGLDevice::enumerateAdapters( Vector<GFXAdapter*> &adapterList )
{
return;
}
loadGLCore();
GFXAdapter *toAdd = new GFXAdapter;
toAdd->mIndex = 0;
@ -163,7 +165,7 @@ void GFXGLDevice::init( const GFXVideoMode &mode, PlatformWindow *window )
PlatformGL::MakeCurrentGL( sdlWindow, mContext );
loadGLCore();
loadGLExtensions(0);
loadGLExtensions(mContext);
// It is very important that extensions be loaded before we call initGLState()
initGLState();

View file

@ -33,11 +33,10 @@ namespace GL
{
void gglPerformBinds()
{
// JTH: epoxy has one oddity with windows. You need to bind the context
// after creating the context to udpate the internals of epoxy.
#ifdef TORQUE_OS_WIN
epoxy_handle_external_wglMakeCurrent();
#endif
if (!gladLoadGL())
{
AssertFatal(false, "Unable to load GLAD. Make sure your OpenGL drivers are up to date!");
}
}
void gglPerformExtensionBinds(void *context)

View file

@ -23,11 +23,10 @@
#ifndef T_GL_H
#define T_GL_H
#include <epoxy/gl.h>
#include <glad/glad.h>
// JTH: This is slow, we should probably check extensions once and cache them
// directly inside of some compatability table.
#define gglHasExtension(EXTENSION) epoxy_has_gl_extension("GL_" #EXTENSION)
// JTH: When we use glad, extensions are chached into simple booleans (ints)
#define gglHasExtension(EXTENSION) GLAD_GL_##EXTENSION
#endif

View file

@ -28,9 +28,9 @@
#ifdef TORQUE_OPENGL
#include "tGL.h"
#include <epoxy/wgl.h>
#include <glad/glad_wgl.h>
#define gglHasWExtension(window, EXTENSION) epoxy_has_wgl_extension(window, "WGL_" # EXTENSION)
#define gglHasWExtension(window, EXTENSION) GLAD_WGL_##EXTENSION
#endif //TORQUE_OPENGL

View file

@ -28,9 +28,9 @@
#ifdef TORQUE_OS_LINUX
#include "tGL.h"
#include <epoxy/glx.h>
#include <glad/glad_glx.h>
#define gglHasXExtension(display, screen, EXTENSION) epoxy_has_glx_extension(display, screen, "GLX_" # EXTENSION)
#define gglHasXExtension(display, screen, EXTENSION) GLAD_GLX_##EXTENSION
#endif //TORQUE_OS_LINUX

View file

@ -148,7 +148,8 @@ public:
/// Set the TTL for the last item we entered...
///
/// Primitives default to lasting one frame (ie, ttl=0)
enum {
enum : U32
{
DD_INFINITE = U32_MAX
};
// How long should this primitive be draw for, 0 = one frame, DD_INFINITE = draw forever