Add HLSL compilation support and some tessellation tests.
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / vktTestPackage.cpp
index ad0a145..f62c4fd 100644 (file)
@@ -31,7 +31,7 @@
 #include "vkPlatform.hpp"
 #include "vkPrograms.hpp"
 #include "vkBinaryRegistry.hpp"
-#include "vkGlslToSpirV.hpp"
+#include "vkShaderToSpirV.hpp"
 #include "vkDebugReportUtil.hpp"
 #include "vkQueryUtil.hpp"
 
@@ -78,6 +78,7 @@
 #include "vktTextureTests.hpp"
 #include "vktGeometryTests.hpp"
 #include "vktRobustnessTests.hpp"
+#include "vktYCbCrTests.hpp"
 
 #include <vector>
 #include <sstream>
@@ -90,6 +91,11 @@ vk::ProgramBinary* compileProgram (const vk::GlslSource& source, glu::ShaderProg
        return vk::buildProgram(source, buildInfo);
 }
 
+vk::ProgramBinary* compileProgram (const vk::HlslSource& source, glu::ShaderProgramInfo* buildInfo)
+{
+       return vk::buildProgram(source, buildInfo);
+}
+
 vk::ProgramBinary* compileProgram (const vk::SpirVAsmSource& source, vk::SpirVProgramInfo* buildInfo)
 {
        return vk::assembleProgram(source, buildInfo);
@@ -226,7 +232,25 @@ void TestCaseExecutor::init (tcu::TestCase* testCase, const std::string& casePat
 
        for (vk::GlslSourceCollection::Iterator progIter = sourceProgs.glslSources.begin(); progIter != sourceProgs.glslSources.end(); ++progIter)
        {
-               vk::ProgramBinary* binProg = buildProgram<glu::ShaderProgramInfo, vk::GlslSourceCollection::Iterator>(casePath, progIter, m_prebuiltBinRegistry, log, &m_progCollection);
+               const vk::ProgramBinary* const binProg = buildProgram<glu::ShaderProgramInfo, vk::GlslSourceCollection::Iterator>(casePath, progIter, m_prebuiltBinRegistry, log, &m_progCollection);
+
+               try
+               {
+                       std::ostringstream disasm;
+
+                       vk::disassembleProgram(*binProg, &disasm);
+
+                       log << vk::SpirVAsmSource(disasm.str());
+               }
+               catch (const tcu::NotSupportedError& err)
+               {
+                       log << err;
+               }
+       }
+
+       for (vk::HlslSourceCollection::Iterator progIter = sourceProgs.hlslSources.begin(); progIter != sourceProgs.hlslSources.end(); ++progIter)
+       {
+               const vk::ProgramBinary* const binProg = buildProgram<glu::ShaderProgramInfo, vk::HlslSourceCollection::Iterator>(casePath, progIter, m_prebuiltBinRegistry, log, &m_progCollection);
 
                try
                {
@@ -402,6 +426,7 @@ void TestPackage::init (void)
        addChild(texture::createTests                   (m_testCtx));
        addChild(geometry::createTests                  (m_testCtx));
        addChild(robustness::createTests                (m_testCtx));
+       addChild(ycbcr::createTests                             (m_testCtx));
 }
 
 } // vkt