blob: 7e0af96e201a9563dcbe951cd98f43330c7a08fb [file] [log] [blame]
Karl Schultz6addd812016-02-02 17:17:23 -07001/*
2 * Copyright (c) 2015-2016 The Khronos Group Inc.
3 * Copyright (c) 2015-2016 Valve Corporation
4 * Copyright (c) 2015-2016 LunarG, Inc.
5 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -06006 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
Karl Schultz6addd812016-02-02 17:17:23 -07009 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -060010 * http://www.apache.org/licenses/LICENSE-2.0
Karl Schultz6addd812016-02-02 17:17:23 -070011 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -060012 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
Karl Schultz6addd812016-02-02 17:17:23 -070017 *
18 * Author: Chia-I Wu <olvaffe@gmail.com>
19 * Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
20 * Author: Tony Barbour <tony@LunarG.com>
21 */
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -060022
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -060023#include "vktestframework.h"
24#include "vkrenderframework.h"
Karl Schultz80b8aca2017-01-24 14:44:26 -080025
26// For versions prior to VS 2015, suppress the warning
27// caused by the inconsistent redefinition of snprintf
28// between a vulkan header and a glslang header.
29#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
30#pragma warning(push)
31#pragma warning(disable : 4005)
32#endif
Karl Schultz6addd812016-02-02 17:17:23 -070033// TODO FIXME remove this once glslang doesn't define this
Jon Ashburn94207e92015-12-04 17:03:59 -070034#undef BadValue
Cody Northrop5a95b472015-06-03 13:01:54 -060035#include "SPIRV/GlslangToSpv.h"
36#include "SPIRV/SPVRemapper.h"
Karl Schultz80b8aca2017-01-24 14:44:26 -080037#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
38#pragma warning(pop)
39#endif
Tony Barbour4ab45422014-12-10 17:00:20 -070040#include <limits.h>
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -060041#include <math.h>
Jon Ashburn94207e92015-12-04 17:03:59 -070042
Tony Barbour3d69c9e2015-05-20 16:53:31 -060043#if defined(PATH_MAX) && !defined(MAX_PATH)
44#define MAX_PATH PATH_MAX
45#endif
46
Tony Barbour6a3faf02015-07-23 10:36:18 -060047#ifdef _WIN32
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070048#define ERR_EXIT(err_msg, err_class) \
49 do { \
50 MessageBox(NULL, err_msg, err_class, MB_OK); \
51 exit(1); \
Karl Schultz6addd812016-02-02 17:17:23 -070052 } while (0)
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070053#else // _WIN32
Tony Barbour6a3faf02015-07-23 10:36:18 -060054
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070055#define ERR_EXIT(err_msg, err_class) \
56 do { \
57 printf(err_msg); \
58 fflush(stdout); \
59 exit(1); \
Karl Schultz6addd812016-02-02 17:17:23 -070060 } while (0)
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070061#endif // _WIN32
Tony Barbour6a3faf02015-07-23 10:36:18 -060062
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070063#define GET_INSTANCE_PROC_ADDR(inst, entrypoint) \
64 { \
65 m_fp##entrypoint = (PFN_vk##entrypoint)vkGetInstanceProcAddr(inst, "vk" #entrypoint); \
66 if (m_fp##entrypoint == NULL) { \
67 ERR_EXIT("vkGetInstanceProcAddr failed to find vk" #entrypoint, "vkGetInstanceProcAddr Failure"); \
68 } \
Karl Schultz6addd812016-02-02 17:17:23 -070069 }
Tony Barbour6a3faf02015-07-23 10:36:18 -060070
Mark Lobodzinski64318ba2017-01-26 13:34:13 -070071#define GET_DEVICE_PROC_ADDR(dev, entrypoint) \
72 { \
73 m_fp##entrypoint = (PFN_vk##entrypoint)vkGetDeviceProcAddr(dev, "vk" #entrypoint); \
74 if (m_fp##entrypoint == NULL) { \
75 ERR_EXIT("vkGetDeviceProcAddr failed to find vk" #entrypoint, "vkGetDeviceProcAddr Failure"); \
76 } \
Karl Schultz6addd812016-02-02 17:17:23 -070077 }
Tony Barbour6a3faf02015-07-23 10:36:18 -060078
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -060079// Command-line options
80enum TOptions {
Karl Schultz6addd812016-02-02 17:17:23 -070081 EOptionNone = 0x000,
82 EOptionIntermediate = 0x001,
83 EOptionSuppressInfolog = 0x002,
84 EOptionMemoryLeakMode = 0x004,
85 EOptionRelaxedErrors = 0x008,
86 EOptionGiveWarnings = 0x010,
87 EOptionLinkProgram = 0x020,
88 EOptionMultiThreaded = 0x040,
89 EOptionDumpConfig = 0x080,
90 EOptionDumpReflection = 0x100,
91 EOptionSuppressWarnings = 0x200,
92 EOptionDumpVersions = 0x400,
93 EOptionSpv = 0x800,
94 EOptionDefaultDesktop = 0x1000,
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -060095};
96
Mark Lobodzinskib5ccf3f2016-05-19 17:26:51 -060097struct SwapchainBuffers {
Tony Barbour6a3faf02015-07-23 10:36:18 -060098 VkImage image;
Chia-I Wu3432a0c2015-10-27 18:04:07 +080099 VkCommandBuffer cmd;
Courtney Goeltzenleuchter5861a1b2015-09-01 17:30:39 -0600100 VkImageView view;
Mark Lobodzinskib5ccf3f2016-05-19 17:26:51 -0600101};
Tony Barbour6a3faf02015-07-23 10:36:18 -0600102
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600103#ifndef _WIN32
104
105#include <errno.h>
106
Karl Schultz6addd812016-02-02 17:17:23 -0700107int fopen_s(FILE **pFile, const char *filename, const char *mode) {
108 if (!pFile || !filename || !mode) {
109 return EINVAL;
110 }
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600111
Karl Schultz6addd812016-02-02 17:17:23 -0700112 FILE *f = fopen(filename, mode);
113 if (!f) {
114 if (errno != 0) {
115 return errno;
116 } else {
117 return ENOENT;
118 }
119 }
120 *pFile = f;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600121
Karl Schultz6addd812016-02-02 17:17:23 -0700122 return 0;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600123}
124
125#endif
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600126
Courtney Goeltzenleuchtera0f74c52014-10-08 08:46:51 -0600127// Set up environment for GLSL compiler
128// Must be done once per process
Karl Schultz6addd812016-02-02 17:17:23 -0700129void TestEnvironment::SetUp() {
Cody Northrop3bfd27c2015-03-17 15:55:58 -0600130 // Initialize GLSL to SPV compiler utility
Courtney Goeltzenleuchtera0f74c52014-10-08 08:46:51 -0600131 glslang::InitializeProcess();
Chia-I Wub76e0fa2014-12-28 14:27:28 +0800132
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600133 vk_testing::set_error_callback(test_error_callback);
Courtney Goeltzenleuchtera0f74c52014-10-08 08:46:51 -0600134}
135
Karl Schultz6addd812016-02-02 17:17:23 -0700136void TestEnvironment::TearDown() { glslang::FinalizeProcess(); }
Courtney Goeltzenleuchtera0f74c52014-10-08 08:46:51 -0600137
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600138VkTestFramework::VkTestFramework() : m_compile_options(0), m_num_shader_strings(0) {}
Courtney Goeltzenleuchtera0f74c52014-10-08 08:46:51 -0600139
Karl Schultz6addd812016-02-02 17:17:23 -0700140VkTestFramework::~VkTestFramework() {}
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600141
142// Define all the static elements
Karl Schultz6addd812016-02-02 17:17:23 -0700143bool VkTestFramework::m_canonicalize_spv = false;
144bool VkTestFramework::m_strip_spv = false;
Cody Northrop5a95b472015-06-03 13:01:54 -0600145bool VkTestFramework::m_do_everything_spv = false;
Tobin Ehlis72888642017-11-15 09:43:56 -0700146bool VkTestFramework::m_devsim_layer = false;
Tony Barbour6918cd52015-04-09 12:58:51 -0600147int VkTestFramework::m_width = 0;
148int VkTestFramework::m_height = 0;
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600149
Karl Schultz6addd812016-02-02 17:17:23 -0700150bool VkTestFramework::optionMatch(const char *option, char *optionLine) {
Cody Northrop50a2a4b2015-06-03 16:49:20 -0600151 if (strncmp(option, optionLine, strlen(option)) == 0)
152 return true;
153 else
154 return false;
155}
156
Karl Schultz6addd812016-02-02 17:17:23 -0700157void VkTestFramework::InitArgs(int *argc, char *argv[]) {
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600158 int i, n;
159
Karl Schultz6addd812016-02-02 17:17:23 -0700160 for (i = 1, n = 1; i < *argc; i++) {
Chris Forbesb5e22252017-04-04 15:51:36 -0700161 if (optionMatch("--strip-SPV", argv[i]))
Tony Barbour7b60e492016-02-02 14:43:55 -0700162 m_strip_spv = true;
Cody Northrop50a2a4b2015-06-03 16:49:20 -0600163 else if (optionMatch("--canonicalize-SPV", argv[i]))
164 m_canonicalize_spv = true;
Tobin Ehlis72888642017-11-15 09:43:56 -0700165 else if (optionMatch("--devsim", argv[i]))
166 m_devsim_layer = true;
Karl Schultz6addd812016-02-02 17:17:23 -0700167 else if (optionMatch("--help", argv[i]) || optionMatch("-h", argv[i])) {
Courtney Goeltzenleuchter31144b72014-12-02 13:13:10 -0700168 printf("\nOther options:\n");
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700169 printf(
170 "\t--show-images\n"
171 "\t\tDisplay test images in viewer after tests complete.\n");
172 printf(
173 "\t--save-images\n"
Dave Houlton6c72f352018-02-06 17:49:16 -0700174 "\t\tSave tests images as ppm files in current working directory.\n"
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700175 "\t\tUsed to generate golden images for compare-images.\n");
176 printf(
177 "\t--compare-images\n"
178 "\t\tCompare test images to 'golden' image in golden folder.\n"
179 "\t\tAlso saves the generated test image in current working\n"
Dave Houlton6c72f352018-02-06 17:49:16 -0700180 "\t\t\tdirectory but only if the image is different from the golden\n"
181 "\t\tSetting RENDERTEST_GOLDEN_DIR environment variable can specify\n"
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700182 "\t\t\tdifferent directory for golden images\n"
183 "\t\tSignal test failure if different.\n");
184 printf(
185 "\t--no-SPV\n"
186 "\t\tUse built-in GLSL compiler rather than SPV code path.\n");
187 printf(
188 "\t--strip-SPV\n"
Dave Houlton6c72f352018-02-06 17:49:16 -0700189 "\t\tStrip SPIR-V debug information (line numbers, names, etc).\n");
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700190 printf(
191 "\t--canonicalize-SPV\n"
192 "\t\tRemap SPIR-V ids before submission to aid compression.\n");
Cody Northrop50a2a4b2015-06-03 16:49:20 -0600193 exit(0);
194 } else {
195 printf("\nUnrecognized option: %s\n", argv[i]);
196 printf("\nUse --help or -h for option list.\n");
Tony Barbour4ab45422014-12-10 17:00:20 -0700197 exit(0);
Courtney Goeltzenleuchter31144b72014-12-02 13:13:10 -0700198 }
199
Cody Northrop50a2a4b2015-06-03 16:49:20 -0600200 /*
201 * Since the above "consume" inputs, update argv
202 * so that it contains the trimmed list of args for glutInit
203 */
204
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600205 argv[n] = argv[i];
206 n++;
207 }
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600208}
209
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600210VkFormat VkTestFramework::GetFormat(VkInstance instance, vk_testing::Device *device) {
Tony Barbour2d6d54e2015-12-03 16:05:11 -0700211 VkFormatProperties format_props;
Tony Barbour7b60e492016-02-02 14:43:55 -0700212
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600213 vkGetPhysicalDeviceFormatProperties(device->phy().handle(), VK_FORMAT_B8G8R8A8_UNORM, &format_props);
214 if (format_props.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT ||
215 format_props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) {
Tony Barbour7b60e492016-02-02 14:43:55 -0700216 return VK_FORMAT_B8G8R8A8_UNORM;
Tony Barbour2d6d54e2015-12-03 16:05:11 -0700217 }
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600218 vkGetPhysicalDeviceFormatProperties(device->phy().handle(), VK_FORMAT_R8G8B8A8_UNORM, &format_props);
219 if (format_props.linearTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT ||
220 format_props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) {
Tony Barbour7b60e492016-02-02 14:43:55 -0700221 return VK_FORMAT_R8G8B8A8_UNORM;
Tony Barbour2d6d54e2015-12-03 16:05:11 -0700222 }
Dave Houlton6c72f352018-02-06 17:49:16 -0700223 printf("Error - device does not support VK_FORMAT_B8G8R8A8_UNORM nor VK_FORMAT_R8G8B8A8_UNORM - exiting\n");
Tobin Ehlise37e9732016-07-11 12:57:29 -0600224 exit(1);
Tony Barbour2d6d54e2015-12-03 16:05:11 -0700225}
226
Karl Schultz6addd812016-02-02 17:17:23 -0700227void VkTestFramework::Finish() {}
Courtney Goeltzenleuchter30e9dc42014-09-04 16:24:19 -0600228
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600229//
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600230// These are the default resources for TBuiltInResources, used for both
231// - parsing this string for the case where the user didn't supply one
232// - dumping out a template for user construction of a config file
233//
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700234static const char *DefaultConfig =
235 "MaxLights 32\n"
236 "MaxClipPlanes 6\n"
237 "MaxTextureUnits 32\n"
238 "MaxTextureCoords 32\n"
239 "MaxVertexAttribs 64\n"
240 "MaxVertexUniformComponents 4096\n"
241 "MaxVaryingFloats 64\n"
242 "MaxVertexTextureImageUnits 32\n"
243 "MaxCombinedTextureImageUnits 80\n"
244 "MaxTextureImageUnits 32\n"
245 "MaxFragmentUniformComponents 4096\n"
246 "MaxDrawBuffers 32\n"
247 "MaxVertexUniformVectors 128\n"
248 "MaxVaryingVectors 8\n"
249 "MaxFragmentUniformVectors 16\n"
250 "MaxVertexOutputVectors 16\n"
251 "MaxFragmentInputVectors 15\n"
252 "MinProgramTexelOffset -8\n"
253 "MaxProgramTexelOffset 7\n"
254 "MaxClipDistances 8\n"
255 "MaxComputeWorkGroupCountX 65535\n"
256 "MaxComputeWorkGroupCountY 65535\n"
257 "MaxComputeWorkGroupCountZ 65535\n"
258 "MaxComputeWorkGroupSizeX 1024\n"
259 "MaxComputeWorkGroupSizeY 1024\n"
260 "MaxComputeWorkGroupSizeZ 64\n"
261 "MaxComputeUniformComponents 1024\n"
262 "MaxComputeTextureImageUnits 16\n"
263 "MaxComputeImageUniforms 8\n"
264 "MaxComputeAtomicCounters 8\n"
265 "MaxComputeAtomicCounterBuffers 1\n"
266 "MaxVaryingComponents 60\n"
267 "MaxVertexOutputComponents 64\n"
268 "MaxGeometryInputComponents 64\n"
269 "MaxGeometryOutputComponents 128\n"
270 "MaxFragmentInputComponents 128\n"
271 "MaxImageUnits 8\n"
272 "MaxCombinedImageUnitsAndFragmentOutputs 8\n"
273 "MaxCombinedShaderOutputResources 8\n"
274 "MaxImageSamples 0\n"
275 "MaxVertexImageUniforms 0\n"
276 "MaxTessControlImageUniforms 0\n"
277 "MaxTessEvaluationImageUniforms 0\n"
278 "MaxGeometryImageUniforms 0\n"
279 "MaxFragmentImageUniforms 8\n"
280 "MaxCombinedImageUniforms 8\n"
281 "MaxGeometryTextureImageUnits 16\n"
282 "MaxGeometryOutputVertices 256\n"
283 "MaxGeometryTotalOutputComponents 1024\n"
284 "MaxGeometryUniformComponents 1024\n"
285 "MaxGeometryVaryingComponents 64\n"
286 "MaxTessControlInputComponents 128\n"
287 "MaxTessControlOutputComponents 128\n"
288 "MaxTessControlTextureImageUnits 16\n"
289 "MaxTessControlUniformComponents 1024\n"
290 "MaxTessControlTotalOutputComponents 4096\n"
291 "MaxTessEvaluationInputComponents 128\n"
292 "MaxTessEvaluationOutputComponents 128\n"
293 "MaxTessEvaluationTextureImageUnits 16\n"
294 "MaxTessEvaluationUniformComponents 1024\n"
295 "MaxTessPatchComponents 120\n"
296 "MaxPatchVertices 32\n"
297 "MaxTessGenLevel 64\n"
298 "MaxViewports 16\n"
299 "MaxVertexAtomicCounters 0\n"
300 "MaxTessControlAtomicCounters 0\n"
301 "MaxTessEvaluationAtomicCounters 0\n"
302 "MaxGeometryAtomicCounters 0\n"
303 "MaxFragmentAtomicCounters 8\n"
304 "MaxCombinedAtomicCounters 8\n"
305 "MaxAtomicCounterBindings 1\n"
306 "MaxVertexAtomicCounterBuffers 0\n"
307 "MaxTessControlAtomicCounterBuffers 0\n"
308 "MaxTessEvaluationAtomicCounterBuffers 0\n"
309 "MaxGeometryAtomicCounterBuffers 0\n"
310 "MaxFragmentAtomicCounterBuffers 1\n"
311 "MaxCombinedAtomicCounterBuffers 1\n"
312 "MaxAtomicCounterBufferSize 16384\n"
313 "MaxTransformFeedbackBuffers 4\n"
314 "MaxTransformFeedbackInterleavedComponents 64\n"
315 "MaxCullDistances 8\n"
316 "MaxCombinedClipAndCullDistances 8\n"
317 "MaxSamples 4\n"
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600318
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700319 "nonInductiveForLoops 1\n"
320 "whileLoops 1\n"
321 "doWhileLoops 1\n"
322 "generalUniformIndexing 1\n"
323 "generalAttributeMatrixVectorIndexing 1\n"
324 "generalVaryingIndexing 1\n"
325 "generalSamplerIndexing 1\n"
326 "generalVariableIndexing 1\n"
327 "generalConstantMatrixVectorIndexing 1\n";
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600328
329//
330// *.conf => this is a config file that can set limits/resources
331//
Karl Schultz6addd812016-02-02 17:17:23 -0700332bool VkTestFramework::SetConfigFile(const std::string &name) {
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700333 if (name.size() < 5) return false;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600334
335 if (name.compare(name.size() - 5, 5, ".conf") == 0) {
336 ConfigFile = name;
337 return true;
338 }
339
340 return false;
341}
342
343//
344// Parse either a .conf file provided by the user or the default string above.
345//
Karl Schultz6addd812016-02-02 17:17:23 -0700346void VkTestFramework::ProcessConfigFile() {
347 char **configStrings = 0;
348 char *config = 0;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600349 if (ConfigFile.size() > 0) {
350 configStrings = ReadFileData(ConfigFile.c_str());
351 if (configStrings)
352 config = *configStrings;
353 else {
Dave Houlton6c72f352018-02-06 17:49:16 -0700354 printf("Error opening configuration file; will instead use the default configuration\n");
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600355 }
356 }
357
358 if (config == 0) {
Karl Schultz6addd812016-02-02 17:17:23 -0700359 config = (char *)alloca(strlen(DefaultConfig) + 1);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600360 strcpy(config, DefaultConfig);
361 }
362
Karl Schultz6addd812016-02-02 17:17:23 -0700363 const char *delims = " \t\n\r";
364 const char *token = strtok(config, delims);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600365 while (token) {
Karl Schultz6addd812016-02-02 17:17:23 -0700366 const char *valueStr = strtok(0, delims);
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600367 if (valueStr == 0 || !(valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) {
Dave Houlton6c72f352018-02-06 17:49:16 -0700368 printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", valueStr ? valueStr : "");
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600369 return;
370 }
371 int value = atoi(valueStr);
372
373 if (strcmp(token, "MaxLights") == 0)
374 Resources.maxLights = value;
375 else if (strcmp(token, "MaxClipPlanes") == 0)
376 Resources.maxClipPlanes = value;
377 else if (strcmp(token, "MaxTextureUnits") == 0)
378 Resources.maxTextureUnits = value;
379 else if (strcmp(token, "MaxTextureCoords") == 0)
380 Resources.maxTextureCoords = value;
381 else if (strcmp(token, "MaxVertexAttribs") == 0)
382 Resources.maxVertexAttribs = value;
383 else if (strcmp(token, "MaxVertexUniformComponents") == 0)
384 Resources.maxVertexUniformComponents = value;
385 else if (strcmp(token, "MaxVaryingFloats") == 0)
386 Resources.maxVaryingFloats = value;
387 else if (strcmp(token, "MaxVertexTextureImageUnits") == 0)
388 Resources.maxVertexTextureImageUnits = value;
389 else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0)
390 Resources.maxCombinedTextureImageUnits = value;
391 else if (strcmp(token, "MaxTextureImageUnits") == 0)
392 Resources.maxTextureImageUnits = value;
393 else if (strcmp(token, "MaxFragmentUniformComponents") == 0)
394 Resources.maxFragmentUniformComponents = value;
395 else if (strcmp(token, "MaxDrawBuffers") == 0)
396 Resources.maxDrawBuffers = value;
397 else if (strcmp(token, "MaxVertexUniformVectors") == 0)
398 Resources.maxVertexUniformVectors = value;
399 else if (strcmp(token, "MaxVaryingVectors") == 0)
400 Resources.maxVaryingVectors = value;
401 else if (strcmp(token, "MaxFragmentUniformVectors") == 0)
402 Resources.maxFragmentUniformVectors = value;
403 else if (strcmp(token, "MaxVertexOutputVectors") == 0)
404 Resources.maxVertexOutputVectors = value;
405 else if (strcmp(token, "MaxFragmentInputVectors") == 0)
406 Resources.maxFragmentInputVectors = value;
407 else if (strcmp(token, "MinProgramTexelOffset") == 0)
408 Resources.minProgramTexelOffset = value;
409 else if (strcmp(token, "MaxProgramTexelOffset") == 0)
410 Resources.maxProgramTexelOffset = value;
411 else if (strcmp(token, "MaxClipDistances") == 0)
412 Resources.maxClipDistances = value;
413 else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0)
414 Resources.maxComputeWorkGroupCountX = value;
415 else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0)
416 Resources.maxComputeWorkGroupCountY = value;
417 else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0)
418 Resources.maxComputeWorkGroupCountZ = value;
419 else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0)
420 Resources.maxComputeWorkGroupSizeX = value;
421 else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0)
422 Resources.maxComputeWorkGroupSizeY = value;
423 else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0)
424 Resources.maxComputeWorkGroupSizeZ = value;
425 else if (strcmp(token, "MaxComputeUniformComponents") == 0)
426 Resources.maxComputeUniformComponents = value;
427 else if (strcmp(token, "MaxComputeTextureImageUnits") == 0)
428 Resources.maxComputeTextureImageUnits = value;
429 else if (strcmp(token, "MaxComputeImageUniforms") == 0)
430 Resources.maxComputeImageUniforms = value;
431 else if (strcmp(token, "MaxComputeAtomicCounters") == 0)
432 Resources.maxComputeAtomicCounters = value;
433 else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0)
434 Resources.maxComputeAtomicCounterBuffers = value;
435 else if (strcmp(token, "MaxVaryingComponents") == 0)
436 Resources.maxVaryingComponents = value;
437 else if (strcmp(token, "MaxVertexOutputComponents") == 0)
438 Resources.maxVertexOutputComponents = value;
439 else if (strcmp(token, "MaxGeometryInputComponents") == 0)
440 Resources.maxGeometryInputComponents = value;
441 else if (strcmp(token, "MaxGeometryOutputComponents") == 0)
442 Resources.maxGeometryOutputComponents = value;
443 else if (strcmp(token, "MaxFragmentInputComponents") == 0)
444 Resources.maxFragmentInputComponents = value;
445 else if (strcmp(token, "MaxImageUnits") == 0)
446 Resources.maxImageUnits = value;
447 else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0)
448 Resources.maxCombinedImageUnitsAndFragmentOutputs = value;
449 else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0)
450 Resources.maxCombinedShaderOutputResources = value;
451 else if (strcmp(token, "MaxImageSamples") == 0)
452 Resources.maxImageSamples = value;
453 else if (strcmp(token, "MaxVertexImageUniforms") == 0)
454 Resources.maxVertexImageUniforms = value;
455 else if (strcmp(token, "MaxTessControlImageUniforms") == 0)
456 Resources.maxTessControlImageUniforms = value;
457 else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0)
458 Resources.maxTessEvaluationImageUniforms = value;
459 else if (strcmp(token, "MaxGeometryImageUniforms") == 0)
460 Resources.maxGeometryImageUniforms = value;
461 else if (strcmp(token, "MaxFragmentImageUniforms") == 0)
462 Resources.maxFragmentImageUniforms = value;
463 else if (strcmp(token, "MaxCombinedImageUniforms") == 0)
464 Resources.maxCombinedImageUniforms = value;
465 else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0)
466 Resources.maxGeometryTextureImageUnits = value;
467 else if (strcmp(token, "MaxGeometryOutputVertices") == 0)
468 Resources.maxGeometryOutputVertices = value;
469 else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0)
470 Resources.maxGeometryTotalOutputComponents = value;
471 else if (strcmp(token, "MaxGeometryUniformComponents") == 0)
472 Resources.maxGeometryUniformComponents = value;
473 else if (strcmp(token, "MaxGeometryVaryingComponents") == 0)
474 Resources.maxGeometryVaryingComponents = value;
475 else if (strcmp(token, "MaxTessControlInputComponents") == 0)
476 Resources.maxTessControlInputComponents = value;
477 else if (strcmp(token, "MaxTessControlOutputComponents") == 0)
478 Resources.maxTessControlOutputComponents = value;
479 else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0)
480 Resources.maxTessControlTextureImageUnits = value;
481 else if (strcmp(token, "MaxTessControlUniformComponents") == 0)
482 Resources.maxTessControlUniformComponents = value;
483 else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0)
484 Resources.maxTessControlTotalOutputComponents = value;
485 else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0)
486 Resources.maxTessEvaluationInputComponents = value;
487 else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0)
488 Resources.maxTessEvaluationOutputComponents = value;
489 else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0)
490 Resources.maxTessEvaluationTextureImageUnits = value;
491 else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0)
492 Resources.maxTessEvaluationUniformComponents = value;
493 else if (strcmp(token, "MaxTessPatchComponents") == 0)
494 Resources.maxTessPatchComponents = value;
495 else if (strcmp(token, "MaxPatchVertices") == 0)
496 Resources.maxPatchVertices = value;
497 else if (strcmp(token, "MaxTessGenLevel") == 0)
498 Resources.maxTessGenLevel = value;
499 else if (strcmp(token, "MaxViewports") == 0)
500 Resources.maxViewports = value;
501 else if (strcmp(token, "MaxVertexAtomicCounters") == 0)
502 Resources.maxVertexAtomicCounters = value;
503 else if (strcmp(token, "MaxTessControlAtomicCounters") == 0)
504 Resources.maxTessControlAtomicCounters = value;
505 else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0)
506 Resources.maxTessEvaluationAtomicCounters = value;
507 else if (strcmp(token, "MaxGeometryAtomicCounters") == 0)
508 Resources.maxGeometryAtomicCounters = value;
509 else if (strcmp(token, "MaxFragmentAtomicCounters") == 0)
510 Resources.maxFragmentAtomicCounters = value;
511 else if (strcmp(token, "MaxCombinedAtomicCounters") == 0)
512 Resources.maxCombinedAtomicCounters = value;
513 else if (strcmp(token, "MaxAtomicCounterBindings") == 0)
514 Resources.maxAtomicCounterBindings = value;
515 else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0)
516 Resources.maxVertexAtomicCounterBuffers = value;
517 else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0)
518 Resources.maxTessControlAtomicCounterBuffers = value;
519 else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0)
520 Resources.maxTessEvaluationAtomicCounterBuffers = value;
521 else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0)
522 Resources.maxGeometryAtomicCounterBuffers = value;
523 else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0)
524 Resources.maxFragmentAtomicCounterBuffers = value;
525 else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0)
526 Resources.maxCombinedAtomicCounterBuffers = value;
527 else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0)
528 Resources.maxAtomicCounterBufferSize = value;
529 else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0)
530 Resources.maxTransformFeedbackBuffers = value;
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600531 else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0)
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600532 Resources.maxTransformFeedbackInterleavedComponents = value;
533 else if (strcmp(token, "MaxCullDistances") == 0)
534 Resources.maxCullDistances = value;
535 else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
536 Resources.maxCombinedClipAndCullDistances = value;
537 else if (strcmp(token, "MaxSamples") == 0)
538 Resources.maxSamples = value;
539
540 else if (strcmp(token, "nonInductiveForLoops") == 0)
541 Resources.limits.nonInductiveForLoops = (value != 0);
542 else if (strcmp(token, "whileLoops") == 0)
543 Resources.limits.whileLoops = (value != 0);
544 else if (strcmp(token, "doWhileLoops") == 0)
545 Resources.limits.doWhileLoops = (value != 0);
546 else if (strcmp(token, "generalUniformIndexing") == 0)
547 Resources.limits.generalUniformIndexing = (value != 0);
548 else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0)
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600549 Resources.limits.generalAttributeMatrixVectorIndexing = (value != 0);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600550 else if (strcmp(token, "generalVaryingIndexing") == 0)
551 Resources.limits.generalVaryingIndexing = (value != 0);
552 else if (strcmp(token, "generalSamplerIndexing") == 0)
553 Resources.limits.generalSamplerIndexing = (value != 0);
554 else if (strcmp(token, "generalVariableIndexing") == 0)
555 Resources.limits.generalVariableIndexing = (value != 0);
556 else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0)
557 Resources.limits.generalConstantMatrixVectorIndexing = (value != 0);
558 else
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600559 printf("Warning: unrecognized limit (%s) in configuration file.\n", token);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600560
561 token = strtok(0, delims);
562 }
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700563 if (configStrings) FreeFileData(configStrings);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600564}
565
Karl Schultz6addd812016-02-02 17:17:23 -0700566void VkTestFramework::SetMessageOptions(EShMessages &messages) {
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700567 if (m_compile_options & EOptionRelaxedErrors) messages = (EShMessages)(messages | EShMsgRelaxedErrors);
568 if (m_compile_options & EOptionIntermediate) messages = (EShMessages)(messages | EShMsgAST);
569 if (m_compile_options & EOptionSuppressWarnings) messages = (EShMessages)(messages | EShMsgSuppressWarnings);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600570}
571
572//
573// Malloc a string of sufficient size and read a string into it.
574//
Karl Schultz6addd812016-02-02 17:17:23 -0700575char **VkTestFramework::ReadFileData(const char *fileName) {
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600576 FILE *in;
Karl Schultz6addd812016-02-02 17:17:23 -0700577#if defined(_WIN32) && defined(__GNUC__)
578 in = fopen(fileName, "r");
579 int errorCode = in ? 0 : 1;
580#else
581 int errorCode = fopen_s(&in, fileName, "r");
582#endif
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600583
584 char *fdata;
Jeremy Hayes3b2a3a32016-06-21 11:05:08 -0600585 size_t count = 0;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600586 const int maxSourceStrings = 5;
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600587 char **return_data = (char **)malloc(sizeof(char *) * (maxSourceStrings + 1));
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600588
589 if (errorCode) {
590 printf("Error: unable to open input file: %s\n", fileName);
591 return 0;
592 }
593
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700594 while (fgetc(in) != EOF) count++;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600595
596 fseek(in, 0, SEEK_SET);
597
Karl Schultz6addd812016-02-02 17:17:23 -0700598 if (!(fdata = (char *)malloc(count + 2))) {
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600599 printf("Error allocating memory\n");
600 return 0;
601 }
Karl Schultz6addd812016-02-02 17:17:23 -0700602 if (fread(fdata, 1, count, in) != count) {
603 printf("Error reading input file: %s\n", fileName);
604 return 0;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600605 }
606 fdata[count] = '\0';
607 fclose(in);
608 if (count == 0) {
Karl Schultz6addd812016-02-02 17:17:23 -0700609 return_data[0] = (char *)malloc(count + 2);
610 return_data[0][0] = '\0';
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600611 m_num_shader_strings = 0;
612 return return_data;
613 } else
614 m_num_shader_strings = 1;
615
Jeremy Hayes3b2a3a32016-06-21 11:05:08 -0600616 size_t len = (int)(ceil)((float)count / (float)m_num_shader_strings);
617 size_t ptr_len = 0, i = 0;
Karl Schultz6addd812016-02-02 17:17:23 -0700618 while (count > 0) {
619 return_data[i] = (char *)malloc(len + 2);
620 memcpy(return_data[i], fdata + ptr_len, len);
621 return_data[i][len] = '\0';
622 count -= (len);
623 ptr_len += (len);
624 if (count < len) {
625 if (count == 0) {
626 m_num_shader_strings = (i + 1);
627 break;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600628 }
Karl Schultz6addd812016-02-02 17:17:23 -0700629 len = count;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600630 }
631 ++i;
632 }
633 return return_data;
634}
635
Karl Schultz6addd812016-02-02 17:17:23 -0700636void VkTestFramework::FreeFileData(char **data) {
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700637 for (int i = 0; i < m_num_shader_strings; i++) free(data[i]);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600638}
639
640//
641// Deduce the language from the filename. Files must end in one of the
642// following extensions:
643//
644// .vert = vertex
645// .tesc = tessellation control
646// .tese = tessellation evaluation
647// .geom = geometry
648// .frag = fragment
649// .comp = compute
650//
Karl Schultz6addd812016-02-02 17:17:23 -0700651EShLanguage VkTestFramework::FindLanguage(const std::string &name) {
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600652 size_t ext = name.rfind('.');
653 if (ext == std::string::npos) {
654 return EShLangVertex;
655 }
656
657 std::string suffix = name.substr(ext + 1, std::string::npos);
658 if (suffix == "vert")
659 return EShLangVertex;
660 else if (suffix == "tesc")
661 return EShLangTessControl;
662 else if (suffix == "tese")
663 return EShLangTessEvaluation;
664 else if (suffix == "geom")
665 return EShLangGeometry;
666 else if (suffix == "frag")
667 return EShLangFragment;
668 else if (suffix == "comp")
669 return EShLangCompute;
670
671 return EShLangVertex;
672}
673
674//
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600675// Convert VK shader type to compiler's
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600676//
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600677EShLanguage VkTestFramework::FindLanguage(const VkShaderStageFlagBits shader_type) {
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600678 switch (shader_type) {
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700679 case VK_SHADER_STAGE_VERTEX_BIT:
680 return EShLangVertex;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600681
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700682 case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT:
683 return EShLangTessControl;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600684
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700685 case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT:
686 return EShLangTessEvaluation;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600687
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700688 case VK_SHADER_STAGE_GEOMETRY_BIT:
689 return EShLangGeometry;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600690
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700691 case VK_SHADER_STAGE_FRAGMENT_BIT:
692 return EShLangFragment;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600693
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700694 case VK_SHADER_STAGE_COMPUTE_BIT:
695 return EShLangCompute;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600696
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700697 default:
698 return EShLangVertex;
Chia-I Wub4c2aa42014-12-15 23:50:11 +0800699 }
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600700}
701
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600702//
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600703// Compile a given string containing GLSL into SPV for use by VK
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600704// Return value of false means an error was encountered.
705//
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600706bool VkTestFramework::GLSLtoSPV(const VkShaderStageFlagBits shader_type, const char *pshader, std::vector<unsigned int> &spirv) {
Courtney Goeltzenleuchterc7def922015-09-24 17:05:05 -0600707 glslang::TProgram program;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600708 const char *shaderStrings[1];
709
710 // TODO: Do we want to load a special config file depending on the
711 // shader source? Optional name maybe?
712 // SetConfigFile(fileName);
713
714 ProcessConfigFile();
715
716 EShMessages messages = EShMsgDefault;
717 SetMessageOptions(messages);
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600718 messages = static_cast<EShMessages>(messages | EShMsgSpvRules | EShMsgVulkanRules);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600719
720 EShLanguage stage = FindLanguage(shader_type);
Karl Schultz6addd812016-02-02 17:17:23 -0700721 glslang::TShader *shader = new glslang::TShader(stage);
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600722
723 shaderStrings[0] = pshader;
724 shader->setStrings(shaderStrings, 1);
725
Mark Lobodzinskic6a62142016-09-07 16:35:55 -0600726 if (!shader->parse(&Resources, (m_compile_options & EOptionDefaultDesktop) ? 110 : 100, false, messages)) {
Karl Schultz6addd812016-02-02 17:17:23 -0700727 if (!(m_compile_options & EOptionSuppressInfolog)) {
Cody Northrop195d6622014-11-03 12:54:37 -0700728 puts(shader->getInfoLog());
729 puts(shader->getInfoDebugLog());
730 }
731
Mark Lobodzinski64318ba2017-01-26 13:34:13 -0700732 return false; // something didn't work
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600733 }
734
735 program.addShader(shader);
736
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600737 //
738 // Program-level processing...
739 //
740
Karl Schultz6addd812016-02-02 17:17:23 -0700741 if (!program.link(messages)) {
Karl Schultz6addd812016-02-02 17:17:23 -0700742 if (!(m_compile_options & EOptionSuppressInfolog)) {
Cody Northrop195d6622014-11-03 12:54:37 -0700743 puts(shader->getInfoLog());
744 puts(shader->getInfoDebugLog());
745 }
746
747 return false;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600748 }
749
750 if (m_compile_options & EOptionDumpReflection) {
751 program.buildReflection();
752 program.dumpReflection();
753 }
754
Cody Northrop5a95b472015-06-03 13:01:54 -0600755 glslang::GlslangToSpv(*program.getIntermediate(stage), spirv);
756
757 //
758 // Test the different modes of SPIR-V modification
759 //
760 if (this->m_canonicalize_spv) {
761 spv::spirvbin_t(0).remap(spirv, spv::spirvbin_t::ALL_BUT_STRIP);
762 }
763
764 if (this->m_strip_spv) {
765 spv::spirvbin_t(0).remap(spirv, spv::spirvbin_t::STRIP);
766 }
767
768 if (this->m_do_everything_spv) {
769 spv::spirvbin_t(0).remap(spirv, spv::spirvbin_t::DO_EVERYTHING);
770 }
771
Courtney Goeltzenleuchterc7def922015-09-24 17:05:05 -0600772 delete shader;
Courtney Goeltzenleuchter9818f782014-10-03 09:53:32 -0600773
774 return true;
775}