diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-02-26 20:01:26 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-02-26 20:14:39 +0200 | 
| commit | 42ceac9695f7e098f15264977396a939c8ddfd23 (patch) | |
| tree | a5335524e579d1ad478f1b723215673a55cc51dd | |
| parent | bc02334284839e6e7fb133d8b5b4d75fec919691 (diff) | |
Revert "#2639 GPU test twice to fix misreported bandwidth (#3558)"
This reverts commit b0d80552b3177269eb24ef9a1e0d58a98d95a96f.
| -rw-r--r-- | indra/newview/llglsandbox.cpp | 66 | 
1 files changed, 27 insertions, 39 deletions
| diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 5484ce6276..112008172e 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -903,39 +903,6 @@ private:  }; -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 @@ -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; @@ -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;  } | 
