Lines Matching refs:tcu
93 bool isDepthFormat (deUint32 format, tcu::Sampler::DepthStencilMode mode)
107 const tcu::TextureFormat fmt = glu::mapGLInternalFormat(format);
109 if (fmt.order == tcu::TextureFormat::D)
111 DE_ASSERT(mode == tcu::Sampler::MODE_DEPTH);
114 else if (fmt.order == tcu::TextureFormat::DS && mode == tcu::Sampler::MODE_DEPTH)
121 bool isStencilFormat (deUint32 format, tcu::Sampler::DepthStencilMode mode)
135 const tcu::TextureFormat fmt = glu::mapGLInternalFormat(format);
137 if (fmt.order == tcu::TextureFormat::S)
139 DE_ASSERT(mode == tcu::Sampler::MODE_STENCIL);
142 else if (fmt.order == tcu::TextureFormat::DS && mode == tcu::Sampler::MODE_STENCIL)
149 tcu::TextureChannelClass getFormatChannelClass (deUint32 format, tcu::Sampler::DepthStencilMode mode)
154 return tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
158 const tcu::CompressedTexFormat compressedFmt = glu::mapGLCompressedTexFormat(format);
159 const tcu::TextureFormat uncompressedFmt = tcu::getUncompressedFormat(compressedFmt);
160 return tcu::getTextureChannelClass(uncompressedFmt.type);
164 const tcu::TextureFormat fmt = glu::mapGLInternalFormat(format);
165 const tcu::TextureFormat effectiveFmt = tcu::getEffectiveDepthStencilTextureFormat(fmt, mode);
167 return tcu::getTextureChannelClass(effectiveFmt.type);
177 void generateDefaultCompressedData (tcu::CompressedTexture& dst, const tcu::CompressedTexFormat& format)
179 const int blockByteSize = tcu::getBlockSize(format);
180 const tcu::IVec3 blockPixelSize = tcu::getBlockPixelSize(format);
181 const tcu::IVec3 numBlocks (getDimensionNumBlocks(dst.getWidth(), blockPixelSize.x()),
189 if (tcu::isAstcFormat(format))
217 typedef tcu::IVec2 SizeType;
219 static de::MovePtr<glu::Texture2D> createTextureFromInternalFormat (glu::RenderContext& renderCtx, deUint32 texFormat, const tcu::IVec2& size)
224 static de::MovePtr<glu::Texture2D> createTextureFromFormatAndType (glu::RenderContext& renderCtx, deUint32 texFormat, deUint32 type, const tcu::IVec2& size)
231 const tcu::CompressedTexture& compressedLevel,
232 const tcu::TexDecompressionParams& decompressionParams)
241 static int getTextureNumLayers (const tcu::IVec2& size)
252 typedef tcu::IVec3 SizeType;
254 static de::MovePtr<glu::Texture3D> createTextureFromInternalFormat (glu::RenderContext& renderCtx, deUint32 texFormat, const tcu::IVec3& size)
259 static de::MovePtr<glu::Texture3D> createTextureFromFormatAndType (glu::RenderContext& renderCtx, deUint32 texFormat, deUint32 type, const tcu::IVec3& size)
266 const tcu::CompressedTexture& compressedLevel,
267 const tcu::TexDecompressionParams& decompressionParams)
276 static int getTextureNumLayers (const tcu::IVec3& size)
288 if (isDepthFormat(texFormat, tcu::Sampler::MODE_DEPTH) || isStencilFormat(texFormat, tcu::Sampler::MODE_STENCIL))
294 if (isDepthFormat(texFormat, tcu::Sampler::MODE_DEPTH))
297 const tcu::PixelBufferAccess depthAccess = tcu::getEffectiveDepthStencilAccess(texture->getRefTexture().getLevel(0), tcu::Sampler::MODE_DEPTH);
298 tcu::fillWithComponentGradients(depthAccess, tcu::Vec4(0.0f), tcu::Vec4(1.0f));
301 if (isStencilFormat(texFormat, tcu::Sampler::MODE_STENCIL))
304 const tcu::PixelBufferAccess stencilAccess = tcu::getEffectiveDepthStencilAccess(texture->getRefTexture().getLevel(0), tcu::Sampler::MODE_STENCIL);
305 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(stencilAccess.getFormat());
308 tcu::fillWithComponentGradients(tcu::flipYAccess(stencilAccess), texFormatInfo.valueMax, texFormatInfo.valueMin);
325 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(texture->getRefTexture().getFormat());
326 const tcu::Vec4 rampLow = texFormatInfo.valueMin;
327 const tcu::Vec4 rampHigh = texFormatInfo.valueMax;
328 tcu::fillWithComponentGradients(texture->getRefTexture().getLevel(0), rampLow, rampHigh);
335 const tcu::CompressedTexFormat compressedFormat = glu::mapGLCompressedTexFormat(texFormat);
337 tcu::CompressedTexture compressedLevel (compressedFormat, size.x(), size.y(), numLayers);
338 const bool isAstcFormat = tcu::isAstcFormat(compressedFormat);
339 tcu::TexDecompressionParams decompressionParams ((isAstcFormat) ? (tcu::TexDecompressionParams::ASTCMODE_LDR) : (tcu::TexDecompressionParams::ASTCMODE_LAST));
376 tcu::IVec4 getNBitIntegerVec4MaxValue (bool isSigned, const tcu::IVec4& numBits)
378 return tcu::IVec4(getNBitIntegerMaxValue(isSigned, numBits[0]),
384 tcu::IVec4 getNBitIntegerVec4MinValue (bool isSigned, const tcu::IVec4& numBits)
386 return tcu::IVec4(getNBitIntegerMinValue(isSigned, numBits[0]),
392 rr::GenericVec4 mapToFormatColorUnits (const tcu::TextureFormat& texFormat, const tcu::Vec4& normalizedRange)
394 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(texFormat);
396 switch (tcu::getTextureChannelClass(texFormat.type))
398 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT: return rr::GenericVec4(normalizedRange);
399 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT: return rr::GenericVec4(normalizedRange * 2.0f - 1.0f);
400 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT: return rr::GenericVec4(texFormatInfo.valueMin + normalizedRange * texFormatInfo.valueMax);
401 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER: return rr::GenericVec4(tcu::mix(texFormatInfo.valueMin, texFormatInfo.valueMax, normalizedRange).cast<deInt32>());
402 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER: return rr::GenericVec4(tcu::mix(texFormatInfo.valueMin, texFormatInfo.valueMax, normalizedRange).cast<deUint32>());
410 rr::GenericVec4 mapToFormatColorRepresentable (const tcu::TextureFormat& texFormat, const tcu::Vec4& normalizedRange)
416 const tcu::BVec4 channelMask = tcu::getTextureFormatChannelMask(texFormat);
418 tcu::PixelBufferAccess access (texFormat, tcu::IVec3(1, 1, 1), buffer.getPtr());
420 if (tcu::isSRGB(texFormat))
422 DE_ASSERT(texFormat.type == tcu::TextureFormat::UNORM_INT8);
426 const tcu::Vec4 sRGB = tcu::linearToSRGB(normalizedRange);
427 const tcu::IVec4 sRGB8 = tcu::IVec4(tcu::floatToU8(sRGB[0]),
428 tcu::floatToU8(sRGB[1]),
429 tcu::floatToU8(sRGB[2]),
430 tcu::floatToU8(sRGB[3]));
431 const tcu::Vec4 linearized = tcu::sRGBToLinear(tcu::Vec4((float)sRGB8[0] / 255.0f,
436 return rr::GenericVec4(tcu::select(linearized, tcu::Vec4(0.0f), channelMask));
439 switch (tcu::getTextureChannelClass(texFormat.type))
441 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
442 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
443 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
446 return rr::GenericVec4(tcu::select(access.getPixel(0, 0), tcu::Vec4(0.0f), channelMask));
448 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
451 return rr::GenericVec4(tcu::select(access.getPixelInt(0, 0), tcu::IVec4(0), channelMask));
453 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
456 return rr::GenericVec4(tcu::select(access.getPixelUint(0, 0), tcu::UVec4(0u), channelMask));
466 bool isCoreFilterableFormat (deUint32 format, tcu::Sampler::DepthStencilMode mode)
510 tcu::Vec2 p0;
511 tcu::Vec2 p1;
513 tcu::Vec4 lookupScale;
514 tcu::Vec4 lookupBias;
528 tcu::Sampler::DepthStencilMode mode,
546 void renderTo (tcu::Surface& surface,
552 void verifyImage (const tcu::Surface& image,
556 bool verifyTextureSampleResult (const tcu::ConstPixelBufferAccess& renderedFrame,
559 const tcu::LodPrecision& lodPrecision,
560 const tcu::LookupPrecision& lookupPrecision);
562 bool verifyTextureCompareResult (const tcu::ConstPixelBufferAccess& renderedFrame,
565 const tcu::TexComparePrecision& texComparePrecision,
566 const tcu::TexComparePrecision& lowQualityTexComparePrecision,
567 const tcu::LodPrecision& lodPrecision,
568 const tcu::LodPrecision& lowQualityLodPrecision);
570 bool verifyTextureGatherResult (const tcu::ConstPixelBufferAccess& renderedFrame,
573 const tcu::LookupPrecision& lookupPrecision);
575 bool verifyTextureGatherCmpResult(const tcu::ConstPixelBufferAccess& renderedFrame,
578 const tcu::TexComparePrecision& texComparePrecision,
579 const tcu::TexComparePrecision& lowQualityTexComparePrecision);
592 const tcu::Sampler::DepthStencilMode m_sampleMode;
593 const tcu::TextureChannelClass m_channelClass;
613 tcu::ResultCollector m_result;
620 tcu::Sampler::DepthStencilMode mode,
641 DE_ASSERT(m_channelClass != tcu::TEXTURECHANNELCLASS_LAST || mode != tcu::Sampler::MODE_LAST);
656 throw tcu::NotSupportedError("Test requires GL_EXT_texture_border_clamp extension");
660 tcu::isAstcFormat(glu::mapGLCompressedTexFormat(m_texFormat)) &&
663 throw tcu::NotSupportedError("Test requires GL_KHR_texture_compression_astc_ldr extension");
667 throw tcu::NotSupportedError("Test requires GL_EXT_texture_format_BGRA8888 extension");
672 throw tcu::NotSupportedError("Test requires " + de::toString<int>(VIEWPORT_WIDTH) + "x" + de::toString<int>(VIEWPORT_HEIGHT) + " viewport");
677 m_texture = genDefaultTexture<glu::Texture2D>(m_context.getRenderContext(), m_context.getContextInfo(), m_texFormat, tcu::IVec2(m_texWidth, m_texHeight));
679 m_testCtx.getLog() << tcu::TestLog::Message
683 << tcu::TestLog::EndMessage;
695 m_testCtx.getLog() << tcu::TestLog::Message
697 << tcu::TestLog::EndMessage
701 throw tcu::TestError("failed to build program");
716 const tcu::ScopedLogSection section (m_testCtx.getLog(), "Iteration", iterationDesc);
717 tcu::Surface renderedFrame (VIEWPORT_WIDTH, VIEWPORT_HEIGHT);
734 const std::string borderColorString = (m_channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER) ? (de::toString(config.borderColor.get<deInt32>()))
735 : (m_channelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER) ? (de::toString(config.borderColor.get<deUint32>()))
738 m_testCtx.getLog() << tcu::TestLog::Message
747 << tcu::TestLog::EndMessage;
749 if (m_sampleMode == tcu::Sampler::MODE_DEPTH)
750 m_testCtx.getLog() << tcu::TestLog::Message << "Depth stencil texture mode is DEPTH_COMPONENT" << tcu::TestLog::EndMessage;
751 else if (m_sampleMode == tcu::Sampler::MODE_STENCIL)
752 m_testCtx.getLog() << tcu::TestLog::Message << "Depth stencil texture mode is STENCIL_INDEX" << tcu::TestLog::EndMessage;
756 m_testCtx.getLog() << tcu::TestLog::Message
759 << tcu::TestLog::EndMessage;
763 void TextureBorderClampTest::renderTo (tcu::Surface& surface,
778 if (m_sampleMode == tcu::Sampler::MODE_DEPTH)
780 else if (m_sampleMode == tcu::Sampler::MODE_STENCIL)
804 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
805 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
806 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
810 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
814 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
824 const tcu::Vec4 blue(0.0f, 0.0f, 1.0f, 1.0f);
843 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
844 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
845 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
849 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
853 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
910 void TextureBorderClampTest::verifyImage (const tcu::Surface& renderedFrame,
914 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat();
916 tcu::LodPrecision lodPrecision;
925 if (samplerParams.sampler.compare == tcu::Sampler::COMPAREMODE_NONE)
927 const tcu::TextureFormat texFormat = tcu::getEffectiveDepthStencilTextureFormat(m_texture->getRefTexture().getFormat(), m_sampleMode);
928 const bool isNearestMinFilter = samplerParams.sampler.minFilter == tcu::Sampler::NEAREST || samplerParams.sampler.minFilter == tcu::Sampler::NEAREST_MIPMAP_NEAREST;
929 const bool isNearestMagFilter = samplerParams.sampler.magFilter == tcu::Sampler::NEAREST;
931 const bool isSRGB = texFormat.order == tcu::TextureFormat::sRGB || texFormat.order == tcu::TextureFormat::sRGBA;
933 const tcu::IVec4 colorBits = tcu::max(glu::TextureTestUtil::getBitsVec(pixelFormat) - tcu::IVec4(colorErrorBits), tcu::IVec4(0));
934 tcu::LookupPrecision lookupPrecision;
936 lookupPrecision.colorThreshold = tcu::computeFixedPointThreshold(colorBits) / samplerParams.colorScale;
937 lookupPrecision.coordBits = tcu::IVec3(20,20,0);
938 lookupPrecision.uvwBits = tcu::IVec3(5,5,0);
964 tcu::TexComparePrecision texComparePrecision;
965 tcu::TexComparePrecision lowQualityTexComparePrecision;
966 tcu::LodPrecision lowQualityLodPrecision = lodPrecision;
968 texComparePrecision.coordBits = tcu::IVec3(20,20,0);
969 texComparePrecision.uvwBits = tcu::IVec3(7,7,0);
974 lowQualityTexComparePrecision.coordBits = tcu::IVec3(20,20,0);
975 lowQualityTexComparePrecision.uvwBits = tcu::IVec3(4,4,0);
1011 bool TextureBorderClampTest::verifyTextureSampleResult (const tcu::ConstPixelBufferAccess& renderedFrame,
1014 const tcu::LodPrecision& lodPrecision,
1015 const tcu::LookupPrecision& lookupPrecision)
1017 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat();
1018 tcu::Surface reference (renderedFrame.getWidth(), renderedFrame.getHeight());
1019 tcu::Surface errorMask (renderedFrame.getWidth(), renderedFrame.getHeight());
1022 glu::TextureTestUtil::sampleTexture(tcu::SurfaceAccess(reference, pixelFormat), m_texture->getRefTexture(), texCoord, samplerParams);
1028 m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Result verification failed, got " << numFailedPixels << " invalid pixels!" << tcu::TestLog::EndMessage;
1029 m_testCtx.getLog() << tcu::TestLog::ImageSet("VerifyResult", "Verification result")
1030 << tcu::TestLog::Image("Rendered", "Rendered image", renderedFrame);
1033 m_testCtx.getLog() << tcu::TestLog::Image("Reference", "Ideal reference image", reference)
1034 << tcu::TestLog::Image("ErrorMask", "Error mask", errorMask);
1036 m_testCtx.getLog() << tcu::TestLog::EndImageSet;
1041 bool TextureBorderClampTest::verifyTextureCompareResult (const tcu::ConstPixelBufferAccess& renderedFrame,
1044 const tcu::TexComparePrecision& texComparePrecision,
1045 const tcu::TexComparePrecision& lowQualityTexComparePrecision,
1046 const tcu::LodPrecision& lodPrecision,
1047 const tcu::LodPrecision& lowQualityLodPrecision)
1049 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat();
1051 const tcu::IVec4 nonShadowBits = tcu::max(glu::TextureTestUtil::getBitsVec(pixelFormat) - tcu::IVec4(colorErrorBits), tcu::IVec4(0));
1052 const tcu::Vec3 nonShadowThreshold = tcu::computeFixedPointThreshold(nonShadowBits).swizzle(1,2,3);
1053 std::vector<tcu::ConstPixelBufferAccess> srcLevelStorage;
1054 const tcu::Texture2DView effectiveView = tcu::getEffectiveTextureView(m_texture->getRefTexture(), srcLevelStorage, samplerParams.sampler);
1055 tcu::Surface reference (renderedFrame.getWidth(), renderedFrame.getHeight());
1056 tcu::Surface errorMask (renderedFrame.getWidth(), renderedFrame.getHeight());
1059 glu::TextureTestUtil::sampleTexture(tcu::SurfaceAccess(reference, pixelFormat), effectiveView, texCoord, samplerParams);
1066 m_testCtx.getLog() << tcu::TestLog::Message
1068 << tcu::TestLog::EndMessage;
1074 m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Verification against low precision requirements failed, failing test case." << tcu::TestLog::EndMessage;
1080 m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Result verification failed, got " << numFailedPixels << " invalid pixels!" << tcu::TestLog::EndMessage;
1081 m_testCtx.getLog() << tcu::TestLog::ImageSet("VerifyResult", "Verification result")
1082 << tcu::TestLog::Image("Rendered", "Rendered image", renderedFrame);
1085 m_testCtx.getLog() << tcu::TestLog::Image("Reference", "Ideal reference image", reference)
1086 << tcu::TestLog::Image("ErrorMask", "Error mask", errorMask);
1088 m_testCtx.getLog() << tcu::TestLog::EndImageSet;
1102 bool TextureBorderClampTest::verifyTextureGatherResult (const tcu::ConstPixelBufferAccess& renderedFrame,
1105 const tcu::LookupPrecision& lookupPrecision)
1107 const tcu::Vec2 texCoords[4] =
1109 tcu::Vec2(texCoordArray[0], texCoordArray[1]),
1110 tcu::Vec2(texCoordArray[2], texCoordArray[3]),
1111 tcu::Vec2(texCoordArray[4], texCoordArray[5]),
1112 tcu::Vec2(texCoordArray[6], texCoordArray[7]),
1115 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat();
1116 const deUint8 fbColormask = tcu::getColorMask(pixelFormat);
1118 std::vector<tcu::ConstPixelBufferAccess> srcLevelStorage;
1119 const tcu::Texture2DView effectiveView = tcu::getEffectiveTextureView(m_texture->getRefTexture(), srcLevelStorage, samplerParams.sampler);
1121 tcu::Surface reference (renderedFrame.getWidth(), renderedFrame.getHeight());
1122 tcu::Surface errorMask (renderedFrame.getWidth(), renderedFrame.getHeight());
1125 tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
1130 const tcu::Vec2 viewportCoord = (tcu::Vec2((float)px, (float)py) + tcu::Vec2(0.5f)) / tcu::Vec2((float)reference.getWidth(), (float)reference.getHeight());
1131 const tcu::Vec2 texCoord = triQuadInterpolate(texCoords, viewportCoord.x(), viewportCoord.y());
1132 const tcu::Vec4 referenceValue = effectiveView.gatherOffsets(samplerParams.sampler, texCoord.x(), texCoord.y(), 0, glu::getDefaultGatherOffsets());
1133 const tcu::Vec4 referencePixel = referenceValue * samplerParams.colorScale + samplerParams.colorBias;
1134 const tcu::Vec4 resultPixel = renderedFrame.getPixel(px, py);
1135 const tcu::Vec4 resultValue = (resultPixel - samplerParams.colorBias) / samplerParams.colorScale;
1137 reference.setPixel(px, py, tcu::toRGBAMasked(referenceValue, fbColormask));
1139 if (tcu::boolAny(tcu::logicalAnd(lookupPrecision.colorMask,
1140 tcu::greaterThan(tcu::absDiff(resultPixel, referencePixel),
1143 if (!tcu::isGatherOffsetsResultValid(effectiveView, samplerParams.sampler, lookupPrecision, texCoord, 0, glu::getDefaultGatherOffsets(), resultValue))
1145 errorMask.setPixel(px, py, tcu::RGBA::red());
1152 m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Result verification failed, got " << numFailedPixels << " invalid pixels!" << tcu::TestLog::EndMessage;
1153 m_testCtx.getLog() << tcu::TestLog::ImageSet("VerifyResult", "Verification result")
1154 << tcu::TestLog::Image("Rendered", "Rendered image", renderedFrame);
1157 m_testCtx.getLog() << tcu::TestLog::Image("Reference", "Ideal reference image", reference)
1158 << tcu::TestLog::Image("ErrorMask", "Error mask", errorMask);
1160 m_testCtx.getLog() << tcu::TestLog::EndImageSet;
1165 bool TextureBorderClampTest::verifyTextureGatherCmpResult (const tcu::ConstPixelBufferAccess& renderedFrame,
1168 const tcu::TexComparePrecision& texComparePrecision,
1169 const tcu::TexComparePrecision& lowQualityTexComparePrecision)
1171 const tcu::Vec2 texCoords[4] =
1173 tcu::Vec2(texCoordArray[0], texCoordArray[1]),
1174 tcu::Vec2(texCoordArray[2], texCoordArray[3]),
1175 tcu::Vec2(texCoordArray[4], texCoordArray[5]),
1176 tcu::Vec2(texCoordArray[6], texCoordArray[7]),
1179 std::vector<tcu::ConstPixelBufferAccess> srcLevelStorage;
1180 const tcu::Texture2DView effectiveView = tcu::getEffectiveTextureView(m_texture->getRefTexture(), srcLevelStorage, samplerParams.sampler);
1182 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat();
1183 const tcu::BVec4 colorMask = glu::TextureTestUtil::getCompareMask(pixelFormat);
1184 const deUint8 fbColormask = tcu::getColorMask(pixelFormat);
1185 tcu::Surface reference (renderedFrame.getWidth(), renderedFrame.getHeight());
1186 tcu::Surface errorMask (renderedFrame.getWidth(), renderedFrame.getHeight());
1190 tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
1195 const tcu::Vec2 viewportCoord = (tcu::Vec2((float)px, (float)py) + tcu::Vec2(0.5f)) / tcu::Vec2((float)reference.getWidth(), (float)reference.getHeight());
1196 const tcu::Vec2 texCoord = triQuadInterpolate(texCoords, viewportCoord.x(), viewportCoord.y());
1198 const tcu::Vec4 referenceValue = effectiveView.gatherOffsetsCompare(samplerParams.sampler, refZ, texCoord.x(), texCoord.y(), glu::getDefaultGatherOffsets());
1199 const tcu::Vec4 resultValue = renderedFrame.getPixel(px, py);
1201 reference.setPixel(px, py, tcu::toRGBAMasked(referenceValue, fbColormask));
1203 if (tcu::boolAny(tcu::logicalAnd(colorMask, tcu::notEqual(referenceValue, resultValue))))
1205 if (!tcu::isGatherOffsetsCompareResultValid(effectiveView, samplerParams.sampler, texComparePrecision, texCoord, glu::getDefaultGatherOffsets(), refZ, resultValue))
1210 if (!tcu::isGatherOffsetsCompareResultValid(effectiveView, samplerParams.sampler, lowQualityTexComparePrecision, texCoord, glu::getDefaultGatherOffsets(), refZ, resultValue))
1212 errorMask.setPixel(px, py, tcu::RGBA::red());
1220 m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Result verification failed, got " << numFailedPixels << " invalid pixels!" << tcu::TestLog::EndMessage;
1223 m_testCtx.getLog() << tcu::TestLog::Message << "Warning: Verification assuming high-quality PCF filtering failed." << tcu::TestLog::EndMessage;
1227 m_testCtx.getLog() << tcu::TestLog::ImageSet("VerifyResult", "Verification result")
1228 << tcu::TestLog::Image("Rendered", "Rendered image", renderedFrame);
1231 m_testCtx.getLog() << tcu::TestLog::Image("Reference", "Ideal reference image", reference)
1232 << tcu::TestLog::Image("ErrorMask", "Error mask", errorMask);
1234 m_testCtx.getLog() << tcu::TestLog::EndImageSet;
1246 tcu::SeedBuilder builder;
1257 const tcu::TextureFormat texFormat = tcu::getEffectiveDepthStencilTextureFormat(m_texture->getRefTexture().getFormat(), m_sampleMode);
1262 refParams.sampler.compare = (!m_useShadowSampler) ? (tcu::Sampler::COMPAREMODE_NONE) : (glu::mapGLCompareFunc(config.compareMode));
1272 DE_ASSERT(refParams.sampler.compare == tcu::Sampler::COMPAREMODE_NONE);
1280 DE_ASSERT(refParams.colorScale == tcu::Vec4(refParams.colorScale.x()));
1281 DE_ASSERT(refParams.colorBias == tcu::Vec4(refParams.colorBias.x()));
1312 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
1313 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
1314 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
1319 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
1324 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
1358 tcu::Sampler::DepthStencilMode mode,
1381 tcu::Sampler::DepthStencilMode mode,
1405 const tcu::CompressedTexFormat compressedFormat = glu::mapGLCompressedTexFormat(texFormat);
1406 const tcu::IVec3 blockPixelSize = tcu::getBlockPixelSize(compressedFormat);
1423 const tcu::TextureFormat texFormat = tcu::getEffectiveDepthStencilTextureFormat(getTexture()->getRefTexture().getFormat(), m_sampleMode);
1424 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(texFormat);
1430 iteration.p0 = tcu::Vec2(-1.5f, -3.0f);
1431 iteration.p1 = tcu::Vec2( 1.5f, 2.5f);
1432 iteration.borderColor = mapToFormatColorRepresentable(texFormat, tcu::Vec4(0.3f, 0.7f, 0.2f, 0.5f));
1437 iteration.p0 = tcu::Vec2(-0.5f, 0.75f);
1438 iteration.p1 = tcu::Vec2(0.25f, 1.25f);
1439 iteration.borderColor = mapToFormatColorRepresentable(texFormat, tcu::Vec4(0.9f, 0.2f, 0.4f, 0.6f));
1450 iteration.lookupScale = tcu::Vec4(texFormatInfo.lookupScale.x());
1451 iteration.lookupBias = tcu::Vec4(texFormatInfo.lookupBias.x());
1485 tcu::Sampler::DepthStencilMode mode,
1502 tcu::Sampler::DepthStencilMode mode,
1513 const tcu::TextureFormat texFormat = tcu::getEffectiveDepthStencilTextureFormat(getTexture()->getRefTexture().getFormat(), m_sampleMode);
1515 const bool isFloat = m_channelClass == tcu::TEXTURECHANNELCLASS_FLOATING_POINT;
1516 const bool isFixed = m_channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT || m_channelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
1517 const bool isPureInteger = m_channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER || m_channelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
1524 iteration.p0 = tcu::Vec2(-1.2f, -3.0f);
1525 iteration.p1 = tcu::Vec2( 1.2f, 2.5f);
1526 iteration.borderColor = rr::GenericVec4(tcu::Vec4(std::numeric_limits<float>::infinity()));
1527 iteration.lookupScale = tcu::Vec4(0.5f); // scale & bias to [0.25, 0.5] range to make out-of-range values visible
1528 iteration.lookupBias = tcu::Vec4(0.25f);
1534 iteration.p0 = tcu::Vec2(-0.25f, -0.75f);
1535 iteration.p1 = tcu::Vec2( 2.25f, 1.25f);
1536 iteration.borderColor = rr::GenericVec4(tcu::Vec4(-std::numeric_limits<float>::infinity()));
1537 iteration.lookupScale = tcu::Vec4(0.5f);
1538 iteration.lookupBias = tcu::Vec4(0.25f);
1545 const tcu::IVec4 numBits = tcu::getTextureFormatBitDepth(texFormat);
1546 const bool isSigned = m_channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER;
1552 const tcu::IVec4 minValue = getNBitIntegerVec4MinValue(isSigned, numBits);
1553 const tcu::IVec4 maxValue = getNBitIntegerVec4MaxValue(isSigned, numBits);
1554 const tcu::IVec4 valueRange = maxValue - minValue;
1555 const tcu::IVec4 divSafeRange ((valueRange[0]==0) ? (1) : (valueRange[0]),
1562 const tcu::IVec4 value = maxValue + tcu::IVec4(1);
1565 iteration.p0 = tcu::Vec2(-1.2f, -3.0f);
1566 iteration.p1 = tcu::Vec2( 1.2f, 2.5f);
1568 iteration.lookupScale = tcu::Vec4(0.5f) / divSafeRange.cast<float>();
1569 iteration.lookupBias = (isSigned) ? (tcu::Vec4(0.5f)) : (tcu::Vec4(0.25f));
1576 const tcu::IVec4 value = minValue - tcu::IVec4(1);
1579 iteration.p0 = tcu::Vec2(-0.25f, -0.75f);
1580 iteration.p1 = tcu::Vec2( 2.25f, 1.25f);
1582 iteration.lookupScale = tcu::Vec4(0.5f) / divSafeRange.cast<float>();
1583 iteration.lookupBias = tcu::Vec4(0.5f);
1589 const tcu::IVec4 value = (isSigned) ? (tcu::IVec4(std::numeric_limits<deInt32>::max())) : (tcu::IVec4(std::numeric_limits<deUint32>::max()));
1592 iteration.p0 = tcu::Vec2(-1.6f, -2.1f);
1593 iteration.p1 = tcu::Vec2( 1.2f, 3.5f);
1595 iteration.lookupScale = tcu::Vec4(0.5f) / divSafeRange.cast<float>();
1596 iteration.lookupBias = tcu::Vec4(0.25f);
1603 const tcu::IVec4 value = tcu::IVec4(std::numeric_limits<deInt32>::min());
1606 iteration.p0 = tcu::Vec2(-2.6f, -4.0f);
1607 iteration.p1 = tcu::Vec2( 1.1f, 1.5f);
1609 iteration.lookupScale = tcu::Vec4(0.5f) / divSafeRange.cast<float>();
1610 iteration.lookupBias = tcu::Vec4(0.25f);
1617 const bool isSigned = m_channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
1618 const tcu::Vec4 lookupBias = (isSigned) ? (tcu::Vec4(0.5f)) : (tcu::Vec4(0.25f)); // scale & bias to [0.25, 0.5] range to make out-of-range values visible
1619 const tcu::Vec4 lookupScale = (isSigned) ? (tcu::Vec4(0.25f)) : (tcu::Vec4(0.5f));
1623 iteration.p0 = tcu::Vec2(-1.2f, -3.0f);
1624 iteration.p1 = tcu::Vec2( 1.2f, 2.5f);
1625 iteration.borderColor = mapToFormatColorUnits(texFormat, tcu::Vec4(1.1f, 1.3f, 2.2f, 1.3f));
1633 iteration.p0 = tcu::Vec2(-0.25f, -0.75f);
1634 iteration.p1 = tcu::Vec2( 2.25f, 1.25f);
1635 iteration.borderColor = mapToFormatColorUnits(texFormat, tcu::Vec4(-0.2f, -0.9f, -2.4f, -0.6f));
1676 tcu::Sampler::DepthStencilMode mode,
1700 tcu::Sampler::DepthStencilMode mode,
1726 const tcu::TextureFormat texFormat = tcu::getEffectiveDepthStencilTextureFormat(getTexture()->getRefTexture().getFormat(), m_sampleMode);
1727 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(texFormat);
1730 iteration.p0 = tcu::Vec2(-0.25f, -0.75f);
1731 iteration.p1 = tcu::Vec2( 2.25f, 1.25f);
1732 iteration.borderColor = mapToFormatColorRepresentable(texFormat, tcu::Vec4(0.4f, 0.9f, 0.1f, 0.2f));
1736 iteration.lookupScale = tcu::Vec4(texFormatInfo.lookupScale.x());
1737 iteration.lookupBias = tcu::Vec4(texFormatInfo.lookupBias.x());
1797 tcu::Sampler::MODE_DEPTH,
1814 iteration.p0 = tcu::Vec2(-0.15f, -0.35f);
1815 iteration.p1 = tcu::Vec2( 1.25f, 1.1f);
1816 iteration.borderColor = rr::GenericVec4(tcu::Vec4(0.7f, 0.0f, 0.0f, 0.0f));
1826 iteration.p0 = tcu::Vec2(-0.15f, -0.35f);
1827 iteration.p1 = tcu::Vec2( 1.25f, 1.1f);
1828 iteration.borderColor = rr::GenericVec4(tcu::Vec4(1.5f, 0.0f, 0.0f, 0.0f));
1838 iteration.p0 = tcu::Vec2(-0.15f, -0.35f);
1839 iteration.p1 = tcu::Vec2( 1.25f, 1.1f);
1840 iteration.borderColor = rr::GenericVec4(tcu::Vec4(-0.5f, 0.0f, 0.0f, 0.0f));
1850 iteration.p0 = tcu::Vec2(-0.15f, -0.35f);
1851 iteration.p1 = tcu::Vec2( 1.25f, 1.1f);
1852 iteration.borderColor = rr::GenericVec4(tcu::Vec4(std::numeric_limits<float>::infinity(), 0.0f, 0.0f, 0.0f));
1862 iteration.p0 = tcu::Vec2(-0.15f, -0.35f);
1863 iteration.p1 = tcu::Vec2( 1.25f, 1.1f);
1864 iteration.borderColor = rr::GenericVec4(tcu::Vec4(-std::numeric_limits<float>::infinity(), 0.0f, 0.0f, 0.0f));
1876 iteration.lookupScale = tcu::Vec4(1.0);
1877 iteration.lookupBias = tcu::Vec4(0.0);
1902 tcu::Sampler::DepthStencilMode depthStencilMode);
1917 tcu::Sampler::DepthStencilMode depthStencilMode)
1930 static rr::GenericVec4 selectComponents (const rr::GenericVec4& trueComponents, const rr::GenericVec4& falseComponents, const tcu::BVec4& m)
1932 return rr::GenericVec4(tcu::select(trueComponents.get<deUint32>(), falseComponents.get<deUint32>(), m));
1940 const tcu::TextureFormat texFormat = tcu::getEffectiveDepthStencilTextureFormat(getTexture()->getRefTexture().getFormat(), m_sampleMode);
1941 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(texFormat);
1942 const tcu::BVec4 channelMask = tcu::getTextureFormatChannelMask(texFormat);
1948 const rr::GenericVec4 effectiveColors = mapToFormatColorRepresentable(texFormat, tcu::Vec4(0.6f));
1953 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
1954 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
1955 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
1956 nonEffectiveColors = rr::GenericVec4(tcu::Vec4(maxChannelValue * 0.8f));
1959 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
1960 nonEffectiveColors = rr::GenericVec4(tcu::Vec4(maxChannelValue * 0.8f).cast<deInt32>());
1963 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
1964 nonEffectiveColors = rr::GenericVec4(tcu::Vec4(maxChannelValue * 0.8f).cast<deUint32>());
1971 iteration.p0 = tcu::Vec2(-0.25f, -0.75f);
1972 iteration.p1 = tcu::Vec2( 2.25f, 1.25f);
2015 void renderTo (tcu::Surface& surface,
2020 void verifyImage (const tcu::Surface& image,
2033 const tcu::TextureChannelClass m_channelClass;
2034 const tcu::IVec3 m_size;
2045 tcu::Vec4 m_lookupScale;
2046 tcu::Vec4 m_lookupBias;
2060 , m_channelClass (getFormatChannelClass(texFormat, tcu::Sampler::MODE_LAST))
2061 , m_size ((size == SIZE_POT) ? (tcu::IVec3(8, 16, 4)) : (tcu::IVec3(13, 5, 7)))
2077 throw tcu::NotSupportedError("Test requires GL_EXT_texture_border_clamp extension");
2081 tcu::isAstcFormat(glu::mapGLCompressedTexFormat(m_texFormat)) &&
2084 throw tcu::NotSupportedError("Test requires GL_KHR_texture_compression_astc_ldr extension");
2087 throw tcu::NotSupportedError("Test requires GL_EXT_texture_format_BGRA8888 extension");
2091 throw tcu::NotSupportedError("Test requires " + de::toString<int>(VIEWPORT_WIDTH) + "x" + de::toString<int>(VIEWPORT_HEIGHT) + " viewport");
2099 m_testCtx.getLog() << tcu::TestLog::Message
2102 << tcu::TestLog::EndMessage;
2106 m_testCtx.getLog() << tcu::TestLog::Message
2108 << tcu::TestLog::EndMessage;
2120 const tcu::TextureFormat texFormat = m_texture->getRefTexture().getFormat();
2121 const tcu::TextureFormatInfo texFormatInfo = tcu::getTextureFormatInfo(texFormat);
2123 m_borderColor = mapToFormatColorRepresentable(texFormat, tcu::Vec4(0.2f, 0.6f, 0.9f, 0.4f));
2138 tcu::Surface renderedFrame (VIEWPORT_WIDTH, VIEWPORT_HEIGHT);
2150 const std::string borderColorString = (m_channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER) ? (de::toString(m_borderColor.get<deInt32>()))
2151 : (m_channelClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER) ? (de::toString(m_borderColor.get<deUint32>()))
2154 m_testCtx.getLog() << tcu::TestLog::Message
2162 << tcu::TestLog::EndMessage;
2165 void TextureBorderClampPerAxisCase3D::renderTo (tcu::Surface& surface,
2184 case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
2185 case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
2186 case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
2190 case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
2194 case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
2209 void TextureBorderClampPerAxisCase3D::verifyImage (const tcu::Surface& renderedFrame,
2212 const tcu::PixelFormat pixelFormat = m_context.getRenderTarget().getPixelFormat();
2214 const tcu::IVec4 colorBits = tcu::max(glu::TextureTestUtil::getBitsVec(pixelFormat) - tcu::IVec4(colorErrorBits), tcu::IVec4(0));
2215 tcu::Surface reference (renderedFrame.getWidth(), renderedFrame.getHeight());
2216 tcu::Surface errorMask (renderedFrame.getWidth(), renderedFrame.getHeight());
2217 tcu::LodPrecision lodPrecision;
2218 tcu::LookupPrecision lookupPrecision;
2224 lookupPrecision.colorThreshold = tcu::computeFixedPointThreshold(colorBits) / samplerParams.colorScale;
2225 lookupPrecision.coordBits = tcu::IVec3(20,20,0);
2226 lookupPrecision.uvwBits = tcu::IVec3(5,5,0);
2229 glu::TextureTestUtil::sampleTexture(tcu::SurfaceAccess(reference, pixelFormat), m_texture->getRefTexture(), &m_texCoords[0], samplerParams);
2235 m_testCtx.getLog() << tcu::TestLog::Message << "ERROR: Result verification failed, got " << numFailedPixels << " invalid pixels!" << tcu::TestLog::EndMessage;
2236 m_testCtx.getLog() << tcu::TestLog::ImageSet("VerifyResult", "Verification result")
2237 << tcu::TestLog::Image("Rendered", "Rendered image", renderedFrame);
2240 m_testCtx.getLog() << tcu::TestLog::Image("Reference", "Ideal reference image", reference)
2241 << tcu::TestLog::Image("ErrorMask", "Error mask", errorMask);
2243 m_testCtx.getLog() << tcu::TestLog::EndImageSet;
2253 const tcu::TextureFormat texFormat = m_texture->getRefTexture().getFormat();
2268 tcu::SeedBuilder builder;
2321 tcu::Sampler::DepthStencilMode mode;
2324 { "luminance", GL_LUMINANCE, tcu::Sampler::MODE_LAST },
2325 { "alpha", GL_ALPHA, tcu::Sampler::MODE_LAST },
2326 { "luminance_alpha", GL_LUMINANCE_ALPHA, tcu::Sampler::MODE_LAST },
2327 { "bgra", GL_BGRA, tcu::Sampler::MODE_LAST },
2328 { "r8", GL_R8, tcu::Sampler::MODE_LAST },
2329 { "r8_snorm", GL_R8_SNORM, tcu::Sampler::MODE_LAST },
2330 { "rg8", GL_RG8, tcu::Sampler::MODE_LAST },
2331 { "rg8_snorm", GL_RG8_SNORM, tcu::Sampler::MODE_LAST },
2332 { "rgb8", GL_RGB8, tcu::Sampler::MODE_LAST },
2333 { "rgb8_snorm", GL_RGB8_SNORM, tcu::Sampler::MODE_LAST },
2334 { "rgb565", GL_RGB565, tcu::Sampler::MODE_LAST },
2335 { "rgba4", GL_RGBA4, tcu::Sampler::MODE_LAST },
2336 { "rgb5_a1", GL_RGB5_A1, tcu::Sampler::MODE_LAST },
2337 { "rgba8", GL_RGBA8, tcu::Sampler::MODE_LAST },
2338 { "rgba8_snorm", GL_RGBA8_SNORM, tcu::Sampler::MODE_LAST },
2339 { "rgb10_a2", GL_RGB10_A2, tcu::Sampler::MODE_LAST },
2340 { "rgb10_a2ui", GL_RGB10_A2UI, tcu::Sampler::MODE_LAST },
2341 { "srgb8", GL_SRGB8, tcu::Sampler::MODE_LAST },
2342 { "srgb8_alpha8", GL_SRGB8_ALPHA8, tcu::Sampler::MODE_LAST },
2343 { "r16f", GL_R16F, tcu::Sampler::MODE_LAST },
2344 { "rg16f", GL_RG16F, tcu::Sampler::MODE_LAST },
2345 { "rgb16f", GL_RGB16F, tcu::Sampler::MODE_LAST },
2346 { "rgba16f", GL_RGBA16F, tcu::Sampler::MODE_LAST },
2347 { "r32f", GL_R32F, tcu::Sampler::MODE_LAST },
2348 { "rg32f", GL_RG32F, tcu::Sampler::MODE_LAST },
2349 { "rgb32f", GL_RGB32F, tcu::Sampler::MODE_LAST },
2350 { "rgba32f", GL_RGBA32F, tcu::Sampler::MODE_LAST },
2351 { "r11f_g11f_b10f", GL_R11F_G11F_B10F, tcu::Sampler::MODE_LAST },
2352 { "rgb9_e5", GL_RGB9_E5, tcu::Sampler::MODE_LAST },
2353 { "r8i", GL_R8I, tcu::Sampler::MODE_LAST },
2354 { "r8ui", GL_R8UI, tcu::Sampler::MODE_LAST },
2355 { "r16i", GL_R16I, tcu::Sampler::MODE_LAST },
2356 { "r16ui", GL_R16UI, tcu::Sampler::MODE_LAST },
2357 { "r32i", GL_R32I, tcu::Sampler::MODE_LAST },
2358 { "r32ui", GL_R32UI, tcu::Sampler::MODE_LAST },
2359 { "rg8i", GL_RG8I, tcu::Sampler::MODE_LAST },
2360 { "rg8ui", GL_RG8UI, tcu::Sampler::MODE_LAST },
2361 { "rg16i", GL_RG16I, tcu::Sampler::MODE_LAST },
2362 { "rg16ui", GL_RG16UI, tcu::Sampler::MODE_LAST },
2363 { "rg32i", GL_RG32I, tcu::Sampler::MODE_LAST },
2364 { "rg32ui", GL_RG32UI, tcu::Sampler::MODE_LAST },
2365 { "rgb8i", GL_RGB8I, tcu::Sampler::MODE_LAST },
2366 { "rgb8ui", GL_RGB8UI, tcu::Sampler::MODE_LAST },
2367 { "rgb16i", GL_RGB16I, tcu::Sampler::MODE_LAST },
2368 { "rgb16ui", GL_RGB16UI, tcu::Sampler::MODE_LAST },
2369 { "rgb32i", GL_RGB32I, tcu::Sampler::MODE_LAST },
2370 { "rgb32ui", GL_RGB32UI, tcu::Sampler::MODE_LAST },
2371 { "rgba8i", GL_RGBA8I, tcu::Sampler::MODE_LAST },
2372 { "rgba8ui", GL_RGBA8UI, tcu::Sampler::MODE_LAST },
2373 { "rgba16i", GL_RGBA16I, tcu::Sampler::MODE_LAST },
2374 { "rgba16ui", GL_RGBA16UI, tcu::Sampler::MODE_LAST },
2375 { "rgba32i", GL_RGBA32I, tcu::Sampler::MODE_LAST },
2376 { "rgba32ui", GL_RGBA32UI, tcu::Sampler::MODE_LAST },
2377 { "depth_component16", GL_DEPTH_COMPONENT16, tcu::Sampler::MODE_DEPTH },
2378 { "depth_component24", GL_DEPTH_COMPONENT24, tcu::Sampler::MODE_DEPTH },
2379 { "depth_component32f", GL_DEPTH_COMPONENT32F, tcu::Sampler::MODE_DEPTH },
2380 { "stencil_index8", GL_STENCIL_INDEX8, tcu::Sampler::MODE_STENCIL },
2381 { "depth24_stencil8_sample_depth", GL_DEPTH24_STENCIL8, tcu::Sampler::MODE_DEPTH },
2382 { "depth32f_stencil8_sample_depth", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_DEPTH },
2383 { "depth24_stencil8_sample_stencil", GL_DEPTH24_STENCIL8, tcu::Sampler::MODE_STENCIL },
2384 { "depth32f_stencil8_sample_stencil", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_STENCIL },
2385 { "compressed_r11_eac", GL_COMPRESSED_R11_EAC, tcu::Sampler::MODE_LAST },
2386 { "compressed_signed_r11_eac", GL_COMPRESSED_SIGNED_R11_EAC, tcu::Sampler::MODE_LAST },
2387 { "compressed_rg11_eac", GL_COMPRESSED_RG11_EAC, tcu::Sampler::MODE_LAST },
2388 { "compressed_signed_rg11_eac", GL_COMPRESSED_SIGNED_RG11_EAC, tcu::Sampler::MODE_LAST },
2389 { "compressed_rgb8_etc2", GL_COMPRESSED_RGB8_ETC2, tcu::Sampler::MODE_LAST },
2390 { "compressed_srgb8_etc2", GL_COMPRESSED_SRGB8_ETC2, tcu::Sampler::MODE_LAST },
2391 { "compressed_rgb8_punchthrough_alpha1_etc2", GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, tcu::Sampler::MODE_LAST },
2392 { "compressed_srgb8_punchthrough_alpha1_etc2", GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, tcu::Sampler::MODE_LAST },
2393 { "compressed_rgba8_etc2_eac", GL_COMPRESSED_RGBA8_ETC2_EAC, tcu::Sampler::MODE_LAST },
2394 { "compressed_srgb8_alpha8_etc2_eac", GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, tcu::Sampler::MODE_LAST },
2397 tcu::TestCaseGroup* const formatsGroup = new tcu::TestCaseGroup(m_testCtx, "formats", "Format tests");
2404 const tcu::Sampler::DepthStencilMode sampleMode = formats[formatNdx].mode;
2407 tcu::TestCaseGroup* const formatGroup = new tcu::TestCaseGroup(m_testCtx, formats[formatNdx].name, "Format test");
2452 tcu::Sampler::DepthStencilMode mode;
2455 { "unorm_color", GL_R8, tcu::Sampler::MODE_LAST },
2456 { "snorm_color", GL_R8_SNORM, tcu::Sampler::MODE_LAST },
2457 { "float_color", GL_RG32F, tcu::Sampler::MODE_LAST },
2458 { "int_color", GL_R8I, tcu::Sampler::MODE_LAST },
2459 { "uint_color", GL_R16UI, tcu::Sampler::MODE_LAST },
2460 { "srgb_color", GL_SRGB8_ALPHA8, tcu::Sampler::MODE_LAST },
2461 { "unorm_depth", GL_DEPTH_COMPONENT24, tcu::Sampler::MODE_DEPTH },
2462 { "float_depth", GL_DEPTH_COMPONENT32F, tcu::Sampler::MODE_DEPTH },
2463 { "uint_stencil", GL_STENCIL_INDEX8, tcu::Sampler::MODE_STENCIL },
2464 { "float_depth_uint_stencil_sample_depth", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_DEPTH },
2465 { "float_depth_uint_stencil_sample_stencil", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_STENCIL },
2466 { "unorm_depth_uint_stencil_sample_depth", GL_DEPTH24_STENCIL8, tcu::Sampler::MODE_DEPTH },
2467 { "unorm_depth_uint_stencil_sample_stencil", GL_DEPTH24_STENCIL8, tcu::Sampler::MODE_STENCIL },
2468 { "compressed_color", GL_COMPRESSED_RG11_EAC, tcu::Sampler::MODE_LAST },
2471 tcu::TestCaseGroup* const rangeClampGroup = new tcu::TestCaseGroup(m_testCtx, "range_clamp", "Range clamp tests");
2478 const tcu::Sampler::DepthStencilMode sampleMode = formats[formatNdx].mode;
2497 tcu::Sampler::DepthStencilMode mode;
2500 { "unorm_color", GL_R8, tcu::Sampler::MODE_LAST },
2501 { "snorm_color", GL_R8_SNORM, tcu::Sampler::MODE_LAST },
2502 { "float_color", GL_RG32F, tcu::Sampler::MODE_LAST },
2503 { "int_color", GL_R8I, tcu::Sampler::MODE_LAST },
2504 { "uint_color", GL_R16UI, tcu::Sampler::MODE_LAST },
2505 { "unorm_depth", GL_DEPTH_COMPONENT24, tcu::Sampler::MODE_DEPTH },
2506 { "float_depth", GL_DEPTH_COMPONENT32F, tcu::Sampler::MODE_DEPTH },
2507 { "uint_stencil", GL_STENCIL_INDEX8, tcu::Sampler::MODE_STENCIL },
2508 { "compressed_color", GL_COMPRESSED_RG11_EAC, tcu::Sampler::MODE_LAST },
2511 tcu::TestCaseGroup* const samplerGroup = new tcu::TestCaseGroup(m_testCtx, "sampler", "Sampler param tests");
2517 const tcu::Sampler::DepthStencilMode sampleMode = formats[formatNdx].mode;
2547 tcu::Sampler::DepthStencilMode mode;
2551 { "unorm_color", GL_RG8, tcu::Sampler::MODE_LAST, true },
2552 { "snorm_color", GL_RG8_SNORM, tcu::Sampler::MODE_LAST, true },
2553 { "float_color", GL_R32F, tcu::Sampler::MODE_LAST, true },
2554 { "int_color", GL_RG16I, tcu::Sampler::MODE_LAST, true },
2555 { "uint_color", GL_R8UI, tcu::Sampler::MODE_LAST, true },
2556 { "unorm_depth", GL_DEPTH_COMPONENT16, tcu::Sampler::MODE_DEPTH, false },
2557 { "float_depth", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_DEPTH, false },
2558 { "uint_stencil", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_STENCIL, false },
2559 { "compressed_color", GL_COMPRESSED_RGB8_ETC2, tcu::Sampler::MODE_LAST, false },
2582 tcu::TestCaseGroup* const perAxisGroup = new tcu::TestCaseGroup(m_testCtx, "per_axis_wrap_mode", "Per-axis wrapping modes");
2588 tcu::TestCaseGroup* const targetGroup = new tcu::TestCaseGroup(m_testCtx, targets[targetNdx].name, "Texture target test");
2599 const tcu::Sampler::DepthStencilMode sampleMode = formats[formatNdx].mode;
2601 tcu::TestCaseGroup* const formatGroup = new tcu::TestCaseGroup(m_testCtx, formats[formatNdx].name, "Format test");
2623 tcu::TestCaseGroup* const filteringGroup = new tcu::TestCaseGroup(m_testCtx, s_filters[filterNdx].name, "Tests with specific filter");
2653 DE_ASSERT(sampleMode == tcu::Sampler::MODE_LAST);
2688 tcu::TestCaseGroup* const compareGroup = new tcu::TestCaseGroup(m_testCtx, "depth_compare_mode", "Tests depth compare mode");
2694 tcu::TestCaseGroup* const formatGroup = new tcu::TestCaseGroup(m_testCtx, formats[formatNdx].name, "Format test");
2725 tcu::Sampler::DepthStencilMode mode;
2728 { "r8", GL_R8, tcu::Sampler::MODE_LAST },
2729 { "rg8_snorm", GL_RG8_SNORM, tcu::Sampler::MODE_LAST },
2730 { "rgb8", GL_RGB8, tcu::Sampler::MODE_LAST },
2731 { "rg32f", GL_RG32F, tcu::Sampler::MODE_LAST },
2732 { "r16i", GL_RG16I, tcu::Sampler::MODE_LAST },
2733 { "luminance", GL_LUMINANCE, tcu::Sampler::MODE_LAST },
2734 { "alpha", GL_ALPHA, tcu::Sampler::MODE_LAST },
2735 { "luminance_alpha", GL_LUMINANCE_ALPHA, tcu::Sampler::MODE_LAST },
2736 { "depth_component16", GL_DEPTH_COMPONENT16, tcu::Sampler::MODE_DEPTH },
2737 { "depth_component32f", GL_DEPTH_COMPONENT32F, tcu::Sampler::MODE_DEPTH },
2738 { "stencil_index8", GL_STENCIL_INDEX8, tcu::Sampler::MODE_STENCIL },
2739 { "depth32f_stencil8_sample_depth", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_DEPTH },
2740 { "depth32f_stencil8_sample_stencil", GL_DEPTH32F_STENCIL8, tcu::Sampler::MODE_STENCIL },
2741 { "depth24_stencil8_sample_depth", GL_DEPTH24_STENCIL8, tcu::Sampler::MODE_DEPTH },
2742 { "depth24_stencil8_sample_stencil", GL_DEPTH24_STENCIL8, tcu::Sampler::MODE_STENCIL },
2743 { "compressed_r11_eac", GL_COMPRESSED_R11_EAC, tcu::Sampler::MODE_LAST },
2746 tcu::TestCaseGroup* const unusedGroup = new tcu::TestCaseGroup(m_testCtx, "unused_channels", "Tests channels that are not present in the internal format");