Merge branch 'FirestormViewer:master' into FIRE-34884

master
Angeldark Raymaker 2025-01-06 22:29:08 +00:00 committed by GitHub
commit c8e8880b14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 78 additions and 11 deletions

View File

@ -108,6 +108,10 @@ bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, LLT
llassert(usage == LLTexUnit::TT_TEXTURE);
llassert(!isBoundInStack());
if(mResX == resx && mResY == resy && mUsage == usage && depth == mUseDepth && mGenerateMipMaps == generateMipMaps)
{
return true;
}
resx = llmin(resx, (U32) gGLManager.mGLMaxTextureSize);
resy = llmin(resy, (U32) gGLManager.mGLMaxTextureSize);
@ -360,7 +364,8 @@ void LLRenderTarget::release()
sBytesAllocated -= mResX*mResY*4;
}
else if (mFBO)
// else if (mFBO)
if (mFBO)
{
glBindFramebuffer(GL_FRAMEBUFFER, mFBO);

View File

@ -203,6 +203,16 @@ void FloaterAO::updateList()
}
}
void FloaterAO::updateScrollListData()
{
auto animationListData = mAnimationList->getAllData();
for (auto index = 0; index < mSelectedState->mAnimations.size(); ++index)
{
LLScrollListItem* item = animationListData[index];
item->setUserdata(&mSelectedState->mAnimations[index].mInventoryUUID);
}
}
bool FloaterAO::postBuild()
{
LLPanel* aoPanel = getChild<LLPanel>("animation_overrider_outer_panel");
@ -674,6 +684,7 @@ void FloaterAO::onClickMoveUp()
if (AOEngine::instance().swapWithPrevious(mSelectedState, currentIndex))
{
mAnimationList->swapWithPrevious(currentIndex);
updateScrollListData();
}
}
@ -699,6 +710,7 @@ void FloaterAO::onClickMoveDown()
if (AOEngine::instance().swapWithNext(mSelectedState, currentIndex))
{
mAnimationList->swapWithNext(currentIndex);
updateScrollListData();
}
}

View File

@ -55,6 +55,7 @@ class FloaterAO
virtual void onOpen(const LLSD& key);
virtual void onClose(bool app_quitting);
void updateList();
void updateScrollListData();
void updateSetParameters();
void updateAnimationList();

View File

@ -718,7 +718,7 @@ void LLAppViewerWin32::bugsplatAddStaticAttributes(const LLSD& info)
if (bugSplatMap.writeToFile(BugSplatAttributes::getCrashContextFileName()))
{
LL_INFOS() << "Crash context saved to " << WCSTR(BugSplatAttributes::getCrashContextFileName()) << LL_ENDL;
LL_INFOS() << "Crash context saved to " << BugSplatAttributes::getCrashContextFileName() << LL_ENDL;
}
#endif
}

View File

@ -551,9 +551,12 @@ public:
static LLCachedControl<bool> debugShowMemory(gSavedSettings, "DebugShowMemory");
if (debugShowMemory)
{
auto rss = LLMemory::getCurrentRSS() / 1024;
addText(xpos, ypos,
STRINGIZE("Memory: " << (LLMemory::getCurrentRSS() / 1024) << " (KB)"));
STRINGIZE("Memory: " << rss << " (KB)"));
ypos += y_inc;
LL_PROFILE_PLOT("RSS", (int64_t)rss );
LL_PROFILE_PLOT("GL:", (int64_t)LLRenderTarget::sBytesAllocated );
}
if (gDisplayCameraPos)

View File

@ -372,7 +372,13 @@ bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false)
U32 orm = GL_RGBA;
U32 norm = GL_RGBA16F;
U32 emissive = GL_RGB16F;
// <FS:Beq> FIRE-34483 additional fix
if (target.getNumTextures() > 1)
{
LL_DEBUGS() << "LLPipeline::addDeferredAttachments() - target already has textures - skipping" << LL_ENDL;
return true;
}
// </FS:Beq>
static LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
bool hdr = has_hdr() && gGLManager.mGLVersion > 4.05f;
@ -877,6 +883,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
if (mRT == &mMainRT)
{ // hacky -- allocate auxillary buffer
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("check reflection map setup"); // <FS:Beq/> improve Tracy scoping
gCubeSnapshot = true;
@ -961,8 +968,10 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
if (!gCubeSnapshot) // hack to not re-allocate various targets for cube snapshots
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("non-cube allocations"); // <FS:Beq/> improve Tracy scoping
if (RenderUIBuffer)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("UIBuffer"); // <FS:Beq/> improve Tracy scoping
if (!mUIScreen.allocate(resX, resY, GL_RGBA))
{
return false;
@ -971,9 +980,11 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
if (RenderFSAAType > 0)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("FSAABuffer"); // <FS:Beq/> improve Tracy scoping
if (!mFXAAMap.allocate(resX, resY, GL_RGBA)) return false;
if (RenderFSAAType == 2)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("SMAABuffer"); // <FS:Beq/> improve Tracy scoping
if (!mSMAABlendBuffer.allocate(resX, resY, GL_RGBA, false)) return false;
}
}
@ -988,6 +999,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
if(RenderScreenSpaceReflections)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("SSRBuffer"); // <FS:Beq/> improve Tracy scoping
mSceneMap.allocate(resX, resY, screenFormat, true);
}
else
@ -995,14 +1007,22 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
mSceneMap.release();
}
{LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("mPostMapBuffer"); // <FS:Beq/> improve Tracy scoping
mPostMap.allocate(resX, resY, screenFormat);
} // <FS:Beq/> improve Tracy scoping
// used to scale down textures
// See LLViwerTextureList::updateImagesCreateTextures and LLImageGL::scaleDown
{LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("DownResBuffer");// <FS:Beq/> create an independent preview screen target
mDownResMap.allocate(1024, 1024, GL_RGBA);
}// <FS:Beq/> create an independent preview screen target
mPreviewScreen.allocate(MAX_PREVIEW_WIDTH, MAX_PREVIEW_HEIGHT, GL_RGBA); // <FS:Beq/> create an independent preview screen target
// <FS:Beq> create an independent preview screen target
{LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("PreviewScreenBuffer");
mPreviewScreen.allocate(MAX_PREVIEW_WIDTH, MAX_PREVIEW_HEIGHT, GL_RGBA);
} // </FS:Beq>
{LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("BakeMapBuffer");// <FS:Beq/> create an independent preview screen target
mBakeMap.allocate(LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH, LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT, GL_RGBA);
}// <FS:Beq/> create an independent preview screen target
}
//HACK make screenbuffer allocations start failing after 30 seconds
if (gSavedSettings.getBOOL("SimulateFBOFailure"))
@ -8019,7 +8039,10 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst)
F32 blur_constant = focal_length * focal_length / (fnumber * (subject_distance - focal_length));
blur_constant /= 1000.f; // convert to meters for shader
F32 magnification = focal_length / (subject_distance - focal_length);
// <FS:Beq> FIRE-13989 DOF should be equivalent in all resolutions of the same rendered image
F32 screen_to_target_scale_factor = (F32)gViewerWindow->getWindowHeightRaw()/dst->getHeight();
F32 adj_COF = CameraMaxCoF / screen_to_target_scale_factor;
// </FS:Beq>
{ // build diffuse+bloom+CoF
mRT->deferredLight.bindTarget();
@ -8033,9 +8056,16 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst)
gDeferredCoFProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight());
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance / 1000.f);
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f / LLDrawable::sCurPixelAngle));
// <FS:Beq> FIRE-13989 DOF should be equivalent in all resolutions of the same rendered image
// gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f / LLDrawable::sCurPixelAngle));
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f / LLDrawable::sCurPixelAngle) * screen_to_target_scale_factor);
// </FS:Beq>
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
// <FS:Beq> FIRE-13989 DOF should be equivalent in all resolutions of the same rendered image
// gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
// divide by the screen->target ratio so tha a larger target (ratio < 1) has a higher MaxCoF value
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, adj_COF);
// </FS:Beq>
gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
mScreenTriangleVB->setBuffer();
@ -8057,7 +8087,10 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst)
gDeferredPostProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, &mRT->deferredLight, LLTexUnit::TFO_POINT);
gDeferredPostProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight());
gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
// <FS:Beq> FIRE-13989 DOF should be equivalent in all resolutions of the same rendered image
// gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, adj_COF);
// </FS:Beq>
gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
mScreenTriangleVB->setBuffer();
@ -8079,7 +8112,10 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst)
gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_LIGHT, &mRT->deferredLight, LLTexUnit::TFO_POINT);
gDeferredDoFCombineProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight());
gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
// <FS:Beq> FIRE-13989 DOF should be equivalent in all resolutions of the same rendered image
// gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, adj_COF);
// </FS:Beq>
gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_WIDTH, (dof_width - 1) / (F32)src->getWidth());
gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_HEIGHT, (dof_height - 1) / (F32)src->getHeight());

View File

@ -7,6 +7,8 @@
<combo_box.item label="Klein (128x128)" name="Small(128x128)"/>
<combo_box.item label="Mittel (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Groß (512x512)" name="Large(512x512)"/>
<combo_box.item label="Sehr Groß (1024x1024)" name="Very Large(1024x1024)"/>
<combo_box.item label="Riesig (2048x2048)" name="Huge(2048x2048)"/>
<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
<combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>

View File

@ -59,6 +59,14 @@
label="Large (512x512)"
name="Large(512x512)"
value="[i512,i512]" />
<combo_box.item
label="Very Large (1024x1024)"
name="Very Large(1024x1024)"
value="[i1024,i1024]" />
<combo_box.item
label="Huge (2048x2048)"
name="Huge(2048x2048)"
value="[i2048,i2048]" />
<combo_box.item
label="Current Window"
name="CurrentWindow"