# Conflicts:
#	indra/newview/pipeline.cpp
meow-7.2.2
Ansariel 2023-01-04 17:10:49 +01:00
commit c2d26cced9
12 changed files with 733 additions and 600 deletions

View File

@ -5072,10 +5072,10 @@ void LLWindowWin32::LLWindowWin32Thread::updateVRAMUsage()
void LLWindowWin32::LLWindowWin32Thread::close()
{
assert_main_thread();
if (! mQueue.isClosed() && gDisconnected)
if (!mQueue->isClosed() && gDisconnected)
{
LL_DEBUGS("ThreadPool") << mName << " closing queue and joining threads" << LL_ENDL;
mQueue.close();
mQueue->close();
for (auto& pair: mThreads)
{
LL_DEBUGS("ThreadPool") << mName << " waiting on thread " << pair.first << LL_ENDL;

View File

@ -35,7 +35,7 @@ VARYING vec2 vary_texcoord1;
void main()
{
gl_Position = vec4(position.xyz, 1.0);
vary_texcoord0 = texcoord0;
vary_texcoord1 = texcoord1;
vary_texcoord0 = position.xy * 0.5 + 0.5;
vary_texcoord1 = vary_texcoord0;
}

View File

@ -193,8 +193,6 @@ std::string USE_TEXTURE;
LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit()
{
LLRender::eTexIndex channel_to_edit = LLRender::DIFFUSE_MAP;
if (mComboMatMedia)
{
@ -216,6 +214,17 @@ LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit()
return channel_to_edit;
}
LLRender::eTexIndex LLPanelFace::getTextureDropChannel()
{
if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL)
{
LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
return LLRender::eTexIndex(radio_mat_type->getSelectedIndex());
}
return LLRender::eTexIndex(MATTYPE_DIFFUSE);
}
// Things the UI provides...
//
LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); }
@ -1691,7 +1700,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
enabled = editable && has_pbr_material;
material_type = mRadioPbrType->getSelectedIndex();
}
LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type));
switch (material_type)
{

View File

@ -121,6 +121,7 @@ public:
}
LLRender::eTexIndex getTextureChannelToEdit();
LLRender::eTexIndex getTextureDropChannel();
protected:
void navigateToTitleMedia(const std::string url);

View File

@ -1109,10 +1109,6 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab
// check to see if object is already in list
LLSelectNode *nodep = mSelectedObjects->findNode(objectp);
// Reset (in anticipation of being set to an appropriate value by panel refresh, if they're up)
//
setTextureChannel(LLRender::DIFFUSE_MAP);
// if not in list, add it
if (!nodep)
{

View File

@ -692,11 +692,6 @@ public:
void saveSelectedShinyColors();
void saveSelectedObjectTextures();
// Sets which texture channel to query for scale and rot of display
// and depends on UI state of LLPanelFace when editing
void setTextureChannel(LLRender::eTexIndex texIndex) { mTextureChannel = texIndex; }
LLRender::eTexIndex getTextureChannel() { return mTextureChannel; }
void selectionUpdatePhysics(BOOL use_physics);
void selectionUpdateTemporary(BOOL is_temporary);
void selectionUpdatePhantom(BOOL is_ghost);

View File

@ -302,7 +302,59 @@ void LLFloaterTexturePicker::stopUsingPipette()
void LLFloaterTexturePicker::updateImageStats()
{
if (mTexturep.notNull())
if (mGLTFMaterial.notNull())
{
S32 width = 0;
S32 height = 0;
bool has_texture = false;
if (mGLTFMaterial->mBaseColorTexture)
{
width = llmax(width, mGLTFMaterial->mBaseColorTexture->getFullWidth());
height = llmax(height, mGLTFMaterial->mBaseColorTexture->getFullHeight());
has_texture = true;
}
if (mGLTFMaterial->mNormalTexture)
{
width = llmax(width, mGLTFMaterial->mNormalTexture->getFullWidth());
height = llmax(height, mGLTFMaterial->mNormalTexture->getFullHeight());
has_texture = true;
}
if (mGLTFMaterial->mMetallicRoughnessTexture)
{
width = llmax(width, mGLTFMaterial->mMetallicRoughnessTexture->getFullWidth());
height = llmax(height, mGLTFMaterial->mMetallicRoughnessTexture->getFullHeight());
has_texture = true;
}
if (mGLTFMaterial->mEmissiveTexture)
{
width = llmax(width, mGLTFMaterial->mEmissiveTexture->getFullWidth());
height = llmax(height, mGLTFMaterial->mEmissiveTexture->getFullHeight());
has_texture = true;
}
if (width > 0 && height > 0)
{
std::string formatted_dims = llformat("%d x %d", width, height);
mResolutionLabel->setTextArg("[DIMENSIONS]", formatted_dims);
if (mOnUpdateImageStatsCallback)
{
mOnUpdateImageStatsCallback(mTexturep);
}
}
else if (has_texture)
{
// unknown resolution
mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("[? x ?]"));
}
else
{
// No textures - no applicable resolution (may be show some max value instead?)
mResolutionLabel->setTextArg("[DIMENSIONS]", std::string(""));
}
}
else if (mTexturep.notNull())
{
//RN: have we received header data for this image?
if (mTexturep->getFullWidth() > 0 && mTexturep->getFullHeight() > 0)
@ -560,6 +612,8 @@ void LLFloaterTexturePicker::draw()
static LLCachedControl<F32> max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f);
drawConeToOwner(mContextConeOpacity, max_opacity, mOwner);
// This is going to spam mOnUpdateImageStatsCallback,
// either move elsewhere or fix to cause update once per image
updateImageStats();
// if we're inactive, gray out "apply immediate" checkbox
@ -571,30 +625,38 @@ void LLFloaterTexturePicker::draw()
if( mOwner )
{
mTexturep = NULL;
if(mImageAssetID.notNull())
{
LLPointer<LLViewerFetchedTexture> texture = NULL;
mGLTFMaterial = NULL;
if (mImageAssetID.notNull())
{
if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL)
{
mGLTFMaterial = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mImageAssetID);
}
else
{
LLPointer<LLViewerFetchedTexture> texture = NULL;
if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
{
// TODO: Fix this! Picker is not warrantied to be connected to a selection
// LLSelectMgr shouldn't be used in texture picker
LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if (obj)
{
LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID);
texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL;
}
}
if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
{
// TODO: Fix this! Picker is not warrantied to be connected to a selection
// LLSelectMgr shouldn't be used in texture picker
LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if (obj)
{
LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID);
texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL;
}
}
if (texture.isNull())
{
texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID);
}
if (texture.isNull())
{
texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID);
}
mTexturep = texture;
mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
}
mTexturep = texture;
mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
}
}
if (mTentativeLabel)
{

View File

@ -48,6 +48,7 @@ class LLRadioGroup;
class LLFloaterTexturePicker;
class LLInventoryItem;
class LLViewerFetchedTexture;
class LLFetchedGLTFMaterial;
// used for setting drag & drop callbacks.
typedef boost::function<BOOL (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback;
@ -374,6 +375,7 @@ protected:
void refreshInventoryFilter();
LLPointer<LLViewerTexture> mTexturep;
LLPointer<LLFetchedGLTFMaterial> mGLTFMaterial;
LLView* mOwner;
LLUUID mImageAssetID; // Currently selected texture

View File

@ -1211,7 +1211,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
if (gFloaterTools->getVisible() && panel_face)
{
tex_channel = (tex_channel > -1) ? tex_channel : LLSelectMgr::getInstance()->getTextureChannel();
tex_channel = (tex_channel > -1) ? tex_channel : panel_face->getTextureDropChannel();
switch (tex_channel)
{

View File

@ -1511,9 +1511,12 @@ void render_ui(F32 zoom_factor, int subfield)
}
{
// Render our post process prior to the HUD, UI, etc.
gPipeline.renderPostProcess();
// draw hud and 3D ui elements into screen render target so they'll be able to use
// the depth buffer (avoids extra copy of depth buffer per frame)
gPipeline.mRT->screen.bindTarget();
gPipeline.screenTarget()->bindTarget();
// SL-15709
// NOTE: Tracy only allows one ZoneScoped per function.
// Solutions are:
@ -1553,7 +1556,7 @@ void render_ui(F32 zoom_factor, int subfield)
}
}
gPipeline.mRT->screen.flush();
gPipeline.screenTarget()->flush();
// apply gamma correction and post effects before rendering 2D UI
gPipeline.renderFinalize();

File diff suppressed because it is too large Load Diff

View File

@ -137,6 +137,8 @@ public:
void generateImpostor(LLVOAvatar* avatar, bool preview_avatar = false);
void bindScreenToTexture();
void renderFinalize();
void renderPostProcess();
LLRenderTarget* screenTarget();
void init();
void cleanup();