diff options
| author | Graham Linden <none@none> | 2014-11-17 14:54:00 -0800 | 
|---|---|---|
| committer | Graham Linden <none@none> | 2014-11-17 14:54:00 -0800 | 
| commit | de2fe42a5277d1c9609372ac395767ca976d94e7 (patch) | |
| tree | 4487527cf9d847e6d11e5d7e829cb16cc2eb686c | |
| parent | 9eeb8344a6dd8721ebc85463e966b05a9b034381 (diff) | |
Attempt wider disable of using profile API when timer query is not present
| -rwxr-xr-x | indra/llrender/llvertexbuffer.cpp | 6 | ||||
| -rwxr-xr-x | indra/newview/llglsandbox.cpp | 26 | 
2 files changed, 22 insertions, 10 deletions
| diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index d06564df36..0fae600a90 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -843,9 +843,11 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const  	{  		LL_RECORD_BLOCK_TIME(FTM_GL_DRAW_ARRAYS);  		stop_glerror(); -	LLGLSLShader::startProfile(); +		LLGLSLShader::startProfile(); +		stop_glerror();  		glDrawArrays(sGLMode[mode], first, count); -	LLGLSLShader::stopProfile(count, mode); +		stop_glerror(); +		LLGLSLShader::stopProfile(count, mode);  	}  	stop_glerror(); diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 7cf17c90e9..687838a344 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -920,7 +920,10 @@ F32 gpu_benchmark()  	//number of samples to take  	const S32 samples = 64; -	LLGLSLShader::initProfile(); +	if (gGLManager.mHasTimerQuery) +	{ +		LLGLSLShader::initProfile(); +	}  	LLRenderTarget dest[count];  	U32 source[count]; @@ -977,15 +980,18 @@ F32 gpu_benchmark()  	buff->flush();  	gBenchmarkProgram.bind(); -	buff->setBuffer(LLVertexBuffer::MAP_VERTEX); - -	//wait for any previoius GL commands to finish -	glFinish();  	bool busted_finish = false; +	LL_INFOS() << "GPU BENCHMARK START." << LL_ENDL; +  	for (S32 c = -1; c < samples; ++c)  	{ +		buff->setBuffer(LLVertexBuffer::MAP_VERTEX); +		glFinish(); + +		LL_INFOS() << "GPU BENCHMARK ITERATION." << LL_ENDL; +  		LLTimer timer;  		timer.start(); @@ -1023,9 +1029,11 @@ F32 gpu_benchmark()  			if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f)  			{ //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored  				busted_finish = true; +				LL_INFOS() << "GPU BENCHMARK DETECTED GL DRIVER WITH NOT SO MUCH WORKING glFinish." << LL_ENDL;  			}  			else  			{ +				LL_INFOS() << "GPU BENCHMARK ESTIMATE." << gbps << " Gbps" << LL_ENDL;  				results.push_back(gbps);  			}		  		} @@ -1033,10 +1041,12 @@ F32 gpu_benchmark()  	gBenchmarkProgram.unbind(); -	LLGLSLShader::finishProfile(false); -	 -	LLImageGL::deleteTextures(count, source); +	if (gGLManager.mHasTimerQuery) +	{ +		LLGLSLShader::finishProfile(false); +	} +	LLImageGL::deleteTextures(count, source);  	std::sort(results.begin(), results.end()); | 
