Browse Source

Refactor tests

pull/576/head
Vladislav Oleshko 4 years ago
parent
commit
3ab4b6fef3
  1. 50
      src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp
  2. 69
      src/Magnum/Shaders/Test/FlatGLTest.cpp
  3. 264
      src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
  4. 72
      src/Magnum/Shaders/Test/PhongGLTest.cpp
  5. 49
      src/Magnum/Shaders/Test/VectorGLTest.cpp
  6. 33
      src/Magnum/Shaders/Test/VertexColorGLTest.cpp

50
src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp

@ -388,22 +388,14 @@ template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::construct() {
template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::constructAsync() { template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::constructAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
constexpr struct { auto compileState = DistanceFieldVectorGL<dimensions>::compile(DistanceFieldVectorGL2D::Flag::TextureTransformation);
const char* name; CORRADE_COMPARE(compileState.flags(), DistanceFieldVectorGL2D::Flag::TextureTransformation);
DistanceFieldVectorGL2D::Flags flags;
} data{
"texture transformation", DistanceFieldVectorGL2D::Flag::TextureTransformation
};
setTestCaseDescription(data.name);
auto compileState = DistanceFieldVectorGL<dimensions>::compile(data.flags);
CORRADE_COMPARE(compileState.flags(), data.flags);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
DistanceFieldVectorGL<dimensions> shader{std::move(compileState)}; DistanceFieldVectorGL<dimensions> shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), DistanceFieldVectorGL2D::Flag::TextureTransformation);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
@ -459,44 +451,24 @@ template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::constructUnifor
template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::constructUniformBuffersAsync() { template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::constructUniformBuffersAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
constexpr struct {
const char* name;
DistanceFieldVectorGL2D::Flags flags;
UnsignedInt materialCount, drawCount;
} data {
"multidraw with all the things", DistanceFieldVectorGL2D::Flag::MultiDraw|DistanceFieldVectorGL2D::Flag::TextureTransformation, 16, 48
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & DistanceFieldVectorGL2D::Flag::UniformBuffers) && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif #endif
if(data.flags >= DistanceFieldVectorGL2D::Flag::MultiDraw) { auto compileState = DistanceFieldVectorGL<dimensions>::compile(DistanceFieldVectorGL2D::Flag::UniformBuffers, 16, 4);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), DistanceFieldVectorGL2D::Flag::UniformBuffers);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.materialCount(), 16);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported."); CORRADE_COMPARE(compileState.drawCount(), 4);
#elif !defined(MAGNUM_TARGET_WEBGL)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = DistanceFieldVectorGL<dimensions>::compile(data.flags, data.materialCount, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.materialCount(), data.materialCount);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
DistanceFieldVectorGL<dimensions> shader{std::move(compileState)}; DistanceFieldVectorGL<dimensions> shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), DistanceFieldVectorGL2D::Flag::UniformBuffers);
CORRADE_COMPARE(shader.materialCount(), data.materialCount); CORRADE_COMPARE(shader.materialCount(), 16);
CORRADE_COMPARE(shader.drawCount(), data.drawCount); CORRADE_COMPARE(shader.drawCount(), 4);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {

69
src/Magnum/Shaders/Test/FlatGLTest.cpp

@ -866,32 +866,14 @@ template<UnsignedInt dimensions> void FlatGLTest::construct() {
template<UnsignedInt dimensions> void FlatGLTest::constructAsync() { template<UnsignedInt dimensions> void FlatGLTest::constructAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
auto compileState = FlatGL<dimensions>::compile(FlatGL2D::Flag::Textured|FlatGL2D::Flag::TextureTransformation);
constexpr struct { CORRADE_COMPARE(compileState.flags(), FlatGL2D::Flag::Textured|FlatGL2D::Flag::TextureTransformation);
const char* name;
FlatGL2D::Flags flags;
} data {
"textured + texture transformation",
FlatGL2D::Flag::Textured|FlatGL2D::Flag::TextureTransformation
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES
if((data.flags & FlatGL2D::Flag::ObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
if((data.flags & FlatGL2D::Flag::TextureArrays) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::texture_array>())
CORRADE_SKIP(GL::Extensions::EXT::texture_array::string() << "is not supported.");
#endif
auto compileState = FlatGL<dimensions>::compile(data.flags);
CORRADE_COMPARE(compileState.flags(), data.flags);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
FlatGL<dimensions> shader{std::move(compileState)}; FlatGL<dimensions> shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), FlatGL2D::Flag::Textured|FlatGL2D::Flag::TextureTransformation);
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
@ -951,52 +933,23 @@ template<UnsignedInt dimensions> void FlatGLTest::constructUniformBuffers() {
template<UnsignedInt dimensions> void FlatGLTest::constructUniformBuffersAsync() { template<UnsignedInt dimensions> void FlatGLTest::constructUniformBuffersAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
constexpr struct {
const char* name;
FlatGL2D::Flags flags;
UnsignedInt materialCount, drawCount;
} data {
"alpha mask",
FlatGL2D::Flag::UniformBuffers|FlatGL2D::Flag::AlphaMask,
1, 1
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & FlatGL2D::Flag::UniformBuffers) && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
if((data.flags & FlatGL2D::Flag::ObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
if((data.flags & FlatGL2D::Flag::TextureArrays) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::texture_array>())
CORRADE_SKIP(GL::Extensions::EXT::texture_array::string() << "is not supported.");
#endif #endif
if(data.flags >= FlatGL2D::Flag::MultiDraw) { auto compileState = FlatGL<dimensions>::compile(FlatGL2D::Flag::UniformBuffers|FlatGL2D::Flag::AlphaMask, 1, 1);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), FlatGL2D::Flag::UniformBuffers|FlatGL2D::Flag::AlphaMask);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.materialCount(), 1);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported."); CORRADE_COMPARE(compileState.drawCount(), 1);
#elif !defined(MAGNUM_TARGET_WEBGL)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = FlatGL<dimensions>::compile(data.flags, data.materialCount, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.materialCount(), data.materialCount);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
FlatGL<dimensions> shader{std::move(compileState)}; FlatGL<dimensions> shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), FlatGL2D::Flag::UniformBuffers|FlatGL2D::Flag::AlphaMask);
CORRADE_COMPARE(shader.materialCount(), data.materialCount); CORRADE_COMPARE(shader.materialCount(), 1);
CORRADE_COMPARE(shader.drawCount(), data.drawCount); CORRADE_COMPARE(shader.drawCount(), 1);
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) #if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES)

264
src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp

@ -1416,64 +1416,14 @@ void MeshVisualizerGLTest::construct2D() {
void MeshVisualizerGLTest::construct2DAsync() { void MeshVisualizerGLTest::construct2DAsync() {
constexpr struct { auto compileState = MeshVisualizerGL2D::compile(MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader);
const char* name; CORRADE_COMPARE(compileState.flags(), MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader);
MeshVisualizerGL2D::Flags flags;
} data {
"wireframe w/o GS", MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES
if((data.flags & MeshVisualizerGL2D::Flag::InstancedObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if(data.flags >= MeshVisualizerGL2D::Flag::PrimitiveIdFromVertexId &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL300)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES300)
#endif
) CORRADE_SKIP("gl_VertexID not supported.");
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if(data.flags & MeshVisualizerGL2D::Flag::PrimitiveId && !(data.flags >= MeshVisualizerGL2D::Flag::PrimitiveIdFromVertexId) &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL320)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES320)
#endif
) CORRADE_SKIP("gl_PrimitiveID not supported.");
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if((data.flags & MeshVisualizerGL2D::Flag::Wireframe) && !(data.flags & MeshVisualizerGL2D::Flag::NoGeometryShader)) {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::geometry_shader>())
CORRADE_SKIP(GL::Extensions::EXT::geometry_shader::string() << "is not supported.");
#endif
#ifdef MAGNUM_TARGET_GLES
if(GL::Context::current().isExtensionSupported<GL::Extensions::NV::shader_noperspective_interpolation>())
CORRADE_INFO("Using" << GL::Extensions::NV::shader_noperspective_interpolation::string());
#endif
}
#endif
auto compileState = MeshVisualizerGL2D::compile(data.flags);
CORRADE_COMPARE(compileState.flags(), data.flags);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
MeshVisualizerGL2D shader{std::move(compileState)}; MeshVisualizerGL2D shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
@ -1566,85 +1516,23 @@ void MeshVisualizerGLTest::constructUniformBuffers2D() {
void MeshVisualizerGLTest::constructUniformBuffers2DAsync() { void MeshVisualizerGLTest::constructUniformBuffers2DAsync() {
constexpr struct {
const char* name;
MeshVisualizerGL2D::Flags flags;
UnsignedInt materialCount, drawCount;
} data {
"multidraw with wireframe w/o GS and vertex ID", MeshVisualizerGL2D::Flag::MultiDraw|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader|MeshVisualizerGL2D::Flag::VertexId, 8, 55
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & MeshVisualizerGL2D::Flag::InstancedObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(data.flags >= MeshVisualizerGL2D::Flag::PrimitiveIdFromVertexId &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL300)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES300)
#endif
) CORRADE_SKIP("gl_VertexID not supported.");
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(data.flags & MeshVisualizerGL2D::Flag::PrimitiveId && !(data.flags >= MeshVisualizerGL2D::Flag::PrimitiveIdFromVertexId) &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL320)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES320)
#endif
) CORRADE_SKIP("gl_PrimitiveID not supported.");
#endif
#ifndef MAGNUM_TARGET_WEBGL
if((data.flags & MeshVisualizerGL2D::Flag::Wireframe) && !(data.flags & MeshVisualizerGL2D::Flag::NoGeometryShader)) {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::geometry_shader>())
CORRADE_SKIP(GL::Extensions::EXT::geometry_shader::string() << "is not supported.");
#endif
#ifdef MAGNUM_TARGET_GLES
if(GL::Context::current().isExtensionSupported<GL::Extensions::NV::shader_noperspective_interpolation>())
CORRADE_INFO("Using" << GL::Extensions::NV::shader_noperspective_interpolation::string());
#endif
}
#endif
#ifndef MAGNUM_TARGET_GLES
if(data.flags & MeshVisualizerGL2D::Flag::UniformBuffers && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif #endif
if(data.flags >= MeshVisualizerGL2D::Flag::MultiDraw) { auto compileState = MeshVisualizerGL2D::compile( MeshVisualizerGL2D::Flag::UniformBuffers|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader, 8, 55);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), MeshVisualizerGL2D::Flag::UniformBuffers|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.materialCount(), 8);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported."); CORRADE_COMPARE(compileState.drawCount(), 55);
#elif !defined(MAGNUM_TARGET_WEBGL)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = MeshVisualizerGL2D::compile(data.flags, data.materialCount, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.materialCount(), data.materialCount);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
MeshVisualizerGL2D shader{std::move(compileState)}; MeshVisualizerGL2D shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), MeshVisualizerGL2D::Flag::UniformBuffers|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader);
CORRADE_COMPARE(shader.materialCount(), 8);
CORRADE_COMPARE(shader.drawCount(), 55);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
@ -1718,64 +1606,15 @@ void MeshVisualizerGLTest::construct3D() {
} }
void MeshVisualizerGLTest::construct3DAsync() { void MeshVisualizerGLTest::construct3DAsync() {
constexpr struct { auto compileState = MeshVisualizerGL3D::compile(MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader);
const char* name; CORRADE_COMPARE(compileState.flags(), MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader);
MeshVisualizerGL3D::Flags flags;
} data {
"wireframe w/o GS", MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES
if((data.flags & MeshVisualizerGL3D::Flag::InstancedObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if(data.flags >= MeshVisualizerGL3D::Flag::PrimitiveIdFromVertexId &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL300)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES300)
#endif
) CORRADE_SKIP("gl_VertexID not supported.");
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if(data.flags & MeshVisualizerGL3D::Flag::PrimitiveId && !(data.flags >= MeshVisualizerGL3D::Flag::PrimitiveIdFromVertexId) &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL320)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES320)
#endif
) CORRADE_SKIP("gl_PrimitiveID not supported.");
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if(((data.flags & MeshVisualizerGL3D::Flag::Wireframe) && !(data.flags & MeshVisualizerGL3D::Flag::NoGeometryShader)) || (data.flags & (MeshVisualizerGL3D::Flag::TangentDirection|MeshVisualizerGL3D::Flag::BitangentDirection|MeshVisualizerGL3D::Flag::BitangentFromTangentDirection|MeshVisualizerGL3D::Flag::NormalDirection))) {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::geometry_shader>())
CORRADE_SKIP(GL::Extensions::EXT::geometry_shader::string() << "is not supported.");
#endif
#ifdef MAGNUM_TARGET_GLES
if(GL::Context::current().isExtensionSupported<GL::Extensions::NV::shader_noperspective_interpolation>())
CORRADE_INFO("Using" << GL::Extensions::NV::shader_noperspective_interpolation::string());
#endif
}
#endif
auto compileState = MeshVisualizerGL3D::compile(data.flags);
CORRADE_COMPARE(compileState.flags(), data.flags);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
MeshVisualizerGL3D shader{data.flags}; // TODO: FIXME MeshVisualizerGL3D shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); MeshVisualizerGL3D shader{MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader};
CORRADE_COMPARE(shader.flags(), MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader);
CORRADE_VERIFY(compileState.isLinkFinished()); CORRADE_VERIFY(compileState.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
@ -1872,80 +1711,27 @@ void MeshVisualizerGLTest::constructUniformBuffers3DAsync() {
MeshVisualizerGL3D::Flags flags; MeshVisualizerGL3D::Flags flags;
UnsignedInt materialCount, drawCount; UnsignedInt materialCount, drawCount;
} data { } data {
"multidraw with wireframe w/o GS and vertex ID", MeshVisualizerGL3D::Flag::MultiDraw|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader|MeshVisualizerGL3D::Flag::VertexId, 6, 28 "multiple materials, draws", MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader, 8, 55
}; };
setTestCaseDescription(data.name); setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & MeshVisualizerGL3D::Flag::InstancedObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(data.flags >= MeshVisualizerGL3D::Flag::PrimitiveIdFromVertexId &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL300)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES300)
#endif
) CORRADE_SKIP("gl_VertexID not supported.");
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(data.flags & MeshVisualizerGL3D::Flag::PrimitiveId && !(data.flags >= MeshVisualizerGL3D::Flag::PrimitiveIdFromVertexId) &&
#ifndef MAGNUM_TARGET_GLES
!GL::Context::current().isVersionSupported(GL::Version::GL320)
#else
!GL::Context::current().isVersionSupported(GL::Version::GLES320)
#endif
) CORRADE_SKIP("gl_PrimitiveID not supported.");
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(((data.flags & MeshVisualizerGL3D::Flag::Wireframe) && !(data.flags & MeshVisualizerGL3D::Flag::NoGeometryShader)) || (data.flags & (MeshVisualizerGL3D::Flag::TangentDirection|MeshVisualizerGL3D::Flag::BitangentDirection|MeshVisualizerGL3D::Flag::BitangentFromTangentDirection|MeshVisualizerGL3D::Flag::NormalDirection))) {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::geometry_shader>())
CORRADE_SKIP(GL::Extensions::EXT::geometry_shader::string() << "is not supported.");
#endif
#ifdef MAGNUM_TARGET_GLES
if(GL::Context::current().isExtensionSupported<GL::Extensions::NV::shader_noperspective_interpolation>())
CORRADE_INFO("Using" << GL::Extensions::NV::shader_noperspective_interpolation::string());
#endif
}
#endif
#ifndef MAGNUM_TARGET_GLES
if(data.flags & MeshVisualizerGL3D::Flag::UniformBuffers && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif #endif
if(data.flags >= MeshVisualizerGL3D::Flag::MultiDraw) { auto compileState = MeshVisualizerGL3D::compile(MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader, 8, 55);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.materialCount(), 8);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported."); CORRADE_COMPARE(compileState.drawCount(), 55);
#elif !defined(MAGNUM_TARGET_WEBGL)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = MeshVisualizerGL3D::compile(data.flags, data.materialCount, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.materialCount(), data.materialCount);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
MeshVisualizerGL3D shader{std::move(compileState)}; MeshVisualizerGL3D shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader);
CORRADE_COMPARE(compileState.materialCount(), 8);
CORRADE_COMPARE(compileState.drawCount(), 55);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {

72
src/Magnum/Shaders/Test/PhongGLTest.cpp

@ -1199,32 +1199,16 @@ void PhongGLTest::construct() {
} }
void PhongGLTest::constructAsync() { void PhongGLTest::constructAsync() {
constexpr struct { auto compileState = PhongGL::compile(PhongGL::Flag::SpecularTexture|PhongGL::Flag::InstancedTextureOffset, 3);
const char* name; CORRADE_COMPARE(compileState.flags(), PhongGL::Flag::SpecularTexture|PhongGL::Flag::InstancedTextureOffset);
PhongGL::Flags flags; CORRADE_COMPARE(compileState.lightCount(), 3);
UnsignedInt lightCount;
} data {
"instanced specular texture offset", PhongGL::Flag::SpecularTexture|PhongGL::Flag::InstancedTextureOffset, 3
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES
if((data.flags & PhongGL::Flag::ObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
if((data.flags & PhongGL::Flag::TextureArrays) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::texture_array>())
CORRADE_SKIP(GL::Extensions::EXT::texture_array::string() << "is not supported.");
#endif
auto compileState = PhongGL::compile(data.flags, data.lightCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.lightCount(), data.lightCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
PhongGL shader{std::move(compileState)}; PhongGL shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), PhongGL::Flag::SpecularTexture|PhongGL::Flag::InstancedTextureOffset);
CORRADE_COMPARE(shader.lightCount(), data.lightCount); CORRADE_COMPARE(shader.lightCount(), 3);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
@ -1281,51 +1265,25 @@ void PhongGLTest::constructUniformBuffers() {
} }
void PhongGLTest::constructUniformBuffersAsync() { void PhongGLTest::constructUniformBuffersAsync() {
constexpr struct {
const char* name;
PhongGL::Flags flags;
UnsignedInt lightCount, materialCount, drawCount;
} data {
"multiple lights, materials, draws + light culling", PhongGL::Flag::UniformBuffers|PhongGL::Flag::LightCulling, 8, 8, 24
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & PhongGL::Flag::UniformBuffers) && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
if((data.flags & PhongGL::Flag::ObjectId) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
if((data.flags & PhongGL::Flag::TextureArrays) && !GL::Context::current().isExtensionSupported<GL::Extensions::EXT::texture_array>())
CORRADE_SKIP(GL::Extensions::EXT::texture_array::string() << "is not supported.");
#endif #endif
if(data.flags >= PhongGL::Flag::MultiDraw) { auto compileState = PhongGL::compile(PhongGL::Flag::UniformBuffers|PhongGL::Flag::LightCulling, 8, 8, 24);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), PhongGL::Flag::UniformBuffers|PhongGL::Flag::LightCulling);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.lightCount(), 8);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported."); CORRADE_COMPARE(compileState.materialCount(), 8);
#elif !defined(MAGNUM_TARGET_WEBGL) CORRADE_COMPARE(compileState.drawCount(), 24);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = PhongGL::compile(data.flags, data.lightCount, data.materialCount, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.lightCount(), data.lightCount);
CORRADE_COMPARE(compileState.materialCount(), data.materialCount);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
PhongGL shader{std::move(compileState)}; PhongGL shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), PhongGL::Flag::UniformBuffers|PhongGL::Flag::LightCulling);
CORRADE_COMPARE(shader.lightCount(), data.lightCount); CORRADE_COMPARE(shader.lightCount(), 8);
CORRADE_COMPARE(shader.materialCount(), data.materialCount); CORRADE_COMPARE(shader.materialCount(), 8);
CORRADE_COMPARE(shader.drawCount(), data.drawCount); CORRADE_COMPARE(shader.drawCount(), 24);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {

49
src/Magnum/Shaders/Test/VectorGLTest.cpp

@ -384,23 +384,15 @@ template<UnsignedInt dimensions> void VectorGLTest::construct() {
template<UnsignedInt dimensions> void VectorGLTest::constructAsync() { template<UnsignedInt dimensions> void VectorGLTest::constructAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
constexpr struct { auto compileState = VectorGL<dimensions>::compile(VectorGL2D::Flag::TextureTransformation);
const char* name; CORRADE_COMPARE(compileState.flags(), VectorGL2D::Flag::TextureTransformation);
VectorGL2D::Flags flags;
} data {
"texture transformation", VectorGL2D::Flag::TextureTransformation
};
setTestCaseDescription(data.name);
auto compileState = VectorGL<dimensions>::compile(data.flags);
CORRADE_COMPARE(compileState.flags(), data.flags);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
VectorGL<dimensions> shader{std::move(compileState)}; VectorGL<dimensions> shader{std::move(compileState)};
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), VectorGL2D::Flag::TextureTransformation);
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) #if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES)
@ -455,43 +447,24 @@ template<UnsignedInt dimensions> void VectorGLTest::constructUniformBuffers() {
template<UnsignedInt dimensions> void VectorGLTest::constructUniformBuffersAsync() { template<UnsignedInt dimensions> void VectorGLTest::constructUniformBuffersAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
constexpr struct {
const char* name;
VectorGL2D::Flags flags;
UnsignedInt materialCount, drawCount;
} data {"texture transformation", VectorGL2D::Flag::UniformBuffers|VectorGL2D::Flag::TextureTransformation, 1, 1};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & VectorGL<dimensions>::Flag::UniformBuffers) && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif #endif
if(data.flags >= VectorGL2D::Flag::MultiDraw) { auto compileState = VectorGL<dimensions>::compile(VectorGL2D::Flag::UniformBuffers|VectorGL2D::Flag::TextureTransformation, 1, 1);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), VectorGL2D::Flag::UniformBuffers|VectorGL2D::Flag::TextureTransformation);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.materialCount(), 1);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported."); CORRADE_COMPARE(compileState.drawCount(), 1);
#elif !defined(MAGNUM_TARGET_WEBGL)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = VectorGL<dimensions>::compile(data.flags, data.materialCount, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.materialCount(), data.materialCount);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
VectorGL<dimensions> shader{std::move(compileState)}; VectorGL<dimensions> shader{std::move(compileState)};
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), VectorGL2D::Flag::UniformBuffers|VectorGL2D::Flag::TextureTransformation);
CORRADE_COMPARE(shader.drawCount(), data.drawCount); CORRADE_COMPARE(shader.materialCount(), 1);
CORRADE_COMPARE(shader.drawCount(), 1);
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {
#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) #if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES)

33
src/Magnum/Shaders/Test/VertexColorGLTest.cpp

@ -382,42 +382,21 @@ template<UnsignedInt dimensions> void VertexColorGLTest::constructUniformBuffers
template<UnsignedInt dimensions> void VertexColorGLTest::constructUniformBuffersAsync() { template<UnsignedInt dimensions> void VertexColorGLTest::constructUniformBuffersAsync() {
setTestCaseTemplateName(Utility::format("{}", dimensions)); setTestCaseTemplateName(Utility::format("{}", dimensions));
constexpr struct {
const char* name;
VertexColorGL2D::Flags flags;
UnsignedInt drawCount;
} data {
"multiple draws", VertexColorGL2D::Flag::UniformBuffers, 63
};
setTestCaseDescription(data.name);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if((data.flags & VertexColorGL<dimensions>::Flag::UniformBuffers) && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>()) if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported."); CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif #endif
if(data.flags >= VertexColorGL2D::Flag::MultiDraw) { auto compileState = VertexColorGL<dimensions>::compile(VertexColorGL2D::Flag::UniformBuffers, 63);
#ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(compileState.flags(), VertexColorGL2D::Flag::UniformBuffers);
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::shader_draw_parameters>()) CORRADE_COMPARE(compileState.drawCount(), 63);
CORRADE_SKIP(GL::Extensions::ARB::shader_draw_parameters::string() << "is not supported.");
#elif !defined(MAGNUM_TARGET_WEBGL)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ANGLE::multi_draw>())
CORRADE_SKIP(GL::Extensions::ANGLE::multi_draw::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::WEBGL::multi_draw>())
CORRADE_SKIP(GL::Extensions::WEBGL::multi_draw::string() << "is not supported.");
#endif
}
auto compileState = VertexColorGL<dimensions>::compile(data.flags, data.drawCount);
CORRADE_COMPARE(compileState.flags(), data.flags);
CORRADE_COMPARE(compileState.drawCount(), data.drawCount);
while(!compileState.isLinkFinished()) while(!compileState.isLinkFinished())
Utility::System::sleep(100); Utility::System::sleep(100);
VertexColorGL<dimensions> shader{std::move(compileState)}; VertexColorGL<dimensions> shader{std::move(compileState)};
CORRADE_COMPARE(shader.flags(), data.flags); CORRADE_COMPARE(shader.flags(), VertexColorGL2D::Flag::UniformBuffers);
CORRADE_COMPARE(shader.drawCount(), data.drawCount); CORRADE_COMPARE(shader.drawCount(), 63);
CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.isLinkFinished());
CORRADE_VERIFY(shader.id()); CORRADE_VERIFY(shader.id());
{ {

Loading…
Cancel
Save