vkSpirVProgram.cpp revision 3b9dcc5bfd3b622b8fa0a75d88d205a425dd3603
1/*-------------------------------------------------------------------------
2 * Vulkan CTS Framework
3 * --------------------
4 *
5 * Copyright (c) 2015 Google Inc.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and/or associated documentation files (the
9 * "Materials"), to deal in the Materials without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Materials, and to
12 * permit persons to whom the Materials are furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice(s) and this permission notice shall be
16 * included in all copies or substantial portions of the Materials.
17 *
18 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
25 *
26 *//*!
27 * \file
28 * \brief Spirv program and binary info.
29 *//*--------------------------------------------------------------------*/
30
31#include "vkSpirVProgram.hpp"
32
33#include "tcuTestLog.hpp"
34
35namespace vk
36{
37
38tcu::TestLog& operator<< (tcu::TestLog& log, const SpirVProgramInfo& shaderInfo)
39{
40	log << tcu::TestLog::ShaderProgram(shaderInfo.compileOk , shaderInfo.infoLog)
41		<< tcu::TestLog::SpirVAssemblySource(shaderInfo.source)
42		<< tcu::TestLog::EndShaderProgram;
43
44	// Write statistics
45	log << tcu::TestLog::Float(	"SpirVAssemblyTime",
46								"SpirV assembly time",
47								"ms", QP_KEY_TAG_TIME, (float)shaderInfo.compileTimeUs / 1000.0f);
48	return log;
49}
50
51tcu::TestLog& operator<< (tcu::TestLog& log, const SpirVAsmSource& source)
52{
53	log << tcu::TestLog::ShaderProgram(true , "")
54		<< tcu::TestLog::SpirVAssemblySource(source.source)
55		<< tcu::TestLog::EndShaderProgram;
56
57	return log;
58}
59
60} // vk
61