Hash :
25aef453
Author :
Date :
2017-01-29T16:15:44
Add new ESSL 3.10 pack/unpack builtins This adds new built-ins found in ESSL 3.10 section 8.4 Floating-Point Pack and Unpack Functions. This includes constant folding support and support for both GLSL and HLSL output. In HLSL all of these functions need to be emulated. BUG=angleproject:1730 TEST=angle_unittests TEST=dEQP-GLES31.functional.shaders.*pack*norm4x8* Change-Id: Ibed60286a366cd35c4faafd405e79af562a02a06 Reviewed-on: https://chromium-review.googlesource.com/434170 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
//
// Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ConstantFoldingTest.cpp:
// Utilities for constant folding tests.
//
#include "tests/test_utils/ConstantFoldingTest.h"
#include "angle_gl.h"
#include "compiler/translator/TranslatorESSL.h"
#include "GLSLANG/ShaderLang.h"
using namespace sh;
void ConstantFoldingExpressionTest::evaluateFloat(const std::string &floatExpression)
{
std::stringstream shaderStream;
shaderStream << "#version 310 es\n"
"precision mediump float;\n"
"out float my_FragColor;\n"
"void main()\n"
"{\n"
<< " my_FragColor = " << floatExpression << ";\n"
<< "}\n";
compileAssumeSuccess(shaderStream.str());
}
void ConstantFoldingExpressionTest::evaluateInt(const std::string &intExpression)
{
std::stringstream shaderStream;
shaderStream << "#version 310 es\n"
"precision mediump int;\n"
"out int my_FragColor;\n"
"void main()\n"
"{\n"
<< " my_FragColor = " << intExpression << ";\n"
<< "}\n";
compileAssumeSuccess(shaderStream.str());
}
void ConstantFoldingExpressionTest::evaluateUint(const std::string &uintExpression)
{
std::stringstream shaderStream;
shaderStream << "#version 310 es\n"
"precision mediump int;\n"
"out uint my_FragColor;\n"
"void main()\n"
"{\n"
<< " my_FragColor = " << uintExpression << ";\n"
<< "}\n";
compileAssumeSuccess(shaderStream.str());
}