TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_shader_draw_parameters");
// Shader draw parameters is part of Vulkan 1.1 but is optional
- if (context.getUsedApiVersion() >= VK_API_VERSION_1_1)
+ if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) )
{
// Check if shader draw parameters is supported on the physical device.
vk::VkPhysicalDeviceShaderDrawParameterFeatures drawParameters =
TestInstance* SpvAsmLoopControlDependencyInfiniteCase::createInstance (Context& context) const
{
- if (context.getUsedApiVersion() < VK_API_VERSION_1_1)
+ if (context.contextSupports(vk::ApiVersion(1, 1, 0)))
TCU_THROW(NotSupportedError, "SPIR-V higher than 1.3 is required for this test to run");
return new SpvAsmLoopControlDependencyInfiniteInstance(context);
TestInstance* SpvAsmLoopControlDependencyLengthCase::createInstance (Context& context) const
{
- if (context.getUsedApiVersion() < VK_API_VERSION_1_1)
+ if (context.contextSupports(vk::ApiVersion(1, 1, 0)))
TCU_THROW(NotSupportedError, "SPIR-V higher than 1.3 is required for this test to run");
return new SpvAsmLoopControlDependencyLengthInstance(context);
bool vkt::subgroups::isSubgroupSupported(Context& context)
{
- return context.getUsedApiVersion() < VK_API_VERSION_1_1 ? false : true;
+ return context.contextSupports(vk::ApiVersion(1, 1, 0));
}
bool vkt::subgroups::areSubgroupOperationsSupportedForStage(
#include "vkMemUtil.hpp"
#include "vkPlatform.hpp"
#include "vkDebugReportUtil.hpp"
-#include "vkApiVersion.hpp"
#include "tcuCommandLine.hpp"
vk::VkQueue Context::getUniversalQueue (void) const { return m_device->getUniversalQueue(); }
vk::Allocator& Context::getDefaultAllocator (void) const { return *m_allocator; }
deUint32 Context::getUsedApiVersion (void) const { return m_device->getUsedApiVersion(); }
+bool Context::contextSupports (const deUint32 majorNum, const deUint32 minorNum, const deUint32 patchNum) const
+ { return m_device->getUsedApiVersion() >= VK_MAKE_VERSION(majorNum, minorNum, patchNum); }
+bool Context::contextSupports (const ApiVersion version) const
+ { return m_device->getUsedApiVersion() >= pack(version); }
+bool Context::contextSupports (const deUint32 requiredApiVersionBits) const
+ { return m_device->getUsedApiVersion() >= requiredApiVersionBits; }
// TestCase
#include "vkDefs.hpp"
#include "deUniquePtr.hpp"
#include "vkPrograms.hpp"
+#include "vkApiVersion.hpp"
namespace glu
{
deUint32 getUsedApiVersion (void) const;
vk::Allocator& getDefaultAllocator (void) const;
+ bool contextSupports (const deUint32 majorNum, const deUint32 minorNum, const deUint32 patchNum) const;
+ bool contextSupports (const vk::ApiVersion version) const;
+ bool contextSupports (const deUint32 requiredApiVersionBits) const;
protected:
tcu::TestContext& m_testCtx;
Context& operator= (const Context&); // Not allowed
};
-
class TestInstance;
class TestCase : public tcu::TestCase