diff options
Diffstat (limited to 'indra/newview/llglsandbox.cpp')
-rw-r--r-- | indra/newview/llglsandbox.cpp | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 175f1849cf..2e4d0f85b9 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -815,7 +815,7 @@ void LLViewerObjectList::renderObjectBeacons() const LLVector3 &thisline = debug_beacon.mPositionAgent; gGL.begin(LLRender::LINES); - gGL.color4fv(color.mV); + gGL.color4fv(linearColor4(color).mV); draw_cross_lines(thisline, 2.0f, 2.0f, 50.f); draw_line_cube(0.10f, thisline); @@ -844,7 +844,7 @@ void LLViewerObjectList::renderObjectBeacons() const LLVector3 &thisline = debug_beacon.mPositionAgent; gGL.begin(LLRender::LINES); - gGL.color4fv(debug_beacon.mColor.mV); + gGL.color4fv(linearColor4(debug_beacon.mColor).mV); draw_cross_lines(thisline, 0.5f, 0.5f, 0.5f); draw_line_cube(0.10f, thisline); @@ -987,9 +987,8 @@ private: //----------------------------------------------------------------------------- F32 gpu_benchmark() { - if (!gGLManager.mHasTimerQuery) + if (gGLManager.mGLVersion < 3.3f) { // don't bother benchmarking venerable drivers which don't support accurate timing anyway - // and are likely to be correctly identified by the GPU table already. return -1.f; } @@ -1000,8 +999,8 @@ F32 gpu_benchmark() gBenchmarkProgram.mName = "Benchmark Shader"; gBenchmarkProgram.mFeatures.attachNothing = true; gBenchmarkProgram.mShaderFiles.clear(); - gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER_ARB)); - gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER_ARB)); + gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER)); + gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER)); gBenchmarkProgram.mShaderLevel = 1; if (!gBenchmarkProgram.createShader(NULL, NULL)) { @@ -1051,7 +1050,7 @@ F32 gpu_benchmark() for (U32 i = 0; i < count; ++i) { //allocate render targets and textures - if (!dest[i].allocate(res, res, GL_RGBA, false, false, LLTexUnit::TT_TEXTURE, true)) + if (!dest[i].allocate(res, res, GL_RGBA)) { LL_WARNS("Benchmark") << "Failed to allocate render target." << LL_ENDL; // abandon the benchmark test @@ -1084,9 +1083,9 @@ F32 gpu_benchmark() delete [] pixels; //make a dummy triangle to draw with - LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, GL_STREAM_DRAW_ARB); + LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX); - if (!buff->allocateBuffer(3, 0, true)) + if (!buff->allocateBuffer(3, 0)) { LL_WARNS("Benchmark") << "Failed to allocate buffer during benchmark." << LL_ENDL; // abandon the benchmark test @@ -1110,22 +1109,12 @@ F32 gpu_benchmark() v[1].set(-1, -3, 0); v[2].set(3, 1, 0); - buff->flush(); + buff->unmapBuffer(); // ensure matched pair of bind() and unbind() calls ShaderBinder binder(gBenchmarkProgram); -#ifdef GL_ARB_vertex_array_object - U32 glarray = 0; - - if (LLRender::sGLCoreProfile) - { - glGenVertexArrays(1, &glarray); - glBindVertexArray(glarray); - } -#endif - - buff->setBuffer(LLVertexBuffer::MAP_VERTEX); + buff->setBuffer(); glFinish(); F32 time_passed = 0; // seconds @@ -1157,15 +1146,6 @@ F32 gpu_benchmark() } } -#ifdef GL_ARB_vertex_array_object - if (LLRender::sGLCoreProfile) - { - glBindVertexArray(0); - glDeleteVertexArrays(1, &glarray); - } -#endif - - std::sort(results.begin(), results.end()); F32 gbps = results[results.size()/2]; |