From 2da04a989bc6f26e70ee3cd30a18476c8dbf77b6 Mon Sep 17 00:00:00 2001 From: Graeme Leese Date: Fri, 14 Jun 2019 18:01:34 +0100 Subject: [PATCH] Use float16 precision for testing mediump The precision requirements for mediump are not in the spec, they're just for the conformance test, so it makes sense to use the simplest thing. Allow the same error margins for mediump's 16-bit as for true 16-bit floats. This slightly increases the precision requirements on mediump exp but loosens them for atan. Note, however, that the requirements for fp16 are still stricter than for mediump because of the FloatFormat involved. fp16 requires support for a wider exponent range than mediump. Components: Vulkan Affects: dEQP-VK.glsl.builtin.precision.exp*.mediump.* dEQP-VK.glsl.builtin.precision.atan*.mediump.* Change-Id: I600a53984ba6a4f624bbb1525636f392d74ae96f (cherry picked from commit b7dea11e6a395552a1423009c33d5518d9a0b2ec) --- .../shaderexecutor/vktShaderBuiltinPrecisionTests.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp index bad8cb9..903e9ba 100644 --- a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp +++ b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp @@ -921,19 +921,16 @@ struct EvalContext EvalContext (const FloatFormat& format_, Precision floatPrecision_, Environment& env_, - int callDepth_, - bool isShaderFloat16Int8_ = false) + int callDepth_) : format (format_) , floatPrecision (floatPrecision_) , env (env_) - , callDepth (callDepth_) - , isShaderFloat16Int8 (isShaderFloat16Int8_) {} + , callDepth (callDepth_) {} FloatFormat format; Precision floatPrecision; Environment& env; int callDepth; - bool isShaderFloat16Int8; }; /*--------------------------------------------------------------------*//*! @@ -1863,7 +1860,7 @@ protected: funEnv.bind(*m_var3, args.d); { - EvalContext funCtx(ctx.format, ctx.floatPrecision, funEnv, ctx.callDepth, ctx.isShaderFloat16Int8); + EvalContext funCtx(ctx.format, ctx.floatPrecision, funEnv, ctx.callDepth); for (size_t ndx = 0; ndx < m_body.size(); ++ndx) m_body[ndx]->execute(funCtx); @@ -2575,8 +2572,7 @@ double ExpFunc >::precision (const EvalContext& ctx, do return ctx.format.ulp(ret, 3.0 + 2.0 * deAbs(x)); case glu::PRECISION_MEDIUMP: case glu::PRECISION_LAST: - return ctx.isShaderFloat16Int8 ? ctx.format.ulp(ret, 1.0 + 2.0 * deAbs(x)) : - ctx.format.ulp(ret, 2.0 + 2.0 * deAbs(x)); + return ctx.format.ulp(ret, 1.0 + 2.0 * deAbs(x)); default: DE_FATAL("Impossible"); } @@ -2964,7 +2960,7 @@ protected: if (ctx.floatPrecision == glu::PRECISION_HIGHP) return ctx.format.ulp(ret, 4096.0); else - return ctx.format.ulp(ret, ctx.isShaderFloat16Int8 ? 5.0 : 2.0); + return ctx.format.ulp(ret, 5.0); } }; @@ -5635,7 +5631,7 @@ tcu::TestStatus BuiltinPrecisionCaseTestInstance::iterate (void) env.lookup(*m_variables.in3) = convert(fmt, round(fmt, inputs.in3[valueNdx])); { - EvalContext ctx (fmt, m_caseCtx.precision, env, 0, m_context.getShaderFloat16Int8Features().shaderFloat16 != 0u); + EvalContext ctx (fmt, m_caseCtx.precision, env, 0); m_stmt->execute(ctx); switch (outCount) -- 2.7.4