Skip to content

Merge branch 'main' into release/2025.03 #3707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions indra/newview/llagent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "llgroupmgr.h"
#include "llhudmanager.h"
#include "lljoystickbutton.h"
#include "lllandmarkactions.h"
#include "llmorphview.h"
#include "llmoveview.h"
#include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state
Expand Down Expand Up @@ -4320,8 +4321,17 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id)

void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id)
{
LLViewerRegion *regionp = getRegion();
if(regionp && teleportCore())
bool is_local(false);
LLViewerRegion* regionp = getRegion();

if (LLLandmark* landmark = gLandmarkList.getAsset(landmark_asset_id, NULL))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to check region, this is using regionp->getHandle() insde.

{
LLVector3d pos_global;
landmark->getGlobalPos(pos_global);
is_local = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]));
}

if(regionp && teleportCore(is_local))
{
LL_INFOS("Teleport") << "Sending TeleportLandmarkRequest. Current region handle " << regionp->getHandle()
<< " region id " << regionp->getRegionID()
Expand Down
66 changes: 27 additions & 39 deletions indra/newview/llglsandbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,39 +903,6 @@ class ShaderBinder
};


F32 shader_timer_benchmark(std::vector<LLRenderTarget> & dest, TextureHolder & texHolder, U32 textures_count, LLVertexBuffer * buff, F32 &seconds)
{
// run GPU timer benchmark

//number of samples to take
const S32 samples = 64;

{
ShaderProfileHelper initProfile;
dest[0].bindTarget();
gBenchmarkProgram.bind();
for (S32 c = 0; c < samples; ++c)
{
for (U32 i = 0; i < textures_count; ++i)
{
texHolder.bind(i);
buff->setBuffer();
buff->drawArrays(LLRender::TRIANGLES, 0, 3);
}
}
gBenchmarkProgram.unbind();
dest[0].flush();
}

F32 ms = gBenchmarkProgram.mTimeElapsed / 1000000.f;
seconds = ms / 1000.f;

F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn;
F64 gpixels_drawn = samples_drawn / 1000000000.0;
F32 samples_sec = (F32)(gpixels_drawn / seconds);
return samples_sec * 4; // 4 bytes per sample
}

//-----------------------------------------------------------------------------
// gpu_benchmark()
// returns measured memory bandwidth of GPU in gigabytes per second
Expand Down Expand Up @@ -977,6 +944,9 @@ F32 gpu_benchmark()
//number of textures
const U32 count = 32;

//number of samples to take
const S32 samples = 64;

//time limit, allocation operations shouldn't take longer then 30 seconds, same for actual benchmark.
const F32 time_limit = 30;

Expand Down Expand Up @@ -1066,15 +1036,33 @@ F32 gpu_benchmark()

LLGLSLShader::unbind();

// run GPU timer benchmark twice
F32 seconds = 0;
F32 gbps = shader_timer_benchmark(dest, texHolder, count, buff.get(), seconds);
// run GPU timer benchmark
{
ShaderProfileHelper initProfile;
dest[0].bindTarget();
gBenchmarkProgram.bind();
for (S32 c = 0; c < samples; ++c)
{
for (U32 i = 0; i < count; ++i)
{
texHolder.bind(i);
buff->setBuffer();
buff->drawArrays(LLRender::TRIANGLES, 0, 3);
}
}
gBenchmarkProgram.unbind();
dest[0].flush();
}

LL_INFOS("Benchmark") << "Memory bandwidth, 1st run is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL;
F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
F32 seconds = ms/1000.f;

gbps = shader_timer_benchmark(dest, texHolder, count, buff.get(), seconds);
F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn;
F64 gpixels_drawn = samples_drawn / 1000000000.0;
F32 samples_sec = (F32)(gpixels_drawn/seconds);
F32 gbps = samples_sec*4; // 4 bytes per sample

LL_INFOS("Benchmark") << "Memory bandwidth, final run is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL;
LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL;

return gbps;
}