X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=modules%2Fegl%2FteglRenderTests.cpp;h=46b1780d9ee38413ca7eaa8435ecbc7731b03510;hb=6a46f98d8d09ba6ca77700e693b8ad5cec55c02e;hp=8b5b5c2998d4229b8f4a71d9985f61abd06592e6;hpb=a921fc525271da902dfe8809a354e2609902a732;p=platform%2Fupstream%2FVK-GL-CTS.git diff --git a/modules/egl/teglRenderTests.cpp b/modules/egl/teglRenderTests.cpp index 8b5b5c2..46b1780 100644 --- a/modules/egl/teglRenderTests.cpp +++ b/modules/egl/teglRenderTests.cpp @@ -356,6 +356,37 @@ tcu::TextureFormat getColorFormat (const tcu::PixelFormat& colorBits) #undef PACK_FMT } +/* +The getColorThreshold function is used to obtain a +threshold usable for the fuzzyCompare function. + +For 8bit color depths a value of 0.02 should provide +a good metric for rejecting images above this level. +For other bit depths other thresholds should be selected. +Ideally this function would take advantage of the +getColorThreshold function provided by the PixelFormat class +as this would also allow setting per channel thresholds. +However using the PixelFormat provided function can result +in too strict thresholds for 8bit bit depths (compared to +the current default of 0.02) or too relaxed for lower bit +depths if scaled proportionally to the 8bit default. +*/ + +float getColorThreshold (const tcu::PixelFormat& colorBits) +{ + if ((colorBits.redBits > 0 && colorBits.redBits < 8) || + (colorBits.greenBits > 0 && colorBits.greenBits < 8) || + (colorBits.blueBits > 0 && colorBits.blueBits < 8) || + (colorBits.alphaBits > 0 && colorBits.alphaBits < 8)) + { + return 0.05f; + } + else + { + return 0.02f; + } +} + tcu::TextureFormat getDepthFormat (const int depthBits) { switch (depthBits) @@ -699,9 +730,9 @@ void SingleThreadRenderCase::executeForContexts (EGLDisplay display, EGLSurface const int numContexts = (int)contexts.size(); const int drawsPerCtx = 2; const int numIters = 2; - const float threshold = 0.02f; - const tcu::PixelFormat pixelFmt = getPixelFormat(egl, display, config.config); + const float threshold = getColorThreshold(pixelFmt); + const int depthBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_DEPTH_SIZE); const int stencilBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_STENCIL_SIZE); const int numSamples = eglu::getConfigAttribInt(egl, display, config.config, EGL_SAMPLES); @@ -868,6 +899,7 @@ public: // Signal completion. packetIter->signal->increment(); } + m_egl.releaseThread(); } private: @@ -902,9 +934,9 @@ void MultiThreadRenderCase::executeForContexts (EGLDisplay display, EGLSurface s const int packetsPerThread = 2; const int numThreads = numContexts; const int numPackets = numThreads * packetsPerThread; - const float threshold = 0.02f; - const tcu::PixelFormat pixelFmt = getPixelFormat(egl, display, config.config); + const float threshold = getColorThreshold(pixelFmt); + const int depthBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_DEPTH_SIZE); const int stencilBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_STENCIL_SIZE); const int numSamples = eglu::getConfigAttribInt(egl, display, config.config, EGL_SAMPLES);