From: Mika Isojarvi Date: Thu, 14 Jan 2016 17:47:11 +0000 (+0000) Subject: Merge "Bug fixes to render pass tests." into vulkan X-Git-Tag: upstream/0.1.0~812^2~167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=107081fe267277f337d60f88e4e6750e0e1b1c5c;hp=4d76ecc3b4c8e41e19fd4dd4d770629d8f3be89c;p=platform%2Fupstream%2FVK-GL-CTS.git Merge "Bug fixes to render pass tests." into vulkan --- diff --git a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp index 6e593a4..3c6ad0c 100644 --- a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp +++ b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp @@ -2805,6 +2805,7 @@ void checkColorRenderQuad (const ConstPixelBufferAccess& result, if (pixelStatus.getColorStatus() == PixelStatus::STATUS_UNDEFINED) { + const Vec4 minDiff = Vec4(1.0f) / (IVec4(1) << tcu::getTextureFormatMantissaBitDepth(format)).cast(); const Vec4 minUvs = computeUvs(posA, posB, IVec2(x-1, y-1)); const Vec4 maxUvs = computeUvs(posA, posB, IVec2(x+1, y+1)); const bool softCheck = std::abs(x - posA.x()) <= 1 || std::abs(x - posB.x()) <= 1 @@ -2812,10 +2813,22 @@ void checkColorRenderQuad (const ConstPixelBufferAccess& result, const Vec4 resColor (result.getPixel(x, y)); - const Vec4 minRefColor = srgb ? tcu::linearToSRGB(valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs)) - : valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs) - threshold; - const Vec4 maxRefColor = srgb ? tcu::linearToSRGB(valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs)) - : valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs) + threshold; + Vec4 minRefColor = srgb ? tcu::linearToSRGB(valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs)) + : valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs) - threshold; + Vec4 maxRefColor = srgb ? tcu::linearToSRGB(valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs)) + : valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs) + threshold; + + // Take into account rounding and quantization + if (channelClass == tcu::TEXTURECHANNELCLASS_FLOATING_POINT) + { + minRefColor = tcu::min(minRefColor * (Vec4(1.0f) - minDiff), minRefColor * (Vec4(1.0f) + minDiff)); + maxRefColor = tcu::max(maxRefColor * (Vec4(1.0f) - minDiff), maxRefColor * (Vec4(1.0f) + minDiff)); + } + else + { + minRefColor = minRefColor - minDiff; + maxRefColor = maxRefColor + minDiff; + } DE_ASSERT(minRefColor[0] <= maxRefColor[0]); DE_ASSERT(minRefColor[1] <= maxRefColor[1]); @@ -3703,6 +3716,18 @@ tcu::TestStatus renderPassTest (Context& context, TestConfig config) checkTextureFormatSupport(log, context.getInstanceInterface(), context.getPhysicalDevice(), config.renderPass.getAttachments()); { + const vk::VkPhysicalDeviceProperties properties = vk::getPhysicalDeviceProperties(context.getInstanceInterface(), context.getPhysicalDevice()); + + log << TestLog::Message << "Max color attachments: " << properties.limits.maxColorAttachments << TestLog::EndMessage; + + for (size_t subpassNdx = 0; subpassNdx < renderPassInfo.getSubpasses().size(); subpassNdx++) + { + if (renderPassInfo.getSubpasses()[subpassNdx].getColorAttachments().size() > (size_t)properties.limits.maxColorAttachments) + TCU_THROW(NotSupportedError, "Subpass uses more than maxColorAttachments."); + } + } + + { const VkDevice device = context.getDevice(); const DeviceInterface& vk = context.getDeviceInterface(); const VkQueue queue = context.getUniversalQueue(); @@ -3830,7 +3855,7 @@ static const VkFormat s_coreDepthStencilFormats[] = de::MovePtr createAttachmentTestCaseGroup (tcu::TestContext& testCtx) { - const deUint32 attachmentCounts[] = { 1, 3, 8 }; + const deUint32 attachmentCounts[] = { 1, 3, 4, 8 }; const VkAttachmentLoadOp loadOps[] = { VK_ATTACHMENT_LOAD_OP_LOAD,