diff options
Diffstat (limited to 'indra/llrender/llglslshader.h')
-rw-r--r-- | indra/llrender/llglslshader.h | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 85e83dbcb9..23db1a8549 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -52,12 +52,14 @@ public: bool hasShadows; bool hasAmbientOcclusion; bool hasSrgb; - bool encodesNormal; + bool encodesNormal; // include: shaders\class1\environment\encodeNormF.glsl bool isDeferred; + bool hasScreenSpaceReflections; bool hasIndirect; S32 mIndexedTextureChannels; bool disableTextureIndex; bool hasAlphaMask; + bool hasReflectionProbes = false; bool attachNothing; // char numLights; @@ -117,6 +119,11 @@ public: mVector3s.push_back({ index, value }); } + void uniform3fv(S32 index, const F32* value) + { + mVector3s.push_back({ index, LLVector3(value) }); + } + void apply(LLGLSLShader* shader); @@ -128,6 +135,13 @@ public: class LLGLSLShader { public: + // NOTE: Keep gShaderConsts and LLGLSLShader::ShaderConsts_e in sync! + enum eShaderConsts + { + SHADER_CONST_CLOUD_MOON_DEPTH + , SHADER_CONST_STAR_DEPTH + , NUM_SHADER_CONSTS + }; // enum primarily used to control application sky settings uniforms typedef enum @@ -145,7 +159,7 @@ public: LLGLSLShader(); ~LLGLSLShader(); - static GLhandleARB sCurBoundShader; + static GLuint sCurBoundShader; static LLGLSLShader* sCurBoundShaderPtr; static S32 sIndexedTextureChannels; @@ -167,17 +181,19 @@ public: const char** varyings = NULL); BOOL attachFragmentObject(std::string object); BOOL attachVertexObject(std::string object); - void attachObject(GLhandleARB object); - void attachObjects(GLhandleARB* objects = NULL, S32 count = 0); + void attachObject(GLuint object); + void attachObjects(GLuint* objects = NULL, S32 count = 0); BOOL mapAttributes(const std::vector<LLStaticHashedString> * attributes); BOOL mapUniforms(const std::vector<LLStaticHashedString> *); void mapUniform(GLint index, const std::vector<LLStaticHashedString> *); void uniform1i(U32 index, GLint i); void uniform1f(U32 index, GLfloat v); + void fastUniform1f(U32 index, GLfloat v); void uniform2f(U32 index, GLfloat x, GLfloat y); void uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z); void uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); void uniform1iv(U32 index, U32 count, const GLint* i); + void uniform4iv(U32 index, U32 count, const GLint* i); void uniform1fv(U32 index, U32 count, const GLfloat* v); void uniform2fv(U32 index, U32 count, const GLfloat* v); void uniform3fv(U32 index, U32 count, const GLfloat* v); @@ -188,6 +204,8 @@ public: void uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v); void uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v); void uniform1i(const LLStaticHashedString& uniform, GLint i); + void uniform1iv(const LLStaticHashedString& uniform, U32 count, const GLint* v); + void uniform4iv(const LLStaticHashedString& uniform, U32 count, const GLint* v); void uniform1f(const LLStaticHashedString& uniform, GLfloat v); void uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y); void uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y, GLfloat z); @@ -207,12 +225,14 @@ public: GLint getUniformLocation(U32 index); GLint getAttribLocation(U32 attrib); - GLint mapUniformTextureChannel(GLint location, GLenum type); + GLint mapUniformTextureChannel(GLint location, GLenum type, GLint size); void clearPermutations(); void addPermutation(std::string name, std::string value); void removePermutation(std::string name); + void addConstant( const LLGLSLShader::eShaderConsts shader_const ); + //enable/disable texture channel for specified uniform //if given texture uniform is active in the shader, //the corresponding channel will be active upon return @@ -239,7 +259,7 @@ public: U32 mMatHash[LLRender::NUM_MATRIX_MODES]; U32 mLightHash; - GLhandleARB mProgramObject; + GLuint mProgramObject; #if LL_RELEASE_WITH_DEBUG_INFO struct attr_name { @@ -290,6 +310,10 @@ public: // this pointer should be set to whichever shader represents this shader's rigged variant LLGLSLShader* mRiggedVariant = nullptr; + #ifdef LL_PROFILER_ENABLE_RENDER_DOC + void setLabel(const char* label); + #endif + private: void unloadInternal(); }; @@ -301,5 +325,10 @@ extern LLGLSLShader gSolidColorProgram; //Alpha mask shader (declared here so llappearance can access properly) extern LLGLSLShader gAlphaMaskProgram; +#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#define LL_SET_SHADER_LABEL(shader) shader.setLabel(#shader) +#else +#define LL_SET_SHADER_LABEL(shader, label) +#endif #endif |