From 3f0b298d9ba3c5fbda1af8e4393edb6b42b302b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 1 Mar 2019 23:01:18 +0100 Subject: [PATCH] DebugTools: disable bufferData() tests on drivers w/o map_buffer_range. Was crashing, haha. --- .../DebugTools/Test/BufferDataGLTest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp index d8a2b9bdf..2e0d3269b 100644 --- a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp +++ b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp @@ -26,6 +26,8 @@ #include #include "Magnum/DebugTools/BufferData.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #include "Magnum/GL/OpenGLTester.h" namespace Magnum { namespace DebugTools { namespace Test { namespace { @@ -45,6 +47,14 @@ BufferDataGLTest::BufferDataGLTest() { constexpr Int Data[] = {2, 7, 5, 13, 25}; void BufferDataGLTest::data() { + #ifndef MAGNUM_TARGET_GLES + if(!GL::Context::current().isExtensionSupported()) + CORRADE_SKIP(GL::Extensions::ARB::map_buffer_range::string() + std::string(" is not supported")); + #elif defined(MAGNUM_TARGET_GLES2) + if(!GL::Context::current().isExtensionSupported()) + CORRADE_SKIP(GL::Extensions::EXT::map_buffer_range::string() + std::string(" is not supported")); + #endif + GL::Buffer buffer; buffer.setData(Data, GL::BufferUsage::StaticDraw); const Containers::Array contents = bufferData(buffer); @@ -54,6 +64,14 @@ void BufferDataGLTest::data() { } void BufferDataGLTest::subData() { + #ifndef MAGNUM_TARGET_GLES + if(!GL::Context::current().isExtensionSupported()) + CORRADE_SKIP(GL::Extensions::ARB::map_buffer_range::string() + std::string(" is not supported")); + #elif defined(MAGNUM_TARGET_GLES2) + if(!GL::Context::current().isExtensionSupported()) + CORRADE_SKIP(GL::Extensions::EXT::map_buffer_range::string() + std::string(" is not supported")); + #endif + GL::Buffer buffer; buffer.setData(Data, GL::BufferUsage::StaticDraw); const Containers::Array contents = bufferSubData(buffer, 4, 3);