Merge in changes from Khronos Vulkan CTS repo
[platform/upstream/VK-GL-CTS.git] / framework / qphelper / qpTestLog.c
index 77e182a..26c7923 100644 (file)
@@ -144,7 +144,7 @@ typedef struct qpKeyStringMap_s
        char*   string;
 } qpKeyStringMap;
 
-static const char* LOG_FORMAT_VERSION = "0.3.3";
+static const char* LOG_FORMAT_VERSION = "0.3.4";
 
 /* Mapping enum to above strings... */
 static const qpKeyStringMap s_qpTestTypeMap[] =
@@ -1234,6 +1234,26 @@ deBool qpTestLog_writeKernelSource (qpTestLog* log, const char* source)
 }
 
 /*--------------------------------------------------------------------*//*!
+ * \brief Write a SPIR-V module assembly source into the log.
+ *//*--------------------------------------------------------------------*/
+deBool qpTestLog_writeSpirVAssemblySource (qpTestLog* log, const char* source)
+{
+       DE_ASSERT(log);
+       DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM);
+       deMutex_lock(log->lock);
+
+       if (!qpXmlWriter_writeStringElement(log->writer, "SpirVAssemblySource", source))
+       {
+               qpPrintf("qpTestLog_writeSpirVAssemblySource(): Writing XML failed\n");
+               deMutex_unlock(log->lock);
+               return DE_FALSE;
+       }
+
+       deMutex_unlock(log->lock);
+       return DE_TRUE;
+}
+
+/*--------------------------------------------------------------------*//*!
  * \brief Write OpenCL kernel compilation results into the log
  *//*--------------------------------------------------------------------*/
 deBool qpTestLog_writeCompileInfo (qpTestLog* log, const char* name, const char* description, deBool compileOk, const char* infoLog)