From 14f6bbadef2c39e58a3b54c0c6212949acf50e45 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 8 Aug 2011 15:29:23 -0500 Subject: SH-2242 Work in progress migrating to glVertexAttrib everywhere --- indra/llrender/llrender.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 9eedebe2ce..5f97bff1c4 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -350,6 +350,12 @@ public: void color3fv(const GLfloat* c); void color4ubv(const GLubyte* c); + void diffuseColor3f(F32 r, F32 g, F32 b); + void diffuseColor3fv(const F32* c); + void diffuseColor4f(F32 r, F32 g, F32 b, F32 a); + void diffuseColor4fv(const F32* c); + void diffuseColor4ubv(const U8* c); + void vertexBatchPreTransformed(LLVector3* verts, S32 vert_count); void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count); void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLColor4U*, S32 vert_count); -- cgit v1.2.3 From 7c95af74f195c9ec4ebc0fc0264d98cd4a85be49 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 14 Sep 2011 16:30:45 -0500 Subject: SH-2243 work in progress -- application side matrix stack management --- indra/llrender/llrender.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index c202aa4b73..465c16f0de 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -41,6 +41,8 @@ #include "llstrider.h" #include "llpointer.h" #include "llglheaders.h" +#include "llmatrix4a.h" +#include "glh/glh_linear.h" class LLVertexBuffer; class LLCubeMap; @@ -48,6 +50,8 @@ class LLImageGL; class LLRenderTarget; class LLTexture ; +#define LL_MATRIX_STACK_DEPTH 32 + class LLTexUnit { friend class LLRender; @@ -308,6 +312,18 @@ public: BF_UNDEF } eBlendFactor; + typedef enum + { + MM_MODELVIEW = 0, + MM_PROJECTION, + MM_TEXTURE0, + MM_TEXTURE1, + MM_TEXTURE2, + MM_TEXTURE3, + NUM_MATRIX_MODES, + MM_TEXTURE + } eMatrixMode; + LLRender(); ~LLRender(); void init() ; @@ -319,8 +335,19 @@ public: void translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z); void scalef(const GLfloat& x, const GLfloat& y, const GLfloat& z); + void rotatef(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z); + void ortho(F32 left, F32 right, F32 bottom, F32 top, F32 zNear, F32 zFar); + void pushMatrix(); void popMatrix(); + void loadMatrix(const GLfloat* m); + void loadMatrix(const GLdouble* m); + void loadIdentity(); + void multMatrix(const GLfloat* m); + void multMatrix(const GLdouble* m); + void matrixMode(U32 mode); + + void syncMatrices(); void translateUI(F32 x, F32 y, F32 z); void scaleUI(F32 x, F32 y, F32 z); @@ -397,7 +424,14 @@ public: static U32 sUIVerts; private: - bool mDirty; + U32 mMatrixMode; + U32 mMatIdx[NUM_MATRIX_MODES]; + U32 mMatHash[NUM_MATRIX_MODES]; + glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH]; + + U32 mCurMatHash[NUM_MATRIX_MODES]; + + bool mDirty; U32 mCount; U32 mMode; U32 mCurrTextureUnitIndex; -- cgit v1.2.3 From 24ae2fb5af52d7128e79a0f63afce9a8db1123eb Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Sep 2011 16:38:31 -0500 Subject: SH-2243 work in progress -- don't use built-in GL light state when shaders are available. --- indra/llrender/llrender.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 465c16f0de..0805ebb61a 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -239,6 +239,8 @@ public: void setSpotDirection(const LLVector3& direction); protected: + friend class LLRender; + S32 mIndex; bool mEnabled; LLColor4 mDiffuse; @@ -347,7 +349,10 @@ public: void multMatrix(const GLdouble* m); void matrixMode(U32 mode); + const glh::matrix4f& getModelviewMatrix(); + void syncMatrices(); + void syncLightState(); void translateUI(F32 x, F32 y, F32 z); void scaleUI(F32 x, F32 y, F32 z); -- cgit v1.2.3 From 4fea7dcb3ef35cae9e31ba467403d31ce9083905 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Sep 2011 17:10:33 -0500 Subject: SH-2243 work in progress -- use a hash check to avoid redundantly setting light state --- indra/llrender/llrender.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 0805ebb61a..3f319022f6 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -429,12 +429,14 @@ public: static U32 sUIVerts; private: + friend class LLLightState; + U32 mMatrixMode; U32 mMatIdx[NUM_MATRIX_MODES]; U32 mMatHash[NUM_MATRIX_MODES]; glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH]; - U32 mCurMatHash[NUM_MATRIX_MODES]; + U32 mLightHash; bool mDirty; U32 mCount; -- cgit v1.2.3 From 4f99ace06944a704e46cc3014607f3a5a4ef246b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 17 Sep 2011 00:19:19 -0500 Subject: SH-2243 work in progress -- put back ambient lighting when atmospheric shaders disabled. --- indra/llrender/llrender.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 3f319022f6..7d636060f5 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -406,7 +406,8 @@ public: eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor); LLLightState* getLight(U32 index); - + void setAmbientLightColor(const LLColor4& color); + LLTexUnit* getTexUnit(U32 index); U32 getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; } @@ -437,6 +438,7 @@ private: glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH]; U32 mCurMatHash[NUM_MATRIX_MODES]; U32 mLightHash; + LLColor4 mAmbientLightColor; bool mDirty; U32 mCount; -- cgit v1.2.3 From 66acb932ba7bbd7fecbe78a34e753b5aab2d2104 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 20 Sep 2011 03:34:09 -0500 Subject: SH-2244 Add "RenderGLCoreProfile" debug setting that allows the viewer to start with a non-compatibility-profile OpenGL context. --- indra/llrender/llrender.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 7d636060f5..44d9ec1f15 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -428,6 +428,7 @@ public: public: static U32 sUICalls; static U32 sUIVerts; + static bool sGLCoreProfile; private: friend class LLLightState; -- cgit v1.2.3 From a2d08a6d80c4be7456d30f728da1838e63eb397f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 22 Sep 2011 00:10:57 -0500 Subject: SH-2244 Fix "RenderGLCoreProfile" actually make a core profile context and modify viewer to run under said context without generating errors. --- indra/llrender/llrender.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 44d9ec1f15..61e503d384 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -442,6 +442,7 @@ private: LLColor4 mAmbientLightColor; bool mDirty; + U32 mQuadCycle; U32 mCount; U32 mMode; U32 mCurrTextureUnitIndex; -- cgit v1.2.3 From 79912f9d3f0807529183521f69f989f947c1cff1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 7 Oct 2011 03:12:11 -0500 Subject: SH-2031 Profile guided optimization of matrix ops - don't use F64 except where needed (should really factor out calls to gluProject) - get rid of sorting by texture in favor of sorting by matrix (no sort needed, geometry is already matrix sorted as a result of frustum cull tree traversal order) - unroll matrix sync inner loop and cache MVP and normal matrices --- indra/llrender/llrender.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/llrender/llrender.h') diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 61e503d384..7581b9f908 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -343,10 +343,8 @@ public: void pushMatrix(); void popMatrix(); void loadMatrix(const GLfloat* m); - void loadMatrix(const GLdouble* m); void loadIdentity(); void multMatrix(const GLfloat* m); - void multMatrix(const GLdouble* m); void matrixMode(U32 mode); const glh::matrix4f& getModelviewMatrix(); @@ -470,10 +468,10 @@ private: }; -extern F64 gGLModelView[16]; -extern F64 gGLLastModelView[16]; -extern F64 gGLLastProjection[16]; -extern F64 gGLProjection[16]; +extern F32 gGLModelView[16]; +extern F32 gGLLastModelView[16]; +extern F32 gGLLastProjection[16]; +extern F32 gGLProjection[16]; extern S32 gGLViewport[4]; extern LLRender gGL; -- cgit v1.2.3