diff options
| -rwxr-xr-x | indra/newview/llglsandbox.cpp | 24 | 
1 files changed, 22 insertions, 2 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index f620bf19fb..0a423e6785 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -969,6 +969,8 @@ F32 gpu_benchmark()  	//wait for any previoius GL commands to finish  	glFinish(); +	bool busted_finish = false; +  	for (S32 c = -1; c < samples; ++c)  	{  		LLTimer timer; @@ -983,7 +985,18 @@ F32 gpu_benchmark()  		}  		//wait for current batch of copies to finish -		glFinish(); +		if (busted_finish) +		{ +			//read a pixel off the last target since some drivers seem to ignore glFinish +			dest[count-1].bindTarget(); +			U32 pixel = 0; +			glReadPixels(0,0,1,1,GL_RGBA, GL_UNSIGNED_BYTE, &pixel); +			dest[count-1].flush(); +		} +		else +		{ +			glFinish(); +		}  		F32 time = timer.getElapsedTimeF32(); @@ -994,7 +1007,14 @@ F32 gpu_benchmark()  			F32 gbps = gb/time; -			results.push_back(gbps); +			if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f) +			{ //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored +				busted_finish = true; +			} +			else +			{ +				results.push_back(gbps); +			}		  		}  	}  | 
