• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*-------------------------------------------------------------------------
2  * drawElements Quality Program Tester Core
3  * ----------------------------------------
4  *
5  * Copyright 2014 The Android Open Source Project
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  *//*!
20  * \file
21  * \brief Test Log C++ Wrapper.
22  *//*--------------------------------------------------------------------*/
23 
24 #include "deCommandLine.h"
25 #include "tcuTestLog.hpp"
26 #include "tcuTextureUtil.hpp"
27 #include "tcuSurface.hpp"
28 #include "deMath.h"
29 
30 #include <limits>
31 
32 namespace tcu
33 {
34 
35 class LogWriteFailedError : public ResourceError
36 {
37 public:
LogWriteFailedError(void)38 	LogWriteFailedError (void) : ResourceError("Writing to test log failed") {}
39 };
40 
41 enum
42 {
43 	MAX_IMAGE_SIZE_2D		= 4096,
44 	MAX_IMAGE_SIZE_3D		= 128
45 };
46 
47 // LogImage
48 
LogImage(const std::string & name,const std::string & description,const Surface & surface,qpImageCompressionMode compression)49 LogImage::LogImage (const std::string& name, const std::string& description, const Surface& surface, qpImageCompressionMode compression)
50 	: m_name		(name)
51 	, m_description	(description)
52 	, m_access		(surface.getAccess())
53 	, m_scale		(1.0f, 1.0f, 1.0f, 1.0f)
54 	, m_bias		(0.0f, 0.0f, 0.0f, 0.0f)
55 	, m_compression	(compression)
56 {
57 }
58 
LogImage(const std::string & name,const std::string & description,const ConstPixelBufferAccess & access,qpImageCompressionMode compression)59 LogImage::LogImage (const std::string& name, const std::string& description, const ConstPixelBufferAccess& access, qpImageCompressionMode compression)
60 	: m_name		(name)
61 	, m_description	(description)
62 	, m_access		(access)
63 	, m_scale		(1.0f, 1.0f, 1.0f, 1.0f)
64 	, m_bias		(0.0f, 0.0f, 0.0f, 0.0f)
65 	, m_compression	(compression)
66 {
67 	// Simplify combined formats that only use a single channel
68 	if (tcu::isCombinedDepthStencilType(m_access.getFormat().type))
69 	{
70 		if (m_access.getFormat().order == tcu::TextureFormat::D)
71 			m_access = tcu::getEffectiveDepthStencilAccess(m_access, tcu::Sampler::MODE_DEPTH);
72 		else if (m_access.getFormat().order == tcu::TextureFormat::S)
73 			m_access = tcu::getEffectiveDepthStencilAccess(m_access, tcu::Sampler::MODE_STENCIL);
74 	}
75 
76 	// Implicit scale and bias
77 	if (m_access.getFormat().order != tcu::TextureFormat::DS)
78 		computePixelScaleBias(m_access, m_scale, m_bias);
79 	else
80 	{
81 		// Pack D and S bias and scale to R and G
82 		const ConstPixelBufferAccess	depthAccess		= tcu::getEffectiveDepthStencilAccess(m_access, tcu::Sampler::MODE_DEPTH);
83 		const ConstPixelBufferAccess	stencilAccess	= tcu::getEffectiveDepthStencilAccess(m_access, tcu::Sampler::MODE_STENCIL);
84 		tcu::Vec4						depthScale;
85 		tcu::Vec4						depthBias;
86 		tcu::Vec4						stencilScale;
87 		tcu::Vec4						stencilBias;
88 
89 		computePixelScaleBias(depthAccess, depthScale, depthBias);
90 		computePixelScaleBias(stencilAccess, stencilScale, stencilBias);
91 
92 		m_scale = tcu::Vec4(depthScale.x(), stencilScale.x(), 0.0f, 0.0f);
93 		m_bias = tcu::Vec4(depthBias.x(), stencilBias.x(), 0.0f, 0.0f);
94 	}
95 }
96 
LogImage(const std::string & name,const std::string & description,const ConstPixelBufferAccess & access,const Vec4 & scale,const Vec4 & bias,qpImageCompressionMode compression)97 LogImage::LogImage (const std::string& name, const std::string& description, const ConstPixelBufferAccess& access, const Vec4& scale, const Vec4& bias, qpImageCompressionMode compression)
98 	: m_name		(name)
99 	, m_description	(description)
100 	, m_access		(access)
101 	, m_scale		(scale)
102 	, m_bias		(bias)
103 	, m_compression	(compression)
104 {
105 	// Cannot set scale and bias of combined formats
106 	DE_ASSERT(access.getFormat().order != tcu::TextureFormat::DS);
107 
108 	// Simplify access
109 	if (tcu::isCombinedDepthStencilType(access.getFormat().type))
110 	{
111 		if (access.getFormat().order == tcu::TextureFormat::D)
112 			m_access = tcu::getEffectiveDepthStencilAccess(access, tcu::Sampler::MODE_DEPTH);
113 		if (access.getFormat().order == tcu::TextureFormat::S)
114 			m_access = tcu::getEffectiveDepthStencilAccess(access, tcu::Sampler::MODE_STENCIL);
115 		else
116 		{
117 			// Cannot log a DS format
118 			DE_ASSERT(false);
119 			return;
120 		}
121 	}
122 }
123 
write(TestLog & log) const124 void LogImage::write (TestLog& log) const
125 {
126 	if (m_access.getFormat().order != tcu::TextureFormat::DS)
127 		log.writeImage(m_name.c_str(), m_description.c_str(), m_access, m_scale, m_bias, m_compression);
128 	else
129 	{
130 		const ConstPixelBufferAccess	depthAccess		= tcu::getEffectiveDepthStencilAccess(m_access, tcu::Sampler::MODE_DEPTH);
131 		const ConstPixelBufferAccess	stencilAccess	= tcu::getEffectiveDepthStencilAccess(m_access, tcu::Sampler::MODE_STENCIL);
132 
133 		log.startImageSet(m_name.c_str(), m_description.c_str());
134 		log.writeImage("Depth", "Depth channel", depthAccess, m_scale.swizzle(0, 0, 0, 0), m_bias.swizzle(0, 0, 0, 0), m_compression);
135 		log.writeImage("Stencil", "Stencil channel", stencilAccess, m_scale.swizzle(1, 1, 1, 1), m_bias.swizzle(1, 1, 1, 1), m_compression);
136 		log.endImageSet();
137 	}
138 }
139 
140 // MessageBuilder
141 
MessageBuilder(const MessageBuilder & other)142 MessageBuilder::MessageBuilder (const MessageBuilder& other)
143 	: m_log(other.m_log)
144 {
145 	m_str.str(other.m_str.str());
146 }
147 
operator =(const MessageBuilder & other)148 MessageBuilder& MessageBuilder::operator= (const MessageBuilder& other)
149 {
150 	m_log = other.m_log;
151 	m_str.str(other.m_str.str());
152 	return *this;
153 }
154 
operator <<(const TestLog::EndMessageToken &)155 TestLog& MessageBuilder::operator<< (const TestLog::EndMessageToken&)
156 {
157 	m_log->writeMessage(m_str.str().c_str());
158 	return *m_log;
159 }
160 
161 // SampleBuilder
162 
operator <<(const TestLog::EndSampleToken &)163 TestLog& SampleBuilder::operator<< (const TestLog::EndSampleToken&)
164 {
165 	m_log->startSample();
166 
167 	for (std::vector<Value>::const_iterator val = m_values.begin(); val != m_values.end(); ++val)
168 	{
169 		if (val->type == Value::TYPE_FLOAT64)
170 			m_log->writeSampleValue(val->value.float64);
171 		else if (val->type == Value::TYPE_INT64)
172 			m_log->writeSampleValue(val->value.int64);
173 		else
174 			DE_ASSERT(false);
175 	}
176 
177 	m_log->endSample();
178 
179 	return *m_log;
180 }
181 
182 // TestLog
183 
TestLog(const char * fileName,int argc,char ** argv,deUint32 flags)184 TestLog::TestLog (const char* fileName, int argc, char** argv, deUint32 flags)
185 	: m_log(qpTestLog_createFileLog(fileName, argc, argv, flags))
186 {
187 	if (!m_log)
188 		throw ResourceError(std::string("Failed to open test log file '") + fileName + "'");
189 }
190 
TestLog(const char * fileName,const std::string & cmdLine,deUint32 flags)191 TestLog::TestLog (const char* fileName, const std::string& cmdLine, deUint32 flags)
192 {
193 
194 	deCommandLine* parsedCmdLine = deCommandLine_parse(cmdLine.c_str());
195 	if (!parsedCmdLine)
196 		throw std::bad_alloc();
197 
198 	m_log = qpTestLog_createFileLog(fileName, parsedCmdLine->numArgs, parsedCmdLine->args, flags);
199 	deCommandLine_destroy(parsedCmdLine);
200 
201 	if (!m_log)
202 		throw ResourceError(std::string("Failed to open test log file '") + fileName + "'");
203 }
204 
~TestLog(void)205 TestLog::~TestLog (void)
206 {
207 	qpTestLog_destroy(m_log);
208 }
209 
writeMessage(const char * msgStr)210 void TestLog::writeMessage (const char* msgStr)
211 {
212 	if (qpTestLog_writeText(m_log, DE_NULL, DE_NULL, QP_KEY_TAG_NONE, msgStr) == DE_FALSE)
213 		throw LogWriteFailedError();
214 }
215 
startImageSet(const char * name,const char * description)216 void TestLog::startImageSet (const char* name, const char* description)
217 {
218 	if (qpTestLog_startImageSet(m_log, name, description) == DE_FALSE)
219 		throw LogWriteFailedError();
220 }
221 
endImageSet(void)222 void TestLog::endImageSet (void)
223 {
224 	if (qpTestLog_endImageSet(m_log) == DE_FALSE)
225 		throw LogWriteFailedError();
226 }
227 
228 template <int Size>
computeScaledSize(const Vector<int,Size> & imageSize,int maxSize)229 static Vector<int, Size> computeScaledSize (const Vector<int, Size>& imageSize, int maxSize)
230 {
231 	bool allInRange = true;
232 	for (int i = 0; i < Size; i++)
233 		allInRange = allInRange && (imageSize[i] <= maxSize);
234 
235 	if (allInRange)
236 		return imageSize;
237 	else
238 	{
239 		float d = 1.0f;
240 		for (int i = 0; i < Size; i++)
241 			d = de::max(d, (float)imageSize[i] / (float)maxSize);
242 
243 		Vector<int, Size> res;
244 		for (int i = 0; i < Size; i++)
245 			res[i] = de::max(1, deRoundFloatToInt32((float)imageSize[i] / d));
246 
247 		return res;
248 	}
249 }
250 
writeImage(const char * name,const char * description,const ConstPixelBufferAccess & access,const Vec4 & pixelScale,const Vec4 & pixelBias,qpImageCompressionMode compressionMode)251 void TestLog::writeImage (const char* name, const char* description, const ConstPixelBufferAccess& access, const Vec4& pixelScale, const Vec4& pixelBias, qpImageCompressionMode compressionMode)
252 {
253 	const TextureFormat&	format		= access.getFormat();
254 	int						width		= access.getWidth();
255 	int						height		= access.getHeight();
256 	int						depth		= access.getDepth();
257 
258 	// Writing a combined image does not make sense
259 	DE_ASSERT(!tcu::isCombinedDepthStencilType(access.getFormat().type));
260 
261 	// Do not bother with preprocessing if images are not stored
262 	if ((qpTestLog_getLogFlags(m_log) & QP_TEST_LOG_EXCLUDE_IMAGES) != 0)
263 		return;
264 
265 	if (depth == 1 && format.type == TextureFormat::UNORM_INT8
266 		&& width <= MAX_IMAGE_SIZE_2D && height <= MAX_IMAGE_SIZE_2D
267 		&& (format.order == TextureFormat::RGB || format.order == TextureFormat::RGBA)
268 		&& access.getPixelPitch() == access.getFormat().getPixelSize()
269 		&& pixelBias[0] == 0.0f && pixelBias[1] == 0.0f && pixelBias[2] == 0.0f && pixelBias[3] == 0.0f
270 		&& pixelScale[0] == 1.0f && pixelScale[1] == 1.0f && pixelScale[2] == 1.0f && pixelScale[3] == 1.0f)
271 	{
272 		// Fast-path.
273 		bool isRGBA = format.order == TextureFormat::RGBA;
274 
275 		writeImage(name, description, compressionMode,
276 				   isRGBA ? QP_IMAGE_FORMAT_RGBA8888 : QP_IMAGE_FORMAT_RGB888,
277 				   width, height, access.getRowPitch(), access.getDataPtr());
278 	}
279 	else if (depth == 1)
280 	{
281 		Sampler				sampler			(Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::LINEAR, Sampler::NEAREST);
282 		IVec2				logImageSize	= computeScaledSize(IVec2(width, height), MAX_IMAGE_SIZE_2D);
283 		tcu::TextureLevel	logImage		(TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8), logImageSize.x(), logImageSize.y(), 1);
284 		PixelBufferAccess	logImageAccess	= logImage.getAccess();
285 		std::ostringstream	longDesc;
286 
287 		longDesc << description << " (p' = p * " << pixelScale << " + " << pixelBias << ")";
288 
289 		for (int y = 0; y < logImage.getHeight(); y++)
290 		{
291 			for (int x = 0; x < logImage.getWidth(); x++)
292 			{
293 				float	yf	= ((float)y + 0.5f) / (float)logImage.getHeight();
294 				float	xf	= ((float)x + 0.5f) / (float)logImage.getWidth();
295 				Vec4	s	= access.sample2D(sampler, sampler.minFilter, xf, yf, 0)*pixelScale + pixelBias;
296 
297 				logImageAccess.setPixel(s, x, y);
298 			}
299 		}
300 
301 		writeImage(name, longDesc.str().c_str(), compressionMode, QP_IMAGE_FORMAT_RGBA8888,
302 				   logImageAccess.getWidth(), logImageAccess.getHeight(), logImageAccess.getRowPitch(),
303 				   logImageAccess.getDataPtr());
304 	}
305 	else
306 	{
307 		// Isometric splat volume rendering.
308 		const float			blendFactor			= 0.85f;
309 		IVec3				scaledSize			= computeScaledSize(IVec3(width, height, depth), MAX_IMAGE_SIZE_3D);
310 		int					w					= scaledSize.x();
311 		int					h					= scaledSize.y();
312 		int					d					= scaledSize.z();
313 		int					logImageW			= w+d - 1;
314 		int					logImageH			= w+d+h;
315 		std::vector<float>	blendImage			(logImageW*logImageH*4, 0.0f);
316 		PixelBufferAccess	blendImageAccess	(TextureFormat(TextureFormat::RGBA, TextureFormat::FLOAT), logImageW, logImageH, 1, &blendImage[0]);
317 		tcu::TextureLevel	logImage			(TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8), logImageW, logImageH, 1);
318 		PixelBufferAccess	logImageAccess		= logImage.getAccess();
319 		Sampler				sampler				(Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::NEAREST, Sampler::NEAREST);
320 		std::ostringstream	longDesc;
321 
322 		// \note Back-to-front.
323 		for (int z = d-1; z >= 0; z--)
324 		{
325 			for (int y = 0; y < h; y++)
326 			{
327 				for (int x = 0; x < w; x++)
328 				{
329 					int		px	= w - (x + 1) + z;
330 					int		py	= (w + d + h) - (x + y + z + 1);
331 
332 					float	xf	= ((float)x + 0.5f) / (float)w;
333 					float	yf	= ((float)y + 0.5f) / (float)h;
334 					float	zf	= ((float)z + 0.5f) / (float)d;
335 
336 					Vec4	p	= blendImageAccess.getPixel(px, py);
337 					Vec4	s	= access.sample3D(sampler, sampler.minFilter, xf, yf, zf);
338 					Vec4	b	= s + p*blendFactor;
339 
340 					blendImageAccess.setPixel(b, px, py);
341 				}
342 			}
343 		}
344 
345 		// Scale blend image nicely.
346 		longDesc << description << " (p' = p * " << pixelScale << " + " << pixelBias << ")";
347 
348 		// Write to final image.
349 		tcu::clear(logImageAccess, tcu::IVec4(0x33, 0x66, 0x99, 0xff));
350 
351 		for (int z = 0; z < d; z++)
352 		{
353 			for (int y = 0; y < h; y++)
354 			{
355 				for (int x = 0; x < w; x++)
356 				{
357 					if (z != 0 && !(x == 0 || y == h-1 || y == h-2))
358 						continue;
359 
360 					int		px	= w - (x + 1) + z;
361 					int		py	= (w + d + h) - (x + y + z + 1);
362 					Vec4	s	= blendImageAccess.getPixel(px, py)*pixelScale + pixelBias;
363 
364 					logImageAccess.setPixel(s, px, py);
365 				}
366 			}
367 		}
368 
369 		writeImage(name, longDesc.str().c_str(), compressionMode, QP_IMAGE_FORMAT_RGBA8888,
370 				   logImageAccess.getWidth(), logImageAccess.getHeight(), logImageAccess.getRowPitch(),
371 				   logImageAccess.getDataPtr());
372 	}
373 }
374 
writeImage(const char * name,const char * description,qpImageCompressionMode compressionMode,qpImageFormat format,int width,int height,int stride,const void * data)375 void TestLog::writeImage (const char* name, const char* description, qpImageCompressionMode compressionMode, qpImageFormat format, int width, int height, int stride, const void* data)
376 {
377 	if (qpTestLog_writeImage(m_log, name, description, compressionMode, format, width, height, stride, data) == DE_FALSE)
378 		throw LogWriteFailedError();
379 }
380 
startSection(const char * name,const char * description)381 void TestLog::startSection (const char* name, const char* description)
382 {
383 	if (qpTestLog_startSection(m_log, name, description) == DE_FALSE)
384 		throw LogWriteFailedError();
385 }
386 
endSection(void)387 void TestLog::endSection (void)
388 {
389 	if (qpTestLog_endSection(m_log) == DE_FALSE)
390 		throw LogWriteFailedError();
391 }
392 
startShaderProgram(bool linkOk,const char * linkInfoLog)393 void TestLog::startShaderProgram (bool linkOk, const char* linkInfoLog)
394 {
395 	if (qpTestLog_startShaderProgram(m_log, linkOk?DE_TRUE:DE_FALSE, linkInfoLog) == DE_FALSE)
396 		throw LogWriteFailedError();
397 }
398 
endShaderProgram(void)399 void TestLog::endShaderProgram (void)
400 {
401 	if (qpTestLog_endShaderProgram(m_log) == DE_FALSE)
402 		throw LogWriteFailedError();
403 }
404 
writeShader(qpShaderType type,const char * source,bool compileOk,const char * infoLog)405 void TestLog::writeShader (qpShaderType type, const char* source, bool compileOk, const char* infoLog)
406 {
407 	if (qpTestLog_writeShader(m_log, type, source, compileOk?DE_TRUE:DE_FALSE, infoLog) == DE_FALSE)
408 		throw LogWriteFailedError();
409 }
410 
writeSpirVAssemblySource(const char * source)411 void TestLog::writeSpirVAssemblySource (const char* source)
412 {
413 	if (qpTestLog_writeSpirVAssemblySource(m_log, source) == DE_FALSE)
414 		throw LogWriteFailedError();
415 }
416 
writeKernelSource(const char * source)417 void TestLog::writeKernelSource (const char* source)
418 {
419 	if (qpTestLog_writeKernelSource(m_log, source) == DE_FALSE)
420 		throw LogWriteFailedError();
421 }
422 
writeCompileInfo(const char * name,const char * description,bool compileOk,const char * infoLog)423 void TestLog::writeCompileInfo (const char* name, const char* description, bool compileOk, const char* infoLog)
424 {
425 	if (qpTestLog_writeCompileInfo(m_log, name, description, compileOk ? DE_TRUE : DE_FALSE, infoLog) == DE_FALSE)
426 		throw LogWriteFailedError();
427 }
428 
writeFloat(const char * name,const char * description,const char * unit,qpKeyValueTag tag,float value)429 void TestLog::writeFloat (const char* name, const char* description, const char* unit, qpKeyValueTag tag, float value)
430 {
431 	if (qpTestLog_writeFloat(m_log, name, description, unit, tag, value) == DE_FALSE)
432 		throw LogWriteFailedError();
433 }
434 
writeInteger(const char * name,const char * description,const char * unit,qpKeyValueTag tag,deInt64 value)435 void TestLog::writeInteger (const char* name, const char* description, const char* unit, qpKeyValueTag tag, deInt64 value)
436 {
437 	if (qpTestLog_writeInteger(m_log, name, description, unit, tag, value) == DE_FALSE)
438 		throw LogWriteFailedError();
439 }
440 
startEglConfigSet(const char * name,const char * description)441 void TestLog::startEglConfigSet (const char* name, const char* description)
442 {
443 	if (qpTestLog_startEglConfigSet(m_log, name, description) == DE_FALSE)
444 		throw LogWriteFailedError();
445 }
446 
writeEglConfig(const qpEglConfigInfo * config)447 void TestLog::writeEglConfig (const qpEglConfigInfo* config)
448 {
449 	if (qpTestLog_writeEglConfig(m_log, config) == DE_FALSE)
450 		throw LogWriteFailedError();
451 }
452 
endEglConfigSet(void)453 void TestLog::endEglConfigSet (void)
454 {
455 	if (qpTestLog_endEglConfigSet(m_log) == DE_FALSE)
456 		throw LogWriteFailedError();
457 }
458 
startCase(const char * testCasePath,qpTestCaseType testCaseType)459 void TestLog::startCase (const char* testCasePath, qpTestCaseType testCaseType)
460 {
461 	if (qpTestLog_startCase(m_log, testCasePath, testCaseType) == DE_FALSE)
462 		throw LogWriteFailedError();
463 }
464 
endCase(qpTestResult result,const char * description)465 void TestLog::endCase (qpTestResult result, const char* description)
466 {
467 	if (qpTestLog_endCase(m_log, result, description) == DE_FALSE)
468 		throw LogWriteFailedError();
469 }
470 
terminateCase(qpTestResult result)471 void TestLog::terminateCase (qpTestResult result)
472 {
473 	if (qpTestLog_terminateCase(m_log, result) == DE_FALSE)
474 		throw LogWriteFailedError();
475 }
476 
startTestsCasesTime(void)477 void TestLog::startTestsCasesTime (void)
478 {
479 	if (qpTestLog_startTestsCasesTime(m_log) == DE_FALSE)
480 		throw LogWriteFailedError();
481 }
482 
endTestsCasesTime(void)483 void TestLog::endTestsCasesTime (void)
484 {
485 	if (qpTestLog_endTestsCasesTime(m_log) == DE_FALSE)
486 		throw LogWriteFailedError();
487 }
488 
startSampleList(const std::string & name,const std::string & description)489 void TestLog::startSampleList (const std::string& name, const std::string& description)
490 {
491 	if (qpTestLog_startSampleList(m_log, name.c_str(), description.c_str()) == DE_FALSE)
492 		throw LogWriteFailedError();
493 }
494 
startSampleInfo(void)495 void TestLog::startSampleInfo (void)
496 {
497 	if (qpTestLog_startSampleInfo(m_log) == DE_FALSE)
498 		throw LogWriteFailedError();
499 }
500 
writeValueInfo(const std::string & name,const std::string & description,const std::string & unit,qpSampleValueTag tag)501 void TestLog::writeValueInfo (const std::string& name, const std::string& description, const std::string& unit, qpSampleValueTag tag)
502 {
503 	if (qpTestLog_writeValueInfo(m_log, name.c_str(), description.c_str(), unit.empty() ? DE_NULL : unit.c_str(), tag) == DE_FALSE)
504 		throw LogWriteFailedError();
505 }
506 
endSampleInfo(void)507 void TestLog::endSampleInfo (void)
508 {
509 	if (qpTestLog_endSampleInfo(m_log) == DE_FALSE)
510 		throw LogWriteFailedError();
511 }
512 
startSample(void)513 void TestLog::startSample (void)
514 {
515 	if (qpTestLog_startSample(m_log) == DE_FALSE)
516 		throw LogWriteFailedError();
517 }
518 
writeSampleValue(double value)519 void TestLog::writeSampleValue (double value)
520 {
521 	if (qpTestLog_writeValueFloat(m_log, value) == DE_FALSE)
522 		throw LogWriteFailedError();
523 }
524 
writeSampleValue(deInt64 value)525 void TestLog::writeSampleValue (deInt64 value)
526 {
527 	if (qpTestLog_writeValueInteger(m_log, value) == DE_FALSE)
528 		throw LogWriteFailedError();
529 }
530 
endSample(void)531 void TestLog::endSample (void)
532 {
533 	if (qpTestLog_endSample(m_log) == DE_FALSE)
534 		throw LogWriteFailedError();
535 }
536 
endSampleList(void)537 void TestLog::endSampleList (void)
538 {
539 	if (qpTestLog_endSampleList(m_log) == DE_FALSE)
540 		throw LogWriteFailedError();
541 }
542 
isShaderLoggingEnabled(void)543 bool TestLog::isShaderLoggingEnabled (void)
544 {
545 	return (qpTestLog_getLogFlags(m_log) & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) == 0;
546 }
547 
548 const TestLog::BeginMessageToken		TestLog::Message			= TestLog::BeginMessageToken();
549 const TestLog::EndMessageToken			TestLog::EndMessage			= TestLog::EndMessageToken();
550 const TestLog::EndImageSetToken			TestLog::EndImageSet		= TestLog::EndImageSetToken();
551 const TestLog::EndSectionToken			TestLog::EndSection			= TestLog::EndSectionToken();
552 const TestLog::EndShaderProgramToken	TestLog::EndShaderProgram	= TestLog::EndShaderProgramToken();
553 const TestLog::SampleInfoToken			TestLog::SampleInfo			= TestLog::SampleInfoToken();
554 const TestLog::EndSampleInfoToken		TestLog::EndSampleInfo		= TestLog::EndSampleInfoToken();
555 const TestLog::BeginSampleToken			TestLog::Sample				= TestLog::BeginSampleToken();
556 const TestLog::EndSampleToken			TestLog::EndSample			= TestLog::EndSampleToken();
557 const TestLog::EndSampleListToken		TestLog::EndSampleList		= TestLog::EndSampleListToken();
558 
559 } // tcu
560