DRAWTYPE_LAST
};
+enum class IndirectCountType
+{
+ NONE,
+ BUFFER_LIMIT,
+ PARAM_LIMIT,
+
+ LAST
+};
+
struct DrawTypedTestSpec : public TestSpecBase
{
DrawTypedTestSpec()
- : testFirstInstanceNdx(false)
- , testIndirectCountExt(false)
- {};
-
- DrawType drawType;
- bool testFirstInstanceNdx;
- bool testIndirectCountExt;
+ : drawType(DRAWTYPE_LAST)
+ , testFirstInstanceNdx(false)
+ , testIndirectCountExt(IndirectCountType::NONE)
+ {}
+
+ DrawType drawType;
+ bool testFirstInstanceNdx;
+ IndirectCountType testIndirectCountExt;
};
class IndirectDraw : public DrawTestsBaseClass
vk::VkDeviceSize m_offsetInBuffer;
deUint32 m_strideInBuffer;
- const bool m_testIndirectCountExt;
+ const IndirectCountType m_testIndirectCountExt;
de::SharedPtr<Buffer> m_indirectCountBuffer;
vk::VkDeviceSize m_offsetInCountBuffer;
const deUint32 m_indirectCountExtDrawPadding;
}
IndirectDraw::IndirectDraw (Context &context, TestSpec testSpec)
- : DrawTestsBaseClass (context, testSpec.shaders[glu::SHADERTYPE_VERTEX], testSpec.shaders[glu::SHADERTYPE_FRAGMENT], testSpec.topology)
+ : DrawTestsBaseClass (context, testSpec.shaders[glu::SHADERTYPE_VERTEX], testSpec.shaders[glu::SHADERTYPE_FRAGMENT], testSpec.useDynamicRendering, testSpec.topology)
, m_testIndirectCountExt (testSpec.testIndirectCountExt)
, m_indirectCountExtDrawPadding (1u)
, m_drawType (testSpec.drawType)
const vk::VkQueue queue = m_context.getUniversalQueue();
const vk::VkDevice device = m_context.getDevice();
+ m_drawCount = 2;
+ m_offsetInBuffer = sizeof(m_junkData);
+ const deUint32 m_bufferDrawCount = 2u * m_drawCount;
+
if (m_drawType == DRAW_TYPE_SEQUENTIAL)
{
switch (m_topology)
addCommand(drawCommands[0]);
addCommand(drawCommands[1]);
addCommand(drawCommands[2]);
- if (m_testIndirectCountExt)
+ addCommand(drawCommands[1]);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCommands[1]);
- addCommand(drawCommands[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCommands[1]);
+ addCommand(drawCommands[1]);
+ }
}
break;
}
addCommand(drawCommands[0]);
addCommand(drawCommands[1]);
addCommand(drawCommands[2]);
- if (m_testIndirectCountExt)
+ addCommand(drawCommands[1]);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCommands[1]);
- addCommand(drawCommands[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCommands[1]);
+ addCommand(drawCommands[1]);
+ }
}
break;
}
addCommand(drawCommands[0]);
addCommand(drawCommands[1]);
addCommand(drawCommands[2]);
- if (m_testIndirectCountExt)
+ addCommand(drawCommands[1]);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCommands[1]);
- addCommand(drawCommands[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCommands[1]);
+ addCommand(drawCommands[1]);
+ }
}
break;
}
addCommand(drawCommands[0]);
addCommand(drawCommands[1]);
addCommand(drawCommands[2]);
- if (m_testIndirectCountExt)
+ addCommand(drawCommands[1]);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCommands[1]);
- addCommand(drawCommands[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCommands[1]);
+ addCommand(drawCommands[1]);
+ }
}
break;
}
m_strideInBuffer = 2 * (deUint32)sizeof(vk::VkDrawIndexedIndirectCommand);
}
- m_drawCount = 2;
- m_offsetInBuffer = sizeof(m_junkData);
-
- beginRenderPass();
+ beginRender();
const vk::VkDeviceSize vertexBufferOffset = 0;
const vk::VkBuffer vertexBuffer = m_vertexBuffer->object();
vk::flushAlloc(m_vk, m_context.getDevice(), m_indirectBuffer->getBoundMemory());
- if (m_testIndirectCountExt)
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
m_offsetInCountBuffer = sizeof(tcu::Vec3);
m_indirectCountBuffer = Buffer::createAndAlloc(m_vk,
deUint8* countBufferPtr = reinterpret_cast<deUint8*>(m_indirectCountBuffer->getBoundMemory().getHostPtr());
+ // For IndirectCountType::PARAM_LIMIT, the real limit will be set using the call parameter.
if (m_isMultiDrawEnabled && m_drawCount <= m_drawIndirectMaxCount)
- *(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = m_drawCount;
+ *(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = m_drawCount + (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? 0u : m_indirectCountExtDrawPadding);
else
- *(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = 1u;
+ *(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? 1u : m_drawCount + m_indirectCountExtDrawPadding);
vk::flushAlloc(m_vk, m_context.getDevice(), m_indirectCountBuffer->getBoundMemory());
}
{
case DRAW_TYPE_SEQUENTIAL:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer, m_drawCount + m_indirectCountExtDrawPadding,
- m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = m_drawCount + (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_indirectCountExtDrawPadding : 0u);
+ m_vk.cmdDrawIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer, maxDrawCount,
+ m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
break;
}
case DRAW_TYPE_INDEXED:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndexedIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer, m_drawCount + m_indirectCountExtDrawPadding,
- m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = m_drawCount + (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_indirectCountExtDrawPadding : 0u);
+ m_vk.cmdDrawIndexedIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer, maxDrawCount,
+ m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndexedIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
break;
{
case DRAW_TYPE_SEQUENTIAL:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer, m_drawCount + m_indirectCountExtDrawPadding,
- m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_drawCount + m_indirectCountExtDrawPadding : 1u);
+ m_vk.cmdDrawIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer, maxDrawCount,
+ m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer, 1u, 0u);
break;
}
case DRAW_TYPE_INDEXED:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndexedIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer, m_drawCount + m_indirectCountExtDrawPadding,
- m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_drawCount + m_indirectCountExtDrawPadding : 1u);
+ m_vk.cmdDrawIndexedIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer, maxDrawCount,
+ m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndexedIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer, 1u, 0u);
break;
}
}
}
- endRenderPass(m_vk, *m_cmdBuffer);
+ endRender();
endCommandBuffer(m_vk, *m_cmdBuffer);
submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
// Validation
- tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+ tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
referenceFrame.allocLevel(0);
const deInt32 frameWidth = referenceFrame.getWidth();
const vk::VkQueue queue = m_context.getUniversalQueue();
const vk::VkDevice device = m_context.getDevice();
+ m_drawCount = 2;
+ m_offsetInBuffer = sizeof(m_junkData);
+ const deUint32 m_bufferDrawCount = 2u * m_drawCount;
+
if (m_drawType == DRAW_TYPE_SEQUENTIAL)
{
switch (m_topology)
addCommand(drawCmd[0]);
addCommand(drawCmd[1]);
addCommand(drawCmd[2]);
- if (m_testIndirectCountExt)
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCmd[1]);
- addCommand(drawCmd[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCmd[1]);
+ addCommand(drawCmd[1]);
+ }
}
break;
}
addCommand(drawCmd[0]);
addCommand(drawCmd[1]);
addCommand(drawCmd[2]);
- if (m_testIndirectCountExt)
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCmd[1]);
- addCommand(drawCmd[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCmd[1]);
+ addCommand(drawCmd[1]);
+ }
}
break;
}
addCommand(drawCmd[0]);
addCommand(drawCmd[1]);
addCommand(drawCmd[2]);
- if (m_testIndirectCountExt)
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCmd[1]);
- addCommand(drawCmd[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCmd[1]);
+ addCommand(drawCmd[1]);
+ }
}
break;
}
addCommand(drawCmd[0]);
addCommand(drawCmd[1]);
addCommand(drawCmd[2]);
- if (m_testIndirectCountExt)
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
- addCommand(drawCmd[1]);
- addCommand(drawCmd[1]);
+ // Add padding data to the buffer to make sure it's large enough.
+ for (deUint32 i = 0; i < m_bufferDrawCount; ++i)
+ {
+ addCommand(drawCmd[1]);
+ addCommand(drawCmd[1]);
+ }
}
break;
}
m_strideInBuffer = 2 * (deUint32)sizeof(vk::VkDrawIndexedIndirectCommand);
}
- m_drawCount = 2;
- m_offsetInBuffer = sizeof(m_junkData);
-
- beginRenderPass();
+ beginRender();
const vk::VkDeviceSize vertexBufferOffset = 0;
const vk::VkBuffer vertexBuffer = m_vertexBuffer->object();
vk::flushAlloc(m_vk, m_context.getDevice(), m_indirectBuffer->getBoundMemory());
- if (m_testIndirectCountExt)
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
{
m_offsetInCountBuffer = sizeof(tcu::Vec3);
m_indirectCountBuffer = Buffer::createAndAlloc(m_vk,
deUint8* countBufferPtr = reinterpret_cast<deUint8*>(m_indirectCountBuffer->getBoundMemory().getHostPtr());
+ // For IndirectCountType::PARAM_LIMIT, the real limit will be set using the call parameter.
if (m_isMultiDrawEnabled && m_drawCount <= m_drawIndirectMaxCount)
- *(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = m_drawCount;
+ *(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = m_drawCount + (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? 0u : m_indirectCountExtDrawPadding);
else
*(deUint32*)(countBufferPtr + m_offsetInCountBuffer) = 1u;
{
case DRAW_TYPE_SEQUENTIAL:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer,
- m_drawCount + m_indirectCountExtDrawPadding, m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = m_drawCount + (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_indirectCountExtDrawPadding : 0u);
+ m_vk.cmdDrawIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer,
+ maxDrawCount, m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
break;
}
case DRAW_TYPE_INDEXED:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndexedIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer,
- m_drawCount + m_indirectCountExtDrawPadding, m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = m_drawCount + (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_indirectCountExtDrawPadding : 0u);
+ m_vk.cmdDrawIndexedIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer,
+ maxDrawCount, m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndexedIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
break;
{
case DRAW_TYPE_SEQUENTIAL:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer, m_drawCount + m_indirectCountExtDrawPadding,
- m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_drawCount + m_indirectCountExtDrawPadding : 1u);
+ m_vk.cmdDrawIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer, maxDrawCount,
+ m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer, 1u, 0u);
break;
}
case DRAW_TYPE_INDEXED:
{
- if (m_testIndirectCountExt)
- m_vk.cmdDrawIndexedIndirectCountKHR(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
- m_indirectCountBuffer->object(), m_offsetInCountBuffer, m_drawCount + m_indirectCountExtDrawPadding,
- m_strideInBuffer);
+ if (m_testIndirectCountExt != IndirectCountType::NONE)
+ {
+ const deUint32 maxDrawCount = (m_testIndirectCountExt == IndirectCountType::BUFFER_LIMIT ? m_drawCount + m_indirectCountExtDrawPadding : 1u);
+ m_vk.cmdDrawIndexedIndirectCount(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer,
+ m_indirectCountBuffer->object(), m_offsetInCountBuffer, maxDrawCount,
+ m_strideInBuffer);
+ }
else
m_vk.cmdDrawIndexedIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer + drawNdx*m_strideInBuffer, 1u, 0u);
break;
}
}
}
- endRenderPass(m_vk, *m_cmdBuffer);
+ endRender();
endCommandBuffer(m_vk, *m_cmdBuffer);
submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
// Validation
VK_CHECK(m_vk.queueWaitIdle(queue));
- tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+ tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5 + static_cast<float>(HEIGHT)));
referenceFrame.allocLevel(0);
return tcu::TestStatus(res, qpGetTestResultName(res));
}
-void checkIndirectCountExt (Context& context)
+void checkSupport(Context& context, IndirectDraw::TestSpec testSpec)
{
- context.requireDeviceExtension("VK_KHR_draw_indirect_count");
+ if (testSpec.testIndirectCountExt != IndirectCountType::NONE)
+ context.requireDeviceFunctionality("VK_KHR_draw_indirect_count");
+
+ if (testSpec.useDynamicRendering)
+ context.requireDeviceFunctionality("VK_KHR_dynamic_rendering");
}
} // anonymous
-IndirectDrawTests::IndirectDrawTests (tcu::TestContext& testCtx)
- : TestCaseGroup(testCtx, "indirect_draw", "indirect drawing simple geometry")
+IndirectDrawTests::IndirectDrawTests (tcu::TestContext& testCtx, bool useDynamicRendering)
+ : TestCaseGroup (testCtx, "indirect_draw", "indirect drawing simple geometry")
+ , m_useDynamicRendering (useDynamicRendering)
{
/* Left blank on purpose */
}
tcu::TestCaseGroup* drawTypeGroup = new tcu::TestCaseGroup(m_testCtx, drawTypeStr.c_str(), ("Draws geometry using " + drawTypeStr + "draw call").c_str());
{
- tcu::TestCaseGroup* indirectDrawGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw", "Draws geometry");
- tcu::TestCaseGroup* indirectDrawCountGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_count", "Draws geometry with VK_KHR_draw_indirect_count extension");
+ tcu::TestCaseGroup* indirectDrawGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw", "Draws geometry");
+ tcu::TestCaseGroup* indirectDrawCountGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_count", "Draws geometry with VK_KHR_draw_indirect_count extension");
+ tcu::TestCaseGroup* indirectDrawParamCountGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_param_count", "Draws geometry with VK_KHR_draw_indirect_count extension and limit draws count with call parameter");
{
IndirectDraw::TestSpec testSpec;
testSpec.drawType = static_cast<DrawType>(drawTypeIdx);
+ testSpec.useDynamicRendering = m_useDynamicRendering;
testSpec.shaders[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetch.vert";
testSpec.shaders[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
+
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawGroup->addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "triangle_list", "Draws triangle list", testSpec));
+ indirectDrawGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawGroup->addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "triangle_strip", "Draws triangle strip", testSpec));
+ indirectDrawGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
- testSpec.testIndirectCountExt = true;
+ testSpec.testIndirectCountExt = IndirectCountType::BUFFER_LIMIT;
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawCountGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport0>(m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawCountGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawCountGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport0>(m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawCountGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
+
+ testSpec.testIndirectCountExt = IndirectCountType::PARAM_LIMIT;
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ indirectDrawParamCountGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
+ indirectDrawParamCountGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
}
drawTypeGroup->addChild(indirectDrawGroup);
drawTypeGroup->addChild(indirectDrawCountGroup);
+ drawTypeGroup->addChild(indirectDrawParamCountGroup);
{
- tcu::TestCaseGroup* indirectDrawFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_first_instance", "Draws geometry with different first instance in one commandbuffer");
- tcu::TestCaseGroup* indirectDrawCountFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_count_first_instance", "Draws geometry with VK_KHR_draw_indirect_count extension with different first instance in one commandbuffer using ");
+ tcu::TestCaseGroup* indirectDrawFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_first_instance", "Draws geometry with different first instance in one commandbuffer");
+ tcu::TestCaseGroup* indirectDrawCountFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_count_first_instance", "Draws geometry with VK_KHR_draw_indirect_count extension with different first instance in one commandbuffer");
+ tcu::TestCaseGroup* indirectDrawParamCountFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_param_count_first_instance", "Draws geometry with VK_KHR_draw_indirect_count extension with different first instance in one commandbuffer and limit draws count with call parameter");
{
IndirectDraw::TestSpec testSpec;
testSpec.testFirstInstanceNdx = true;
testSpec.drawType = static_cast<DrawType>(drawTypeIdx);
+ testSpec.useDynamicRendering = m_useDynamicRendering;
testSpec.shaders[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstanceIndex.vert";
testSpec.shaders[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
+
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "triangle_list", "Draws triangle list", testSpec));
+ indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "triangle_strip", "Draws triangle strip", testSpec));
+ indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
- testSpec.testIndirectCountExt = true;
+ testSpec.testIndirectCountExt = IndirectCountType::BUFFER_LIMIT;
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport0>(m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport0>(m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
+
+ testSpec.testIndirectCountExt = IndirectCountType::PARAM_LIMIT;
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ indirectDrawParamCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws triangle list", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
+ indirectDrawParamCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDraw, FunctionSupport1<IndirectDraw::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws triangle strip", testSpec, FunctionSupport1<IndirectDraw::TestSpec>::Args(checkSupport, testSpec)));
}
drawTypeGroup->addChild(indirectDrawFirstInstanceGroup);
drawTypeGroup->addChild(indirectDrawCountFirstInstanceGroup);
+ drawTypeGroup->addChild(indirectDrawParamCountFirstInstanceGroup);
}
- tcu::TestCaseGroup* indirectDrawInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_instanced", "Draws an instanced geometry");
- tcu::TestCaseGroup* indirectDrawCountInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_count_instanced", "Draws an instanced geometry with VK_KHR_draw_indirect_count extension");
+ tcu::TestCaseGroup* indirectDrawInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_instanced", "Draws an instanced geometry");
+ tcu::TestCaseGroup* indirectDrawCountInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_count_instanced", "Draws an instanced geometry with VK_KHR_draw_indirect_count extension");
+ tcu::TestCaseGroup* indirectDrawParamCountInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_param_count_instanced", "Draws an instanced geometry with VK_KHR_draw_indirect_count extension and limit draws count with call parameter");
{
- tcu::TestCaseGroup* indirectDrawNoFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance");
- tcu::TestCaseGroup* indirectDrawCountNoFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance");
+ tcu::TestCaseGroup* indirectDrawNoFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance");
+ tcu::TestCaseGroup* indirectDrawCountNoFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance");
+ tcu::TestCaseGroup* indirectDrawParamCountNoFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance");
{
- IndirectDrawInstanced<FirstInstanceNotSupported>::TestSpec testSpec;
+ typedef IndirectDrawInstanced<FirstInstanceNotSupported> IDFirstInstanceNotSupported;
+
+ IDFirstInstanceNotSupported::TestSpec testSpec;
testSpec.drawType = static_cast<DrawType>(drawTypeIdx);
+ testSpec.useDynamicRendering = m_useDynamicRendering;
testSpec.shaders[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstanced.vert";
testSpec.shaders[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawNoFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceNotSupported> >(m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec));
+ indirectDrawNoFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceNotSupported, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawNoFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceNotSupported> >(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec));
- testSpec.testIndirectCountExt = true;
+ indirectDrawNoFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceNotSupported, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec>::Args(checkSupport, testSpec)));
+
+ testSpec.testIndirectCountExt = IndirectCountType::BUFFER_LIMIT;
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ indirectDrawCountNoFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceNotSupported, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec>::Args(checkSupport, testSpec)));
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
+ indirectDrawCountNoFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceNotSupported, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec>::Args(checkSupport, testSpec)));
+
+ testSpec.testIndirectCountExt = IndirectCountType::PARAM_LIMIT;
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawCountNoFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceNotSupported>, FunctionSupport0>(m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawParamCountNoFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceNotSupported, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawCountNoFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceNotSupported>, FunctionSupport0>(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawParamCountNoFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceNotSupported, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport1<IDFirstInstanceNotSupported::TestSpec>::Args(checkSupport, testSpec)));
}
indirectDrawInstancedGroup->addChild(indirectDrawNoFirstInstanceGroup);
indirectDrawCountInstancedGroup->addChild(indirectDrawCountNoFirstInstanceGroup);
+ indirectDrawParamCountInstancedGroup->addChild(indirectDrawParamCountNoFirstInstanceGroup);
- tcu::TestCaseGroup* indirectDrawFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature");
- tcu::TestCaseGroup* indirectDrawCountFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature");
+ tcu::TestCaseGroup* indirectDrawFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature");
+ tcu::TestCaseGroup* indirectDrawCountFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature");
+ tcu::TestCaseGroup* indirectDrawParamCountFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature");
{
- IndirectDrawInstanced<FirstInstanceSupported>::TestSpec testSpec;
+ typedef IndirectDrawInstanced<FirstInstanceSupported> IDFirstInstanceSupported;
+
+ IDFirstInstanceSupported::TestSpec testSpec;
testSpec.drawType = static_cast<DrawType>(drawTypeIdx);
+ testSpec.useDynamicRendering = m_useDynamicRendering;
testSpec.shaders[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert";
testSpec.shaders[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceSupported> >(m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec));
+ indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceSupported, FunctionSupport1<IDFirstInstanceSupported::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport1<IDFirstInstanceSupported::TestSpec>::Args(checkSupport, testSpec)));
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
+ indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceSupported, FunctionSupport1<IDFirstInstanceSupported::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport1<IDFirstInstanceSupported::TestSpec>::Args(checkSupport, testSpec)));
+
+ testSpec.testIndirectCountExt = IndirectCountType::BUFFER_LIMIT;
+ testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceSupported, FunctionSupport1<IDFirstInstanceSupported::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport1<IDFirstInstanceSupported::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceSupported> >(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec));
+ indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceSupported, FunctionSupport1<IDFirstInstanceSupported::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport1<IDFirstInstanceSupported::TestSpec>::Args(checkSupport, testSpec)));
- testSpec.testIndirectCountExt = true;
+ testSpec.testIndirectCountExt = IndirectCountType::PARAM_LIMIT;
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceSupported>, FunctionSupport0>(m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawParamCountFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceSupported, FunctionSupport1<IDFirstInstanceSupported::TestSpec> >
+ (m_testCtx, "triangle_list", "Draws an instanced triangle list", testSpec, FunctionSupport1<IDFirstInstanceSupported::TestSpec>::Args(checkSupport, testSpec)));
testSpec.topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
- indirectDrawCountFirstInstanceGroup->addChild(new InstanceFactory<IndirectDrawInstanced<FirstInstanceSupported>, FunctionSupport0>(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport0(checkIndirectCountExt)));
+ indirectDrawParamCountFirstInstanceGroup->addChild(new InstanceFactory<IDFirstInstanceSupported, FunctionSupport1<IDFirstInstanceSupported::TestSpec> >
+ (m_testCtx, "triangle_strip", "Draws an instanced triangle strip", testSpec, FunctionSupport1<IDFirstInstanceSupported::TestSpec>::Args(checkSupport, testSpec)));
}
indirectDrawInstancedGroup->addChild(indirectDrawFirstInstanceGroup);
indirectDrawCountInstancedGroup->addChild(indirectDrawCountFirstInstanceGroup);
+ indirectDrawParamCountInstancedGroup->addChild(indirectDrawParamCountFirstInstanceGroup);
}
drawTypeGroup->addChild(indirectDrawInstancedGroup);
drawTypeGroup->addChild(indirectDrawCountInstancedGroup);
+ drawTypeGroup->addChild(indirectDrawParamCountInstancedGroup);
}
addChild(drawTypeGroup);