Lines Matching defs:const

75 static const deUint32		STENCIL_REFERENCE	= 1u;
76 static const float DEPTH_CLEAR = 1.0f;
77 static const float DEPTH_REFERENCE = 0.5f;
78 static const Vec4 CLEAR_COLOR_0 = Vec4(0.0f, 0.0f, 0.0f, 1.0f);
79 static const Vec4 CLEAR_COLOR_1 = Vec4(0.5f, 0.25f, 0.75f, 1.0f);
80 static const VkDeviceSize ZERO = 0u;
83 inline const T* dataOrNullPtr (const std::vector<T>& v)
95 inline void append (std::vector<T>& first, const std::vector<T>& second)
104 bool operator()(const VectorT& v1, const VectorT& v2) const
125 void init (vk::SourceCollections& dst, const Arg0& arg0) const { m_func(dst, arg0); }
128 const Function m_func;
134 const std::string& name,
148 std::string getString (const VkSampleCountFlagBits sampleCount)
155 bool isSupportedDepthStencilFormat (const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkFormat format)
162 VkFormat findSupportedDepthStencilFormat (Context& context, const bool useDepth, const bool useStencil)
164 const InstanceInterface& vki = context.getInstanceInterface();
165 const VkPhysicalDevice physDevice = context.getPhysicalDevice();
183 const auto& vki = context.getInstanceInterface();
184 const auto physicalDevice = context.getPhysicalDevice();
205 for (const auto& rate : supportedFragmentShadingRates)
220 VkImageAspectFlags getImageAspectFlags (const VkFormat format)
222 const tcu::TextureFormat tcuFormat = mapVkFormat(format);
234 const InstanceInterface& vki = context.getInstanceInterface();
235 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
255 inline deUint32 numSamplesPerPixel (const MultisamplePixelGrid& pixelGrid)
262 const VkSampleLocationsInfoEXT info =
265 DE_NULL, // const void* pNext;
269 DE_NULL, // const VkSampleLocationEXT* pSampleLocations;
274 void logPixelGrid (tcu::TestLog& log, const VkPhysicalDeviceSampleLocationsPropertiesEXT& sampleLocationsProperties, const MultisamplePixelGrid& pixelGrid)
287 const VkSampleLocationEXT& loc = pixelGrid.getSample(gridX, gridY, sampleNdx);
295 const deUint32 height = deMinu32(1u << sampleLocationsProperties.sampleLocationSubPixelBits, 16u); // increase if you want more precision
296 const deUint32 width = 2 * height; // works well with a fixed-size font
306 const VkSampleLocationEXT& loc = pixelGrid.getSample(gridX, gridY, sampleNdx);
307 const deUint32 ndx = deMinu32(width - 1, static_cast<deUint32>(static_cast<float>(width) * loc.x)) +
309 const deUint32 evenNdx = ndx - ndx % 2;
332 void fillSampleLocationsPacked (MultisamplePixelGrid& grid, const deUint32 subPixelBits)
334 const deUint32 numLocations = 1u << subPixelBits;
335 const int offset[3] = { -1, 0, 1 };
342 const UVec2 baseLocationNdx (rng.getUint32() % numLocations,
351 const VkSampleLocationEXT location =
371 bool compareGreenImage (tcu::TestLog& log, const char* name, const char* description, const tcu::ConstPixelBufferAccess& image)
379 bool intThresholdCompare (const tcu::ConstPixelBufferAccess& reference, const tcu::ConstPixelBufferAccess& result, const UVec4& threshold)
408 int countUniqueColors (const tcu::ConstPixelBufferAccess& image)
421 Move<VkImage> makeImage (const DeviceInterface& vk,
422 const VkDevice device,
423 const VkImageCreateFlags flags,
424 const VkFormat format,
425 const UVec2& size,
426 const VkSampleCountFlagBits samples,
427 const VkImageUsageFlags usage)
429 const VkImageCreateInfo imageParams =
432 DE_NULL, // const void* pNext;
444 DE_NULL, // const deUint32* pQueueFamilyIndices;
450 Move<VkEvent> makeEvent (const DeviceInterface& vk, const VkDevice device)
452 const VkEventCreateInfo createInfo =
455 DE_NULL, // const void* pNext;
463 std::vector<Vec2> genFramebufferSampleLocations (const MultisamplePixelGrid& pixelGrid, const UVec2& gridSize, const UVec2& framebufferSize)
471 const VkSampleLocationEXT& location = pixelGrid.getSample(x % gridSize.x(), y % gridSize.y(), sampleNdx);
472 const float globalX = location.x + static_cast<float>(x);
473 const float globalY = location.y + static_cast<float>(y);
488 PositionColor (const tcu::Vec4& pos, const tcu::Vec4& col) : position(pos), color(col) {}
491 std::vector<PositionColor> genVerticesFullQuad (const Vec4& color = Vec4(1.0f), const float z = 0.0f)
493 const PositionColor vertices[] =
508 std::vector<PositionColor> genVerticesShapes (const Vec4& color = Vec4(1.0f), const float z = 0.0f)
512 const float numSteps = 16.0f;
513 const float angleStep = (2.0f * DE_PI) / numSteps;
561 const std::vector<VkDynamicState>& dynamicState,
562 const PipelineLayoutWrapper& pipelineLayout,
563 const VkRenderPass renderPass,
564 const ShaderWrapper vertexModule,
565 const ShaderWrapper fragmentModule,
566 const deUint32 subpassIndex,
567 const VkViewport& viewport,
568 const VkRect2D scissor,
569 const VkSampleCountFlagBits numSamples,
570 const bool useSampleLocations,
571 const VkSampleLocationsInfoEXT& sampleLocationsInfo,
572 const bool useDepth,
573 const bool useStencil,
574 const VertexInputConfig vertexInputConfig,
575 const VkPrimitiveTopology topology,
576 const VkStencilOpState& stencilOpState,
577 const bool useFragmentShadingRate)
582 const deUint32 sizeofVec4 = static_cast<deUint32>(sizeof(Vec4));
605 const VkPipelineVertexInputStateCreateInfo vertexInputStateInfo =
608 DE_NULL, // const void* pNext;
611 dataOrNullPtr(vertexInputBindingDescriptions), // const VkVertexInputBindingDescription* pVertexBindingDescriptions;
613 dataOrNullPtr(vertexInputAttributeDescriptions), // const VkVertexInputAttributeDescription* pVertexAttributeDescriptions;
616 const VkPipelineSampleLocationsStateCreateInfoEXT pipelineSampleLocationsCreateInfo =
619 DE_NULL, // const void* pNext;
624 const VkPipelineMultisampleStateCreateInfo pipelineMultisampleStateInfo =
627 &pipelineSampleLocationsCreateInfo, // const void* pNext;
632 DE_NULL, // const VkSampleMask* pSampleMask;
640 DE_NULL, // const void* pNext;
653 const VkPipelineDynamicStateCreateInfo dynamicStateCreateInfo =
656 DE_NULL, // const void* pNext;
659 dataOrNullPtr(dynamicState), // const VkDynamicState* pDynamicStates;
662 const VkPipelineColorBlendAttachmentState colorBlendAttachmentState
681 const std::vector<VkViewport> viewports { viewport };
682 const std::vector<VkRect2D> scissors { scissor };
687 DE_NULL, // const void* pNext;
716 const std::vector<VkDynamicState>& dynamicState,
717 const PipelineLayoutWrapper& pipelineLayout,
718 const VkRenderPass renderPass,
719 const ShaderWrapper vertexModule,
720 const ShaderWrapper fragmentModule,
721 const VkViewport& viewport,
722 const VkRect2D scissor,
723 const VkSampleCountFlagBits numSamples,
724 const bool useSampleLocations,
725 const VkSampleLocationsInfoEXT& sampleLocationsInfo,
726 const VertexInputConfig vertexInputConfig,
727 const VkPrimitiveTopology topology,
728 const bool useFragmentShadingRate)
746 deUint32 addAttachment (const VkImage image,
747 const VkImageView imageView,
748 const VkAttachmentDescriptionFlags flags,
749 const VkFormat format,
750 const VkSampleCountFlagBits numSamples,
751 const VkAttachmentLoadOp loadOp,
752 const VkAttachmentStoreOp storeOp,
753 const VkAttachmentLoadOp stencilLoadOp,
754 const VkAttachmentStoreOp stencilStoreOp,
755 const VkImageLayout initialLayout,
756 const VkImageLayout finalLayout,
757 const VkClearValue clearValue,
758 const VkSampleLocationsInfoEXT* pInitialSampleLocations = DE_NULL)
760 const deUint32 index = static_cast<deUint32>(m_attachments.size());
779 const VkAttachmentSampleLocationsEXT attachmentSampleLocations =
790 void addSubpassColorAttachment (const deUint32 attachmentIndex, const VkImageLayout subpassLayout)
798 void addSubpassColorAttachmentWithResolve (const deUint32 colorAttachmentIndex, const VkImageLayout colorSubpassLayout, const deUint32 resolveAttachmentIndex, const VkImageLayout resolveSubpassLayout, const VkSampleLocationsInfoEXT* pSampleLocations = DE_NULL)
807 const VkSubpassSampleLocationsEXT subpassSampleLocations =
816 void addSubpassDepthStencilAttachment (const deUint32 attachmentIndex, const VkImageLayout subpassLayout, const VkSampleLocationsInfoEXT* pSampleLocations = DE_NULL)
823 const VkSubpassSampleLocationsEXT subpassSampleLocations =
832 void addSubpassInputAttachment (const deUint32 attachmentIndex, const VkImageLayout subpassLayout)
838 void addSubpassPreserveAttachment (const deUint32 attachmentIndex)
849 void bake (const DeviceInterface& vk,
850 const VkDevice device,
851 const PipelineConstructionType pipelineConstructionType,
852 const UVec2& framebufferSize)
854 const deUint32 numSubpasses = static_cast<deUint32>(m_subpasses.size());
860 const SubpassDescription& sd = m_subpasses[subpassNdx];
861 const VkSubpassDescription description =
866 dataOrNullPtr(sd.inputAttachmentReferences), // const VkAttachmentReference* pInputAttachments;
868 dataOrNullPtr(sd.colorAttachmentReferences), // const VkAttachmentReference* pColorAttachments;
869 dataOrNullPtr(sd.resolveAttachmentReferences), // const VkAttachmentReference* pResolveAttachments;
870 dataOrNullPtr(sd.depthStencilAttachmentReferences), // const VkAttachmentReference* pDepthStencilAttachment;
872 dataOrNullPtr(sd.preserveAttachmentReferences) // const deUint32* pPreserveAttachments;
879 static const VkAccessFlags accessAny = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT
884 const VkSubpassDependency dependency =
898 const VkSubpassDependency finalDependency = {
909 const VkRenderPassCreateInfo renderPassInfo =
912 DE_NULL, // const void* pNext;
915 dataOrNullPtr(m_attachmentDescriptions), // const VkAttachmentDescription* pAttachments;
917 dataOrNullPtr(subpassDescriptions), // const VkSubpassDescription* pSubpasses;
919 dataOrNullPtr(subpassDependencies) // const VkSubpassDependency* pDependencies;
926 const RenderPassWrapper& getRenderPassWrapper (void) const
931 VkRenderPass getRenderPass (void) const
936 VkFramebuffer getFramebuffer(void) const
941 void recordBeginRenderPass (const DeviceInterface& vk,
942 const VkCommandBuffer cmdBuffer,
943 const VkRect2D& renderArea,
944 const VkSubpassContents subpassContents) const
946 const VkRenderPassSampleLocationsBeginInfoEXT renderPassSampleLocationsBeginInfo =
949 DE_NULL, // const void* pNext;
951 dataOrNullPtr(m_attachmentSampleLocations), // const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations;
953 dataOrNullPtr(m_subpassSampleLocations), // const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations;
958 void nextSubpass (const DeviceInterface& vk, const VkCommandBuffer cmdBuffer, const VkSubpassContents subpassContents) const
963 void endRenderPass (const DeviceInterface& vk, const VkCommandBuffer cmdBuffer) const
988 RenderTarget (const RenderTarget&);
989 RenderTarget& operator=(const RenderTarget&);
992 void recordImageBarrier (const DeviceInterface& vk,
993 const VkCommandBuffer cmdBuffer,
994 const VkImage image,
995 const VkImageAspectFlags aspect,
996 const VkPipelineStageFlags srcStageMask,
997 const VkPipelineStageFlags dstStageMask,
998 const VkAccessFlags srcAccessMask,
999 const VkAccessFlags dstAccessMask,
1000 const VkImageLayout oldLayout,
1001 const VkImageLayout newLayout,
1002 const VkSampleLocationsInfoEXT* pSampleLocationsInfo = DE_NULL)
1004 const VkImageMemoryBarrier barrier =
1007 pSampleLocationsInfo, // const void* pNext;
1021 void recordWaitEventWithImage (const DeviceInterface& vk,
1022 const VkCommandBuffer cmdBuffer,
1023 const VkEvent event,
1024 const VkImage image,
1025 const VkImageAspectFlags aspect,
1026 const VkPipelineStageFlags srcStageMask,
1027 const VkPipelineStageFlags dstStageMask,
1028 const VkAccessFlags srcAccessMask,
1029 const VkAccessFlags dstAccessMask,
1030 const VkImageLayout oldLayout,
1031 const VkImageLayout newLayout,
1032 const VkSampleLocationsInfoEXT* pSampleLocationsInfo = DE_NULL)
1034 const VkImageMemoryBarrier barrier =
1037 pSampleLocationsInfo, // const void* pNext;
1051 &event, // const VkEvent* pEvents,
1055 DE_NULL, // const VkMemoryBarrier* pMemoryBarriers,
1057 DE_NULL, // const VkBufferMemoryBarrier* pBufferMemoryBarriers,
1059 &barrier); // const VkImageMemoryBarrier* pImageMemoryBarriers);
1062 void recordCopyImageToBuffer (const DeviceInterface& vk,
1063 const VkCommandBuffer cmdBuffer,
1064 const UVec2& imageSize,
1065 const VkImage srcImage,
1066 const VkBuffer dstBuffer)
1070 const VkBufferImageCopy region =
1084 const VkBufferMemoryBarrier barrier =
1087 DE_NULL, // const void* pNext;
1102 void recordClearAttachments (const DeviceInterface& vk,
1103 const VkCommandBuffer cmdBuffer,
1104 const deUint32 colorAttachment,
1105 const VkClearValue& colorClearValue,
1106 const VkImageAspectFlags depthStencilAspect,
1107 const VkClearValue& depthStencilClearValue,
1108 const VkRect2D& clearRect)
1112 const VkClearRect rect =
1121 const VkClearAttachment attachment =
1132 const VkClearAttachment attachment =
1145 void beginSecondaryCommandBuffer (const DeviceInterface& vk,
1146 const VkCommandBuffer commandBuffer,
1147 const RenderPassWrapper& renderPass,
1148 const deUint32 subpass,
1149 const VkSampleCountFlagBits samples,
1150 const PipelineConstructionType pct)
1157 DE_NULL, // const void* pNext;
1166 const VkCommandBufferBeginInfo beginInfo =
1169 DE_NULL, // const void* pNext;
1172 &inheritanceInfo, // const VkCommandBufferInheritanceInfo* pInheritanceInfo;
1194 const VkPhysicalDeviceSampleLocationsPropertiesEXT sampleLocationsProperties = getSampleLocationsPropertiesEXT(context);
1201 const VkSampleCountFlags allowedSampleCounts = (VK_SAMPLE_COUNT_2_BIT |
1242 const InstanceInterface& vki = context.getInstanceInterface();
1243 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1246 const VkPhysicalDeviceSampleLocationsPropertiesEXT sampleLocationsProperties = getSampleLocationsPropertiesEXT(context);
1248 const VkSampleCountFlagBits sampleCountRange[] =
1261 for (const VkSampleCountFlagBits* pLoopNumSamples = sampleCountRange; pLoopNumSamples < DE_ARRAY_END(sampleCountRange); ++pLoopNumSamples)
1276 const bool isSupportedSampleCount = (*pLoopNumSamples & sampleLocationsProperties.sampleLocationSampleCounts) != 0;
1315 static UVec2& renderSize (void* const basePtr) { return *reinterpret_cast<UVec2*> (static_cast<deUint8*>(basePtr) + 0 * sizeof(deUint32)); }
1316 static UVec2& gridSize (void* const basePtr) { return *reinterpret_cast<UVec2*> (static_cast<deUint8*>(basePtr) + 2 * sizeof(deUint32)); }
1317 static deUint32& samplesPerPixel (void* const basePtr) { return *reinterpret_cast<deUint32*> (static_cast<deUint8*>(basePtr) + 4 * sizeof(deUint32)); }
1320 static T* sampleData (void* const basePtr) { DE_STATIC_ASSERT(sizeof(T) == sizeof(Vec2));
1341 void checkSupportVerifyTests (Context& context, const TestParams params)
1375 void addProgramsVerifyLocationGeometry (SourceCollections& programCollection, const TestParams)
1420 void addProgramsVerifyInterpolation (SourceCollections& programCollection, const TestParams)
1473 TestBase (Context& context, const TestParams params)
1508 const deUint32 pixelGridRepetitions = 2; // just to make sure the pattern is consistently applied across the framebuffer
1523 const DeviceInterface& vk = m_context.getDeviceInterface();
1524 const VkDevice device = m_context.getDevice();
1537 const VkDeviceSize colorBufferSize = m_renderSize.x() * m_renderSize.y() * tcu::getPixelSize(mapVkFormat(m_colorFormat));
1555 const UVec2& currentGridSize (void)
1570 void drawSinglePass (const VertexInputConfig vertexInputConfig)
1574 const InstanceInterface& vki = m_context.getInstanceInterface();
1575 const DeviceInterface& vk = m_context.getDeviceInterface();
1576 const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
1577 const VkDevice device = m_context.getDevice();
1578 const VkViewport viewport = makeViewport(m_renderSize);
1579 const VkRect2D renderArea = makeRect2D(m_renderSize);
1580 const VkRect2D scissor = makeRect2D(m_renderSize);
1581 const ShaderWrapper vertexModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
1582 const ShaderWrapper fragmentModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("frag"), 0u));
1583 const PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, vk, device, *m_descriptorSetLayout);
1585 const bool useDynamicStateSampleLocations = ((m_params.options & TEST_OPTION_DYNAMIC_STATE_BIT) != 0u);
1586 const bool useFragmentShadingRate = ((m_params.options & TEST_OPTION_FRAGMENT_SHADING_RATE_BIT) != 0u);
1587 const VkSampleLocationsInfoEXT sampleLocationsInfo = makeSampleLocationsInfo(*m_pixelGrid);
1650 const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, m_context.getUniversalQueueFamilyIndex()));
1651 const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
1677 void createSampleDataBufferAndDescriptors (const VkDeviceSize bufferSize)
1682 const DeviceInterface& vk = m_context.getDeviceInterface();
1683 const VkDevice device = m_context.getDevice();
1699 const VkDescriptorBufferInfo bufferDescriptorInfo = makeDescriptorBufferInfo(*m_sampleDataBuffer, 0ull, bufferSize);
1712 void createVertexBuffer (const std::vector<Vertex>& vertices)
1714 const DeviceInterface& vk = m_context.getDeviceInterface();
1715 const VkDevice device = m_context.getDevice();
1717 const VkDeviceSize vertexBufferSize = static_cast<VkDeviceSize>(vertices.size() * sizeof(vertices[0]));
1727 const TestParams m_params;
1728 const VkPhysicalDeviceSampleLocationsPropertiesEXT m_sampleLocationsProperties;
1729 const VkFormat m_colorFormat;
1758 VerifyLocationTest (Context& context, const TestParams params) : TestBase(context, params) {}
1766 const Vec2 pixelSize = Vec2(2.0f) / m_renderSize.cast<float>();
1767 const Vec2 offset = pixelSize / UVec2(1u << m_sampleLocationsProperties.sampleLocationSubPixelBits).cast<float>();
1771 const float y1 = 0.5f * offset.y();
1772 const float y2 = 0.35f * offset.y();
1773 const float x1 = 0.5f * offset.x();
1775 const std::vector<Vec2> locations = genFramebufferSampleLocations(*m_pixelGrid, m_pixelGrid->size(), m_renderSize);
1792 const tcu::ConstPixelBufferAccess image (tcu::ConstPixelBufferAccess(mapVkFormat(m_colorFormat), tcu::IVec3(m_renderSize.x(), m_renderSize.y(), 1), m_colorBufferAlloc->getHostPtr()));
1802 VerifyInterpolationTest (Context& context, const TestParams params) : TestBase(context, params) {}
1810 const deUint32 numSamples = m_pixelGrid->samplesPerPixel();
1811 const deUint32 numDataEntries = numSamples * m_renderSize.x() * m_renderSize.y();
1812 const VkDeviceSize bufferSize = SampleDataSSBO::STATIC_SIZE + sizeof(Vec2) * numDataEntries;
1816 Vec2* const pSampleData = SampleDataSSBO::sampleData<Vec2>(m_sampleDataBufferAlloc->getHostPtr());
1817 const std::vector<Vec2> locations = genFramebufferSampleLocations(*m_pixelGrid, m_pixelGrid->size(), m_renderSize);
1830 const tcu::ConstPixelBufferAccess image (tcu::ConstPixelBufferAccess(mapVkFormat(m_colorFormat), tcu::IVec3(m_renderSize.x(), m_renderSize.y(), 1), m_colorBufferAlloc->getHostPtr()));
1837 void addCases (tcu::TestCaseGroup* group, const VkSampleCountFlagBits numSamples, PipelineConstructionType pipelineConstructionType, bool useFragmentShadingRate, const ProgramsFunc initPrograms)
1858 for (const auto &options : testOpts)
1926 void checkSupportDrawTests (Context& context, const TestParams params)
1954 const char* getString (const TestImageAspect aspect)
1966 const char* getString (const TestDrawIn drawIn)
1978 const char* getString (const TestClears clears)
1991 std::string getTestOptionFlagsString (const deUint32 flags)
2004 void initPrograms (SourceCollections& programCollection, const TestParams)
2055 static const deUint32 NUM_PASSES = 2u;
2058 DrawTest (Context& context, const TestParams params)
2090 const DeviceInterface& vk = m_context.getDeviceInterface();
2091 const VkDevice device = m_context.getDevice();
2093 const VkImageUsageFlags colorImageUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
2105 const VkDeviceSize colorBufferSize = m_renderSize.x() * m_renderSize.y() * tcu::getPixelSize(mapVkFormat(m_colorFormat));
2111 const VkImageUsageFlags depthStencilImageUsageFlags = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
2126 const DeviceInterface& vk = m_context.getDeviceInterface();
2127 const VkDevice device = m_context.getDevice();
2145 const VkDeviceSize vertexBufferSize = static_cast<VkDeviceSize>(vertices.size() * sizeof(vertices[0]));
2157 const deUint32 numGrids = (useSameSamplePattern() ? 1u : NUM_PASSES);
2162 const deUint32 seed = 142u + 75u * passNdx;
2170 const bool isClearCase = (m_params.clears != TEST_CLEARS_NO_CLEAR);
2171 const bool hasLeftSideImage = (!isClearCase ||
2178 const tcu::TextureFormat colorFormat = mapVkFormat(m_colorFormat);
2201 const tcu::ConstPixelBufferAccess image (tcu::ConstPixelBufferAccess(mapVkFormat(m_colorFormat), tcu::IVec3(m_renderSize.x(), m_renderSize.y(), 1), m_colorBufferAlloc->getHostPtr()));
2214 const int numBackgroundColors = 1;
2215 const int numExpectedColorsRight = numBackgroundColors + static_cast<int>(m_params.numSamples);
2216 const int numExpectedColorsLeft = (isClearCase ? numBackgroundColors : numExpectedColorsRight);
2217 const int numActualColorsLeft = countUniqueColors(tcu::getSubregion(image, 0, 0, m_renderSize.x()/2, m_renderSize.y()));
2218 const int numActualColorsRight = countUniqueColors(tcu::getSubregion(image, m_renderSize.x()/2, 0, m_renderSize.x()/2, m_renderSize.y()));
2237 const bool match = intThresholdCompare(tcu::getSubregion(image, 0, 0, m_renderSize.x()/2, m_renderSize.y()),
2261 bool useDepth (void) const { return m_params.imageAspect == TEST_IMAGE_ASPECT_DEPTH; }
2262 bool useStencil (void) const { return m_params.imageAspect == TEST_IMAGE_ASPECT_STENCIL; }
2263 bool useSameSamplePattern (void) const { return (m_params.options & TEST_OPTION_SAME_PATTERN_BIT) != 0u; }
2264 bool useDynamicState (void) const { return (m_params.options & TEST_OPTION_DYNAMIC_STATE_BIT) != 0u; }
2265 bool useSecondaryCmdBuffer (void) const { return (m_params.options & TEST_OPTION_SECONDARY_COMMAND_BUFFER_BIT) != 0u; }
2266 bool useGeneralLayout (void) const { return (m_params.options & TEST_OPTION_GENERAL_LAYOUT_BIT) != 0u; }
2267 bool useWaitEvents (void) const { return (m_params.options & TEST_OPTION_WAIT_EVENTS_BIT) != 0u; }
2268 bool useFragmentShadingRate (void) const { return (m_params.options & TEST_OPTION_FRAGMENT_SHADING_RATE_BIT) != 0u; }
2273 const InstanceInterface& vki = m_context.getInstanceInterface();
2274 const DeviceInterface& vk = m_context.getDeviceInterface();
2275 const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
2276 const VkDevice device = m_context.getDevice();
2277 const VkViewport viewport = makeViewport(m_renderSize);
2278 const VkRect2D renderArea = makeRect2D(m_renderSize);
2279 const VkRect2D scissor = makeRect2D(m_renderSize);
2280 const ShaderWrapper vertexModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
2281 const ShaderWrapper fragmentModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("frag"), 0u));
2282 const PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, vk, device);
2283 const VkSampleLocationsInfoEXT sampleLocationsInfo = makeSampleLocationsInfo(m_pixelGrids[0]);
2284 const VkClearValue clearColor0 = (m_params.clears == TEST_CLEARS_NO_CLEAR ? makeClearValueColor(CLEAR_COLOR_0) : makeClearValueColor(CLEAR_COLOR_1));
2346 const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, m_context.getUniversalQueueFamilyIndex()));
2347 const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
2390 const InstanceInterface& vki = m_context.getInstanceInterface();
2391 const DeviceInterface& vk = m_context.getDeviceInterface();
2392 const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
2393 const VkDevice device = m_context.getDevice();
2394 const VkViewport viewport = makeViewport(m_renderSize);
2395 const VkRect2D renderArea = makeRect2D(m_renderSize);
2396 const VkRect2D scissor = makeRect2D(m_renderSize);
2397 const ShaderWrapper vertexModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
2398 const ShaderWrapper fragmentModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("frag"), 0u));
2399 const PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, vk, device);
2400 const VkClearValue clearColor0 = makeClearValueColor(CLEAR_COLOR_0);
2401 const VkClearValue clearColor1 = makeClearValueColor(CLEAR_COLOR_1);
2402 const VkClearValue clearDepthStencil0 = makeClearValueDepthStencil(DEPTH_CLEAR, STENCIL_REFERENCE);
2403 const VkSampleLocationsInfoEXT sampleLocationsInfo [NUM_PASSES] =
2408 const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, m_context.getUniversalQueueFamilyIndex()));
2420 const VkImageLayout colorLayout1 = useGeneralLayout() && !(useDepth() || useStencil()) ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
2421 const VkImageLayout depthStencilLayout1 = useGeneralLayout() && (useDepth() || useStencil()) ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
2466 const VkAttachmentLoadOp loadOp = (m_params.clears == TEST_CLEARS_LOAD_OP_CLEAR ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD);
2591 const VkImageLayout finalLayout = (useWaitEvents() ? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL : colorLayout1);
2602 const VkImageSubresourceRange subresourceRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
2618 const VkImageLayout finalLayout = (useWaitEvents() ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL : depthStencilLayout1);
2630 const VkImageSubresourceRange subresourceRange = makeImageSubresourceRange(m_depthStencilAspect, 0u, 1u, 0u, 1u);
2727 const Unique<VkFence> fence (createFence(vk, device));
2728 const VkCommandBuffer buffers [NUM_PASSES] =
2734 const VkSubmitInfo submitInfo =
2737 DE_NULL, // const void* pNext;
2739 DE_NULL, // const VkSemaphore* pWaitSemaphores;
2740 DE_NULL, // const VkPipelineStageFlags* pWaitDstStageMask;
2742 buffers, // const VkCommandBuffer* pCommandBuffers;
2744 DE_NULL, // const VkSemaphore* pSignalSemaphores;
2753 void recordFirstPassContents (const VkCommandBuffer cmdBuffer,
2754 const GraphicsPipelineWrapper& pipeline,
2755 const VkSampleLocationsInfoEXT& sampleLocationsInfo)
2757 const DeviceInterface& vk = m_context.getDeviceInterface();
2771 void recordSecondPassContents (const VkCommandBuffer cmdBuffer,
2772 const GraphicsPipelineWrapper& pipeline,
2773 const VkSampleLocationsInfoEXT& sampleLocationsInfo,
2774 const VkClearValue& clearColor,
2775 const VkClearValue& clearDepthStencil,
2776 const VkRect2D& clearRect)
2778 const DeviceInterface& vk = m_context.getDeviceInterface();
2800 const InstanceInterface& vki = m_context.getInstanceInterface();
2801 const DeviceInterface& vk = m_context.getDeviceInterface();
2802 const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
2803 const VkDevice device = m_context.getDevice();
2804 const VkViewport viewport = makeViewport(m_renderSize);
2805 const VkRect2D renderArea = makeRect2D(m_renderSize);
2806 const VkRect2D scissor = makeRect2D(m_renderSize);
2807 const ShaderWrapper vertexModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
2808 const ShaderWrapper fragmentModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("frag"), 0u));
2809 const PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, vk, device);
2810 const VkClearValue clearColor0 = makeClearValueColor(CLEAR_COLOR_0);
2811 const VkClearValue clearColor1 = makeClearValueColor(CLEAR_COLOR_1);
2812 const VkClearValue clearDepthStencil0 = makeClearValueDepthStencil(DEPTH_CLEAR, STENCIL_REFERENCE);
2813 const VkSampleLocationsInfoEXT sampleLocationsInfo [NUM_PASSES] =
2818 const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, m_context.getUniversalQueueFamilyIndex()));
2819 const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
2826 const VkImageLayout colorLayout1 = useGeneralLayout() && !(useDepth() || useStencil()) ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
2827 const VkImageLayout depthStencilLayout1 = useGeneralLayout() && (useDepth() || useStencil()) ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
2974 const InstanceInterface& vki = m_context.getInstanceInterface();
2975 const DeviceInterface& vk = m_context.getDeviceInterface();
2976 const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
2977 const VkDevice device = m_context.getDevice();
2978 const VkViewport viewport = makeViewport(m_renderSize);
2979 const VkRect2D renderArea = makeRect2D(m_renderSize);
2980 const VkRect2D scissor = makeRect2D(m_renderSize);
2981 const ShaderWrapper vertexModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
2982 const ShaderWrapper fragmentModule (ShaderWrapper(vk, device, m_context.getBinaryCollection().get("frag"), 0u));
2983 const PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, vk, device);
2984 const VkClearValue clearColor0 = makeClearValueColor(CLEAR_COLOR_0);
2985 const VkClearValue clearColor1 = makeClearValueColor(CLEAR_COLOR_1);
2986 const VkClearValue clearDepthStencil0 = makeClearValueDepthStencil(DEPTH_CLEAR, STENCIL_REFERENCE);
2987 const VkSampleLocationsInfoEXT sampleLocationsInfo [NUM_PASSES] =
2992 const bool useFragmentShadingRate (TEST_OPTION_FRAGMENT_SHADING_RATE_BIT & m_params.options);
2993 const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, m_context.getUniversalQueueFamilyIndex()));
2994 const Unique<VkCommandBuffer> cmdBuffer (makeCommandBuffer(vk, device, *cmdPool));
3118 const TestParams m_params;
3119 const VkPhysicalDeviceSampleLocationsPropertiesEXT m_sampleLocationsProperties;
3120 const UVec2 m_renderSize;
3126 const VkFormat m_colorFormat;
3157 const VkSampleCountFlagBits sampleCountRange[] =
3173 for (const VkSampleCountFlagBits* pLoopNumSamples = sampleCountRange; pLoopNumSamples < DE_ARRAY_END(sampleCountRange); ++pLoopNumSamples)
3187 const deUint32 globalOption = useFragmentShadingRate ? static_cast<deUint32>(TEST_OPTION_FRAGMENT_SHADING_RATE_BIT) : 0u;
3188 const deUint32 optionSets[] =
3204 const struct
3220 const TestImageAspect aspectRange[] =
3228 for (const TestImageAspect* pLoopImageAspect = aspectRange; pLoopImageAspect != DE_ARRAY_END(aspectRange); ++pLoopImageAspect)
3231 for (const VkSampleCountFlagBits* pLoopNumSamples = sampleCountRange; pLoopNumSamples < DE_ARRAY_END(sampleCountRange); ++pLoopNumSamples)
3236 for (const deUint32* pLoopOptions = optionSets; pLoopOptions != DE_ARRAY_END(optionSets); ++pLoopOptions)
3238 const TestParams params