{
log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
- const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
- DrawState drawState (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
-
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ DrawCallData drawCallData (topology, vertices);
+ VulkanProgram vulkanProgram (shaders);
+
+ VulkanDrawContext drawContext (context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
{
log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
- const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
- DrawState drawState (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
+ const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ DrawCallData drawCallData (topology, vertices);
+ VulkanProgram vulkanProgram (shaders);
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ VulkanDrawContext drawContext (context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
// All pixels must be black -- nothing is drawn.
caseMinPixels[1] = caseMinPixels[3] = 2;
break;
- case VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
- case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
case VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
+ requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(), FEATURE_GEOMETRY_SHADER);
+ // Fallthrough
+ case VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+ case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
caseMinPixels[0] = regionPixels;
caseMinPixels[1] = RENDER_SIZE - 2;
caseMinPixels[2] = regionPixels;
caseMinPixels[3] = 2 * (RENDER_SIZE - 2);
break;
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
+ requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(), FEATURE_GEOMETRY_SHADER);
+ // Fallthrough
case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
- case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
- case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
caseMinPixels[0] = caseMinPixels[1] = caseMinPixels[2] = caseMinPixels[3] = regionPixels;
break;
{
log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
- const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
-
- DrawState drawState (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
- drawState.depthClampEnable = cases[caseNdx].depthClampEnable;
+ const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ pipelineState.depthClampEnable = cases[caseNdx].depthClampEnable;
+ DrawCallData drawCallData (topology, vertices);
+ VulkanProgram vulkanProgram (shaders);
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ VulkanDrawContext drawContext (context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
{
log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
- const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
-
- DrawState drawState (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
- drawState.depthClampEnable = false;
- drawState.explicitDepthClipEnable = true;
- drawState.depthClipEnable = cases[caseNdx].depthClipEnable;
-
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ pipelineState.depthClampEnable = false;
+ pipelineState.explicitDepthClipEnable = true;
+ pipelineState.depthClipEnable = cases[caseNdx].depthClipEnable;
+ DrawCallData drawCallData (topology, vertices);
+ VulkanProgram vulkanProgram (shaders);
+
+ VulkanDrawContext drawContext(context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
{
log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
- const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
-
- DrawState drawState (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
- drawState.depthClampEnable = true;
- drawState.explicitDepthClipEnable = true;
- drawState.depthClipEnable = cases[caseNdx].depthClipEnable;
-
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ pipelineState.depthClampEnable = true;
+ pipelineState.explicitDepthClipEnable = true;
+ pipelineState.depthClipEnable = cases[caseNdx].depthClipEnable;
+ DrawCallData drawCallData (topology, vertices);
+ VulkanProgram vulkanProgram (shaders);
+
+ VulkanDrawContext drawContext(context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
log << tcu::TestLog::Message << "Drawing several large points just outside the clip volume. Expecting an empty image or all points rendered." << tcu::TestLog::EndMessage;
- DrawState drawState (VK_PRIMITIVE_TOPOLOGY_POINT_LIST, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ DrawCallData drawCallData (VK_PRIMITIVE_TOPOLOGY_POINT_LIST, vertices);
+ VulkanProgram vulkanProgram (shaders);
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ VulkanDrawContext drawContext(context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
// Popful case: All pixels must be black -- nothing is drawn.
<< tcu::TestLog::Message << "Line width is " << lineWidth << "." << tcu::TestLog::EndMessage
<< tcu::TestLog::Message << "strictLines is " << (strictLines ? "VK_TRUE." : "VK_FALSE.") << tcu::TestLog::EndMessage;
- DrawState drawState (VK_PRIMITIVE_TOPOLOGY_LINE_LIST, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
- drawState.lineWidth = lineWidth;
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ DrawCallData drawCallData (VK_PRIMITIVE_TOPOLOGY_LINE_LIST, vertices);
+ VulkanProgram vulkanProgram (shaders);
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ VulkanDrawContext drawContext(context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
// Popful case: All pixels must be black -- nothing is drawn.
refVertices.push_back(wideLineVertices[3]);
}
- WideLineVertexShader vertexShader;
- WideLineFragmentShader fragmentShader;
+ std::shared_ptr<rr::VertexShader> vertexShader = std::make_shared<WideLineVertexShader>();
+ std::shared_ptr<rr::FragmentShader> fragmentShader = std::make_shared<WideLineFragmentShader>();
// Draw wide line was two triangles
- DrawState refDrawState (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData refCallData (refVertices);
- ReferenceDrawContext refDrawContext (refDrawState, refCallData, vertexShader, fragmentShader);
+ DrawCallData refCallData (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, refVertices);
+ ReferenceDrawContext refDrawContext (framebufferState);
+ refDrawContext.registerDrawObject( pipelineState, vertexShader, fragmentShader, refCallData );
refDrawContext.draw();
if (tcu::intThresholdCompare(log, "Compare", "Result comparsion", refDrawContext.getColorPixels(), drawContext.getColorPixels(), tcu::UVec4(1), tcu::COMPARE_LOG_ON_ERROR))
<< tcu::TestLog::Message << "Using " << caseDef.numClipDistances << " ClipDistance(s) and " << caseDef.numCullDistances << " CullDistance(s)" << tcu::TestLog::EndMessage
<< tcu::TestLog::Message << "Expecting upper half of the clipped bars to be black." << tcu::TestLog::EndMessage;
- DrawState drawState (caseDef.topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
-
+ FrameBufferState framebufferState (RENDER_SIZE, RENDER_SIZE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
if (caseDef.enableTessellation)
- drawState.numPatchControlPoints = NUM_PATCH_CONTROL_POINTS;
+ pipelineState.numPatchControlPoints = NUM_PATCH_CONTROL_POINTS;
+ DrawCallData drawCallData (caseDef.topology, vertices);
+ VulkanProgram vulkanProgram (shaders);
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ VulkanDrawContext drawContext (context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
// Count black pixels in the whole image.
<< tcu::TestLog::Message << "Using " << numClipDistances << " clipping plane(s), one of them possibly having negative values." << tcu::TestLog::EndMessage
<< tcu::TestLog::Message << "Expecting a uniform gray area, no missing (black) nor overlapped (white) pixels." << tcu::TestLog::EndMessage;
- DrawState drawState (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, RENDER_SIZE_LARGE, RENDER_SIZE_LARGE, context.getDeviceProperties().limits.subPixelPrecisionBits);
- DrawCallData drawCallData (vertices);
- VulkanProgram vulkanProgram (shaders);
- drawState.blendEnable = true;
+ FrameBufferState framebufferState (RENDER_SIZE_LARGE, RENDER_SIZE_LARGE);
+ PipelineState pipelineState (context.getDeviceProperties().limits.subPixelPrecisionBits);
+ pipelineState.blendEnable = true;
+ DrawCallData drawCallData (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, vertices);
+ VulkanProgram vulkanProgram (shaders);
- VulkanDrawContext drawContext(context, drawState, drawCallData, vulkanProgram);
+ VulkanDrawContext drawContext (context, framebufferState);
+ drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
drawContext.draw();
const int numGrayPixels = countPixels(drawContext.getColorPixels(), Vec4(0.5f, 0.5f, 0.5f, 1.0f), Vec4(0.02f, 0.02f, 0.02f, 0.0f));