This change replaces usage of vsnprintf with tcu::TestLog.
Components: OpenGL
VK-GL-CTS issue: 482
Affects:
KHR-GL43.compute_shader.*
KHR-GL43.program_interface_query.*
KHR-GL42.shader_image_load_store.*
Change-Id: I4460f5f5ae37608735322a5735a526f6c2f0f941
typedef UVec4 uvec4;
typedef Mat4 mat4;
-static tcu::TestLog* currentLog;
-
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
const char* const kGLSLVer = "#version 430 core\n";
class ComputeShaderBase : public deqp::SubcaseBase
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_TESS_CONTROL_SHADER:
- Output("*** Tessellation Control Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_TESS_EVALUATION_SHADER:
- Output("*** Tessellation Evaluation Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_GEOMETRY_SHADER:
- Output("*** Geometry Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
break;
}
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
{
if (!ColorEqual(display[j * w + i], expected, g_color_eps))
{
- Output("Color at (%d, %d) is [%f, %f, %f, %f] should be [%f, %f, %f, %f].\n", x + i, y + j,
- display[j * w + i].x(), display[j * w + i].y(), display[j * w + i].z(),
- display[j * w + i].w(), expected.x(), expected.y(), expected.z(), expected.w());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Color at (" << (x + i) << ", " << (y + j) << ") is ["
+ << display[j * w + i].x() << ", " << display[j * w + i].y() << ", " << display[j * w + i].z()
+ << ", " << display[j * w + i].w() << "] should be [" << expected.x() << ", " << expected.y()
+ << ", " << expected.z() << ", " << expected.w() << "]." << tcu::TestLog::EndMessage;
return false;
}
}
const int idx = y * width + x;
if (!ColorEqual(fb[idx], lb, g_color_eps))
{
- Output("First bad color (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "First bad color (" << x << ", " << y << "): " << fb[idx].x() << " "
+ << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
status = false;
}
}
const int idx = y * width + x;
if (!ColorEqual(fb[idx], rb, g_color_eps))
{
- Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+ << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
status = false;
}
}
const int idx = y * width + x;
if (!ColorEqual(fb[idx], rt, g_color_eps))
{
- Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+ << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
status = false;
}
}
const int idx = y * width + x;
if (!ColorEqual(fb[idx], lt, g_color_eps))
{
- Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+ << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
status = false;
}
}
const int idx = y * width + x;
if (!ColorEqual(fb[idx], vec3(0), g_color_eps))
{
- Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+ << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
status = false;
}
}
const int idx = y * width + x;
if (!ColorEqual(fb[idx], vec3(0), g_color_eps))
{
- Output("Bad color at (%d, %d): %f %f %f\n", x, y, fb[idx].x(), fb[idx].y(), fb[idx].z());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad color at (" << x << ", " << y << "): " << fb[idx].x() << " "
+ << fb[idx].y() << " " << fb[idx].z() << tcu::TestLog::EndMessage;
status = false;
}
}
glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
if (v[0] != 1 || v[1] != 1 || v[2] != 1)
{
- Output("Got %d, %d, %d, expected: 1, 1, 1 in GL_COMPUTE_WORK_GROUP_SIZE check", v[0], v[1], v[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Got " << v[0] << ", " << v[1] << ", " << v[2]
+ << ", expected: 1, 1, 1 in GL_COMPUTE_WORK_GROUP_SIZE check" << tcu::TestLog::EndMessage;
return ERROR;
}
glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
if (v[0] != local_size_x || v[1] != local_size_y || v[2] != local_size_z)
{
- Output("GL_COMPUTE_LOCAL_WORK_SIZE is (%d %d %d) should be (%d %d %d)\n", v[0], v[1], v[2], local_size_x,
- local_size_y, local_size_z);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_COMPUTE_LOCAL_WORK_SIZE is (" << v[0] << " " << v[1] << " " << v[2]
+ << ") should be (" << local_size_x << " " << local_size_y << " " << local_size_z << ")"
+ << tcu::TestLog::EndMessage;
return false;
}
const int index = z * local_size_x * local_size_y + y * local_size_x + x;
if (!IsEqual(data[index], uvec4(x, y, z, 0)))
{
- Output("Invalid data at offset %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at offset " << index << tcu::TestLog::EndMessage;
ret = false;
}
}
glGetActiveUniformBlockiv(m_program, index, GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER, &p);
if (p == GL_FALSE)
{
- Output("UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER should be TRUE.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER should be TRUE."
+ << tcu::TestLog::EndMessage;
return false;
}
}
{
if (!IsEqual(data[index * 12 + i], vec4(static_cast<float>(index * 12 + i))))
{
- Output("Incorrect data at offset %d.\n", index * 12 + i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Incorrect data at offset "
+ << index * 12 + i << "." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (!IsEqual(buffer_data[index], vec4(123.0f)))
{
- Output("Incorrect data at index %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect data at index " << index << "." << tcu::TestLog::EndMessage;
return false;
}
}
const vec4 c = vec4(float(y + x) / 255.0f);
if (!ColorEqual(display[y * kWidth + x], c, g_color_eps))
{
- Output("Got %f, %f, %f, %f, expected %f, %f, %f, %f at %d, %d", display[y * kWidth + x].x(),
- display[y * kWidth + x].y(), display[y * kWidth + x].z(), display[y * kWidth + x].w(), c.x(),
- c.y(), c.z(), c.w(), x, y);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Got " << display[y * kWidth + x].x() << ", "
+ << display[y * kWidth + x].y() << ", " << display[y * kWidth + x].z() << ", "
+ << display[y * kWidth + x].w() << ", expected " << c.x() << ", " << c.y() << ", " << c.z()
+ << ", " << c.w() << " at " << x << ", " << y << tcu::TestLog::EndMessage;
return false;
}
}
if (!pixelFormat.alphaBits)
{
- OutputNotSupported("Test requires default framebuffer alpha bits");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Test requires default framebuffer alpha bits" << tcu::TestLog::EndMessage;
return NO_ERROR;
}
if (p[0] == GL_FALSE || p[1] == GL_FALSE)
{
- Output("ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER should be TRUE.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER should be TRUE."
+ << tcu::TestLog::EndMessage;
return false;
}
{
if (data[i] != i)
{
- Output("Value at index %d is %d should be %d.\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Value at index " << i << " is "
+ << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
return false;
}
}
glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(GLuint), &value);
if (value != kSize)
{
- Output("Final atomic counter value (buffer 0) is %d should be %d.\n", value, kSize);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Final atomic counter value (buffer 0) is "
+ << value << " should be " << kSize << "." << tcu::TestLog::EndMessage;
return false;
}
glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(GLuint), &value);
if (value != 0)
{
- Output("Final atomic counter value (buffer 1) is %d should be %d.\n", value, 0);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Final atomic counter value (buffer 1) is "
+ << value << " should be 0." << tcu::TestLog::EndMessage;
return false;
}
{
if (!IsEqual(data[i], uvec4(i)))
{
- Output("Invalid value at index %d.\n", i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid value at index " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(GLuint), &value);
if (value != 16)
{
- Output("Final atomic counter value is %d should be %d.\n", value, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Final atomic counter value is " << value
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != 1)
{
- Output("Data is %d should be 1.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != 1)
{
- Output("Data is %d should be 1.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (!IsEqual(data[index], uvec4(num_groups.x(), num_groups.y(), num_groups.z(), 0)))
{
- Output("gl_NumWorkGroups: Invalid data at index %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "gl_NumWorkGroups: Invalid data at index " << index << "."
+ << tcu::TestLog::EndMessage;
return false;
}
}
{
if (!IsEqual(data[index], uvec4(local_size.x(), local_size.y(), local_size.z(), 0)))
{
- Output("gl_WorkGroupSize: Invalid data at index %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "gl_WorkGroupSize: Invalid data at index " << index << "."
+ << tcu::TestLog::EndMessage;
return false;
}
}
expected.z() /= local_size.z();
if (!IsEqual(data[index], uvec4(expected.x(), expected.y(), expected.z(), 0)))
{
- Output("gl_WorkGroupID: Invalid data at index %d.\n", index);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "gl_WorkGroupID: Invalid data at index "
+ << index << "." << tcu::TestLog::EndMessage;
return false;
}
}
expected.z() %= local_size.z();
if (!IsEqual(data[index], uvec4(expected.x(), expected.y(), expected.z(), 0)))
{
- Output("gl_LocalInvocationID: Invalid data at index %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "gl_LocalInvocationID: Invalid data at index " << index << "."
+ << tcu::TestLog::EndMessage;
return false;
}
}
local_size.y() * num_groups.y());
if (!IsEqual(data[index], uvec4(expected.x(), expected.y(), expected.z(), 0)))
{
- Output("gl_GlobalInvocationID: Invalid data at index %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "gl_GlobalInvocationID: Invalid data at index " << index << "."
+ << tcu::TestLog::EndMessage;
return false;
}
}
(coord.z() % local_size.z()) * local_size.x() * local_size.y();
if (!IsEqual(data[index], uvec4(expected)))
{
- Output("gl_LocalInvocationIndex: Invalid data at index %d.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "gl_LocalInvocationIndex: Invalid data at index " << index << "."
+ << tcu::TestLog::EndMessage;
return false;
}
}
glGetIntegeri_v(target, c, &i);
if (i < min_values[c])
{
- Output("Is %d should be at least %d.\n", i, min_values[c]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Is " << i << " should be at least "
+ << min_values[c] << "." << tcu::TestLog::EndMessage;
return false;
}
}
glGetInteger64i_v(target, c, &i64);
if (i64 < static_cast<GLint64>(min_values[c]))
{
- Output("Is %d should be at least %d.\n", static_cast<GLint>(i64), min_values[c]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is " << static_cast<GLint>(i64) << " should be at least "
+ << min_values[c] << "." << tcu::TestLog::EndMessage;
return false;
}
}
glGetFloati_v(target, c, &f);
if (f < static_cast<GLfloat>(min_values[c]))
{
- Output("Is %d should be at least %d.\n", static_cast<GLint>(f), min_values[c]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is " << static_cast<GLint>(f) << " should be at least "
+ << min_values[c] << "." << tcu::TestLog::EndMessage;
return false;
}
}
glGetDoublei_v(target, c, &d);
if (d < static_cast<GLdouble>(min_values[c]))
{
- Output("Is %d should be at least %d.\n", static_cast<GLint>(d), min_values[c]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is " << static_cast<GLint>(d) << " should be at least "
+ << min_values[c] << "." << tcu::TestLog::EndMessage;
return false;
}
}
glGetBooleani_v(target, c, &b);
if (b == GL_FALSE)
{
- Output("Is GL_FALSE should be at least GL_TRUE.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is GL_FALSE should be at least GL_TRUE." << tcu::TestLog::EndMessage;
return false;
}
}
glGetIntegerv(target, &i);
if (i < min_value)
{
- Output("Is %d should be at least %d.\n", i, min_value);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Is " << i << " should be at least "
+ << min_value << "." << tcu::TestLog::EndMessage;
return false;
}
glGetInteger64v(target, &i64);
if (static_cast<GLint>(i64) < min_value)
{
- Output("Is %d should be at least %d.\n", static_cast<GLint>(i64), min_value);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is " << static_cast<GLint>(i64) << " should be at least " << min_value
+ << "." << tcu::TestLog::EndMessage;
return false;
}
glGetFloatv(target, &f);
if (f < static_cast<GLfloat>(min_value))
{
- Output("Is %d should be at least %d.\n", static_cast<GLint>(f), min_value);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is " << static_cast<GLint>(f) << " should be at least " << min_value << "."
+ << tcu::TestLog::EndMessage;
return false;
}
glGetDoublev(target, &d);
if (d < static_cast<GLdouble>(min_value))
{
- Output("Is %d should be at least %d.\n", static_cast<GLint>(d), min_value);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Is " << static_cast<GLint>(d) << " should be at least " << min_value << "."
+ << tcu::TestLog::EndMessage;
return false;
}
glGetBooleanv(target, &b);
if (b != (min_value ? GL_TRUE : GL_FALSE))
{
- Output("Is %d should be %d.\n", b, (min_value ? GL_TRUE : GL_FALSE));
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Is " << b << " should be "
+ << (min_value ? GL_TRUE : GL_FALSE) << "." << tcu::TestLog::EndMessage;
return false;
}
glGetShaderiv(sh1, GL_SHADER_TYPE, &type);
if (static_cast<GLenum>(type) != GL_COMPUTE_SHADER)
{
- Output("SHADER_TYPE should be COMPUTE_SHADER.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "SHADER_TYPE should be COMPUTE_SHADER." << tcu::TestLog::EndMessage;
glDeleteShader(sh1);
return false;
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
{
- Output("Invalid value!\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid value!" << tcu::TestLog::EndMessage;
res = false;
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
{
- Output("Invalid value!\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid value!" << tcu::TestLog::EndMessage;
res = false;
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(vec4), &data[0]);
if (!IsEqual(data, vec4(1.0f, 2.0f, 3.0f, 4.0f)))
{
- Output("Invalid value!\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid value!" << tcu::TestLog::EndMessage;
res = false;
}
{
if (data[i] != 1)
{
- Output("Data at index %d is %d should be %d.\n", i, data[i], 1);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+ << data[i] << " should be 1." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (!IsEqual(data[i], vec4(static_cast<float>(i))))
{
- Output("Invalid data at index %d.\n", i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (data[i] != i)
{
- Output("Data at index %d is %d should be %d.\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+ << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
return false;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
if (data != 1)
{
- Output("Data is %d should be 1.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
if (data != 2)
{
- Output("Data is %d should be 2.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 2." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
if (data != 2)
{
- Output("Data is %d should be 2.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 2." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(int), &data);
if (data != 1)
{
- Output("Data is %d should be 1.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != i)
{
- Output("Data at index %d is %d should be %d.\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+ << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != i)
{
- Output("Data at index %d is %d should be %d.\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+ << data[i] << " should be " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (udata[i] != 7)
{
- Output("uData at index %d is %d should be %d.\n", i, udata[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << udata[i] << " should be 7." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (idata[i] != 7)
{
- Output("iData at index %d is %d should be %d.\n", i, idata[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at index " << i << " is "
+ << idata[i] << " should be 7." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (udata[i] != 7)
{
- Output("uData at index %d is %d should be %d.\n", i, udata[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << udata[i] << " should be 7." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (idata[i] != 7)
{
- Output("iData at index %d is %d should be %d.\n", i, idata[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << idata[i] << " should be 7." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (getWindowWidth() > 100 && data[i] != 0x0f)
{
- Output("Data at index %d is %d should be %d.\n", i, data[i], 0x0f);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data at index " << i << " is " << data[i] << " should be " << 0x0f
+ << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (!ColorEqual(data[i], vec4(0.25f, 0.5f, 0.75f, 1.0f), g_color_eps))
{
- Output("Invalid data at texture.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at texture." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 4)
{
- Output("Data is: %d should be: %d.\n", data[i], 2);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is " << data[i]
+ << " should be 2." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != i)
{
- Output("Data is: %d should be: %d.\n", data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is " << data[i]
+ << " should be " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 5)
{
- Output("Data is: %d should be: %d.\n", data[i], 5);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is: " << data[i]
+ << " should be: 5." << tcu::TestLog::EndMessage;
return ERROR;
}
if (data[i + 256] != 7)
{
- Output("Data is: %d should be: %d.\n", data[i + 256], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is: " << data[i + 256]
+ << " should be: 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data[0](0, 0));
if (data[0] != translationMatrix(vec3(10.0f, 20.0f, 30.0f)))
{
- Output("Data is incorrect.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is incorrect." << tcu::TestLog::EndMessage;
return ERROR;
}
if (data[1] != transpose(translationMatrix(vec3(10.0f, 20.0f, 30.0f))))
{
- Output("Data is incorrect.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is incorrect." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(data), data);
if (data[3] != 4)
{
- Output("Data is: %d should be: %d.\n", data[3], 4);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is: " << data[3] << " should be: 4." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (!IsEqual(data[i], vec4(1, 1, 0, 1)))
{
- Output("Invalid data at index %d.\n", i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), data);
if (memcmp(data, in_data, sizeof(data)) != 0)
{
- Output("Data in shader storage buffer is incorrect.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data in shader storage buffer is incorrect."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(data), data);
if (memcmp(data, ref_data, sizeof(data)) != 0)
{
- Output("Data in xfb buffer is incorrect.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data in xfb buffer is incorrect." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (!IsEqual(data[i], vec4(0, 1, 0, 1)))
{
- Output("Invalid data at index %d.\n", i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (!IsEqual(data[i], vec4(1.0f)))
{
- Output("Invalid data at index %d.\n", i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (!IsEqual(data[i], expected[i]))
{
- Output("Invalid data at index %d.\n", i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Invalid data at index " << i << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
if (data != (index + 1) * 6)
{
- Output("Data is %d should be %d.\n", data, (index + 1) * 6);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data is " << data << " should be "
+ << (index + 1) * 6 << "." << tcu::TestLog::EndMessage;
result = false;
}
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != expected[i])
{
- Output("Data at index %d is %f should be %f.\n", i, data, expected[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data at index " << i << " is " << data << " should be "
+ << expected[i] << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != 1)
{
- Output("Data is %d should be 1.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != 1)
{
- Output("Data is %d should be 1.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (fabs(data[i] - expected[i]) > g_color_eps.x())
{
- Output("Data at index %d is %f should be %f.\n", i, data[i], expected[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data at index " << i << " is " << data[i] << " should be "
+ << expected[i] << "." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != 16)
{
- Output("Data is %d should be 16.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(data), &data);
if (data != 16 && m_context.getRenderContext().getRenderTarget().getDepthBits() != 0)
{
- Output("Data is %d should be 16.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
else if (data != 32 && m_context.getRenderContext().getRenderTarget().getDepthBits() == 0)
{
- Output("Data is %d should be 32.\n", data);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is " << data << " should be 32." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glDispatchCompute(1, 2, 3);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by DispatchCompute or\n"
- "DispatchComputeIndirect if there is no active program for the compute\n"
- "shader stage.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+ << "DispatchComputeIndirect if there is no active program for the compute\n"
+ << "shader stage." << tcu::TestLog::EndMessage;
return ERROR;
}
glDeleteBuffers(1, &buffer);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by DispatchCompute or\n"
- "DispatchComputeIndirect if there is no active program for the compute\n"
- "shader stage.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+ << "DispatchComputeIndirect if there is no active program for the compute\n"
+ << "shader stage." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glDispatchCompute(1, 2, 3);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by DispatchCompute or\n"
- "DispatchComputeIndirect if there is no active program for the compute\n"
- "shader stage.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+ << "DispatchComputeIndirect if there is no active program for the compute\n"
+ << "shader stage." << tcu::TestLog::EndMessage;
return ERROR;
}
glDeleteBuffers(1, &buffer);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by DispatchCompute or\n"
- "DispatchComputeIndirect if there is no active program for the compute\n"
- "shader stage.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION is generated by DispatchCompute or\n"
+ << "DispatchComputeIndirect if there is no active program for the compute\n"
+ << "shader stage." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glDispatchCompute(x + 1, 1, 1);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
- "<num_groups_y> or <num_groups_z> is greater than the value of\n"
- "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
+ << "<num_groups_y> or <num_groups_z> is greater than the value of\n"
+ << "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension." << tcu::TestLog::EndMessage;
return ERROR;
}
glDispatchCompute(1, y + 1, 1);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
- "<num_groups_y> or <num_groups_z> is greater than the value of\n"
- "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
+ << "<num_groups_y> or <num_groups_z> is greater than the value of\n"
+ << "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension." << tcu::TestLog::EndMessage;
return ERROR;
}
glDispatchCompute(1, 1, z + 1);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
- "<num_groups_y> or <num_groups_z> is greater than the value of\n"
- "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchCompute if any of <num_groups_x>,\n"
+ << "<num_groups_y> or <num_groups_z> is greater than the value of\n"
+ << "MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension." << tcu::TestLog::EndMessage;
return ERROR;
}
glDispatchComputeIndirect(-2);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
- "less than zero or not a multiple of four.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
+ << "less than zero or not a multiple of four." << tcu::TestLog::EndMessage;
return ERROR;
}
glDispatchComputeIndirect(3);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
- "less than zero or not a multiple of four.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by DispatchComputeIndirect if <indirect> is\n"
+ << "less than zero or not a multiple of four." << tcu::TestLog::EndMessage;
return ERROR;
}
glDispatchComputeIndirect(16);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
- "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
- "beyond the end of the bound buffer object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
+ << "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
+ << "beyond the end of the bound buffer object." << tcu::TestLog::EndMessage;
return ERROR;
}
glDispatchComputeIndirect(0);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
- "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
- "beyond the end of the bound buffer object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_OPERATION is generated by DispatchComputeIndirect if no buffer is\n"
+ << "bound to DISPATCH_INDIRECT_BUFFER or if the command would source data\n"
+ << "beyond the end of the bound buffer object." << tcu::TestLog::EndMessage;
return ERROR;
}
glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
- "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
- "successfully, or has been linked but contains no compute shaders.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
+ << "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
+ << "successfully, or has been linked but contains no compute shaders." << tcu::TestLog::EndMessage;
return ERROR;
}
glGetProgramiv(m_program, GL_COMPUTE_WORK_GROUP_SIZE, v);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
- "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
- "successfully, or has been linked but contains no compute shaders.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION is generated by GetProgramiv if <pname> is\n"
+ << "COMPUTE_LOCAL_WORK_SIZE and either the program has not been linked\n"
+ << "successfully, or has been linked but contains no compute shaders." << tcu::TestLog::EndMessage;
return ERROR;
}
glDeleteProgram(m_program);
glGetProgramiv(m_program, GL_LINK_STATUS, &status);
if (status == GL_TRUE)
{
- Output("LinkProgram will fail if <program> contains a combination of compute and\n"
- "non-compute shaders.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "LinkProgram will fail if <program> contains a combination"
+ << " of compute and\n non-compute shaders.\n"
+ << tcu::TestLog::EndMessage;
return ERROR;
}
GLchar log[1024];
glGetShaderInfoLog(sh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Compilation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail." << tcu::TestLog::EndMessage;
return false;
}
if (status == GL_FALSE)
{
glDeleteProgram(p);
- Output("CS0 compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "CS0 compilation should be ok." << tcu::TestLog::EndMessage;
return false;
}
}
if (status == GL_FALSE)
{
glDeleteProgram(p);
- Output("CS1 compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "CS1 compilation should be ok." << tcu::TestLog::EndMessage;
return false;
}
}
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetProgramiv(p, GL_LINK_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Link operation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
return false;
}
{
if (data[i] != (i + 25))
{
- Output("Data at index %u is %u should be %u.\n", i, data[i], i + 25);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data at index " << i << " is " << data[i] << " should be " << i + 25
+ << "." << tcu::TestLog::EndMessage;
error = ERROR;
}
}
void ComputeShaderTests::init()
{
using namespace deqp;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "simple-compute", TestSubcase::Create<SimpleCompute>));
addChild(new TestSubcase(m_context, "one-work-group", TestSubcase::Create<BasicOneWorkGroup>));
addChild(new TestSubcase(m_context, "resource-ubo", TestSubcase::Create<BasicResourceUBO>));
T2DA
};
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
const char* const kGLSLVer = "#version 310 es";
const char* const kGLSLSIA = NL "#extension GL_OES_shader_image_atomic : require";
const char* const kGLSLPrec =
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[i]).c_str(),
- ToString(expected_value).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str() << "." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (always)
{
- Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[i]).c_str(),
- ToString(expected_value).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str() << "." << tcu::TestLog::EndMessage;
}
}
return true;
fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
{
-
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
- expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << ", " << y
+ << "). Color is (" << fb[i + 0] / g_color_max[0] << ", " << fb[i + 1] / g_color_max[1] << ", "
+ << fb[i + 2] / g_color_max[2] << "). Color should be (" << expected[0] << ", " << expected[1]
+ << ", " << expected[2] << ")." << tcu::TestLog::EndMessage;
return false;
}
}
glGetShaderInfoLog(shader, sizeof(log), &length, log);
if (length > 1)
{
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
return false;
}
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
return false;
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
if (!LinkProgram(p))
{
if (src_vs)
- Output("%s%s\n", hvs.c_str(), src_vs);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << hvs.c_str() << src_vs << tcu::TestLog::EndMessage;
if (src_fs)
- Output("%s%s\n", hfs.c_str(), src_fs);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << hfs.c_str() << src_fs << tcu::TestLog::EndMessage;
return p;
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
if (!LinkProgram(p))
{
if (!cs.empty())
- Output("%s%s\n", hcs.c_str(), cs.c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << hcs.c_str() << cs.c_str() << tcu::TestLog::EndMessage;
return p;
}
{
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n%s\n%s\n%s\n", log, src3[0], src3[1], src3[2]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << "\n"
+ << src3[0] << "\n"
+ << src3[1] << "\n"
+ << src3[2] << tcu::TestLog::EndMessage;
}
return p;
}
glGetIntegeri_v(GL_IMAGE_BINDING_NAME, unit, &i);
if (static_cast<GLuint>(i) != texture)
{
- Output("GL_IMAGE_BINDING_NAME is %d should be %d.\n", i, texture);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_NAME is " << i
+ << " should be " << texture << "." << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_LEVEL, unit, &i);
if (i != level)
{
- Output("GL_IMAGE_BINDING_LEVEL is %d should be %d.\n", i, level);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LEVEL is " << i
+ << " should be " << level << "." << tcu::TestLog::EndMessage;
return false;
}
glGetBooleani_v(GL_IMAGE_BINDING_LAYERED, unit, &b);
if (i != layered || b != layered)
{
- Output("GL_IMAGE_BINDING_LAYERED is %d should be %d.\n", i, layered);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LAYERED is " << i
+ << " should be " << layered << "." << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_LAYER, unit, &i);
if (i != layer)
{
- Output("GL_IMAGE_BINDING_LAYER is %d should be %d.\n", i, layer);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LAYER is " << i
+ << " should be " << layer << "." << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_ACCESS, unit, &i);
if (static_cast<GLenum>(i) != access)
{
- Output("GL_IMAGE_BINDING_ACCESS is %d should be %d.\n", i, access);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_ACCESS is " << i
+ << " should be " << access << "." << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_FORMAT, unit, &i);
if (static_cast<GLenum>(i) != format)
{
- Output("GL_IMAGE_BINDING_FORMAT is %d should be %d.\n", i, format);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_FORMAT is " << i
+ << " should be " << format << "." << tcu::TestLog::EndMessage;
return false;
}
{
if (!CheckMax(GL_MAX_IMAGE_UNITS, 4))
{
- Output("GL_MAX_IMAGE_UNITS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_IMAGE_UNITS value is invalid." << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, 4))
{
- Output("GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_VERTEX_IMAGE_UNIFORMS, 0))
{
- Output("GL_MAX_VERTEX_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_VERTEX_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, 0))
{
- Output("GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_COMBINED_IMAGE_UNIFORMS, 4))
{
- Output("GL_MAX_COMBINED_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_COMBINED_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_COMPUTE_IMAGE_UNIFORMS, 4))
{
- Output("GL_MAX_COMPUTE_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_COMPUTE_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
{
if (!CheckBinding(index, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI))
{
- Output("Binding point %d has invalid default state.\n", index);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Binding point " << index
+ << " has invalid default state." << tcu::TestLog::EndMessage;
status = false;
}
}
glGetIntegeri_v(GL_IMAGE_BINDING_NAME, index, &name);
if (name != 0)
{
- Output("Binding point %d should be set to 0 after texture deletion.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Binding point " << index
+ << " should be set to 0 after texture deletion." << tcu::TestLog::EndMessage;
status = false;
}
if (!CheckBinding(index, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI))
glGetTexParameteriv(GL_TEXTURE_2D, GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, &i);
if (i != GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE)
{
- Output("GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
- "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL.");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
+ << "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glGetTexParameterfv(GL_TEXTURE_2D, GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, &f);
if (static_cast<GLenum>(f) != GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE)
{
- Output("GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
- "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL.");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
+ << "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str()
+ << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+ << tcu::TestLog::EndMessage;
glDeleteTextures(1, &texture);
glUseProgram(0);
glDeleteProgram(program);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str()
+ << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+ << tcu::TestLog::EndMessage;
glDeleteTextures(1, &texture);
glUseProgram(0);
glDeleteProgram(program);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str()
+ << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+ << tcu::TestLog::EndMessage;
glUseProgram(0);
glDeleteProgram(program);
glDeleteTextures(1, &texture);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str()
+ << ". Format is: " << FormatEnumToString(internalformat).c_str() << ". Unit is: " << unit << "."
+ << tcu::TestLog::EndMessage;
glUseProgram(0);
glDeleteProgram(program);
glDeleteTextures(1, &texture);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s.\n", i, ToString(map_data[i]).c_str(),
- ToString(expected_value).c_str(), FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i]).c_str()
+ << ". Value should be: " << ToString(expected_value).c_str()
+ << ". Format is: " << FormatEnumToString(internalformat).c_str() << "." << tcu::TestLog::EndMessage;
glDeleteTextures(2, texture);
glUseProgram(0);
glDeleteProgram(program);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+ << " format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glDeleteTextures(8, textures);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+ << " format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glDeleteTextures(8, textures);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+ << " format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glUseProgram(0);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat).c_str()
+ << " format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glUseProgram(0);
if (!Equal(out_data[i], ivec4(10, 10, 10, 10), 0))
{
status = false;
- Output("[%d] Atomic operation check failed. (operation/target coded: %s) \n", i,
- ToString(out_data[i]).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i
+ << "] Atomic operation check failed. (operation/target coded: " << ToString(out_data[i]).c_str()
+ << ")" << tcu::TestLog::EndMessage;
}
}
if (!Equal(out_data[i], ivec4(0, 1, 0, 1), 0))
{
status = false;
- Output("[%d] load/store operation check failed. (%s) \n", i, ToString(out_data[i]).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] load/store operation check failed. ("
+ << ToString(out_data[i]).c_str() << ")" << tcu::TestLog::EndMessage;
}
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (!Equal(out_data[i], ivec4(0, 1, 0, 1), 0))
{
status = false;
- Output("[%d] Atomic operation check failed. (%s) \n", i, ToString(out_data[i]).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Atomic operation check failed. ("
+ << ToString(out_data[i]).c_str() << ")" << tcu::TestLog::EndMessage;
}
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (!Equal(out_data[i], ivec4(5, 0, 0, 2), 0))
{
status = false;
- Output("[%d] Check failed. Received: %s instead of: %s \n", i, ToString(out_data[i]).c_str(),
- ToString(ivec4(5, 0, 0, 2)).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i
+ << "] Check failed. Received: " << ToString(out_data[i]).c_str()
+ << " instead of: " << ToString(ivec4(5, 0, 0, 2)).c_str() << tcu::TestLog::EndMessage;
}
}
if (!Equal(out_data[i], ivec4(5, 0, 0, 2), 0))
{
status = false;
- Output("[%d] Check failed. Received: %s instead of: %s \n", i, ToString(out_data[i]).c_str(),
- ToString(ivec4(5, 0, 0, 2)).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i
+ << "] Check failed. Received: " << ToString(out_data[i]).c_str()
+ << " instead of: " << ToString(ivec4(5, 0, 0, 2)).c_str() << tcu::TestLog::EndMessage;
}
}
if (!Equal(map_data[0], ivec4(0, 1, 0, 1), 0))
{
- Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[0]).c_str(),
- ToString(ivec4(0, 1, 0, 1)).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[0]).c_str()
+ << ". Value should be: " << ToString(ivec4(0, 1, 0, 1)).c_str() << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
if (!status)
{
- Output("glUniform* should generate INVALID_OPERATION if the location refers to an image variable.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glUniform* should generate INVALID_OPERATION "
+ << "if the location refers to an image variable." << tcu::TestLog::EndMessage;
return ERROR;
}
if (!status)
{
- Output(
- "glProgramUniform* should generate INVALID_OPERATION if the location refers to an image variable.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glProgramUniform* should generate INVALID_OPERATION "
+ << "if the location refers to an image variable." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(max_image_units, m_texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <unit> is greater than or equal to the value of "
- "MAX_IMAGE_UNITS.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <unit> "
+ << "is greater than or equal to the value of MAX_IMAGE_UNITS." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(0, 123, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <texture> is not the name of an existing texture "
- "object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <texture> "
+ << "is not the name of an existing texture object." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <format> is not a legal format.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <format> "
+ << "is not a legal format." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture, -1, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <level> is less than zero.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <level> "
+ << "is less than zero." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture, 0, GL_FALSE, -1, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <layer> is less than zero.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <layer> "
+ << "is less than zero." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture2, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("BindImageTexture should generate INVALID_OPERATION if <texture> is a mutable texture object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BindImageTexture should generate INVALID_VALUE if <texture> "
+ << "is a mutable texture object." << tcu::TestLog::EndMessage;
return ERROR;
}
GLchar log[1024];
glGetShaderInfoLog(sh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Compilation should fail [compute shader].\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail [compute shader]." << tcu::TestLog::EndMessage;
return false;
}
const char* const fsVer = "#version 310 es" NL "precision highp float;";
glCompileShader(fsh);
glGetShaderInfoLog(fsh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
-
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
glDeleteShader(fsh);
if (status == GL_TRUE)
{
- Output("Compilation should fail [fragment shader].\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail [fragment shader]." << tcu::TestLog::EndMessage;
return false;
}
if (status == GL_FALSE)
{
glDeleteProgram(p);
- Output("VS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "VS compilation should be ok." << tcu::TestLog::EndMessage;
return false;
}
glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
glDeleteProgram(p);
- Output("FS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "FS compilation should be ok." << tcu::TestLog::EndMessage;
return false;
}
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
glGetProgramiv(p, GL_LINK_STATUS, &status);
glDeleteProgram(p);
if (status == GL_TRUE)
{
- Output("Link operation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
return false;
}
void ShaderImageLoadStoreTests::init()
{
using namespace deqp;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-api-get", TestSubcase::Create<BasicAPIGet>));
addChild(new TestSubcase(m_context, "basic-api-bind", TestSubcase::Create<BasicAPIBind>));
addChild(new TestSubcase(m_context, "basic-api-barrier", TestSubcase::Create<BasicAPIBarrier>));
bindrangesize
};
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
const char* const kGLSLVer = "#version 310 es" NL "precision highp float;" NL "precision highp int;";
class ShaderStorageBufferObjectBase : public deqp::SubcaseBase
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
- break;
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
}
GLint length;
glGetShaderiv(shaders[i], GL_SHADER_SOURCE_LENGTH, &length);
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
if (length > 0)
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
status = false;
if (!status)
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, c0[0] / color_max[0], c0[1] / color_max[1], c0[2] / color_max[2], expected[0], expected[1],
- expected[2]);
-
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y << "). Color is ("
+ << c0[0] / color_max[0] << " " << c0[1] / color_max[1] << " " << c0[2] / color_max[2]
+ << "). Color should be (" << expected[0] << " " << expected[1] << " " << expected[2] << ")."
+ << tcu::TestLog::EndMessage;
return status;
}
fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
{
-
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
- expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y
+ << "). Color is (" << fb[i + 0] / g_color_max[0] << " " << fb[i + 1] / g_color_max[1] << " "
+ << fb[i + 2] / g_color_max[2] << "). Color should be (" << expected[0] << " " << expected[1]
+ << " " << expected[2] << ")." << tcu::TestLog::EndMessage;
return false;
}
}
}
if (!status)
{
- Output("Left-bottom quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Left-bottom quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// right-bottom quad
}
if (!status)
{
- Output("right-bottom quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "right-bottom quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// right-top quad
}
if (!status)
{
- Output("right-top quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "right-top quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// left-top quad
}
if (!status)
{
- Output("left-top quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "left-top quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// middle horizontal line should be black
}
if (!status)
{
- Output("middle horizontal line checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "middle horizontal line checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// middle vertical line should be black
}
if (!status)
{
- Output("middle vertical line checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "middle vertical line checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
if (bad_pixels)
*bad_pixels = bad;
- Output("Bad pixels:%d, counted bad:%d\n", bad_pixels == NULL ? 0 : *bad_pixels, bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad pixels: " << (bad_pixels == NULL ? 0 : *bad_pixels)
+ << ", counted bad: " << bad << tcu::TestLog::EndMessage;
return status;
}
if (!status)
{
- Output("%s is %d should be at least %d.\n", GLenumToString(e), i, static_cast<GLint>(value));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " is " << i << " should be at least "
+ << static_cast<GLint>(value) << tcu::TestLog::EndMessage;
}
}
else
if (!status)
{
- Output("%s is %d should be at most %d.\n", GLenumToString(e), i, static_cast<GLint>(value));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " is " << i << " should be at most "
+ << static_cast<GLint>(value) << tcu::TestLog::EndMessage;
}
}
return status;
if (!status)
{
- Output("%s is %d should be %d.\n", GLenumToString(e), i, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e) << " is " << i
+ << " should be " << expected << tcu::TestLog::EndMessage;
}
return status;
}
if (!status)
{
- Output("%s at index %d is %d should be %d.\n", GLenumToString(e), index, i, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e) << " at index " << index
+ << " is " << i << " should be " << expected << tcu::TestLog::EndMessage;
}
return status;
}
{
if (in_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], in_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], in_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
else
{
if (data[i] != 7)
{
- Output("uData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 7)
{
- Output("iData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 7)
{
- Output("uData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 7)
{
- Output("iData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
return ERROR;
if (*u != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *u, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *u
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
return ERROR;
if (*i != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *i, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *i
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
return ERROR;
if (*u != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *u, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *u
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
return ERROR;
if (*i != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *i, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *i
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
{
if (udata[i] != i)
{
- Output("uData at index %d is %d should be %d.\n", i, udata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << udata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (idata[i] != i)
{
- Output("iData at index %d is %d should be %d.\n", i, idata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << idata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (udata[i] != i)
{
- Output("uData at index %d is %d should be %d.\n", i, udata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << udata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (idata[i] != i)
{
- Output("iData at index %d is %d should be %d.\n", i, idata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << idata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (expected_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], expected_data[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i)
+ << " is " << tcu::toHex(out_data[i]) << " should be "
+ << tcu::toHex(expected_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (expected_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], expected_data[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i)
+ << " is " << tcu::toHex(out_data[i]) << " should be "
+ << tcu::toHex(expected_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (!Equal(expected[i], out_data[i]))
{
- Output("Float at index %3d is %f should be %f.\n", static_cast<int>(i), out_data[i], expected[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Float at index " << static_cast<int>(i) << " is " << out_data[i]
+ << " should be " << expected[i] << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (!Equal(expected[i], out_data[i]))
{
- Output("Float at index %3d is %f should be %f.\n", static_cast<int>(i), out_data[i], expected[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Float at index " << static_cast<int>(i) << " is " << out_data[i]
+ << " should be " << expected[i] << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
out_data[3] != expected[3])
{
- Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
- out_data[3], expected[0], expected[1], expected[2], expected[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+ << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+ << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+ << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << ", " << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
out_data[3] != expected[3])
{
- Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
- out_data[3], expected[0], expected[1], expected[2], expected[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+ << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+ << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+ << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << ", " << tcu::TestLog::EndMessage;
return ERROR;
}
if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
out_data[3] != expected[3])
{
- Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
- out_data[3], expected[0], expected[1], expected[2], expected[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+ << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+ << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+ << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << ", " << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (out_data[i * 4 + 0] != expected[i * 4 + 0] || out_data[i * 4 + 1] != expected[i * 4 + 1] ||
out_data[i * 4 + 2] != expected[i * 4 + 2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
- out_data[i * 4 + 2], expected[i * 4 + 0], expected[i * 4 + 1], expected[i * 4 + 2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+ << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[i * 4 + 0] << ", "
+ << expected[i * 4 + 1] << ", " << expected[i * 4 + 2] << ", " << tcu::TestLog::EndMessage;
status = false;
}
}
if (fabs(out_data[i * 2 + 0] - expected[i * 2 + 0]) > 1e-6 ||
fabs(out_data[i * 2 + 1] - expected[i * 2 + 1]) > 1e-6)
{
- Output("Received: %f, %f, but expected: %f, %f\n", out_data[i * 2 + 0], out_data[i * 2 + 1],
- expected[i * 2 + 0], expected[i * 2 + 1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 2 + 0] << ", " << out_data[i * 2 + 1]
+ << ", but expected: " << expected[i * 2 + 0] << ", " << expected[i * 2 + 1] << ", "
+ << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data2[i * 4 + 0] != expected2[i * 4 + 0] || out_data2[i * 4 + 1] != expected2[i * 4 + 1] ||
out_data2[i * 4 + 2] != expected2[i * 4 + 2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data2[i * 4 + 0], out_data2[i * 4 + 1],
- out_data2[i * 4 + 2], expected2[i * 4 + 0], expected2[i * 4 + 1], expected2[i * 4 + 2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data2[i * 4 + 0] << ", " << out_data2[i * 4 + 1]
+ << ", " << out_data2[i * 4 + 2] << ", but expected: " << expected2[i * 4 + 0] << ", "
+ << expected2[i * 4 + 1] << ", " << expected2[i * 4 + 2] << ", " << tcu::TestLog::EndMessage;
status = false;
}
}
if (fabs(out_data2[i * 2 + 0] - expected2[i * 2 + 0]) > 1e-6 ||
fabs(out_data2[i * 2 + 1] - expected2[i * 2 + 1]) > 1e-6)
{
- Output("Received: %f, %f, but expected: %f, %f\n", out_data2[i * 2 + 0], out_data2[i * 2 + 1],
- expected2[i * 2 + 0], expected2[i * 2 + 1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data2[i * 2 + 0] << ", " << out_data2[i * 2 + 1]
+ << ", but expected: " << expected2[i * 2 + 0] << ", " << expected2[i * 2 + 1] << ", "
+ << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data[i * 4 + 0] != expected[0] || out_data[i * 4 + 1] != expected[1] ||
out_data[i * 4 + 2] != expected[2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
- out_data[i * 4 + 2], expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+ << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[i * 4 + 0] << ", "
+ << expected[i * 4 + 1] << ", " << expected[i * 4 + 2] << ", " << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data[i * 4 + 0] != expected[0] || out_data[i * 4 + 1] != expected[1] ||
out_data[i * 4 + 2] != expected[2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
- out_data[i * 4 + 2], expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+ << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[0] << ", " << expected[1] << ", "
+ << expected[2] << ", " << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (out_data[i * 4 + 3] != data[i * 4])
{
- Output("Received: %d, but expected: %d -> %d -> %d\n", out_data[i * 4 + 3], data[i * 4],
- out_data[i * 4 + 1], out_data[i * 4 + 2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 3] << ", but expected: " << data[i * 4]
+ << " -> " << out_data[i * 4 + 1] << " -> " << out_data[i * 4 + 2] << " -> "
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (out_data[i * 4 + 3] != data[i * 4])
{
- Output("Received: %d, but expected: %d\n", out_data[i * 4 + 3], data[i * 4]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 3]
+ << ", but expected: " << data[i * 4] << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer2] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer2] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer3] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer3] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer4] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer4] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer5] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer5] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer6] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer6] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer2] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer2] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer3] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer3] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer4] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer4] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer5] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer5] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer6] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer6] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
for (int i = 0; i < kBufs - 1; ++i)
if (dataout[i + 1] != sizes[i])
{
- Output("Array %d length is %d should be %d.\n", i, dataout[i + 1], sizes[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i + 1] << " should be "
+ << sizes[i] << tcu::TestLog::EndMessage;
status = false;
}
if (dataout[0] != sizes[kBufs - 1] - 1)
{
- Output("Array %d length is %d should be %d.\n", kBufs - 1, dataout[0], sizes[kBufs - 1] - 1);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << (kBufs - 1) << " length is " << dataout[0] << " should be "
+ << (sizes[kBufs - 1] - 1) << tcu::TestLog::EndMessage;
status = false;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
sizes[i] -= 2; // space constrained by offset of range size
if ((layout == std140 || layout == std430) && dataout[i] != sizes[i])
{
- Output("Array %d length is %d should be %d.\n", i, dataout[i], sizes[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i] << " should be "
+ << sizes[i] << tcu::TestLog::EndMessage;
status = false;
}
if ((layout == packed || layout == shared) && (dataout[i] > sizes[i]))
{
- Output("Array %d length is %d should be not greater that %d.\n", i, dataout[i], sizes[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i]
+ << " should be not greater that " << sizes[i] << tcu::TestLog::EndMessage;
status = false;
}
}
int i = (sizes[4] - 2) * columns[etype][4] * scalars[etype][4];
if (dataout[i] != 82)
{
- Output("Array 4 index %d is %d should be 82.\n", i, dataout[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Array 4 index " << i << " is "
+ << dataout[i] << " should be 82." << tcu::TestLog::EndMessage;
status = false;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
i = (sizes[6] - 2) * columns[etype][6] * scalars[etype][6];
if (dataout[i] != 82)
{
- Output("Array 6 index %d is %d should be 82.\n", i, dataout[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Array 6 index " << i << " is "
+ << dataout[i] << " should be 82." << tcu::TestLog::EndMessage;
status = false;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
{
if (out_data[i] != expected[i])
{
- Output("Received: %f, but expected: %f\n", out_data[i], expected[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Received: " << out_data[i]
+ << ", but expected: " << expected[i] << tcu::TestLog::EndMessage;
status = false;
}
}
GLint alignment;
GLuint buffer;
glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &bindings);
- Output("Max storage buffer bindings %d\n", bindings);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Max storage buffer bindings " << bindings << tcu::TestLog::EndMessage;
glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &alignment);
- Output("Storage buffer offset alignment %d\n", alignment);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Storage buffer offset alignment " << alignment << tcu::TestLog::EndMessage;
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, bindings, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by BindBufferBase if <target> is\n"
- "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
- "MAX_SHADER_STORAGE_BUFFER_BINDINGS.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+ << "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
+ << "MAX_SHADER_STORAGE_BUFFER_BINDINGS." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindBufferRange(GL_SHADER_STORAGE_BUFFER, bindings, 0, 0, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by BindBufferRange if <target> is\n"
- "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
- "MAX_SHADER_STORAGE_BUFFER_BINDINGS.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+ << "SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
+ << "MAX_SHADER_STORAGE_BUFFER_BINDINGS." << tcu::TestLog::EndMessage;
return ERROR;
}
glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, buffer, alignment - 1, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by BindBufferRange if <target> is\n"
- "SHADER_STORAGE_BUFFER and <offset> is not a multiple of the value of\n"
- "SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+ << "SHADER_STORAGE_BUFFER and <offset> is not a multiple of the value of\n"
+ << "SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT." << tcu::TestLog::EndMessage;
return ERROR;
}
GLchar log[1024];
glGetShaderInfoLog(sh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Compilation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail." << tcu::TestLog::EndMessage;
return false;
}
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
- Output("VS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "VS compilation should be ok." << tcu::TestLog::EndMessage;
CheckProgram(p);
glDeleteProgram(p);
return false;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
- Output("FS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "FS compilation should be ok." << tcu::TestLog::EndMessage;
CheckProgram(p);
glDeleteProgram(p);
return false;
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetProgramiv(p, GL_LINK_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Link operation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
return false;
}
void ShaderStorageBufferObjectTests::init()
{
using namespace deqp;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-basic-vs", TestSubcase::Create<BasicBasicVS>));
addChild(new TestSubcase(m_context, "basic-basic-cs", TestSubcase::Create<BasicBasicCS>));
addChild(new TestSubcase(m_context, "basic-max", TestSubcase::Create<BasicMax>));
namespace
{
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
class PIQBase : public deqp::SubcaseBase
{
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
}
GLenum tmp = glGetError();
if (tmp == expected)
{
- Output("Found expected error\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Found expected error" << tcu::TestLog::EndMessage;
error = NO_ERROR; // Error is expected
}
else
{
error = ERROR;
- Output("%d error was expected, found: %d.\n", expected, tmp);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << expected
+ << " error was expected, found: " << tmp << tcu::TestLog::EndMessage;
}
}
glGetProgramInterfaceiv(program, programInterface, pname, &res);
if (res != expected)
{
- Output("ERROR: Got %d, expected %d\n", res, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+ << expected << tcu::TestLog::EndMessage;
error = ERROR;
}
}
GLuint res = glGetProgramResourceIndex(program, programInterface, name.c_str());
if (res != expected)
{
- Output("ERROR: Got %d, expected %d\n", res, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+ << expected << tcu::TestLog::EndMessage;
error = ERROR;
}
}
GLuint res = glGetProgramResourceIndex(program, programInterface, name.c_str());
if (res == GL_INVALID_INDEX)
{
- Output("ERROR: Got %d, expected number other than -1\n", res);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res
+ << ", expected number other than -1" << tcu::TestLog::EndMessage;
error = ERROR;
return;
}
{
if (it->second == res)
{
- Output("ERROR: Duplicated value found: %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: Duplicated value found: " << res << tcu::TestLog::EndMessage;
error = ERROR;
return;
}
glGetProgramResourceName(program, programInterface, index, 1024, &len, name);
if (len <= 0 || len > 1023 || name[len - 1] == '\0')
{
- Output("ERROR: Length in glGetProgramResourceName should not count null terminator!\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "ERROR: Length in glGetProgramResourceName should not count null terminator!"
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
else if (name != expected || name[len] != '\0')
{
- Output("ERROR: Got %s, expected %s\n", name, expected.c_str());
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << name << ", expected "
+ << expected << tcu::TestLog::EndMessage;
error = ERROR;
}
}
GLint res = glGetProgramResourceLocation(program, programInterface, name.c_str());
if (res != expected)
{
- Output("ERROR: Got %d, expected %d\n", res, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+ << expected << tcu::TestLog::EndMessage;
error = ERROR;
}
}
GLint res = glGetProgramResourceLocation(program, programInterface, name.c_str());
if (res < 0)
{
- Output("ERROR: Got %d, expected not less than 0\n", res);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res
+ << ", expected not less than 0" << tcu::TestLog::EndMessage;
error = ERROR;
return;
}
{
if (it->second == res)
{
- Output("ERROR: Duplicated value found: %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: Duplicated value found: " << res << tcu::TestLog::EndMessage;
error = ERROR;
return;
}
if (length != expectedLength || length <= 0)
{
error = ERROR;
- Output("ERROR: Got length %d, expected %d\n", length, expectedLength);
- Output("CALL: glGetProgramResourceiv, with %d, %d\n", programInterface, index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: Got length " << length << ", expected " << expectedLength
+ << "\nCALL: glGetProgramResourceiv, with " << programInterface << ", " << index
+ << tcu::TestLog::EndMessage;
return;
}
for (int i = 0; i < length; ++i)
if (params[i] != expected[i])
{
error = ERROR;
- Output("ERROR: Got %d, expected %d at: %d\n", params[i], expected[i], i);
- Output("CALL: glGetProgramResourceiv, with %d, %d\n", programInterface, index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: Got " << params[i] << ", expected " << expected[i]
+ << " at: " << i << "\nCALL: glGetProgramResourceiv, with " << programInterface << ", " << index
+ << tcu::TestLog::EndMessage;
}
}
}
GLint res = glGetProgramResourceLocationIndex(program, programInterface, name.c_str());
if (res != expected)
{
- Output("ERROR: Got %d, expected %d\n", res, expected);
- Output("CALL: glGetProgramResourceLocationIndex, with %d, %s\n", programInterface, name.c_str());
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: Got " << res << ", expected "
+ << expected << "\nCALL: glGetProgramResourceLocationIndex, with "
+ << programInterface << ", " << name << tcu::TestLog::EndMessage;
error = ERROR;
}
}
{
if (exp.find(param[i]) == exp.end())
{
- Output("Unexpected index found in active variables of SimpleBlock: %d\n", param[i]);
- Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Unexpected index found in active variables of SimpleBlock: " << param[i]
+ << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK"
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
else if (length != 3)
{
- Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
- Output("Expected length: 3, actual length: %d\n", length);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n"
+ << "Expected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
{
if (exp2.find(param[i]) == exp2.end())
{
- Output("Unexpected index found in active variables of NotSoSimpleBlockk: %d\n", param[i]);
- Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Unexpected index found in active variables of NotSoSimpleBlockk: " << param[i]
+ << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK"
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
else if (length != 3)
{
- Output("Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK\n");
- Output("Expected length: 3, actual length: %d\n", length);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_UNIFORM_BLOCK"
+ << "\nExpected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
glGetProgramInterfaceiv(program, GL_UNIFORM_BLOCK, GL_MAX_NUM_ACTIVE_VARIABLES, &res);
if (res < 3)
{
- Output("Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!"
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
{
if (exp.find(param[i]) == exp.end() || length != 2)
{
- Output("Length: %d\n", length);
- Output("Unexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: %d\n", param[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Length: " << length
+ << "\nUnexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: " << param[i]
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
}
- Output("GL_ACTIVE_VARIABLES ok for 1st ATOMIC_COUNTER_BUFFER\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_ACTIVE_VARIABLES ok for 1st ATOMIC_COUNTER_BUFFER"
+ << tcu::TestLog::EndMessage;
std::set<GLuint> exp2;
GLint param2[bufSize];
exp2.insert(indicesU["d"]);
{
if (exp2.find(param2[i]) == exp2.end() || length != 2)
{
- Output("Length: %d\n", length);
- Output("Unexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: %d\n", param2[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Length: " << length
+ << "\nUnexpected index/length found in active variables of ATOMIC_COUNTER_BUFFER: " << param2[i]
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
{
if (exp.find(param[i]) == exp.end() || length != 2)
{
- Output("Length: %d\n", length);
- Output("Unexpected index/length found in active variables of GL_VERTEX_SUBROUTINE_UNIFORM: %d\n",
- param[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Length: " << length
+ << "\nUnexpected index/length found in active variables of GL_VERTEX_SUBROUTINE_UNIFORM: "
+ << param[i] << tcu::TestLog::EndMessage;
error = ERROR;
}
}
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_TESS_CONTROL_SHADER:
- Output("*** Tessellation Control Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_TESS_EVALUATION_SHADER:
- Output("*** Tessellation Evaluation Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_GEOMETRY_SHADER:
- Output("*** Geometry Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
- break;
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
}
GLint res;
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
// shader info log
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
GLchar name[100] = { '\0' };
GLenum props[1] = { GL_NAME_LENGTH };
- Output("Case 1: <program> not a name of shader/program object\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 1: <program> not a name of shader/program object"
+ << tcu::TestLog::EndMessage;
glGetProgramInterfaceiv(1337u, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &res);
ExpectError(GL_INVALID_VALUE, error);
glGetProgramResourceIndex(31337u, GL_PROGRAM_INPUT, "pie");
ExpectError(GL_INVALID_VALUE, error);
glGetProgramResourceLocationIndex(1337u, GL_PROGRAM_OUTPUT, "pie");
ExpectError(GL_INVALID_VALUE, error);
- Output("Case 1 finished\n");
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 1 finished" << tcu::TestLog::EndMessage;
GLuint program = CreateProgram(VertexShader().c_str(), FragmentShader().c_str(), false);
glBindAttribLocation(program, 0, "position");
glBindFragDataLocation(program, 0, "color");
LinkProgram(program);
- Output("Case 2: <index> is greater than the number of the active resources in GetProgramResourceName\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Case 2: <index> is greater than the number of the active resources in GetProgramResourceName"
+ << tcu::TestLog::EndMessage;
glGetProgramResourceName(program, GL_PROGRAM_INPUT, 3000, 1024, &len, name);
ExpectError(GL_INVALID_VALUE, error);
- Output("Case 2 finished\n");
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 2 finished" << tcu::TestLog::EndMessage;
- Output("Case 3: <propCount> is zero in GetProgramResourceiv\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 3: <propCount> is zero in GetProgramResourceiv"
+ << tcu::TestLog::EndMessage;
glGetProgramResourceiv(program, GL_PROGRAM_INPUT, 0, 0, props, 1024, &len, &res);
ExpectError(GL_INVALID_VALUE, error);
- Output("Case 3 finished\n");
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 3 finished" << tcu::TestLog::EndMessage;
std::string str = "position";
glGetProgramResourceName(program, GL_PROGRAM_INPUT, 0, -100, NULL, const_cast<char*>(str.c_str()));
GLchar name[100] = { '\0' };
GLenum props[1] = { GL_TEXTURE_1D };
- Output("Case 1: <programInterface> is ATOMIC_COUNTER_BUFFER in GetProgramResourceIndex or "
- "GetProgramResourceName\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 1: <programInterface> is ATOMIC_COUNTER_BUFFER "
+ << "in GetProgramResourceIndex or GetProgramResourceName" << tcu::TestLog::EndMessage;
glGetProgramResourceIndex(program, GL_ATOMIC_COUNTER_BUFFER, name);
ExpectError(GL_INVALID_ENUM, error);
glGetProgramResourceName(program, GL_ATOMIC_COUNTER_BUFFER, 0, 1024, &len, name);
ExpectError(GL_INVALID_ENUM, error);
- Output("Case 1 finished\n");
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 1 finished" << tcu::TestLog::EndMessage;
- Output("Case 2: <props> is not a property name supported by the command GetProgramResourceiv\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 2: <props> is not a property name supported by "
+ << "the command GetProgramResourceiv" << tcu::TestLog::EndMessage;
glGetProgramResourceiv(program, GL_PROGRAM_INPUT, 0, 1, props, 1024, &len, &res);
ExpectError(GL_INVALID_ENUM, error);
- Output("Case 2 finished\n");
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 2 finished" << tcu::TestLog::EndMessage;
glGetProgramResourceLocation(program, GL_ATOMIC_COUNTER_BUFFER, "position");
ExpectError(GL_INVALID_ENUM, error);
GLchar name[100] = { '\0' };
GLenum props[1] = { GL_OFFSET };
- Output("Case 1: <program> is the name of a shader object\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 1: <program> is the name of a shader object" << tcu::TestLog::EndMessage;
glGetProgramInterfaceiv(sh, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &res);
ExpectError(GL_INVALID_OPERATION, error);
glGetProgramResourceIndex(sh, GL_PROGRAM_INPUT, "pie");
glGetProgramResourceLocationIndex(sh, GL_PROGRAM_OUTPUT, "pie");
ExpectError(GL_INVALID_OPERATION, error);
glDeleteShader(sh);
- Output("Case 1 finished\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 1 finished\n"
+ << "Case 2: <pname> is not supported in GetProgramInterfacei" << tcu::TestLog::EndMessage;
- Output("Case 2: <pname> is not supported in GetProgramInterfaceiv\n");
glGetProgramInterfaceiv(program, GL_PROGRAM_INPUT, GL_MAX_NUM_ACTIVE_VARIABLES, &res);
ExpectError(GL_INVALID_OPERATION, error);
- Output("Case 2 finished\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 2 finished\n"
+ << "Case 3: <props> is not supported in GetProgramResourceiv" << tcu::TestLog::EndMessage;
- Output("Case 3: <props> is not supported in GetProgramResourceiv");
glGetProgramResourceiv(program, GL_PROGRAM_INPUT, 0, 1, props, 1024, &len, &res);
ExpectError(GL_INVALID_OPERATION, error);
- Output("Case 3 finished\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Case 3 finished\n"
+ << "Case 4: <program> has not been linked in GetProgramResourceLocation/GetProgramResourceLocationIndex"
+ << tcu::TestLog::EndMessage;
- Output("Case 4: <program> has not been linked in GetProgramResourceLocation/GetProgramResourceLocationIndex\n");
glGetProgramResourceLocation(program2, GL_PROGRAM_INPUT, "pie");
ExpectError(GL_INVALID_OPERATION, error);
glGetProgramResourceLocationIndex(program2, GL_PROGRAM_OUTPUT, "pie");
ExpectError(GL_INVALID_OPERATION, error);
- Output("Case 4 finished\n");
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Case 4 finished\n" << tcu::TestLog::EndMessage;
glDeleteProgram(program);
glDeleteProgram(program2);
glGetProgramInterfaceiv(program, GL_BUFFER_VARIABLE, GL_ACTIVE_RESOURCES, &res);
if (res < 7)
{
- Output("Error on: glGetProgramInterfaceiv, if: GL_BUFFER_VARIABLE, param: GL_ACTIVE_RESOURCES\n");
- Output("Expected value greater or equal to 7, got %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Error on: glGetProgramInterfaceiv, if: GL_BUFFER_VARIABLE, param: GL_ACTIVE_RESOURCES\n"
+ << "Expected value greater or equal to 7, got " << res << tcu::TestLog::EndMessage;
error = ERROR;
}
VerifyGetProgramInterfaceiv(program, GL_SHADER_STORAGE_BLOCK, GL_ACTIVE_RESOURCES, 4, error);
{
if (exp.find(param[i]) == exp.end())
{
- Output("Unexpected index found in active variables of SimpleBuffer: %d\n", param[i]);
- Output(
- "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Unexpected index found in active variables of SimpleBuffer: " << param[i]
+ << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: "
+ "GL_SHADER_STORAGE_BLOCK"
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
else if (length != 3)
{
- Output(
- "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
- Output("Expected length: 3, actual length: %d\n", length);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES "
+ "interface: GL_SHADER_STORAGE_BLOCK\n"
+ << "Expected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
{
if (exp2.find(param[i]) == exp2.end())
{
- Output("Unexpected index found in active variables of NotSoSimpleBuffer: %d\n", param[i]);
- Output(
- "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Unexpected index found in active variables of NotSoSimpleBuffer: " << param[i]
+ << "\nCall: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: "
+ "GL_SHADER_STORAGE_BLOCK"
+ << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
else if (length != 3)
{
- Output(
- "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES interface: GL_SHADER_STORAGE_BLOCK\n");
- Output("Expected length: 3, actual length: %d\n", length);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Call: glGetProgramResourceiv, property: GL_ACTIVE_VARIABLES "
+ "interface: GL_SHADER_STORAGE_BLOCK\n"
+ << "Expected length: 3, actual length: " << length << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
glGetProgramInterfaceiv(program, GL_SHADER_STORAGE_BLOCK, GL_MAX_NUM_ACTIVE_VARIABLES, &res);
if (res < 3)
{
- Output("Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!\n");
- Output("Call: glGetProgramInterfaceiv, interface: GL_SHADER_STORAGE_BLOCK\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Value of GL_MAX_NUM_ACTIVE_VARIABLES less than 3!\n"
+ << "Call: glGetProgramInterfaceiv, interface: GL_SHADER_STORAGE_BLOCK" << tcu::TestLog::EndMessage;
return ERROR;
}
indices[name] = i;
}
- Output("Indices of builtins:\n");
- Output("%d, %d, %d, %d, %d\n", indices["gl_NextBuffer"], indices["gl_SkipComponents1"],
- indices["gl_SkipComponents2"], indices["gl_SkipComponents3"], indices["gl_SkipComponents4"]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Indices of builtins:\n"
+ << indices["gl_NextBuffer"] << ", " << indices["gl_SkipComponents1"] << ", "
+ << indices["gl_SkipComponents2"] << ", " << indices["gl_SkipComponents3"]
+ << ", " << indices["gl_SkipComponents4"] << tcu::TestLog::EndMessage;
GLenum props[] = { GL_NAME_LENGTH, GL_TYPE, GL_ARRAY_SIZE };
GLint expected[] = { 14, GL_NONE, 0 };
std::string expected = "color";
if (name != expected)
{
- Output("Expected name: %s, got: %s\n", expected.c_str(), name);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Expected name: " << expected
+ << ", got: " << name << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
else if (res != 1)
{
- Output("Expected array_size: 1, got: %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Expected array_size: 1, got: " << res << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
glGetProgramResourceiv(program, GL_BUFFER_VARIABLE, indicesBV["a[0][0]"], 1, &prop, 1024, &len, &res);
if (res <= 0)
{
- Output("Call: glGetProgramResourceiv, interface: GL_BUFFER_VARIABLE, param: GL_TOP_LEVEL_ARRAY_STRIDE\n");
- Output("Expected value greater than 0, got: %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Call: glGetProgramResourceiv, interface: GL_BUFFER_VARIABLE, param: GL_TOP_LEVEL_ARRAY_STRIDE\n"
+ << "Expected value greater than 0, got: " << res << tcu::TestLog::EndMessage;
glDeleteProgram(program);
return ERROR;
}
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
}
return program;
glGetProgramResourceiv(program, GL_UNIFORM, indicesU["a"], 1, &prop, 1024, &len, &res);
if (res < 1)
{
- Output("ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_MATRIX_STRIDE\n");
- Output("Expected value greater than 0, got %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_MATRIX_STRIDE\n"
+ << "Expected value greater than 0, got " << res << tcu::TestLog::EndMessage;
}
prop = GL_OFFSET;
glGetProgramResourceiv(program, GL_UNIFORM, indicesU["a"], 1, &prop, 1024, &len, &res);
if (res < 0)
{
- Output("ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_OFFSET\n");
- Output("Expected value not less than 0, got %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_OFFSET\n"
+ << "Expected value not less than 0, got " << res << tcu::TestLog::EndMessage;
}
prop = GL_ARRAY_STRIDE;
glGetProgramResourceiv(program, GL_UNIFORM, indicesU["b"], 1, &prop, 1024, &len, &res);
if (res < 1)
{
- Output("ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_ARRAY_STRIDE\n");
- Output("Expected value greater than 0, got %d\n", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "ERROR: glGetProgramResourceiv, interface GL_UNIFORM, prop GL_ARRAY_STRIDE\n"
+ << "Expected value greater than 0, got " << res << tcu::TestLog::EndMessage;
}
glDeleteProgram(program);
glGetProgramResourceName(program, GL_UNIFORM, index, 0, NULL, buff);
if (buff[0] != 'a' || buff[1] != 'b' || buff[2] != 'c')
{
- Output("ERROR: buff has changed\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: buff has changed" << tcu::TestLog::EndMessage;
error = ERROR;
}
glGetProgramResourceName(program, GL_UNIFORM, index, 2, &length, buff);
if (buff[0] != 's' || buff[1] != '\0' || buff[2] != 'c')
{
- Output("ERROR: buff different then expected\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: buff different then expected" << tcu::TestLog::EndMessage;
error = ERROR;
}
if (length != 1)
{
- Output("ERROR: incorrect length, expected 1, got %d\n", length);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: incorrect length, expected 1, got "
+ << length << tcu::TestLog::EndMessage;
error = ERROR;
}
glGetProgramResourceiv(program, GL_UNIFORM, index, 13, props, 0, NULL, params);
if (params[0] != 1 || params[1] != 2 || params[2] != 3)
{
- Output("ERROR: params has changed\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: params has changed" << tcu::TestLog::EndMessage;
error = ERROR;
}
glGetProgramResourceiv(program, GL_UNIFORM, index, 13, props, 2, &length, params);
if (params[0] != 13 || params[1] != GL_FLOAT_VEC4 || params[2] != 3)
{
- Output("ERROR: params has incorrect values\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "ERROR: params has incorrect values" << tcu::TestLog::EndMessage;
error = ERROR;
}
if (length != 2)
{
- Output("ERROR: incorrect length, expected 2, got %d\n", length);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "ERROR: incorrect length, expected 2, got "
+ << length << tcu::TestLog::EndMessage;
error = ERROR;
}
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_TESS_CONTROL_SHADER:
- Output("*** Tessellation Control Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_TESS_EVALUATION_SHADER:
- Output("*** Tessellation Evaluation Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_GEOMETRY_SHADER:
- Output("*** Geometry Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
- break;
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
}
GLint res;
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
// shader info log
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
glGetProgramInterfaceiv(program, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &res);
if (res != 0 && res != 1)
{
- Output("Error, expected 0 or 1 active resources, got: %d", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Error, expected 0 or 1 active resources, got: " << res
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
glGetProgramInterfaceiv(program, GL_PROGRAM_INPUT, GL_MAX_NAME_LENGTH, &res);
if (res != 0 && res != 9)
{
- Output("Error, expected 1 or 9 GL_MAX_NAME_LENGTH, got: %d", res);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Error, expected 1 or 9 GL_MAX_NAME_LENGTH, got: " << res
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
VerifyGetProgramResourceLocation(program, GL_PROGRAM_OUTPUT, "color", -1, error);
void ProgramInterfaceQueryTests::init()
{
using namespace deqp;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "empty-shaders", TestSubcase::Create<NoShaders>));
addChild(new TestSubcase(m_context, "simple-shaders", TestSubcase::Create<SimpleShaders>));
addChild(new TestSubcase(m_context, "input-types", TestSubcase::Create<InputTypes>));