diff options
author | Dave Parks <davep@lindenlab.com> | 2023-01-09 18:12:54 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-01-09 18:12:54 -0600 |
commit | a2d17d3c1e5a62f10ab3922b6b12f909f1cd4682 (patch) | |
tree | 1010a8f928b2e25bd06cff12b83c9b8be39cd9b0 /indra/newview/llviewershadermgr.cpp | |
parent | a710bf9067bd4c4217b9febc0ad277a1636ec882 (diff) |
SL-18869 Optimizations -- Decruftify LLRenderTarget, use a shader to copy color/depth instead of glCopyTexSubImage or glBlitFrameBuffer
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 757a946fda..8dd01a3a29 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -93,6 +93,8 @@ LLGLSLShader gDownsampleDepthRectProgram; LLGLSLShader gAlphaMaskProgram; LLGLSLShader gBenchmarkProgram; LLGLSLShader gReflectionProbeDisplayProgram; +LLGLSLShader gCopyProgram; +LLGLSLShader gCopyDepthProgram; //object shaders LLGLSLShader gObjectSimpleProgram; @@ -3916,6 +3918,27 @@ BOOL LLViewerShaderMgr::loadShadersInterface() success = gReflectionProbeDisplayProgram.createShader(NULL, NULL); } + if (success) + { + gCopyProgram.mName = "Copy Shader"; + gCopyProgram.mShaderFiles.clear(); + gCopyProgram.mShaderFiles.push_back(make_pair("interface/copyV.glsl", GL_VERTEX_SHADER)); + gCopyProgram.mShaderFiles.push_back(make_pair("interface/copyF.glsl", GL_FRAGMENT_SHADER)); + gCopyProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; + success = gCopyProgram.createShader(NULL, NULL); + } + + if (success) + { + gCopyDepthProgram.mName = "Copy Depth Shader"; + gCopyDepthProgram.mShaderFiles.clear(); + gCopyDepthProgram.mShaderFiles.push_back(make_pair("interface/copyV.glsl", GL_VERTEX_SHADER)); + gCopyDepthProgram.mShaderFiles.push_back(make_pair("interface/copyF.glsl", GL_FRAGMENT_SHADER)); + gCopyDepthProgram.clearPermutations(); + gCopyDepthProgram.addPermutation("COPY_DEPTH", "1"); + gCopyDepthProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; + success = gCopyDepthProgram.createShader(NULL, NULL); + } if (success) { |