diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llrender/llshadermgr.cpp | 5 | ||||
-rwxr-xr-x | indra/llrender/llvertexbuffer.cpp | 57 | ||||
-rwxr-xr-x | indra/newview/lldrawpoolalpha.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/llviewershadermgr.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 19 |
5 files changed, 68 insertions, 17 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index c3e76f5e0e..21b8322bf1 100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -177,7 +177,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) if (features->hasSRGB) { +#if LL_DARWIN + if (!shader->attachObject("deferred/srgb_mac.glsl")) + +#else if (!shader->attachObject("deferred/srgb.glsl")) +#endif { return FALSE; } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b1ef6e0576..f1249a842a 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -753,10 +753,10 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi U16* idx = ((U16*) getIndicesPointer())+indices_offset; stop_glerror(); - LLGLSLShader::startProfile(); - glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT, + LLGLSLShader::startProfile(); + glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT, idx); - LLGLSLShader::stopProfile(count, mode); + LLGLSLShader::stopProfile(count, mode); stop_glerror(); @@ -2209,11 +2209,32 @@ void LLVertexBuffer::bindForFeedback(U32 channel, U32 type, U32 index, U32 count #endif } +void DumpComponents(U32 mask) +{ + llinfos << + ((mask & LLVertexBuffer::MAP_VERTEX) ? "vertex:" : " ") << + ((mask & LLVertexBuffer::MAP_NORMAL) ? "norms:" : " ") << + ((mask & LLVertexBuffer::MAP_TEXCOORD0) ? "TC0:" : " ") << + ((mask & LLVertexBuffer::MAP_TEXCOORD1) ? "TC1:" : " ") << + ((mask & LLVertexBuffer::MAP_TEXCOORD2) ? "TC2:" : " ") << + ((mask & LLVertexBuffer::MAP_TEXCOORD3) ? "TC3:" : " ") << + ((mask & LLVertexBuffer::MAP_COLOR) ? "color:" : " ") << + ((mask & LLVertexBuffer::MAP_EMISSIVE) ? "emissive:" : " ") << + ((mask & LLVertexBuffer::MAP_TANGENT) ? "tangents" : " ") << llendl; +} + // Set for rendering void LLVertexBuffer::setBuffer(U32 data_mask) { flush(); + if((getTypeMask() & data_mask) != data_mask) + { + llinfos << "Missing VB stream components." << llendl; + DumpComponents(data_mask & ~getTypeMask()); + data_mask &= getTypeMask(); + } + //set up pointers if the data mask is different ... bool setup = (sLastMask != data_mask); @@ -2237,15 +2258,36 @@ void LLVertexBuffer::setBuffer(U32 data_mask) } } + static bool done_done_it = false; + + if (!done_done_it) + { + done_done_it = true; + + llinfos << + "MAP_VERTEX: " << MAP_VERTEX << + "MAP_VERTEX: " << MAP_NORMAL << + "MAP_VERTEX: " << MAP_TEXCOORD0 << + "MAP_VERTEX: " << MAP_TEXCOORD1 << + "MAP_VERTEX: " << MAP_TEXCOORD2 << + "MAP_VERTEX: " << MAP_TEXCOORD3 << + "MAP_VERTEX: " << MAP_COLOR << + "MAP_VERTEX: " << MAP_EMISSIVE << + "MAP_VERTEX: " << MAP_TANGENT << llendl; + + + } + if ((data_mask & required_mask) != required_mask) { U32 unsatisfied_mask = (required_mask & ~data_mask); U32 i = 0; - while (i < 15) + while (i < TYPE_MAX) { - switch ((unsatisfied_mask & (1 << i))) + U32 unsatisfied_flag = unsatisfied_mask & (1 << i); + switch (unsatisfied_flag) { case MAP_VERTEX: llinfos << "Missing vert pos" << llendl; break; case MAP_NORMAL: llinfos << "Missing normals" << llendl; break; @@ -2264,6 +2306,11 @@ void LLVertexBuffer::setBuffer(U32 data_mask) } } + if (unsatisfied_mask & (1 << TYPE_INDEX)) + { + llinfos << "Missing indices" << llendl; + } + llerrs << "Shader consumption mismatches data provision." << llendl; } } diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 6302cf6b00..f4f63e1042 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -529,7 +529,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - params.mVertexBuffer->setBuffer(mask); + params.mVertexBuffer->setBuffer(mask & ~(params.mFullbright ? (LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0)); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 545a236f81..73177d549b 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1444,7 +1444,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredMultiLightProgram[i].mName = llformat("Deferred MultiLight Shader %d", i); gDeferredMultiLightProgram[i].mShaderFiles.clear(); - gDeferredMultiLightProgram[i].mFeatures.hasSRGB = true; gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiLightProgram[i].mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 165b28beb5..05390f64f0 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8695,12 +8695,6 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredSpotLightProgram); } - //reset mDeferredVB to fullscreen triangle - mDeferredVB->getVertexStrider(vert); - vert[0].set(-1,1,0); - vert[1].set(-1,-3,0); - vert[2].set(3,1,0); - { LLGLDepthTest depth(GL_FALSE); @@ -8719,6 +8713,10 @@ void LLPipeline::renderDeferredLighting() F32 far_z = 0.f; + bindDeferredShader(gDeferredMultiLightProgram[0]); + + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + while (!fullscreen_lights.empty()) { LLFastTimer ftm(FTM_FULLSCREEN_LIGHTS); @@ -8743,14 +8741,15 @@ void LLPipeline::renderDeferredLighting() gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col); gDeferredMultiLightProgram[idx].uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z); far_z = 0.f; - count = 0; - mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + count = 0; + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + unbindDeferredShader(gDeferredMultiLightProgram[idx]); } } - - unbindDeferredShader(gDeferredMultiLightProgram[0]); + unbindDeferredShader(gDeferredMultiLightProgram[0]); + bindDeferredShader(gDeferredMultiSpotLightProgram); gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); |