From: Jarkko Pöyry Date: Mon, 11 May 2015 23:42:02 +0000 (-0700) Subject: Fix issues with non-tightly packed images. X-Git-Tag: upstream/0.1.0~1309^2~120^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f69470fe8597d811df06deb940cc5b54529fb4e;p=platform%2Fupstream%2FVK-GL-CTS.git Fix issues with non-tightly packed images. - Add logging fast-path pixel pitch check. - Fix MultisamplePixelBufferAccess with non-tightly packed images. - Add estimatePixelValueRange() fast-paths for all normalized formats. Change-Id: If5b334de2658b7c714fe56bb561892b5a736e3b0 --- diff --git a/framework/common/tcuTestLog.cpp b/framework/common/tcuTestLog.cpp index fc1ea0f..5870f10 100644 --- a/framework/common/tcuTestLog.cpp +++ b/framework/common/tcuTestLog.cpp @@ -174,9 +174,10 @@ void TestLog::writeImage (const char* name, const char* description, const Const if ((qpTestLog_getLogFlags(m_log) & QP_TEST_LOG_EXCLUDE_IMAGES) != 0) return; - if (depth == 1 && format.type == TextureFormat::UNORM_INT8 && - width <= MAX_IMAGE_SIZE_2D && height <= MAX_IMAGE_SIZE_2D && - (format.order == TextureFormat::RGB || format.order == TextureFormat::RGBA) + if (depth == 1 && format.type == TextureFormat::UNORM_INT8 + && width <= MAX_IMAGE_SIZE_2D && height <= MAX_IMAGE_SIZE_2D + && (format.order == TextureFormat::RGB || format.order == TextureFormat::RGBA) + && access.getPixelPitch() == access.getFormat().getPixelSize() && pixelBias[0] == 0.0f && pixelBias[1] == 0.0f && pixelBias[2] == 0.0f && pixelBias[3] == 0.0f && pixelScale[0] == 1.0f && pixelScale[1] == 1.0f && pixelScale[2] == 1.0f && pixelScale[3] == 1.0f) { diff --git a/framework/common/tcuTextureUtil.cpp b/framework/common/tcuTextureUtil.cpp index 0de34c6..99f8dbd 100644 --- a/framework/common/tcuTextureUtil.cpp +++ b/framework/common/tcuTextureUtil.cpp @@ -916,17 +916,15 @@ void estimatePixelValueRange (const ConstPixelBufferAccess& access, Vec4& minVal { const TextureFormat& format = access.getFormat(); - switch (format.type) + switch (getTextureChannelClass(format.type)) { - case TextureFormat::UNORM_INT8: - case TextureFormat::UNORM_INT16: + case TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT: // Normalized unsigned formats. minVal = Vec4(0.0f); maxVal = Vec4(1.0f); break; - case TextureFormat::SNORM_INT8: - case TextureFormat::SNORM_INT16: + case TEXTURECHANNELCLASS_SIGNED_FIXED_POINT: // Normalized signed formats. minVal = Vec4(-1.0f); maxVal = Vec4(+1.0f); diff --git a/framework/referencerenderer/rrMultisamplePixelBufferAccess.cpp b/framework/referencerenderer/rrMultisamplePixelBufferAccess.cpp index f7effbd..e7ab014 100644 --- a/framework/referencerenderer/rrMultisamplePixelBufferAccess.cpp +++ b/framework/referencerenderer/rrMultisamplePixelBufferAccess.cpp @@ -42,11 +42,8 @@ const tcu::PixelBufferAccess MultisamplePixelBufferAccess::toSinglesampleAccess DE_ASSERT(getNumSamples() == 1); return tcu::PixelBufferAccess(m_access.getFormat(), - m_access.getHeight(), - m_access.getDepth(), - 1, - m_access.getSlicePitch(), - m_access.getSlicePitch() * m_access.getDepth(), + tcu::IVec3(m_access.getHeight(), m_access.getDepth(), 1), + tcu::IVec3(m_access.getRowPitch(), m_access.getSlicePitch(), m_access.getSlicePitch() * m_access.getDepth()), m_access.getDataPtr()); } @@ -55,11 +52,8 @@ MultisamplePixelBufferAccess MultisamplePixelBufferAccess::fromSinglesampleAcces return MultisamplePixelBufferAccess( tcu::PixelBufferAccess( original.getFormat(), - 1, - original.getWidth(), - original.getHeight(), - original.getFormat().getPixelSize(), - original.getRowPitch(), + tcu::IVec3(1, original.getWidth(), original.getHeight()), + tcu::IVec3(original.getPixelPitch(), original.getPixelPitch(), original.getRowPitch()), original.getDataPtr())); } @@ -88,11 +82,8 @@ const tcu::ConstPixelBufferAccess MultisampleConstPixelBufferAccess::toSinglesam DE_ASSERT(getNumSamples() == 1); return tcu::ConstPixelBufferAccess(m_access.getFormat(), - m_access.getHeight(), - m_access.getDepth(), - 1, - m_access.getSlicePitch(), - m_access.getSlicePitch() * m_access.getDepth(), + tcu::IVec3(m_access.getHeight(), m_access.getDepth(), 1), + tcu::IVec3(m_access.getRowPitch(), m_access.getSlicePitch(), m_access.getSlicePitch() * m_access.getDepth()), m_access.getDataPtr()); } @@ -101,11 +92,8 @@ MultisampleConstPixelBufferAccess MultisampleConstPixelBufferAccess::fromSingles return MultisampleConstPixelBufferAccess( tcu::ConstPixelBufferAccess( original.getFormat(), - 1, - original.getWidth(), - original.getHeight(), - original.getFormat().getPixelSize(), - original.getRowPitch(), + tcu::IVec3(1, original.getWidth(), original.getHeight()), + tcu::IVec3(original.getPixelPitch(), original.getPixelPitch(), original.getRowPitch()), original.getDataPtr())); }