{
m_fragShaderSource = shaderSource;
m_vertShaderSource =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location=0) in highp vec4 a_position;\n"
static const char* getTemplate (DiscardTemplate variant)
{
#define GLSL_SHADER_TEMPLATE_HEADER \
- "#version 140\n" \
+ "#version 310 es\n" \
"#extension GL_ARB_separate_shader_objects : enable\n" \
"#extension GL_ARB_shading_language_420pack : enable\n" \
"layout(location = 0) in mediump vec4 v_color;\n" \
IndexAccessType fragAccess)
{
std::ostringstream vtx;
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
vtx << "layout(location = 0) in highp vec4 a_position;\n";
vtx << "}\n";
std::ostringstream frag;
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
frag << "precision mediump int;\n";
std::ostringstream frag;
std::ostringstream& op = isVertexCase ? vtx : frag;
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
std::ostringstream frag;
std::ostringstream& op = isVertexCase ? vtx : frag;
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
int vecLen = getDataTypeScalarSize(varType);
const char* vecLenName = getIntUniformName(vecLen);
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
const char* matSizeName = getIntUniformName(numCols);
DataType vecType = getDataTypeFloatVec(numRows);
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
std::ostringstream frag;
std::ostringstream& op = isVertexCase ? vtx : frag;
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
std::vector<BaseUniformType> uniformInformations;
deUint32 locationCounter = 0;
- vtx << "#version 140\n";
+ vtx << "#version 310 es\n";
vtx << "#extension GL_ARB_separate_shader_objects : enable\n";
vtx << "#extension GL_ARB_shading_language_420pack : enable\n";
- frag << "#version 140\n";
+ frag << "#version 310 es\n";
frag << "#extension GL_ARB_separate_shader_objects : enable\n";
frag << "#extension GL_ARB_shading_language_420pack : enable\n";
std::ostringstream& op = m_isVertexCase ? vtx : frag;
std::string header =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n";
{
m_vertShaderSource = shaderSource;
m_fragShaderSource =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_color;\n"
{
m_fragShaderSource = shaderSource;
m_vertShaderSource =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
de::MovePtr<ShaderReturnCase> makeConditionalReturnInFuncCase (tcu::TestContext& context, const std::string& name, const std::string& description, ReturnMode returnMode, bool isVertex)
{
tcu::StringTemplate tmpl(
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = ${COORDLOC}) in ${COORDPREC} vec4 ${COORDS};\n"
tcu::StringTemplate tmpl(
inFunction
?
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = ${COORDLOC}) in ${COORDPREC} vec4 ${COORDS};\n"
" myfunc();\n"
"}\n"
:
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = ${COORDLOC}) in ${COORDPREC} vec4 ${COORDS};\n"
de::MovePtr<ShaderReturnCase> makeReturnInLoopCase (tcu::TestContext& context, const std::string& name, const std::string& description, bool isDynamicLoop, ReturnMode returnMode, bool isVertex)
{
tcu::StringTemplate tmpl(
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = ${COORDLOC}) in ${COORDPREC} vec4 ${COORDS};\n"
void ShaderReturnTests::init (void)
{
addChild(new ShaderReturnCase(m_testCtx, "single_return_vertex", "Single return statement in function", true,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
" v_color = getColor();\n"
"}\n", evalReturnAlways, DE_NULL));
addChild(new ShaderReturnCase(m_testCtx, "single_return_fragment", "Single return statement in function", false,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_coords;\n"
// Unconditional double return in function.
addChild(new ShaderReturnCase(m_testCtx, "double_return_vertex", "Unconditional double return in function", true,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
" v_color = getColor();\n"
"}\n", evalReturnAlways, DE_NULL));
addChild(new ShaderReturnCase(m_testCtx, "double_return_fragment", "Unconditional double return in function", false,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_coords;\n"
// Last statement in main.
addChild(new ShaderReturnCase(m_testCtx, "last_statement_in_main_vertex", "Return as a final statement in main()", true,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
" return;\n"
"}\n", evalReturnAlways, DE_NULL));
addChild(new ShaderReturnCase(m_testCtx, "last_statement_in_main_fragment", "Return as a final statement in main()", false,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_coords;\n"
// Unconditional return in infinite loop.
addChild(new ShaderReturnCase(m_testCtx, "return_in_infinite_loop_vertex", "Return in infinite loop", true,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
" return;\n"
"}\n", evalReturnAlways, new ReturnTestUniformSetup(UI_ZERO)));
addChild(new ShaderReturnCase(m_testCtx, "return_in_infinite_loop_fragment", "Return in infinite loop", false,
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_coords;\n"
static de::MovePtr<ShaderStructCase> createStructCase (tcu::TestContext& testCtx, const std::string& name, const std::string& description, bool isVertexCase, ShaderEvalFunc evalFunc, UniformSetupFunc uniformFunc, const LineStream& shaderSrc)
{
static std::string defaultVertSrc =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
" gl_Position = a_position;\n"
"}\n";
static std::string defaultFragSrc =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_color;\n"
if (isVertexCase)
{
spParams["HEADER"] =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in highp vec4 a_position;\n"
else
{
spParams["HEADER"] =
- "#version 140\n"
+ "#version 310 es\n"
"#extension GL_ARB_separate_shader_objects : enable\n"
"#extension GL_ARB_shading_language_420pack : enable\n"
"layout(location = 0) in mediump vec4 v_coords;\n"
std::ostringstream frag;
std::ostringstream& op = isVertex ? vtx : frag;
- vtx << "#version 140\n"
+ vtx << "#version 310 es\n"
<< "#extension GL_ARB_separate_shader_objects : enable\n"
<< "#extension GL_ARB_shading_language_420pack : enable\n"
<< "layout(location = 0) in highp vec4 a_position;\n"
<< "layout(location = 1) in highp vec4 a_coords;\n\n";
- frag << "#version 140\n"
+ frag << "#version 310 es\n"
<< "#extension GL_ARB_separate_shader_objects : enable\n"
<< "#extension GL_ARB_shading_language_420pack : enable\n"
<< "layout(location = 0) out mediump vec4 o_color;\n";