Threshold was computed directly from backbuffer format.
This makes the threshold too strict if the texture
sampled from has a lower bit-depth than the backbuffer.
This change takes the minimium bit depth between the
backbuffer and texture to compute the threshold.
Components: OpenGL ES
VK-GL-CTS issue: 163
Affects:
dEQP-GLES2.functional.texture.size.*
dEQP-GLES3.functional.texture.size.*
Change-Id: Id491ff4ef1b958459156fe83d9d5099cf81de81e
RandomViewport viewport (m_renderCtx.getRenderTarget(), 128, 128, deStringHash(getName()));
tcu::Surface renderedFrame (viewport.width, viewport.height);
tcu::Surface referenceFrame (viewport.width, viewport.height);
- tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
+ const tcu::IVec4 texBits = tcu::getTextureFormatBitDepth(glu::mapGLTransferFormat(m_format, m_dataType));
+ const tcu::PixelFormat& rtFmt = m_renderCtx.getRenderTarget().getPixelFormat();
+ const tcu::PixelFormat thresholdFormat(std::min(texBits[0], rtFmt.redBits), std::min(texBits[1], rtFmt.greenBits), std::min(texBits[2], rtFmt.blueBits), std::min(texBits[3], rtFmt.alphaBits));
+ tcu::RGBA threshold = thresholdFormat.getColorThreshold() + tcu::RGBA(7,7,7,7);
deUint32 wrapS = GL_CLAMP_TO_EDGE;
deUint32 wrapT = GL_CLAMP_TO_EDGE;
deUint32 minFilter = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
RandomViewport viewport (m_renderCtx.getRenderTarget(), 128, 128, deStringHash(getName())+(deUint32)face);
tcu::Surface renderedFrame (viewport.width, viewport.height);
tcu::Surface referenceFrame (viewport.width, viewport.height);
- tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
+ const tcu::IVec4 texBits = tcu::getTextureFormatBitDepth(glu::mapGLTransferFormat(m_format, m_dataType));
+ const tcu::PixelFormat& rtFmt = m_renderCtx.getRenderTarget().getPixelFormat();
+ const tcu::PixelFormat thresholdFormat(std::min(texBits[0], rtFmt.redBits), std::min(texBits[1], rtFmt.greenBits), std::min(texBits[2], rtFmt.blueBits), std::min(texBits[3], rtFmt.alphaBits));
+ tcu::RGBA threshold = thresholdFormat.getColorThreshold() + tcu::RGBA(7,7,7,7);
deUint32 wrapS = GL_CLAMP_TO_EDGE;
deUint32 wrapT = GL_CLAMP_TO_EDGE;
deUint32 minFilter = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
RandomViewport viewport (m_renderCtx.getRenderTarget(), 128, 128, deStringHash(getName()));
tcu::Surface renderedFrame (viewport.width, viewport.height);
tcu::Surface referenceFrame (viewport.width, viewport.height);
- tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
+ const tcu::IVec4 texBits = tcu::getTextureFormatBitDepth(glu::mapGLTransferFormat(m_format, m_dataType));
+ const tcu::PixelFormat& rtFmt = m_renderCtx.getRenderTarget().getPixelFormat();
+ const tcu::PixelFormat thresholdFormat(std::min(texBits[0], rtFmt.redBits), std::min(texBits[1], rtFmt.greenBits), std::min(texBits[2], rtFmt.blueBits), std::min(texBits[3], rtFmt.alphaBits));
+ tcu::RGBA threshold = thresholdFormat.getColorThreshold() + tcu::RGBA(7,7,7,7);
deUint32 wrapS = GL_CLAMP_TO_EDGE;
deUint32 wrapT = GL_CLAMP_TO_EDGE;
deUint32 minFilter = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
RandomViewport viewport (m_renderCtx.getRenderTarget(), 128, 128, deStringHash(getName())+(deUint32)face);
tcu::Surface renderedFrame (viewport.width, viewport.height);
tcu::Surface referenceFrame (viewport.width, viewport.height);
- tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
+ const tcu::IVec4 texBits = tcu::getTextureFormatBitDepth(glu::mapGLTransferFormat(m_format, m_dataType));
+ const tcu::PixelFormat& rtFmt = m_renderCtx.getRenderTarget().getPixelFormat();
+ const tcu::PixelFormat thresholdFormat(std::min(texBits[0], rtFmt.redBits), std::min(texBits[1], rtFmt.greenBits), std::min(texBits[2], rtFmt.blueBits), std::min(texBits[3], rtFmt.alphaBits));
+ tcu::RGBA threshold = thresholdFormat.getColorThreshold() + tcu::RGBA(7,7,7,7);
deUint32 wrapS = GL_CLAMP_TO_EDGE;
deUint32 wrapT = GL_CLAMP_TO_EDGE;
deUint32 minFilter = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;