LOCAL_NDK_STL_VARIANT := gnustl_static
LOCAL_RTTI_FLAG := -frtti -fexceptions
LOCAL_MULTILIB := both
+LOCAL_TIDY_CHECKS := \
+ -google-build-explicit-make-pair, \
+ -google-global-names-in-headers, \
+ -google-runtime-member-string-references, \
+ -google-runtime-operator, \
include $(BUILD_SHARED_LIBRARY)
-phaulos@google.com
tinazh@google.com
-misojarvi@google.com
-kraita@google.com
+chrisforbes@google.com
+
+# We miss you
+# phaulos@google.com
+# kraita@google.com
+# misojarvi@google.com
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_arrays_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_instanced_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_instanced_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_instanced_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_instanced_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_elements_instanced_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_range_elements
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_range_elements_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_range_elements_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_range_elements_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_range_elements_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.callbacks.vertex_array.draw_range_elements_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.callbacks.state.enable
dEQP-GLES31.functional.debug.negative_coverage.callbacks.state.disable
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_arrays_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_instanced_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_instanced_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_instanced_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_instanced_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_elements_instanced_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_range_elements
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_range_elements_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_range_elements_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_range_elements_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_range_elements_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.draw_range_elements_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.log.state.enable
dEQP-GLES31.functional.debug.negative_coverage.log.state.disable
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_arrays_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_instanced_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_instanced_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_instanced_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_instanced_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_elements_instanced_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_range_elements
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_range_elements_invalid_program
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_range_elements_incomplete_primitive
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_range_elements_base_vertex
-dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_range_elements_base_vertex_invalid_map
dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.draw_range_elements_base_vertex_primitive_mode_mismatch
dEQP-GLES31.functional.debug.negative_coverage.get_error.state.enable
dEQP-GLES31.functional.debug.negative_coverage.get_error.state.disable
for (int y = 1; y < height-1; y++)
{
- for (int x = 1; x < width-1; x += params.maxSampleSkip > 0 ? (int)rnd.getInt(0, params.maxSampleSkip) : 1)
+ for (int x = 1; x < width-1; x += 1 + (int)rnd.getInt(0, params.maxSampleSkip))
{
const deUint32 minDist2RefToCmp = distSquaredToNeighbor<4>(rnd, readUnorm8<4>(refAccess, x, y), cmpAccess, x, y);
const deUint32 minDist2CmpToRef = distSquaredToNeighbor<4>(rnd, readUnorm8<4>(cmpAccess, x, y), refAccess, x, y);
# Turn on -Wstrict-overflow=5 and check all warnings before removing
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fwrapv")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fwrapv")
+
+ # Force compiler to not export any symbols.
+ # Any static libraries build are linked into the standalone executable binaries.
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
elseif (DE_COMPILER_IS_MSC)
# Compiler flags for msc
DE_BEGIN_EXTERN_C
-void createTestActivity (ANativeActivity* activity, void* savedState, size_t savedStateSize)
+JNIEXPORT void JNICALL createTestActivity (ANativeActivity* activity, void* savedState, size_t savedStateSize)
{
DE_UNREF(savedState && savedStateSize);
try
// Signal completion.
packetIter->signal->increment();
}
+ m_egl.releaseThread();
}
private:
class TestThread : de::Thread
{
public:
- TestThread (const vector<TestContext*> contexts);
+ TestThread (const vector<TestContext*> contexts, const Library& egl);
~TestThread (void);
void start (void);
private:
vector<TestContext*> m_contexts;
+ const Library& m_egl;
bool m_isOk;
string m_errorString;
TestThread (const TestThread&);
};
-TestThread::TestThread (const vector<TestContext*> contexts)
+TestThread::TestThread (const vector<TestContext*> contexts, const Library& egl)
: m_contexts (contexts)
+ , m_egl (egl)
, m_isOk (false)
, m_errorString ("")
, m_beginTimeUs (0)
m_isOk = false;
m_errorString = "Got unknown exception";
}
+
+ m_egl.releaseThread();
}
class SharedRenderingPerfCase : public TestCase
namespace
{
-void createThreads (vector<TestThread*>& threads, int threadCount, int perThreadContextCount, vector<TestContext*>& contexts)
+void createThreads (vector<TestThread*>& threads, int threadCount, int perThreadContextCount, vector<TestContext*>& contexts, const Library& egl)
{
DE_ASSERT(threadCount * perThreadContextCount == (int)contexts.size());
DE_ASSERT(threads.empty());
for (int contextNdx = 0; contextNdx < perThreadContextCount; contextNdx++)
threadContexts.push_back(contexts[threadNdx * perThreadContextCount + contextNdx]);
- threads.push_back(new TestThread(threadContexts));
+ threads.push_back(new TestThread(threadContexts, egl));
threadContexts.clear();
}
if (m_results.empty())
logTestConfig(m_testCtx.getLog(), m_config);
- createThreads(threads, m_config.threadCount, m_config.perThreadContextCount, m_contexts);
+ createThreads(threads, m_config.threadCount, m_config.perThreadContextCount, m_contexts, m_eglTestCtx.getLibrary());
beginTimeUs = deGetMicroseconds();
IterateResult iterate (void)
{
+ const Library& egl = m_eglTestCtx.getLibrary();
+
+ if (eglu::getVersion(egl, m_display) < eglu::Version(1, 5) &&
+ !eglu::hasExtension(egl, m_display, "EGL_KHR_image") &&
+ !eglu::hasExtension(egl, m_display, "EGL_KHR_image_base"))
+ {
+ TCU_THROW(NotSupportedError, "EGLimages not supported");
+ }
+
#define CHECK_CREATE(MSG, DPY, CONTEXT, SOURCE, ERR) checkCreate(MSG, DPY, #DPY, CONTEXT, #CONTEXT, SOURCE, #SOURCE, ERR)
CHECK_CREATE("Testing bad display (-1)...", (EGLDisplay)-1, EGL_NO_CONTEXT, EGL_NONE, EGL_BAD_DISPLAY);
CHECK_CREATE("Testing bad context (-1)...", m_display, (EGLContext)-1, EGL_NONE, EGL_BAD_CONTEXT);
THREADSTATUS_NOT_STARTED = 0,
THREADSTATUS_RUNNING,
THREADSTATUS_READY,
-
- THREADSTATUS_NOT_SUPPORTED,
- THREADSTATUS_ERROR
};
TestThread (MultiThreadedTest& test, int id);
virtual bool runThread (TestThread& thread) = 0;
virtual IterateResult iterate (void);
- bool execTest (TestThread& thread);
+ void execTest (TestThread& thread);
const Library& getLibrary (void) const { return m_eglTestCtx.getLibrary(); }
protected:
- void barrier (TestThread& thread);
+ void barrier (void);
private:
int m_threadCount;
bool m_initialized;
deUint64 m_startTimeUs;
const deUint64 m_timeoutUs;
+ bool m_ok;
+ bool m_supported;
vector<TestThread*> m_threads;
volatile deInt32 m_barrierWaiters;
try
{
- if (m_test.execTest(*this))
- m_status = THREADSTATUS_READY;
- else
- m_status = THREADSTATUS_ERROR;
+ m_test.execTest(*this);
}
catch (const TestThread::TestStop&)
{
{
getLog() << ThreadLog::BeginMessage << "Unknown exception" << ThreadLog::EndMessage;
}
+
+ getLibrary().releaseThread();
+ m_status = THREADSTATUS_READY;
}
-bool MultiThreadedTest::execTest (TestThread& thread)
+void MultiThreadedTest::execTest (TestThread& thread)
{
- bool isOk = false;
-
try
{
- isOk = runThread(thread);
+ if (!runThread(thread))
+ m_ok = false;
}
catch (const TestThread::TestStop&)
{
}
catch (const tcu::NotSupportedError&)
{
- // Set status of each thread
- for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
- m_threads[threadNdx]->setStatus(TestThread::THREADSTATUS_NOT_SUPPORTED);
+ m_supported = false;
// Release barriers
for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
}
catch(...)
{
- // Set status of each thread
- for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
- m_threads[threadNdx]->setStatus(TestThread::THREADSTATUS_ERROR);
+ m_ok = false;
// Release barriers
for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
throw;
}
-
- return isOk;
}
MultiThreadedTest::MultiThreadedTest (EglTestContext& eglTestCtx, const char* name, const char* description, int threadCount, deUint64 timeoutUs)
, m_initialized (false)
, m_startTimeUs (0)
, m_timeoutUs (timeoutUs)
-
+ , m_ok (true)
+ , m_supported (true)
, m_barrierWaiters (0)
, m_barrierSemaphore1 (0, 0)
, m_barrierSemaphore2 (1, 0)
}
}
-void MultiThreadedTest::barrier (TestThread& thread)
+void MultiThreadedTest::barrier (void)
{
{
const deInt32 waiters = deAtomicIncrement32(&m_barrierWaiters);
}
// Barrier was released due an error in other thread
- if (thread.getStatus() != TestThread::THREADSTATUS_RUNNING)
+ if (!m_ok || !m_supported)
throw TestThread::TestStop();
}
{
m_testCtx.getLog() << tcu::TestLog::Message << "Thread timeout limit: " << m_timeoutUs << "us" << tcu::TestLog::EndMessage;
+ m_ok = true;
+ m_supported = true;
+
// Create threads
m_threads.reserve(m_threadCount);
for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
m_threads[threadNdx]->join();
- bool isOk = true;
- bool notSupported = false;
-
- for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
- {
- if (m_threads[threadNdx]->getStatus() == TestThread::THREADSTATUS_ERROR)
- isOk = false;
-
- if (m_threads[threadNdx]->getStatus() == TestThread::THREADSTATUS_NOT_SUPPORTED)
- notSupported = true;
- }
-
// Get logs
{
vector<int> messageNdx;
m_threads.clear();
// Set result
- if (isOk)
+ if (m_ok)
{
- if (notSupported)
+ if (!m_supported)
m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Not Supported");
else
m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
de::Random rnd (deInt32Hash(thread.getId() + 10435));
vector<EGLConfig> configs;
- barrier(thread);
+ barrier();
for (int getConfigsNdx = 0; getConfigsNdx < m_getConfigs; getConfigsNdx++)
{
TCU_THROW(NotSupportedError, "No usable config found");
}
- barrier(thread);
+ barrier();
// Create / Destroy Objects
if ((m_types & TYPE_SINGLE_WINDOW) != 0 && (m_types & TYPE_PBUFFER) == 0 && (m_types & TYPE_PIXMAP) == 0 && (m_types & TYPE_CONTEXT) == 0)
if (thread.getId() == 0)
pushObjectsToShared(thread);
- barrier(thread);
+ barrier();
// Push second threads objects to shared
if (thread.getId() == 1)
pushObjectsToShared(thread);
- barrier(thread);
+ barrier();
// Make queries from shared surfaces
querySetSharedObjects(thread, 100);
- barrier(thread);
+ barrier();
// Pull surfaces for first thread from shared surfaces
if (thread.getId() == 0)
pullObjectsFromShared(thread, (int)(m_sharedPbuffers.size()/2), (int)(m_sharedNativePixmaps.size()/2), (int)(m_sharedNativeWindows.size()/2), (int)(m_sharedContexts.size()/2));
- barrier(thread);
+ barrier();
// Pull surfaces for second thread from shared surfaces
if (thread.getId() == 1)
pullObjectsFromShared(thread, (int)m_sharedPbuffers.size(), (int)m_sharedNativePixmaps.size(), (int)m_sharedNativeWindows.size(), (int)m_sharedContexts.size());
- barrier(thread);
+ barrier();
// Create / Destroy Objects
if ((m_types & TYPE_SINGLE_WINDOW) == 0)
#undef PACK_FMT
}
+/*
+The getColorThreshold function is used to obtain a
+threshold usable for the fuzzyCompare function.
+
+For 8bit color depths a value of 0.02 should provide
+a good metric for rejecting images above this level.
+For other bit depths other thresholds should be selected.
+Ideally this function would take advantage of the
+getColorThreshold function provided by the PixelFormat class
+as this would also allow setting per channel thresholds.
+However using the PixelFormat provided function can result
+in too strict thresholds for 8bit bit depths (compared to
+the current default of 0.02) or too relaxed for lower bit
+depths if scaled proportionally to the 8bit default.
+*/
+
+float getColorThreshold (const tcu::PixelFormat& colorBits)
+{
+ if ((colorBits.redBits > 0 && colorBits.redBits < 8) ||
+ (colorBits.greenBits > 0 && colorBits.greenBits < 8) ||
+ (colorBits.blueBits > 0 && colorBits.blueBits < 8) ||
+ (colorBits.alphaBits > 0 && colorBits.alphaBits < 8))
+ {
+ return 0.05f;
+ }
+ else
+ {
+ return 0.02f;
+ }
+}
+
tcu::TextureFormat getDepthFormat (const int depthBits)
{
switch (depthBits)
const int numContexts = (int)contexts.size();
const int drawsPerCtx = 2;
const int numIters = 2;
- const float threshold = 0.02f;
-
const tcu::PixelFormat pixelFmt = getPixelFormat(egl, display, config.config);
+ const float threshold = getColorThreshold(pixelFmt);
+
const int depthBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_DEPTH_SIZE);
const int stencilBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_STENCIL_SIZE);
const int numSamples = eglu::getConfigAttribInt(egl, display, config.config, EGL_SAMPLES);
// Signal completion.
packetIter->signal->increment();
}
+ m_egl.releaseThread();
}
private:
const int packetsPerThread = 2;
const int numThreads = numContexts;
const int numPackets = numThreads * packetsPerThread;
- const float threshold = 0.02f;
-
const tcu::PixelFormat pixelFmt = getPixelFormat(egl, display, config.config);
+ const float threshold = getColorThreshold(pixelFmt);
+
const int depthBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_DEPTH_SIZE);
const int stencilBits = eglu::getConfigAttribInt(egl, display, config.config, EGL_STENCIL_SIZE);
const int numSamples = eglu::getConfigAttribInt(egl, display, config.config, EGL_SAMPLES);
{
m_error = error;
}
+
+ m_egl.releaseThread();
}
private:
if (numConfigs <= 0)
{
log << tcu::TestLog::Message << "No configs returned." << tcu::TestLog::EndMessage;
- TCU_THROW(NotSupportedError, "10:10:10:2 pixel format is not supported");
+ TCU_THROW(NotSupportedError, "16:16:16:16 pixel format is not supported");
}
log << tcu::TestLog::Message << numConfigs << " configs returned" << tcu::TestLog::EndMessage;
void VertexIDCase::init (void)
{
+ if (m_method == deqp::gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_BASEVERTEX ||
+ m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX ||
+ m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED_BASEVERTEX)
+ {
+ const bool supportsES32 = contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2));
+ TCU_CHECK_AND_THROW(NotSupportedError, supportsES32 || m_context.getContextInfo().isExtensionSupported("GL_EXT_draw_elements_base_vertex"), "GL_EXT_draw_elements_base_vertex is not supported.");
+ }
+
m_testCtx.getLog() << TestLog::Message
<< "gl_VertexID should be the index of the vertex that is being passed to the shader. i.e. indices[i] + basevertex"
<< TestLog::EndMessage;
void FboSRGBQueryCase::init (void)
{
// extension requirements for test
- if (!glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
- TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control or a context version equal or higher than 3.2");
+ if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
+ TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control");
}
void FboSRGBQueryCase::deinit (void)
void FboSRGBUnsupportedEnumCase::init (void)
{
// extension requirements for test
- if (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) || m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
- TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control to be unsupported and a context version less than 3.2");
+ if (m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
+ TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control to be unsupported");
}
void FboSRGBUnsupportedEnumCase::deinit (void)
ctx.glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &maxWorkGroupInvocations);
ctx.expectError(GL_NO_ERROR);
- DE_ASSERT((maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations );
+ DE_ASSERT(((deInt64) maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations );
const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
const char* const shaderVersion = isES32
ctx.endSection();
}
-void draw_elements_base_vertex_invalid_map (NegativeTestContext& ctx)
-{
- GLuint buf = 0;
- GLfloat vertices[1];
-
- ctx.beginSection("GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped.");
- ctx.glGenBuffers(1, &buf);
- ctx.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf);
- ctx.glBufferData(GL_ELEMENT_ARRAY_BUFFER, 10, 0, GL_STATIC_DRAW);
- ctx.glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT);
- ctx.expectError(GL_NO_ERROR);
- ctx.glDrawElementsBaseVertex(GL_POINTS, 1, GL_UNSIGNED_INT, vertices, 1);
- ctx.expectError(GL_INVALID_OPERATION);
- ctx.glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- ctx.glDeleteBuffers(1, &buf);
- ctx.endSection();
-}
-
void draw_elements_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx)
{
TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
ctx.glUseProgram(0);
}
-void draw_elements_instanced_base_vertex_invalid_map (NegativeTestContext& ctx)
-{
- GLfloat vertices[1];
- GLuint buf = 0;
-
- ctx.beginSection("GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped.");
- ctx.glGenBuffers(1, &buf);
- ctx.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf);
- ctx.glBufferData(GL_ELEMENT_ARRAY_BUFFER, 10, 0, GL_STATIC_DRAW);
- ctx.glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT);
- ctx.expectError(GL_NO_ERROR);
- ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, 1, GL_UNSIGNED_INT, vertices, 1, 1);
- ctx.expectError(GL_INVALID_OPERATION);
- ctx.glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- ctx.glDeleteBuffers(1, &buf);
- ctx.endSection();
-
-}
-
void draw_elements_instanced_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx)
{
TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
ctx.glUseProgram(0);
}
-void draw_range_elements_base_vertex_invalid_map (NegativeTestContext& ctx)
-{
- GLuint buf = 0;
- GLfloat vertices[1];
-
- ctx.beginSection("GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped.");
- ctx.glGenBuffers(1, &buf);
- ctx.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf);
- ctx.glBufferData(GL_ELEMENT_ARRAY_BUFFER, 10, 0, GL_STATIC_DRAW);
- ctx.glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT);
- ctx.expectError(GL_NO_ERROR);
- ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 0, 1, 1, GL_UNSIGNED_INT, vertices, 1);
- ctx.expectError(GL_INVALID_OPERATION);
- ctx.glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- ctx.glDeleteBuffers(1, &buf);
- ctx.endSection();
-}
-
void draw_range_elements_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx)
{
TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
{draw_arrays_incomplete_primitive, "draw_arrays_incomplete_primitive", "Invalid glDrawArrays() usage" },
{draw_elements, "draw_elements", "Invalid glDrawElements() usage" },
{draw_elements_base_vertex, "draw_elements_base_vertex", "Invalid glDrawElementsBaseVertex() usage" },
- {draw_elements_base_vertex_invalid_map, "draw_elements_base_vertex_invalid_map" , "Invalid glDrawElementsBaseVertex() usage" },
{draw_elements_base_vertex_primitive_mode_mismatch, "draw_elements_base_vertex_primitive_mode_mismatch", "Invalid glDrawElementsBaseVertex() usage" },
{draw_elements_invalid_program, "draw_elements_invalid_program", "Invalid glDrawElements() usage" },
{draw_elements_incomplete_primitive, "draw_elements_incomplete_primitive", "Invalid glDrawElements() usage" },
{draw_elements_instanced_invalid_program, "draw_elements_instanced_invalid_program", "Invalid glDrawElementsInstanced() usage" },
{draw_elements_instanced_incomplete_primitive, "draw_elements_instanced_incomplete_primitive", "Invalid glDrawElementsInstanced() usage" },
{draw_elements_instanced_base_vertex, "draw_elements_instanced_base_vertex", "Invalid glDrawElementsInstancedBaseVertex() usage" },
- {draw_elements_instanced_base_vertex_invalid_map, "draw_elements_instanced_base_vertex_invalid_map", "Invalid glDrawElementsInstancedBaseVertex() usage" },
{draw_elements_instanced_base_vertex_primitive_mode_mismatch, "draw_elements_instanced_base_vertex_primitive_mode_mismatch", "Invalid glDrawElementsInstancedBaseVertex() usage" },
{draw_range_elements, "draw_range_elements", "Invalid glDrawRangeElements() usage" },
{draw_range_elements_invalid_program, "draw_range_elements_invalid_program", "Invalid glDrawRangeElements() usage" },
{draw_range_elements_incomplete_primitive, "draw_range_elements_incomplete_primitive", "Invalid glDrawRangeElements() usage" },
{draw_range_elements_base_vertex, "draw_range_elements_base_vertex", "Invalid glDrawRangeElementsBaseVertex() usage" },
- {draw_range_elements_base_vertex_invalid_map, "draw_range_elements_base_vertex_invalid_map", "Invalid glDrawRangeElementsBaseVertex() usage" },
{draw_range_elements_base_vertex_primitive_mode_mismatch, "draw_range_elements_base_vertex_primitive_mode_mismatch", "Invalid glDrawRangeElementsBaseVertex() usage" },
};
protected:
ExprP<float> doExpand (ExpandContext&, const ArgExprs& args) const
{
- ExprP<float> val = args.a[0] * args.b[0];
+ ExprP<float> op[Size];
+ // Precompute all products.
+ for (int ndx = 0; ndx < Size; ++ndx)
+ op[ndx] = args.a[ndx] * args.b[ndx];
- for (int ndx = 1; ndx < Size; ++ndx)
- val = val + args.a[ndx] * args.b[ndx];
+ int idx[Size];
+ //Prepare an array of indices.
+ for (int ndx = 0; ndx < Size; ++ndx)
+ idx[ndx] = ndx;
- return val;
+ ExprP<float> res = op[0];
+ // Compute the first dot alternative: SUM(a[i]*b[i]), i = 0 .. Size-1
+ for (int ndx = 1; ndx < Size; ++ndx)
+ res = res + op[ndx];
+
+ // Generate all permutations of indices and
+ // using a permutation compute a dot alternative.
+ // Generates all possible variants fo summation of products in the dot product expansion expression.
+ do {
+ ExprP<float> alt = constant(0.0f);
+ for (int ndx = 0; ndx < Size; ++ndx)
+ alt = alt + op[idx[ndx]];
+ res = alternatives(res, alt);
+ } while (std::next_permutation(idx, idx + Size));
+
+ return res;
}
};
#include "tcuFloat.hpp"
#include "tcuTextureUtil.hpp"
+#include "gluContextInfo.hpp"
#include "gluPixelTransfer.hpp"
#include "gluCallLogWrapper.hpp"
DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const DrawTestSpec& spec, const char* name, const char* desc)
: TestCase (testCtx, name, desc)
, m_renderCtx (renderCtx)
+ , m_contextInfo (DE_NULL)
, m_refBuffers (DE_NULL)
, m_refContext (DE_NULL)
, m_glesContext (DE_NULL)
DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* desc)
: TestCase (testCtx, name, desc)
, m_renderCtx (renderCtx)
+ , m_contextInfo (DE_NULL)
, m_refBuffers (DE_NULL)
, m_refContext (DE_NULL)
, m_glesContext (DE_NULL)
m_maxDiffRed = deCeilFloatToInt32(256.0f * (6.0f / (float)(1 << m_renderCtx.getRenderTarget().getPixelFormat().redBits)));
m_maxDiffGreen = deCeilFloatToInt32(256.0f * (6.0f / (float)(1 << m_renderCtx.getRenderTarget().getPixelFormat().greenBits)));
m_maxDiffBlue = deCeilFloatToInt32(256.0f * (6.0f / (float)(1 << m_renderCtx.getRenderTarget().getPixelFormat().blueBits)));
+ m_contextInfo = glu::ContextInfo::create(m_renderCtx);
}
void DrawTest::deinit (void)
delete m_refBuffers;
delete m_refContext;
delete m_glesContext;
+ delete m_contextInfo;
m_glArrayPack = DE_NULL;
m_rrArrayPack = DE_NULL;
m_refBuffers = DE_NULL;
m_refContext = DE_NULL;
m_glesContext = DE_NULL;
+ m_contextInfo = DE_NULL;
}
DrawTest::IterateResult DrawTest::iterate (void)
{
const int specNdx = (m_iteration / 2);
+ const DrawTestSpec& spec = m_specs[specNdx];
+
+ if (spec.drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_BASEVERTEX ||
+ spec.drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED_BASEVERTEX ||
+ spec.drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX)
+ {
+ const bool supportsES32 = contextSupports(m_renderCtx.getType(), glu::ApiType::es(3, 2));
+ TCU_CHECK_AND_THROW(NotSupportedError, supportsES32 || m_contextInfo->isExtensionSupported("GL_EXT_draw_elements_base_vertex"), "GL_EXT_draw_elements_base_vertex is not supported.");
+ }
+
const bool drawStep = (m_iteration % 2) == 0;
const bool compareStep = (m_iteration % 2) == 1;
const IterateResult iterateResult = ((size_t)m_iteration + 1 == m_specs.size()*2) ? (STOP) : (CONTINUE);
- const DrawTestSpec& spec = m_specs[specNdx];
const bool updateProgram = (m_iteration == 0) || (drawStep && !checkSpecsShaderCompatible(m_specs[specNdx], m_specs[specNdx-1])); // try to use the same shader in all iterations
IterationLogSectionEmitter sectionEmitter (m_testCtx.getLog(), specNdx, m_specs.size(), m_iteration_descriptions[specNdx], drawStep && m_specs.size()!=1);
#include "tcuResultCollector.hpp"
#include "gluRenderContext.hpp"
+namespace glu
+{
+class ContextInfo;
+}
+
namespace sglr
{
glu::RenderContext& m_renderCtx;
+ glu::ContextInfo* m_contextInfo;
sglr::ReferenceContextBuffers* m_refBuffers;
sglr::ReferenceContext* m_refContext;
sglr::Context* m_glesContext;