Browse Source

Merge branch 'master' into async-shader-compile

pull/576/head
Vladislav 4 years ago committed by GitHub
parent
commit
1ae63af256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      doc/changelog.dox
  2. 170
      doc/developers.dox
  3. 1
      doc/opengl-mapping.dox
  4. 3
      doc/opengl-support.dox
  5. 2
      package/archlinux/magnum-git/PKGBUILD
  6. 5
      src/Magnum/DebugTools/Test/CMakeLists.txt
  7. 25
      src/Magnum/GL/Context.cpp
  8. 6
      src/Magnum/GL/Extensions.h
  9. 5
      src/Magnum/GL/Test/CMakeLists.txt
  10. 68
      src/Magnum/GL/Test/ContextTest.cpp
  11. 5
      src/Magnum/MeshTools/Test/CMakeLists.txt
  12. 4
      src/Magnum/Platform/gl-info.cpp
  13. 5
      src/Magnum/Shaders/Test/CMakeLists.txt
  14. 4
      src/Magnum/Tags.h
  15. 3
      src/Magnum/Test/TagsTest.cpp
  16. 5
      src/Magnum/TextureTools/Test/CMakeLists.txt
  17. 5
      src/Magnum/Vk/Test/CMakeLists.txt
  18. 1
      src/MagnumExternal/OpenGL/GL/extensions.txt
  19. 3
      src/MagnumExternal/OpenGL/GL/flextGL.cpp
  20. 9
      src/MagnumExternal/OpenGL/GL/flextGL.h
  21. 3
      src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp
  22. 10
      src/MagnumExternal/OpenGL/GLES2/Emscripten/extensions.txt
  23. 2
      src/MagnumExternal/OpenGL/GLES2/extensions.txt
  24. 13
      src/MagnumExternal/OpenGL/GLES2/flextGL.h
  25. 5
      src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h
  26. 3
      src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp
  27. 6
      src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp
  28. 3
      src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp
  29. 13
      src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h
  30. 6
      src/MagnumExternal/OpenGL/GLES3/Emscripten/extensions.txt
  31. 1
      src/MagnumExternal/OpenGL/GLES3/extensions.txt
  32. 13
      src/MagnumExternal/OpenGL/GLES3/flextGL.h
  33. 5
      src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h
  34. 3
      src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp
  35. 6
      src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp
  36. 3
      src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp
  37. 13
      src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h
  38. 4
      src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt
  39. 4
      src/MagnumPlugins/AnyImageConverter/Test/CMakeLists.txt
  40. 4
      src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt
  41. 4
      src/MagnumPlugins/AnySceneConverter/Test/CMakeLists.txt
  42. 6
      src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp
  43. 6
      src/MagnumPlugins/AnySceneImporter/Test/CMakeLists.txt
  44. 4
      src/MagnumPlugins/AnyShaderConverter/Test/CMakeLists.txt
  45. 4
      src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt
  46. 4
      src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt
  47. 1
      src/MagnumPlugins/ObjImporter/ObjImporter.cpp
  48. 42
      src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt
  49. 730
      src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp
  50. 0
      src/MagnumPlugins/ObjImporter/Test/empty.obj
  51. 23
      src/MagnumPlugins/ObjImporter/Test/invalid-incomplete-data.obj
  52. 4
      src/MagnumPlugins/ObjImporter/Test/invalid-inconsistent-index-tuple.obj
  53. 1
      src/MagnumPlugins/ObjImporter/Test/invalid-keyword.obj
  54. 14
      src/MagnumPlugins/ObjImporter/Test/invalid-mixed-primitives.obj
  55. 29
      src/MagnumPlugins/ObjImporter/Test/invalid-number-count.obj
  56. 31
      src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj
  57. 8
      src/MagnumPlugins/ObjImporter/Test/invalid-optional-coordinate.obj
  58. 7
      src/MagnumPlugins/ObjImporter/Test/keywords.obj
  59. 3
      src/MagnumPlugins/ObjImporter/Test/mesh-ignored-keyword.obj
  60. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-multiple.obj
  61. 3
      src/MagnumPlugins/ObjImporter/Test/mesh-named-first-unnamed-index-first.obj
  62. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-named-first-unnamed.obj
  63. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-named.obj
  64. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-normals.obj
  65. 2
      src/MagnumPlugins/ObjImporter/Test/mesh-positions-optional-coordinate.obj
  66. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-primitive-lines.obj
  67. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-primitive-points.obj
  68. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-primitive-triangles.obj
  69. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-texture-coordinates-normals.obj
  70. 3
      src/MagnumPlugins/ObjImporter/Test/mesh-texture-coordinates-optional-coordinate.obj
  71. 0
      src/MagnumPlugins/ObjImporter/Test/mesh-texture-coordinates.obj
  72. 23
      src/MagnumPlugins/ObjImporter/Test/missingData.obj
  73. 13
      src/MagnumPlugins/ObjImporter/Test/mixedPrimitives.obj
  74. 17
      src/MagnumPlugins/ObjImporter/Test/optionalCoordinates.obj
  75. 29
      src/MagnumPlugins/ObjImporter/Test/wrongNumberCount.obj
  76. 22
      src/MagnumPlugins/ObjImporter/Test/wrongNumbers.obj
  77. 4
      src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt
  78. 4
      src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt
  79. 4
      src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt
  80. 2
      toolchains

7
doc/changelog.dox

@ -108,8 +108,11 @@ See also:
resulted in a new @cpp "firefox-deprecated-debug-renderer-info" @ce resulted in a new @cpp "firefox-deprecated-debug-renderer-info" @ce
workaround being added, see @ref opengl-workarounds for more info. workaround being added, see @ref opengl-workarounds for more info.
- Recognizing @webgl_extension{EXT,float_blend} and - Recognizing @webgl_extension{EXT,float_blend} and
@webgl_extension{WEBGL,debug_shaders} extensions, no implementation done @webgl_extension{WEBGL,debug_shaders} WebGL extensions, no implementation
yet done yet
- Recognizing @gl_extension{KHR,parallel_shader_compile} GL, GLES and
@webgl_extension{KHR,parallel_shader_compile} WebGL extensions, no
implementation done yet
- Recognizing ANGLE GLES and WebGL base vertex, base instance and multi-draw - Recognizing ANGLE GLES and WebGL base vertex, base instance and multi-draw
extensions and using them in @ref GL::AbstractShaderProgram::draw(Mesh&) extensions and using them in @ref GL::AbstractShaderProgram::draw(Mesh&)
and @ref GL::AbstractShaderProgram::draw(Containers::ArrayView<const Containers::Reference<MeshView>>): and @ref GL::AbstractShaderProgram::draw(Containers::ArrayView<const Containers::Reference<MeshView>>):

170
doc/developers.dox

@ -561,14 +561,41 @@ in inverse --- but usually @ref developers-deprecation "deprecate first".
10. Iterate until the CIs are green 10. Iterate until the CIs are green
11. Merge to `master` 11. Merge to `master`
@section developers-gl-extensions Checklist for adding / removing GL versions and extensions @section developers-gl-extensions Checklist for adding / removing GL extensions
1. Install [flextGL](https://github.com/mosra/flextgl) 1. Add new extensions to the GL, GLES and WebGL sections of
2. Go to `src/MagnumExternal/OpenGL/`: `src/Magnum/GL/Extensions.h`
- Update `GL/extensions.txt`, `GLES2/extensions.txt`, - Order them by extension ID that is mentioned in every extension spec
file. If the extension isn't in the official Khronos registry (such as
various ANGLE extensions), at it at the end of the range.
- Update the numbering to stay monotonic and unique, round up start index
of next section to nearest ten to make the updates bearable
- In case there's a lot of new extensions,
@cpp Implementation::ExtensionCount @ce might needed to be increased.
2. Add them alphabetically ordered to the correct list in
`src/magnum/GL/Context.cpp`
- run GL, ES2, ES3, WebGL1 and WebGL2 build of `GLContextTest` to verify
everything is still okay
- run GL, ES2, ES3, WebGL1 and WebGL2 build of `magnum-gl-info`
- the extension should be listed unless it's not available on given
GL flavor
- and also marked as supported unless the machine doesn't support it
(cross-check with `--extension-strings`)
3. Get [flextGL](https://github.com/mosra/flextgl) and go to
`src/MagnumExternal/OpenGL/`:
- Add/remove extensions in `GL/extensions.txt`, `GLES2/extensions.txt`,
`GLES2/Emscripten/extensions.txt`, `GLES3/extensions.txt`, `GLES2/Emscripten/extensions.txt`, `GLES3/extensions.txt`,
`GLES3/Emscripten/extensions.txt` (bump versions or add/remove `GLES3/Emscripten/extensions.txt`, in the same order as in
extensions) `src/Magnum/GL/Extensions.h`
- For GLES and WebGL extensions, if they aren't in the official Khronos
registry (such as various ANGLE extensions), check if they're in
ANGLE's [gl_angle_ext.xml](https://raw.githubusercontent.com/google/angle/master/scripts/gl_angle_ext.xml)
at least. If not, like with core WebGL functionality that has no match
in the base GLES spec, you may need to craft your own XML file. See
`src/MagnumExternal/OpenGL/GLES3/webgl.xml` for an example.
- WebGL extensions usually have a GLES extension as a base, but then may
remove certains entrypoints from it. If that's the case, add it to the
function blacklist at the end of the Emscripten-specific files.
- Run `./update-flextgl.sh` to update everything. Reason there is so many - Run `./update-flextgl.sh` to update everything. Reason there is so many
variants of the files are the following: variants of the files are the following:
- Desktop GLES on Windows still links to the ancient `opengl32.dll` - Desktop GLES on Windows still links to the ancient `opengl32.dll`
@ -580,11 +607,44 @@ in inverse --- but usually @ref developers-deprecation "deprecate first".
set the function pointers to those exported symbols in case the set the function pointers to those exported symbols in case the
system GL header defines them. system GL header defines them.
- Emscripten doesn't have the ability to manually load extension - Emscripten doesn't have the ability to manually load extension
pointers, thus it has only header files. pointers either, thus it has only header files.
3. Check @cb{.sh} git diff @ce for suspicious changes and whitespace-at-EOL 4. Check @cb{.sh} git diff @ce for suspicious changes and whitespace-at-EOL
4. For every new added function, add an entry to `doc/opengl-mapping.dox` - If any extensions don't add any useful symbols, comment them out in
5. For every new added limit query (various `GL_MIN_*` and `GL_MAX_*` macros the `extensions.txt` files and regenerate to avoid needless bloat
etc.), add an entry to the bottom of `doc/opengl-mapping.dox` 5. For every new function that appeared in the regenerated extension headers,
add an entry to `doc/opengl-mapping.dox`
6. For every new added limit query that appeared in the regenerated extension
headers (various `GL_MIN_*` and `GL_MAX_*` macros etc.), add an entry to
the bottom of `doc/opengl-mapping.dox`
7. Add new extensions to the general GL, GLES and WebGL lists in
`doc/opengl-support.dox`, again matching the order in `Extensions.h` ---
grouped by prefix, but then ordered by extension number
In order to remove GL functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all.
@see @ref developers-gl-versions, @ref developers-vk-extensions
@section developers-gl-versions Checklist for adding / removing GL versions
1. Add new version enum value:
- to `src/Magnum/GL/Version.h`
- to debug output in `src/Magnum/GL/Version.cpp`
- to @cpp GL::Extension::extensions() @ce in `src/Magnum/GL/Context.cpp`
- to @cpp GL::Context::tryCreate() @ce in `src/Magnum/GL/Context.cpp`
- to specify GLSL version in `src/Magnum/GL/Shader.cpp`
- to the list in `src/Magnum/Platform/gl-info.cpp`
- to the test in `src/Magnum/GL/Test/ContextTest.cpp`
2. Update existing extensions with version in which they became core (last
parameter of the `_extension()` macro in `src/Magnum/GL/Extensions.h`)
3. Go to `src/MagnumExternal/OpenGL/`, bump versions in `GL/extensions.txt`,
`GLES2/extensions.txt`, `GLES2/Emscripten/extensions.txt`,
`GLES3/extensions.txt`, `GLES3/Emscripten/extensions.txt`
4. Continue with @ref developers-gl-extensions for all extensions that were
added by the new version and were not already present
5. For all existing extensions APIs that lose their suffix in the new version,
update doc references to be without the suffix
6. Add a table listing the new version and all new extensions in it to 6. Add a table listing the new version and all new extensions in it to
`doc/opengl-support.dox` (take a list of them from the changelog in the `doc/opengl-support.dox` (take a list of them from the changelog in the
official spec PDF). Some extensions might be already present in the general official spec PDF). Some extensions might be already present in the general
@ -595,31 +655,13 @@ in inverse --- but usually @ref developers-deprecation "deprecate first".
8. Add a new `requires-glXY`, `requires-glesXY` or `requires-webglXY` alias 8. Add a new `requires-glXY`, `requires-glesXY` or `requires-webglXY` alias
to `Doxyfile`, `Doxyfile-mcss` and `Doxyfile-public`, copypaste it from to `Doxyfile`, `Doxyfile-mcss` and `Doxyfile-public`, copypaste it from
existing and change the numbers existing and change the numbers
9. Add new version enum value:
- to `src/Magnum/GL/Version.h`
- to debug output in `src/Magnum/GL/Version.cpp`
- to @ref GL::Extension::extensions() in `src/Magnum/GL/Context.cpp`
- to @cpp GL::Context::tryCreate() @ce in `src/Magnum/GL/Context.cpp`
- to specify GLSL version in `src/Magnum/GL/Shader.cpp`
- to the list in `src/Magnum/Platform/gl-info.cpp`
- to the test in `src/Magnum/GL/Test/ContextTest.cpp`
10. Add new extensions to `src/Magnum/GL/Extensions.h`
- order them by extension ID that is mentioned in every extension spec
file
- update the numbering to stay monotonic and unique, round up start index
of next section to nearest ten to make the updates bearable
- in case there's a lot of new extensions, @cpp Implementation::ExtensionCount @ce
might needed to be increased
- run `ContextTest` to verify everything is still okay
11. Update existing extensions with version in which they become core (last
parameter of the `_extension()` macro)
12. Update extension list in `src/magnum/GL/Context.cpp` according to changes
in `src/Magnum/GL/Extensions.h`
In order to remove GL functionality, be sure to touch all places mentioned In order to remove GL functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first", above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all. unless it doesn't affect public API at all.
@see @ref developers-vk-versions
@section developers-gl-functionality Checklist for adding / removing GL functionality @section developers-gl-functionality Checklist for adding / removing GL functionality
1. Check if given desktop functionality has equivalent in ES or WebGL, add 1. Check if given desktop functionality has equivalent in ES or WebGL, add
@ -728,11 +770,11 @@ In order to remove OpenAL functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first", above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all. unless it doesn't affect public API at all.
@section developers-vk-extensions Checklist for adding / removing Vulkan versions and extensions @section developers-vk-extensions Checklist for adding / removing Vulkan extensions
1. Add new extensions to `src/Magnum/Vk/Extensions.h` 1. Add new extensions to `src/Magnum/Vk/Extensions.h`
- there's a separate list for instance and device extensions, ensure each - there's a separate list for instance and device extensions, ensure each
in the right list is in the right list
- order them by extension ID that is mentioned on every extension spec - order them by extension ID that is mentioned on every extension spec
page page
- update the numbering to stay monotonic and unique, round up start index - update the numbering to stay monotonic and unique, round up start index
@ -743,37 +785,61 @@ unless it doesn't affect public API at all.
need to be increased need to be increased
2. Add them alphabetically ordered to the correct list in 2. Add them alphabetically ordered to the correct list in
`src/Magnum/Vk/Extensions.cpp` `src/Magnum/Vk/Extensions.cpp`
3. Update existing extensions with version in which they become core (last - run `VkExtensionsTest` to verify everything is still okay
parameter of the `_extension()` macro) - run `magnum-vk-info`, the extension should be listed and also marked as
4. Get [flextGL](https://github.com/mosra/flextgl) and go to supported, unless the machine doesn't support it (cross-check with
`--extension-strings`)
3. Get [flextGL](https://github.com/mosra/flextgl) and go to
`src/MagnumExternal/Vulkan/`: `src/MagnumExternal/Vulkan/`:
- Update `extensions.txt` (bump a version or add/remove extensions), - Add/remove extensions in `extensions.txt`, in the same order as in
in the same order as `Extensions.h` `src/Magnum/Vk/Extensions.h`
- Run `./update-flexgl.sh` to update everything - Run `./update-flexgl.sh` to update everything
5. Check @cb{.sh} git diff @ce for suspicious changes and whitespace-at-EOL 4. Check @cb{.sh} git diff @ce for suspicious changes and whitespace-at-EOL
6. For every new added function and structure, add an entry to - If any extensions don't add any useful symbols, comment them out in
the `extensions.txt` file and regenerate to avoid needless bloat
5. For every new added function and structure, add an entry to
`doc/vulkan-mapping.dox` `doc/vulkan-mapping.dox`
7. For every new `*Feature` structure, expand the @ref Vk::DeviceFeatures 6. For every new `*Feature` structure, expand the @ref Vk::DeviceFeatures
enum according to @ref developers-vk-features enum according to @ref developers-vk-features
8. Add a table listing the new version and all new extensions in it to 7. Add new extensions to the general list in `doc/vulkan-support.dox`, again
matching the order in `Extensions.h` --- grouped by prefix, but then
ordered by extension number
In order to remove Vulkan functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all.
@see @ref developers-vk-versions, @ref developers-gl-extensions
@section developers-vk-versions Checklist for adding / removing Vulkan versions
1. Add new version enum value:
- to `src/Magnum/Vk/Version.h`
- to the list in `src/Magnum/Vk/vk-info.cpp`
- to @cpp Vk::InstanceExtension::extensions() @ce and
@cpp Vk::Extension::extensions() @ce in `src/Magnum/Vk/Extensions.cpp`
2. Update existing extensions with version in which they became core (last
parameter of the `_extension()` macro)
3. Continue with @ref developers-vk-extensions for all extensions that were
added by the new version and were not already present
4. For all existing extensions APIs that lose their suffix in the new version,
update doc references to be without the suffix
5. Add a table listing the new version and all new extensions in it to
`doc/vulkan-support.dox` (take a list of them from the changelog in the `doc/vulkan-support.dox` (take a list of them from the changelog in the
official spec PDF). Some extensions might be already present in the general official spec). Some extensions might be already present in the general
extension list, move them out of there. extension list, move them out of there.
9. Add a new `requires-vkXY` page with @c \@m_footernavigation to 6. Add a new `requires-vkXY` page with @c \@m_footernavigation to
`doc/vulkan-support.dox`, mention it as a @c \@subpage at a correct `doc/vulkan-support.dox`, mention it as a @c \@subpage at a correct
position in the list position in the list
10. Add a new `requires-vkXY` alias to `Doxyfile`, `Doxyfile-mcss` and 7. Add a new `requires-vkXY` alias to `Doxyfile`, `Doxyfile-mcss` and
`Doxyfile-public`, copypaste it from existing and change the numbers `Doxyfile-public`, copypaste it from existing and change the numbers
11. Add new version enum value:
- to `src/Magnum/Vk/Version.h`
- to the list in `src/Magnum/Vk/vk-info.cpp`
- to @ref Vk::InstanceExtension::extensions() and
@ref Vk::Extension::extensions() in `src/Magnum/Vk/Extensions.cpp`
In order to remove Vulkan functionality, be sure to touch all places mentioned In order to remove Vulkan functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first", above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all. unless it doesn't affect public API at all.
@see @ref developers-gl-versions
@section developers-vk-functionality Checklist for adding / removing Vulkan functionality @section developers-vk-functionality Checklist for adding / removing Vulkan functionality
@todoc adapt from the GL section @todoc adapt from the GL section

1
doc/opengl-mapping.dox

@ -290,6 +290,7 @@ OpenGL function | Matching API
@fn_gl_extension{MakeTextureHandleResident,ARB,bindless_texture} | | @fn_gl_extension{MakeTextureHandleResident,ARB,bindless_texture} | |
@fn_gl_extension{MakeTextureHandleNonResident,ARB,bindless_texture} | | @fn_gl_extension{MakeTextureHandleNonResident,ARB,bindless_texture} | |
@fn_gl{MapBuffer}, \n `glMapNamedBuffer()`, \n @fn_gl{MapBufferRange}, \n `glMapNamedBufferRange()`, \n @fn_gl{UnmapBuffer}, \n `glUnmapNamedBuffer()` | @ref GL::Buffer::map(), @ref GL::Buffer::unmap() @fn_gl{MapBuffer}, \n `glMapNamedBuffer()`, \n @fn_gl{MapBufferRange}, \n `glMapNamedBufferRange()`, \n @fn_gl{UnmapBuffer}, \n `glUnmapNamedBuffer()` | @ref GL::Buffer::map(), @ref GL::Buffer::unmap()
@fn_gl_extension{MaxShaderCompilerThreads,KHR,parallel_shader_compile} | |
@fn_gl{MemoryBarrier}, \n `glMemoryBarrierByRegion()` | @ref GL::Renderer::setMemoryBarrier(), \n @ref GL::Renderer::setMemoryBarrierByRegion() @fn_gl{MemoryBarrier}, \n `glMemoryBarrierByRegion()` | @ref GL::Renderer::setMemoryBarrier(), \n @ref GL::Renderer::setMemoryBarrierByRegion()
@fn_gl{MinSampleShading} | @ref GL::Renderer::setMinSampleShading() @fn_gl{MinSampleShading} | @ref GL::Renderer::setMinSampleShading()
@fn_gl{MultiDrawArrays}, \n @fn_gl{MultiDrawElements}, \n @fn_gl{MultiDrawElementsBaseVertex} | @ref GL::AbstractShaderProgram::draw(Containers::ArrayView<const Containers::Reference<MeshView>>) @fn_gl{MultiDrawArrays}, \n @fn_gl{MultiDrawElements}, \n @fn_gl{MultiDrawElementsBaseVertex} | @ref GL::AbstractShaderProgram::draw(Containers::ArrayView<const Containers::Reference<MeshView>>)

3
doc/opengl-support.dox

@ -297,6 +297,7 @@ Extension | Status
@gl_extension{KHR,blend_equation_advanced} | done @gl_extension{KHR,blend_equation_advanced} | done
@gl_extension2{KHR,blend_equation_advanced_coherent,KHR_blend_equation_advanced} | done @gl_extension2{KHR,blend_equation_advanced_coherent,KHR_blend_equation_advanced} | done
@gl_extension{KHR,texture_compression_astc_sliced_3d} | done (nothing to do) @gl_extension{KHR,texture_compression_astc_sliced_3d} | done (nothing to do)
@gl_extension{KHR,parallel_shader_compile} | |
@subsection opengl-support-extensions-vendor Vendor OpenGL extensions @subsection opengl-support-extensions-vendor Vendor OpenGL extensions
@ -489,6 +490,7 @@ Extension | Status
@gl_extension{KHR,context_flush_control} | | @gl_extension{KHR,context_flush_control} | |
@gl_extension{KHR,no_error} | done @gl_extension{KHR,no_error} | done
@gl_extension{KHR,texture_compression_astc_sliced_3d} | done (nothing to do) @gl_extension{KHR,texture_compression_astc_sliced_3d} | done (nothing to do)
@gl_extension{KHR,parallel_shader_compile} | |
@gl_extension2{NV,read_buffer_front,NV_read_buffer} | done @gl_extension2{NV,read_buffer_front,NV_read_buffer} | done
@gl_extension2{NV,read_depth,NV_read_depth_stencil} | done @gl_extension2{NV,read_depth,NV_read_depth_stencil} | done
@gl_extension2{NV,read_stencil,NV_read_depth_stencil} | done @gl_extension2{NV,read_stencil,NV_read_depth_stencil} | done
@ -564,6 +566,7 @@ Extension | Status
@webgl_extension{EXT,clip_cull_distance} | done @webgl_extension{EXT,clip_cull_distance} | done
@webgl_extension{EXT,texture_norm16} | done @webgl_extension{EXT,texture_norm16} | done
@webgl_extension{EXT,draw_buffers_indexed} | done @webgl_extension{EXT,draw_buffers_indexed} | done
@webgl_extension{KHR,parallel_shader_compile} | |
@webgl_extension{OES,texture_float_linear} | done @webgl_extension{OES,texture_float_linear} | done
@webgl_extension{OVR,multiview2} | | @webgl_extension{OVR,multiview2} | |
@webgl_extension{WEBGL,lose_context} | | @webgl_extension{WEBGL,lose_context} | |

2
package/archlinux/magnum-git/PKGBUILD

@ -1,6 +1,6 @@
# Author: mosra <mosra@centrum.cz> # Author: mosra <mosra@centrum.cz>
pkgname=magnum-git pkgname=magnum-git
pkgver=2020.06.r481.ga4979e2cd pkgver=2020.06.r1626.g67d37c9ed
pkgrel=1 pkgrel=1
pkgdesc="C++11/C++14 graphics middleware for games and data visualization (Git version)" pkgdesc="C++11/C++14 graphics middleware for games and data visualization (Git version)"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')

5
src/Magnum/DebugTools/Test/CMakeLists.txt

@ -44,11 +44,6 @@ if(MAGNUM_WITH_TRADE)
set(COMPAREIMAGETEST_SAVE_DIR ${CMAKE_CURRENT_BINARY_DIR}/write) set(COMPAREIMAGETEST_SAVE_DIR ${CMAKE_CURRENT_BINARY_DIR}/write)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since
# Corrade doesn't support dynamic plugins on iOS, this sorta works around
# that. Should be revisited when updating Travis to newer Xcode (xcode7.3
# has CMake 3.6).
if(NOT MAGNUM_BUILD_PLUGINS_STATIC) if(NOT MAGNUM_BUILD_PLUGINS_STATIC)
if(MAGNUM_WITH_ANYIMAGEIMPORTER) if(MAGNUM_WITH_ANYIMAGEIMPORTER)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)

25
src/Magnum/GL/Context.cpp

@ -104,6 +104,7 @@ constexpr Extension ExtensionList[]{
Extensions::GREMEDY::string_marker{}, Extensions::GREMEDY::string_marker{},
Extensions::KHR::blend_equation_advanced{}, Extensions::KHR::blend_equation_advanced{},
Extensions::KHR::blend_equation_advanced_coherent{}, Extensions::KHR::blend_equation_advanced_coherent{},
Extensions::KHR::parallel_shader_compile{},
Extensions::KHR::texture_compression_astc_hdr{}, Extensions::KHR::texture_compression_astc_hdr{},
Extensions::KHR::texture_compression_astc_ldr{}, Extensions::KHR::texture_compression_astc_ldr{},
Extensions::KHR::texture_compression_astc_sliced_3d{}, Extensions::KHR::texture_compression_astc_sliced_3d{},
@ -290,6 +291,7 @@ constexpr Extension ExtensionList[]{
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
Extensions::EXT::texture_norm16{}, Extensions::EXT::texture_norm16{},
#endif #endif
Extensions::KHR::parallel_shader_compile{},
Extensions::OES::texture_float_linear{}, Extensions::OES::texture_float_linear{},
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
Extensions::OVR::multiview2{}, Extensions::OVR::multiview2{},
@ -394,6 +396,7 @@ constexpr Extension ExtensionList[]{
Extensions::KHR::blend_equation_advanced_coherent{}, Extensions::KHR::blend_equation_advanced_coherent{},
Extensions::KHR::context_flush_control{}, Extensions::KHR::context_flush_control{},
Extensions::KHR::no_error{}, Extensions::KHR::no_error{},
Extensions::KHR::parallel_shader_compile{},
Extensions::KHR::texture_compression_astc_hdr{}, Extensions::KHR::texture_compression_astc_hdr{},
Extensions::KHR::texture_compression_astc_sliced_3d{}, Extensions::KHR::texture_compression_astc_sliced_3d{},
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -1281,11 +1284,14 @@ Context::Configuration& Context::Configuration::addDisabledExtensions(std::initi
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Debug& operator<<(Debug& debug, const Context::Flag value) { Debug& operator<<(Debug& debug, const Context::Flag value) {
debug << "GL::Context::Flag" << Debug::nospace; const bool packed = debug.immediateFlags() >= Debug::Flag::Packed;
if(!packed)
debug << "GL::Context::Flag" << Debug::nospace;
switch(value) { switch(value) {
/* LCOV_EXCL_START */ /* LCOV_EXCL_START */
#define _c(value) case Context::Flag::value: return debug << "::" #value; #define _c(value) case Context::Flag::value: return debug << (packed ? "" : "::") << Debug::nospace << #value;
_c(Debug) _c(Debug)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_c(ForwardCompatible) _c(ForwardCompatible)
@ -1298,11 +1304,11 @@ Debug& operator<<(Debug& debug, const Context::Flag value) {
/* LCOV_EXCL_STOP */ /* LCOV_EXCL_STOP */
} }
return debug << "(" << Debug::nospace << reinterpret_cast<void*>(GLint(value)) << Debug::nospace << ")"; return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast<void*>(GLint(value)) << Debug::nospace << (packed ? "" : ")");
} }
Debug& operator<<(Debug& debug, const Context::Flags value) { Debug& operator<<(Debug& debug, const Context::Flags value) {
return Containers::enumSetDebugOutput(debug, value, "GL::Context::Flags{}", { return Containers::enumSetDebugOutput(debug, value, debug.immediateFlags() >= Debug::Flag::Packed ? "{}" : "GL::Context::Flags{}", {
Context::Flag::Debug, Context::Flag::Debug,
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Context::Flag::ForwardCompatible, Context::Flag::ForwardCompatible,
@ -1316,11 +1322,14 @@ Debug& operator<<(Debug& debug, const Context::Flags value) {
#endif #endif
Debug& operator<<(Debug& debug, const Context::DetectedDriver value) { Debug& operator<<(Debug& debug, const Context::DetectedDriver value) {
debug << "GL::Context::DetectedDriver" << Debug::nospace; const bool packed = debug.immediateFlags() >= Debug::Flag::Packed;
if(!packed)
debug << "GL::Context::DetectedDriver" << Debug::nospace;
switch(value) { switch(value) {
/* LCOV_EXCL_START */ /* LCOV_EXCL_START */
#define _c(value) case Context::DetectedDriver::value: return debug << "::" #value; #define _c(value) case Context::DetectedDriver::value: return debug << (packed ? "" : "::") << Debug::nospace << #value;
_c(Amd) _c(Amd)
#ifdef MAGNUM_TARGET_GLES #ifdef MAGNUM_TARGET_GLES
_c(Angle) _c(Angle)
@ -1339,11 +1348,11 @@ Debug& operator<<(Debug& debug, const Context::DetectedDriver value) {
/* LCOV_EXCL_STOP */ /* LCOV_EXCL_STOP */
} }
return debug << "(" << Debug::nospace << reinterpret_cast<void*>(GLint(value)) << Debug::nospace << ")"; return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast<void*>(GLint(value)) << Debug::nospace << (packed ? "" : ")");
} }
Debug& operator<<(Debug& debug, const Context::DetectedDrivers value) { Debug& operator<<(Debug& debug, const Context::DetectedDrivers value) {
return Containers::enumSetDebugOutput(debug, value, "GL::Context::DetectedDrivers{}", { return Containers::enumSetDebugOutput(debug, value, debug.immediateFlags() >= Debug::Flag::Packed ? "{}" : "GL::Context::DetectedDrivers{}", {
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Context::DetectedDriver::Amd, Context::DetectedDriver::Amd,
#endif #endif

6
src/Magnum/GL/Extensions.h

@ -256,8 +256,9 @@ namespace AMD {
_extension(167,KHR,blend_equation_advanced_coherent, GL210, None) // #174 _extension(167,KHR,blend_equation_advanced_coherent, GL210, None) // #174
_extension(168,KHR,no_error, GL210, GL460) // #175 _extension(168,KHR,no_error, GL210, GL460) // #175
_extension(169,KHR,texture_compression_astc_sliced_3d, GL210, None) // #189 _extension(169,KHR,texture_compression_astc_sliced_3d, GL210, None) // #189
_extension(170,KHR,parallel_shader_compile, GL210, None) // #192
} namespace MAGNUM { } namespace MAGNUM {
_extension(170,MAGNUM,shader_vertex_id, GL300, GL300) _extension(171,MAGNUM,shader_vertex_id, GL300, GL300)
} namespace NV { } namespace NV {
_extension(175,NV,primitive_restart, GL210, GL310) // #285 _extension(175,NV,primitive_restart, GL210, GL310) // #285
_extension(176,NV,depth_buffer_float, GL210, GL300) // #334 _extension(176,NV,depth_buffer_float, GL210, GL300) // #334
@ -305,6 +306,8 @@ namespace ANGLE {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_extension(16,EXT,draw_buffers_indexed, GLES300, None) // #45 _extension(16,EXT,draw_buffers_indexed, GLES300, None) // #45
#endif #endif
} namespace KHR {
_extension(17,KHR,parallel_shader_compile, GLES200, None) // #37
} namespace OES { } namespace OES {
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
_extension(20,OES,texture_float, GLES200, GLES300) // #1 _extension(20,OES,texture_float, GLES200, GLES300) // #1
@ -488,6 +491,7 @@ namespace ANDROID {
_extension( 87,KHR,context_flush_control, GLES200, None) // #191 _extension( 87,KHR,context_flush_control, GLES200, None) // #191
_extension( 88,KHR,no_error, GLES200, None) // #243 _extension( 88,KHR,no_error, GLES200, None) // #243
_extension( 89,KHR,texture_compression_astc_sliced_3d, GLES200, None) // #249 _extension( 89,KHR,texture_compression_astc_sliced_3d, GLES200, None) // #249
_extension( 90,KHR,parallel_shader_compile, GLES200, None) // #288
} namespace NV { } namespace NV {
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
_extension(100,NV,draw_buffers, GLES200, GLES300) // #91 _extension(100,NV,draw_buffers, GLES200, GLES300) // #91

5
src/Magnum/GL/Test/CMakeLists.txt

@ -104,11 +104,6 @@ if(MAGNUM_BUILD_GL_TESTS)
set(RENDERERGLTEST_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/RendererGLTestFiles) set(RENDERERGLTEST_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/RendererGLTestFiles)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since
# Corrade doesn't support dynamic plugins on iOS, this sorta works around
# that. Should be revisited when updating Travis to newer Xcode (xcode7.3
# has CMake 3.6).
if(NOT MAGNUM_BUILD_PLUGINS_STATIC) if(NOT MAGNUM_BUILD_PLUGINS_STATIC)
if(MAGNUM_WITH_ANYIMAGEIMPORTER) if(MAGNUM_WITH_ANYIMAGEIMPORTER)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)

68
src/Magnum/GL/Test/ContextTest.cpp

@ -56,10 +56,14 @@ struct ContextTest: TestSuite::Tester {
void extensions(); void extensions();
void debugFlag(); void debugFlag();
void debugFlagPacked();
void debugFlags(); void debugFlags();
void debugFlagsPacked();
void debugDetectedDriver(); void debugDetectedDriver();
void debugDetectedDriverPacked();
void debugDetectedDrivers(); void debugDetectedDrivers();
void debugDetectedDriversPacked();
}; };
ContextTest::ContextTest() { ContextTest::ContextTest() {
@ -78,10 +82,14 @@ ContextTest::ContextTest() {
&ContextTest::extensions, &ContextTest::extensions,
&ContextTest::debugFlag, &ContextTest::debugFlag,
&ContextTest::debugFlagPacked,
&ContextTest::debugFlags, &ContextTest::debugFlags,
&ContextTest::debugFlagsPacked,
&ContextTest::debugDetectedDriver, &ContextTest::debugDetectedDriver,
&ContextTest::debugDetectedDrivers}); &ContextTest::debugDetectedDriverPacked,
&ContextTest::debugDetectedDrivers,
&ContextTest::debugDetectedDriversPacked});
} }
void ContextTest::isExtension() { void ContextTest::isExtension() {
@ -453,13 +461,35 @@ void ContextTest::debugFlag() {
#endif #endif
} }
void ContextTest::debugFlagPacked() {
#ifdef MAGNUM_TARGET_WEBGL
CORRADE_SKIP("No context flags on Emscripten yet.");
#else
std::ostringstream out;
/* Last is not packed, ones before should not make any flags persistent */
Debug{&out} << Debug::packed << Context::Flag::Debug << Debug::packed << Context::Flag(0xdead) << Context::Flag::NoError;
CORRADE_COMPARE(out.str(), "Debug 0xdead GL::Context::Flag::NoError\n");
#endif
}
void ContextTest::debugFlags() { void ContextTest::debugFlags() {
#ifdef MAGNUM_TARGET_WEBGL #ifdef MAGNUM_TARGET_WEBGL
CORRADE_SKIP("No context flags on Emscripten yet."); CORRADE_SKIP("No context flags on Emscripten yet.");
#else #else
std::ostringstream out; std::ostringstream out;
Debug(&out) << Context::Flags{} << (Context::Flag::Debug|Context::Flag::NoError) << (Context::Flag::Debug|Context::Flag(0xded0)); Debug{&out} << (Context::Flag::Debug|Context::Flag::NoError|Context::Flag(0xded0)) << Context::Flags{};
CORRADE_COMPARE(out.str(), "GL::Context::Flags{} GL::Context::Flag::Debug|GL::Context::Flag::NoError GL::Context::Flag::Debug|GL::Context::Flag(0xded0)\n"); CORRADE_COMPARE(out.str(), "GL::Context::Flag::Debug|GL::Context::Flag::NoError|GL::Context::Flag(0xded0) GL::Context::Flags{}\n");
#endif
}
void ContextTest::debugFlagsPacked() {
#ifdef MAGNUM_TARGET_WEBGL
CORRADE_SKIP("No context flags on Emscripten yet.");
#else
std::ostringstream out;
/* Last is not packed, ones before should not make any flags persistent */
Debug{&out} << Debug::packed << (Context::Flag::Debug|Context::Flag::NoError|Context::Flag(0xded0)) << Debug::packed << Context::Flags{} << (Context::Flag::Debug|Context::Flag::NoError);
CORRADE_COMPARE(out.str(), "Debug|NoError|0xded0 {} GL::Context::Flag::Debug|GL::Context::Flag::NoError\n");
#endif #endif
} }
@ -474,14 +504,38 @@ void ContextTest::debugDetectedDriver() {
#endif #endif
} }
void ContextTest::debugDetectedDriverPacked() {
std::ostringstream out;
/* Last is not packed, ones before should not make any flags persistent */
#ifndef MAGNUM_TARGET_WEBGL
Debug{&out} << Debug::packed << Context::DetectedDriver::Amd << Debug::packed << Context::DetectedDriver(0xdead) << Context::DetectedDriver::NVidia;
CORRADE_COMPARE(out.str(), "Amd 0xdead GL::Context::DetectedDriver::NVidia\n");
#else
Debug{&out} << Debug::packed << Context::DetectedDriver::Angle << Debug::packed << Context::DetectedDriver(0xdead) << Context::DetectedDriver::Angle;
CORRADE_COMPARE(out.str(), "Angle 0xdead GL::Context::DetectedDriver::Angle\n");
#endif
}
void ContextTest::debugDetectedDrivers() { void ContextTest::debugDetectedDrivers() {
std::ostringstream out; std::ostringstream out;
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Debug{&out} << Context::DetectedDrivers{} << (Context::DetectedDriver::Amd|Context::DetectedDriver::NVidia) << (Context::DetectedDriver::Mesa|Context::DetectedDriver(0xde00)); Debug{&out} << (Context::DetectedDriver::Amd|Context::DetectedDriver::Mesa|Context::DetectedDriver(0xde00)) << Context::DetectedDrivers{};
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDrivers{} GL::Context::DetectedDriver::Amd|GL::Context::DetectedDriver::NVidia GL::Context::DetectedDriver::Mesa|GL::Context::DetectedDriver(0xde00)\n"); CORRADE_COMPARE(out.str(), "GL::Context::DetectedDriver::Amd|GL::Context::DetectedDriver::Mesa|GL::Context::DetectedDriver(0xde00) GL::Context::DetectedDrivers{}\n");
#else
Debug{&out} << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)) << Context::DetectedDrivers{};
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDriver::Angle|GL::Context::DetectedDriver(0xde00) GL::Context::DetectedDrivers{}\n");
#endif
}
void ContextTest::debugDetectedDriversPacked() {
std::ostringstream out;
/* Last is not packed, ones before should not make any flags persistent */
#ifndef MAGNUM_TARGET_WEBGL
Debug{&out} << Debug::packed << (Context::DetectedDriver::Amd|Context::DetectedDriver::Mesa|Context::DetectedDriver(0xde00)) << Debug::packed << Context::DetectedDrivers{} << (Context::DetectedDriver::Amd|Context::DetectedDriver::Mesa);
CORRADE_COMPARE(out.str(), "Amd|Mesa|0xde00 {} GL::Context::DetectedDriver::Amd|GL::Context::DetectedDriver::Mesa\n");
#else #else
Debug{&out} << Context::DetectedDrivers{} << (Context::DetectedDriver::Angle) << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)); Debug{&out} << Debug::packed << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)) << Debug::packed << Context::DetectedDrivers{} << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00));
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDrivers{} GL::Context::DetectedDriver::Angle GL::Context::DetectedDriver::Angle|GL::Context::DetectedDriver(0xde00)\n"); CORRADE_COMPARE(out.str(), "Angle|0xde00 {} GL::Context::DetectedDriver::Angle|GL::Context::DetectedDriver(0xde00)\n");
#endif #endif
} }

5
src/Magnum/MeshTools/Test/CMakeLists.txt

@ -75,11 +75,6 @@ if(MAGNUM_BUILD_GL_TESTS)
set(MESHTOOLS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(MESHTOOLS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since
# Corrade doesn't support dynamic plugins on iOS, this sorta works around
# that. Should be revisited when updating Travis to newer Xcode (xcode7.3
# has CMake 3.6).
if(NOT MAGNUM_BUILD_PLUGINS_STATIC) if(NOT MAGNUM_BUILD_PLUGINS_STATIC)
if(MAGNUM_WITH_ANYIMAGEIMPORTER) if(MAGNUM_WITH_ANYIMAGEIMPORTER)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)

4
src/Magnum/Platform/gl-info.cpp

@ -413,9 +413,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
Debug{} << "Core profile:" << (c.isCoreProfile() ? "yes" : "no"); Debug{} << "Core profile:" << (c.isCoreProfile() ? "yes" : "no");
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Debug{} << "Context flags:" << c.flags(); Debug{} << "Context flags:" << Debug::packed << c.flags();
#endif #endif
Debug{} << "Detected driver:" << c.detectedDriver(); Debug{} << "Detected driver:" << Debug::packed << c.detectedDriver();
Debug{} << "Supported GLSL versions:"; Debug{} << "Supported GLSL versions:";
Debug{} << " " << ", "_s.joinWithoutEmptyParts(c.shadingLanguageVersionStrings()); Debug{} << " " << ", "_s.joinWithoutEmptyParts(c.shadingLanguageVersionStrings());

5
src/Magnum/Shaders/Test/CMakeLists.txt

@ -54,11 +54,6 @@ if(MAGNUM_BUILD_GL_TESTS)
set(SHADERS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SHADERS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since
# Corrade doesn't support dynamic plugins on iOS, this sorta works around
# that. Should be revisited when updating Travis to newer Xcode (xcode7.3
# has CMake 3.6).
if(NOT MAGNUM_BUILD_PLUGINS_STATIC) if(NOT MAGNUM_BUILD_PLUGINS_STATIC)
if(MAGNUM_WITH_ANYIMAGEIMPORTER) if(MAGNUM_WITH_ANYIMAGEIMPORTER)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)

4
src/Magnum/Tags.h

@ -83,10 +83,10 @@ using Corrade::NoCreateT;
Used to distinguish construction without allocating memory. Used to distinguish construction without allocating memory.
@see @ref NoAllocate @see @ref NoAllocate
*/ */
/* Explicit constructor to avoid ambiguous calls when using {} */
struct NoAllocateT { struct NoAllocateT {
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
struct Init{}; struct Init {};
/* Explicit constructor to avoid ambiguous calls when using {} */
constexpr explicit NoAllocateT(Init) {} constexpr explicit NoAllocateT(Init) {}
#endif #endif
}; };

3
src/Magnum/Test/TagsTest.cpp

@ -43,12 +43,15 @@ TagsTest::TagsTest() {
} }
void TagsTest::noDefaultConstructor() { void TagsTest::noDefaultConstructor() {
/* Isn't default constructible to prevent ambiguity when calling
foo({}) if both foo(TagT) and foo(whatever) is available */
CORRADE_VERIFY(!std::is_default_constructible<NoInitT>::value); CORRADE_VERIFY(!std::is_default_constructible<NoInitT>::value);
CORRADE_VERIFY(!std::is_default_constructible<NoCreateT>::value); CORRADE_VERIFY(!std::is_default_constructible<NoCreateT>::value);
CORRADE_VERIFY(!std::is_default_constructible<NoAllocateT>::value); CORRADE_VERIFY(!std::is_default_constructible<NoAllocateT>::value);
} }
void TagsTest::inlineDefinition() { void TagsTest::inlineDefinition() {
/* Just a sanity check that the types match */
CORRADE_VERIFY(std::is_same<decltype(NoInit), const NoInitT>::value); CORRADE_VERIFY(std::is_same<decltype(NoInit), const NoInitT>::value);
CORRADE_VERIFY(std::is_same<decltype(NoCreate), const NoCreateT>::value); CORRADE_VERIFY(std::is_same<decltype(NoCreate), const NoCreateT>::value);
CORRADE_VERIFY(std::is_same<decltype(NoAllocate), const NoAllocateT>::value); CORRADE_VERIFY(std::is_same<decltype(NoAllocate), const NoAllocateT>::value);

5
src/Magnum/TextureTools/Test/CMakeLists.txt

@ -39,11 +39,6 @@ if(MAGNUM_BUILD_GL_TESTS)
# Otherwise CMake complains that Corrade::PluginManager is not found, wtf # Otherwise CMake complains that Corrade::PluginManager is not found, wtf
find_package(Corrade REQUIRED PluginManager) find_package(Corrade REQUIRED PluginManager)
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since
# Corrade doesn't support dynamic plugins on iOS, this sorta works around
# that. Should be revisited when updating Travis to newer Xcode (xcode7.3
# has CMake 3.6).
if(NOT MAGNUM_BUILD_PLUGINS_STATIC) if(NOT MAGNUM_BUILD_PLUGINS_STATIC)
if(MAGNUM_WITH_ANYIMAGEIMPORTER) if(MAGNUM_WITH_ANYIMAGEIMPORTER)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)

5
src/Magnum/Vk/Test/CMakeLists.txt

@ -39,11 +39,6 @@ if(MAGNUM_BUILD_VK_TESTS)
set(VK_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(VK_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since
# Corrade doesn't support dynamic plugins on iOS, this sorta works around
# that. Should be revisited when updating Travis to newer Xcode (xcode7.3
# has CMake 3.6).
if(NOT MAGNUM_BUILD_PLUGINS_STATIC) if(NOT MAGNUM_BUILD_PLUGINS_STATIC)
if(MAGNUM_WITH_ANYIMAGEIMPORTER) if(MAGNUM_WITH_ANYIMAGEIMPORTER)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)

1
src/MagnumExternal/OpenGL/GL/extensions.txt vendored

@ -41,6 +41,7 @@ extension KHR_texture_compression_astc_ldr optional
extension KHR_blend_equation_advanced optional extension KHR_blend_equation_advanced optional
extension KHR_blend_equation_advanced_coherent optional extension KHR_blend_equation_advanced_coherent optional
# extension KHR_texture_compression_astc_sliced_3d optional # extension KHR_texture_compression_astc_sliced_3d optional
extension KHR_parallel_shader_compile optional
extension NV_sample_locations optional extension NV_sample_locations optional
extension NV_fragment_shader_barycentric optional extension NV_fragment_shader_barycentric optional
extension OVR_multiview optional extension OVR_multiview optional

3
src/MagnumExternal/OpenGL/GL/flextGL.cpp vendored

@ -222,6 +222,9 @@ FlextGL flextGL{
/* GL_KHR_blend_equation_advanced */ /* GL_KHR_blend_equation_advanced */
nullptr, nullptr,
/* GL_KHR_parallel_shader_compile */
nullptr,
/* GL_NV_sample_locations */ /* GL_NV_sample_locations */
nullptr, nullptr,
nullptr, nullptr,

9
src/MagnumExternal/OpenGL/GL/flextGL.h vendored

@ -1775,6 +1775,7 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum
/* GL_KHR_parallel_shader_compile */ /* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1 #define GL_COMPLETION_STATUS_KHR 0x91B1
/* GL_NV_sample_locations */ /* GL_NV_sample_locations */
@ -1880,6 +1881,10 @@ struct FlextGL {
void(APIENTRY *BlendBarrierKHR)(void); void(APIENTRY *BlendBarrierKHR)(void);
/* GL_KHR_parallel_shader_compile */
void(APIENTRY *MaxShaderCompilerThreadsKHR)(GLuint);
/* GL_NV_sample_locations */ /* GL_NV_sample_locations */
void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *); void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *);
@ -2684,6 +2689,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL;
#define glBlendBarrierKHR flextGL.BlendBarrierKHR #define glBlendBarrierKHR flextGL.BlendBarrierKHR
/* GL_KHR_parallel_shader_compile */
#define glMaxShaderCompilerThreadsKHR flextGL.MaxShaderCompilerThreadsKHR
/* GL_NV_sample_locations */ /* GL_NV_sample_locations */
#define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV #define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV

3
src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp vendored

@ -186,6 +186,9 @@ void flextGLInit(Magnum::GL::Context& context) {
/* GL_KHR_blend_equation_advanced */ /* GL_KHR_blend_equation_advanced */
flextGL.BlendBarrierKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glBlendBarrierKHR")); flextGL.BlendBarrierKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glBlendBarrierKHR"));
/* GL_KHR_parallel_shader_compile */
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(loader.load("glMaxShaderCompilerThreadsKHR"));
/* GL_NV_sample_locations */ /* GL_NV_sample_locations */
flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLfloat *)>(loader.load("glFramebufferSampleLocationsfvNV")); flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLfloat *)>(loader.load("glFramebufferSampleLocationsfvNV"));
flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast<void(APIENTRY*)(GLuint, GLuint, GLsizei, const GLfloat *)>(loader.load("glNamedFramebufferSampleLocationsfvNV")); flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast<void(APIENTRY*)(GLuint, GLuint, GLsizei, const GLfloat *)>(loader.load("glNamedFramebufferSampleLocationsfvNV"));

10
src/MagnumExternal/OpenGL/GLES2/Emscripten/extensions.txt vendored

@ -6,6 +6,7 @@ version 2.0 es
extraspec https://raw.githubusercontent.com/google/angle/master/scripts/gl_angle_ext.xml extraspec https://raw.githubusercontent.com/google/angle/master/scripts/gl_angle_ext.xml
# WebGL 1 only extensions
extension ANGLE_instanced_arrays optional extension ANGLE_instanced_arrays optional
extension EXT_color_buffer_half_float optional extension EXT_color_buffer_half_float optional
extension EXT_sRGB optional extension EXT_sRGB optional
@ -23,6 +24,7 @@ extension OES_fbo_render_mipmap optional
extension ANGLE_depth_texture optional extension ANGLE_depth_texture optional
extension EXT_draw_buffers optional extension EXT_draw_buffers optional
# WebGL 1 and 2 extensions
extension EXT_texture_filter_anisotropic optional extension EXT_texture_filter_anisotropic optional
extension EXT_disjoint_timer_query optional extension EXT_disjoint_timer_query optional
extension EXT_texture_compression_rgtc optional extension EXT_texture_compression_rgtc optional
@ -36,7 +38,11 @@ extension KHR_texture_compression_astc_ldr optional
# WEBGL_blend_equation_advanced_coherent includes just the enums but not the # WEBGL_blend_equation_advanced_coherent includes just the enums but not the
# barrier # barrier
extension KHR_blend_equation_advanced optional extension KHR_blend_equation_advanced optional
# KHR_parallel_shader_compile includes just GL_COMPLETION_STATUS_KHR and not
# the max threads setting
extension KHR_parallel_shader_compile optional
# From the gl_angle_ext file, base for WEBGL_multi_draw # From the gl_angle_ext file, base for WEBGL_multi_draw
extension ANGLE_multi_draw optional extension ANGLE_multi_draw optional
@ -50,6 +56,8 @@ extension ANGLE_base_vertex_base_instance optional
begin functions blacklist begin functions blacklist
# Not present in WEBGL_blend_equation_advanced_coherent # Not present in WEBGL_blend_equation_advanced_coherent
BlendBarrierKHR BlendBarrierKHR
# Not present in WebGL variant of KHR_parallel_shader_compile
MaxShaderCompilerThreadsKHR
end functions blacklist end functions blacklist
# kate: hl python # kate: hl python

2
src/MagnumExternal/OpenGL/GLES2/extensions.txt vendored

@ -6,6 +6,7 @@ version 2.0 es
extraspec https://raw.githubusercontent.com/google/angle/master/scripts/gl_angle_ext.xml extraspec https://raw.githubusercontent.com/google/angle/master/scripts/gl_angle_ext.xml
# ES2-only extensions
extension ANGLE_framebuffer_blit optional extension ANGLE_framebuffer_blit optional
extension ANGLE_framebuffer_multisample optional extension ANGLE_framebuffer_multisample optional
extension ANGLE_instanced_arrays optional extension ANGLE_instanced_arrays optional
@ -98,6 +99,7 @@ extension KHR_blend_equation_advanced_coherent optional
extension KHR_context_flush_control optional extension KHR_context_flush_control optional
extension KHR_no_error optional extension KHR_no_error optional
# extension KHR_texture_compression_astc_sliced_3d optional # extension KHR_texture_compression_astc_sliced_3d optional
extension KHR_parallel_shader_compile optional
extension NV_read_buffer_front optional extension NV_read_buffer_front optional
extension NV_read_depth optional extension NV_read_depth optional
extension NV_read_stencil optional extension NV_read_stencil optional

13
src/MagnumExternal/OpenGL/GLES2/flextGL.h vendored

@ -1019,6 +1019,11 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
/* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* GL_NV_texture_border_clamp */ /* GL_NV_texture_border_clamp */
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_TEXTURE_BORDER_COLOR_NV 0x1004
@ -1393,6 +1398,10 @@ struct FlextGL {
void(APIENTRY *PopDebugGroupKHR)(void); void(APIENTRY *PopDebugGroupKHR)(void);
void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *); void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *);
/* GL_KHR_parallel_shader_compile */
void(APIENTRY *MaxShaderCompilerThreadsKHR)(GLuint);
/* GL_KHR_robustness */ /* GL_KHR_robustness */
GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void); GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void);
@ -1643,6 +1652,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL;
#define glPopDebugGroupKHR flextGL.PopDebugGroupKHR #define glPopDebugGroupKHR flextGL.PopDebugGroupKHR
#define glPushDebugGroupKHR flextGL.PushDebugGroupKHR #define glPushDebugGroupKHR flextGL.PushDebugGroupKHR
/* GL_KHR_parallel_shader_compile */
#define glMaxShaderCompilerThreadsKHR flextGL.MaxShaderCompilerThreadsKHR
/* GL_KHR_robustness */ /* GL_KHR_robustness */
#define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR #define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR

5
src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h vendored

@ -576,6 +576,11 @@ typedef khronos_uint64_t GLuint64;
#define GL_HSL_COLOR_KHR 0x92AF #define GL_HSL_COLOR_KHR 0x92AF
#define GL_HSL_LUMINOSITY_KHR 0x92B0 #define GL_HSL_LUMINOSITY_KHR 0x92B0
/* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* Function prototypes */ /* Function prototypes */
/* GL_ANGLE_base_vertex_base_instance */ /* GL_ANGLE_base_vertex_base_instance */

3
src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp vendored

@ -187,6 +187,9 @@ void flextGLInit(Magnum::GL::Context&) {
flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR")); flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR"));
flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR")); flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR"));
/* GL_KHR_parallel_shader_compile */
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(loader.load("glMaxShaderCompilerThreadsKHR"));
/* GL_KHR_robustness */ /* GL_KHR_robustness */
flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR")); flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR"));
flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR")); flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR"));

6
src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp vendored

@ -131,6 +131,7 @@
#undef glObjectPtrLabelKHR #undef glObjectPtrLabelKHR
#undef glPopDebugGroupKHR #undef glPopDebugGroupKHR
#undef glPushDebugGroupKHR #undef glPushDebugGroupKHR
#undef glMaxShaderCompilerThreadsKHR
#undef glGetGraphicsResetStatusKHR #undef glGetGraphicsResetStatusKHR
#undef glGetnUniformfvKHR #undef glGetnUniformfvKHR
#undef glGetnUniformivKHR #undef glGetnUniformivKHR
@ -372,6 +373,11 @@ void flextGLInit(Magnum::GL::Context&) {
flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(glPushDebugGroupKHR); flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(glPushDebugGroupKHR);
#endif #endif
/* GL_KHR_parallel_shader_compile */
#if GL_KHR_parallel_shader_compile
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(glMaxShaderCompilerThreadsKHR);
#endif
/* GL_KHR_robustness */ /* GL_KHR_robustness */
#if GL_KHR_robustness #if GL_KHR_robustness
flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(glGetGraphicsResetStatusKHR); flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(glGetGraphicsResetStatusKHR);

3
src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp vendored

@ -286,6 +286,9 @@ void flextGLInit(Magnum::GL::Context&) {
flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR")); flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR"));
flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR")); flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR"));
/* GL_KHR_parallel_shader_compile */
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(loader.load("glMaxShaderCompilerThreadsKHR"));
/* GL_KHR_robustness */ /* GL_KHR_robustness */
flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR")); flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR"));
flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR")); flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR"));

13
src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h vendored

@ -1015,6 +1015,11 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
/* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* GL_NV_texture_border_clamp */ /* GL_NV_texture_border_clamp */
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_TEXTURE_BORDER_COLOR_NV 0x1004
@ -1393,6 +1398,10 @@ struct FlextGL {
void(APIENTRY *PopDebugGroupKHR)(void); void(APIENTRY *PopDebugGroupKHR)(void);
void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *); void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *);
/* GL_KHR_parallel_shader_compile */
void(APIENTRY *MaxShaderCompilerThreadsKHR)(GLuint);
/* GL_KHR_robustness */ /* GL_KHR_robustness */
GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void); GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void);
@ -1743,6 +1752,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL;
#define glPopDebugGroupKHR flextGL.PopDebugGroupKHR #define glPopDebugGroupKHR flextGL.PopDebugGroupKHR
#define glPushDebugGroupKHR flextGL.PushDebugGroupKHR #define glPushDebugGroupKHR flextGL.PushDebugGroupKHR
/* GL_KHR_parallel_shader_compile */
#define glMaxShaderCompilerThreadsKHR flextGL.MaxShaderCompilerThreadsKHR
/* GL_KHR_robustness */ /* GL_KHR_robustness */
#define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR #define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR

6
src/MagnumExternal/OpenGL/GLES3/Emscripten/extensions.txt vendored

@ -29,6 +29,10 @@ extension KHR_texture_compression_astc_ldr optional
# barrier # barrier
extension KHR_blend_equation_advanced optional extension KHR_blend_equation_advanced optional
# KHR_parallel_shader_compile includes just GL_COMPLETION_STATUS_KHR and not
# the max threads setting
extension KHR_parallel_shader_compile optional
# From the gl_angle_ext file, base for WEBGL_multi_draw etc # From the gl_angle_ext file, base for WEBGL_multi_draw etc
extension ANGLE_multi_draw optional extension ANGLE_multi_draw optional
extension ANGLE_base_vertex_base_instance optional extension ANGLE_base_vertex_base_instance optional
@ -41,6 +45,8 @@ extension MAGNUM_what_webgl_has_but_es_not optional
begin functions blacklist begin functions blacklist
# Not present in WEBGL_blend_equation_advanced_coherent # Not present in WEBGL_blend_equation_advanced_coherent
BlendBarrierKHR BlendBarrierKHR
# Not present in WebGL variant of KHR_parallel_shader_compile
MaxShaderCompilerThreadsKHR
end functions blacklist end functions blacklist
# kate: hl python # kate: hl python

1
src/MagnumExternal/OpenGL/GLES3/extensions.txt vendored

@ -73,6 +73,7 @@ extension KHR_blend_equation_advanced_coherent optional
extension KHR_context_flush_control optional extension KHR_context_flush_control optional
extension KHR_no_error optional extension KHR_no_error optional
# extension KHR_texture_compression_astc_sliced_3d optional # extension KHR_texture_compression_astc_sliced_3d optional
extension KHR_parallel_shader_compile optional
extension NV_read_buffer_front optional extension NV_read_buffer_front optional
extension NV_read_depth optional extension NV_read_depth optional
extension NV_read_stencil optional extension NV_read_stencil optional

13
src/MagnumExternal/OpenGL/GLES3/flextGL.h vendored

@ -1634,6 +1634,11 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
/* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* GL_NV_texture_border_clamp */ /* GL_NV_texture_border_clamp */
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_TEXTURE_BORDER_COLOR_NV 0x1004
@ -2238,6 +2243,10 @@ struct FlextGL {
void(APIENTRY *PopDebugGroupKHR)(void); void(APIENTRY *PopDebugGroupKHR)(void);
void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *); void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *);
/* GL_KHR_parallel_shader_compile */
void(APIENTRY *MaxShaderCompilerThreadsKHR)(GLuint);
/* GL_KHR_robustness */ /* GL_KHR_robustness */
GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void); GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void);
@ -2577,6 +2586,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL;
#define glPopDebugGroupKHR flextGL.PopDebugGroupKHR #define glPopDebugGroupKHR flextGL.PopDebugGroupKHR
#define glPushDebugGroupKHR flextGL.PushDebugGroupKHR #define glPushDebugGroupKHR flextGL.PushDebugGroupKHR
/* GL_KHR_parallel_shader_compile */
#define glMaxShaderCompilerThreadsKHR flextGL.MaxShaderCompilerThreadsKHR
/* GL_KHR_robustness */ /* GL_KHR_robustness */
#define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR #define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR

5
src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h vendored

@ -879,6 +879,11 @@ typedef struct __GLsync *GLsync;
#define GL_HSL_COLOR_KHR 0x92AF #define GL_HSL_COLOR_KHR 0x92AF
#define GL_HSL_LUMINOSITY_KHR 0x92B0 #define GL_HSL_LUMINOSITY_KHR 0x92B0
/* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* Function prototypes */ /* Function prototypes */
/* GL_ANGLE_base_vertex_base_instance */ /* GL_ANGLE_base_vertex_base_instance */

3
src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp vendored

@ -305,6 +305,9 @@ void flextGLInit(Magnum::GL::Context&) {
flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR")); flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR"));
flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR")); flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR"));
/* GL_KHR_parallel_shader_compile */
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(loader.load("glMaxShaderCompilerThreadsKHR"));
/* GL_KHR_robustness */ /* GL_KHR_robustness */
flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR")); flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR"));
flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR")); flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR"));

6
src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp vendored

@ -141,6 +141,7 @@
#undef glObjectPtrLabelKHR #undef glObjectPtrLabelKHR
#undef glPopDebugGroupKHR #undef glPopDebugGroupKHR
#undef glPushDebugGroupKHR #undef glPushDebugGroupKHR
#undef glMaxShaderCompilerThreadsKHR
#undef glGetGraphicsResetStatusKHR #undef glGetGraphicsResetStatusKHR
#undef glGetnUniformfvKHR #undef glGetnUniformfvKHR
#undef glGetnUniformivKHR #undef glGetnUniformivKHR
@ -361,6 +362,11 @@ void flextGLInit(Magnum::GL::Context&) {
flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(glPushDebugGroupKHR); flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(glPushDebugGroupKHR);
#endif #endif
/* GL_KHR_parallel_shader_compile */
#if GL_KHR_parallel_shader_compile
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(glMaxShaderCompilerThreadsKHR);
#endif
/* GL_KHR_robustness */ /* GL_KHR_robustness */
#if GL_KHR_robustness #if GL_KHR_robustness
flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(glGetGraphicsResetStatusKHR); flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(glGetGraphicsResetStatusKHR);

3
src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp vendored

@ -507,6 +507,9 @@ void flextGLInit(Magnum::GL::Context&) {
flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR")); flextGL.PopDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(void)>(loader.load("glPopDebugGroupKHR"));
flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR")); flextGL.PushDebugGroupKHR = reinterpret_cast<void(APIENTRY*)(GLenum, GLuint, GLsizei, const GLchar *)>(loader.load("glPushDebugGroupKHR"));
/* GL_KHR_parallel_shader_compile */
flextGL.MaxShaderCompilerThreadsKHR = reinterpret_cast<void(APIENTRY*)(GLuint)>(loader.load("glMaxShaderCompilerThreadsKHR"));
/* GL_KHR_robustness */ /* GL_KHR_robustness */
flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR")); flextGL.GetGraphicsResetStatusKHR = reinterpret_cast<GLenum(APIENTRY*)(void)>(loader.load("glGetGraphicsResetStatusKHR"));
flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR")); flextGL.GetnUniformfvKHR = reinterpret_cast<void(APIENTRY*)(GLuint, GLint, GLsizei, GLfloat *)>(loader.load("glGetnUniformfvKHR"));

13
src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h vendored

@ -1627,6 +1627,11 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
/* GL_KHR_parallel_shader_compile */
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* GL_NV_texture_border_clamp */ /* GL_NV_texture_border_clamp */
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_TEXTURE_BORDER_COLOR_NV 0x1004
@ -2242,6 +2247,10 @@ struct FlextGL {
void(APIENTRY *PopDebugGroupKHR)(void); void(APIENTRY *PopDebugGroupKHR)(void);
void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *); void(APIENTRY *PushDebugGroupKHR)(GLenum, GLuint, GLsizei, const GLchar *);
/* GL_KHR_parallel_shader_compile */
void(APIENTRY *MaxShaderCompilerThreadsKHR)(GLuint);
/* GL_KHR_robustness */ /* GL_KHR_robustness */
GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void); GLenum(APIENTRY *GetGraphicsResetStatusKHR)(void);
@ -2785,6 +2794,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL;
#define glPopDebugGroupKHR flextGL.PopDebugGroupKHR #define glPopDebugGroupKHR flextGL.PopDebugGroupKHR
#define glPushDebugGroupKHR flextGL.PushDebugGroupKHR #define glPushDebugGroupKHR flextGL.PushDebugGroupKHR
/* GL_KHR_parallel_shader_compile */
#define glMaxShaderCompilerThreadsKHR flextGL.MaxShaderCompilerThreadsKHR
/* GL_KHR_robustness */ /* GL_KHR_robustness */
#define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR #define glGetGraphicsResetStatusKHR flextGL.GetGraphicsResetStatusKHR

4
src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt

@ -33,10 +33,6 @@ else()
set(WAVAUDIOIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/WavAudioImporter/Test) set(WAVAUDIOIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/WavAudioImporter/Test)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_ANYAUDIOIMPORTER_BUILD_STATIC) if(NOT MAGNUM_ANYAUDIOIMPORTER_BUILD_STATIC)
set(ANYAUDIOIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyAudioImporter>) set(ANYAUDIOIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyAudioImporter>)
if(MAGNUM_WITH_WAVAUDIOIMPORTER) if(MAGNUM_WITH_WAVAUDIOIMPORTER)

4
src/MagnumPlugins/AnyImageConverter/Test/CMakeLists.txt

@ -40,10 +40,6 @@ else()
set(ANYIMAGEIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/AnyImageImporter/Test) set(ANYIMAGEIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/AnyImageImporter/Test)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_ANYIMAGECONVERTER_BUILD_STATIC) if(NOT MAGNUM_ANYIMAGECONVERTER_BUILD_STATIC)
set(ANYIMAGECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageConverter>) set(ANYIMAGECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageConverter>)
if(MAGNUM_WITH_TGAIMAGECONVERTER) if(MAGNUM_WITH_TGAIMAGECONVERTER)

4
src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt

@ -33,10 +33,6 @@ else()
set(ANYIMAGEIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(ANYIMAGEIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_ANYIMAGEIMPORTER_BUILD_STATIC) if(NOT MAGNUM_ANYIMAGEIMPORTER_BUILD_STATIC)
set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>) set(ANYIMAGEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnyImageImporter>)
if(MAGNUM_WITH_TGAIMPORTER) if(MAGNUM_WITH_TGAIMPORTER)

4
src/MagnumPlugins/AnySceneConverter/Test/CMakeLists.txt

@ -37,10 +37,6 @@ else()
set(ANYSCENEIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/AnySceneImporter/Test) set(ANYSCENEIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/AnySceneImporter/Test)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_ANYSCENECONVERTER_BUILD_STATIC) if(NOT MAGNUM_ANYSCENECONVERTER_BUILD_STATIC)
set(ANYSCENECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:AnySceneConverter>) set(ANYSCENECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:AnySceneConverter>)
if(MAGNUM_WITH_TGAIMAGECONVERTER) if(MAGNUM_WITH_TGAIMAGECONVERTER)

6
src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

@ -78,7 +78,7 @@ const struct {
const char* name; const char* name;
Containers::String filename; Containers::String filename;
} LoadData[]{ } LoadData[]{
{"OBJ", Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj")}, {"OBJ", Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj")},
}; };
constexpr struct { constexpr struct {
@ -157,7 +157,7 @@ void AnySceneImporterTest::loadDeprecatedMeshData() {
CORRADE_SKIP("ObjImporter plugin not enabled, cannot test"); CORRADE_SKIP("ObjImporter plugin not enabled, cannot test");
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("AnySceneImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("AnySceneImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj")));
/* Check only size, as it is good enough proof that it is working */ /* Check only size, as it is good enough proof that it is working */
@ -298,7 +298,7 @@ void AnySceneImporterTest::propagateFileCallback() {
Containers::Array<char> storage; Containers::Array<char> storage;
importer->setFileCallback([](const std::string&, InputFileCallbackPolicy, Containers::Array<char>& storage) -> Containers::Optional<Containers::ArrayView<const char>> { importer->setFileCallback([](const std::string&, InputFileCallbackPolicy, Containers::Array<char>& storage) -> Containers::Optional<Containers::ArrayView<const char>> {
Containers::Optional<Containers::Array<char>> data = Utility::Path::read(Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj")); Containers::Optional<Containers::Array<char>> data = Utility::Path::read(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj"));
CORRADE_VERIFY(data); CORRADE_VERIFY(data);
storage = *std::move(data); storage = *std::move(data);
return Containers::ArrayView<const char>{storage}; return Containers::ArrayView<const char>{storage};

6
src/MagnumPlugins/AnySceneImporter/Test/CMakeLists.txt

@ -35,10 +35,6 @@ else()
set(OBJIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/ObjImporter/Test) set(OBJIMPORTER_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/ObjImporter/Test)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_ANYSCENEIMPORTER_BUILD_STATIC) if(NOT MAGNUM_ANYSCENEIMPORTER_BUILD_STATIC)
set(ANYSCENEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnySceneImporter>) set(ANYSCENEIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:AnySceneImporter>)
if(MAGNUM_WITH_OBJIMPORTER) if(MAGNUM_WITH_OBJIMPORTER)
@ -55,7 +51,7 @@ file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/configure.h
corrade_add_test(AnySceneImporterTest AnySceneImporterTest.cpp corrade_add_test(AnySceneImporterTest AnySceneImporterTest.cpp
LIBRARIES MagnumTrade LIBRARIES MagnumTrade
FILES FILES
${PROJECT_SOURCE_DIR}/src/MagnumPlugins/ObjImporter/Test/pointMesh.obj ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/ObjImporter/Test/mesh-primitive-points.obj
mesh-custom-attribute.gltf mesh-custom-attribute.gltf
scene-custom-field.gltf scene-custom-field.gltf
triangle.ply) triangle.ply)

4
src/MagnumPlugins/AnyShaderConverter/Test/CMakeLists.txt

@ -35,10 +35,6 @@ else()
set(ANYSHADERCONVERTER_TEST_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(ANYSHADERCONVERTER_TEST_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_ANYSHADERCONVERTER_BUILD_STATIC) if(NOT MAGNUM_ANYSHADERCONVERTER_BUILD_STATIC)
set(ANYSHADERCONVERTER_PLUGIN_FILENAME $<TARGET_FILE:AnyShaderConverter>) set(ANYSHADERCONVERTER_PLUGIN_FILENAME $<TARGET_FILE:AnyShaderConverter>)
endif() endif()

4
src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt

@ -33,10 +33,6 @@ else()
set(MAGNUMFONT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(MAGNUMFONT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_MAGNUMFONT_BUILD_STATIC) if(NOT MAGNUM_MAGNUMFONT_BUILD_STATIC)
set(MAGNUMFONT_PLUGIN_FILENAME $<TARGET_FILE:MagnumFont>) set(MAGNUMFONT_PLUGIN_FILENAME $<TARGET_FILE:MagnumFont>)
set(TGAIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImporter>) set(TGAIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImporter>)

4
src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt

@ -35,10 +35,6 @@ else()
set(MAGNUMFONT_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/MagnumFont/Test) set(MAGNUMFONT_TEST_DIR ${PROJECT_SOURCE_DIR}/src/MagnumPlugins/MagnumFont/Test)
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_MAGNUMFONTCONVERTER_BUILD_STATIC) if(NOT MAGNUM_MAGNUMFONTCONVERTER_BUILD_STATIC)
set(MAGNUMFONTCONVERTER_PLUGIN_FILENAME $<TARGET_FILE:MagnumFontConverter>) set(MAGNUMFONTCONVERTER_PLUGIN_FILENAME $<TARGET_FILE:MagnumFontConverter>)
set(TGAIMAGECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImageConverter>) set(TGAIMAGECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImageConverter>)

1
src/MagnumPlugins/ObjImporter/ObjImporter.cpp

@ -38,7 +38,6 @@
#include <Corrade/Utility/String.h> #include <Corrade/Utility/String.h>
#include "Magnum/Mesh.h" #include "Magnum/Mesh.h"
#include "Magnum/MeshTools/CompressIndices.h"
#include "Magnum/MeshTools/RemoveDuplicates.h" #include "Magnum/MeshTools/RemoveDuplicates.h"
#include "Magnum/MeshTools/Duplicate.h" #include "Magnum/MeshTools/Duplicate.h"
#include "Magnum/Math/Color.h" #include "Magnum/Math/Color.h"

42
src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt

@ -33,10 +33,6 @@ else()
set(OBJIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(OBJIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_OBJIMPORTER_BUILD_STATIC) if(NOT MAGNUM_OBJIMPORTER_BUILD_STATIC)
set(OBJIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:ObjImporter>) set(OBJIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:ObjImporter>)
endif() endif()
@ -50,23 +46,27 @@ file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/configure.h
corrade_add_test(ObjImporterTest ObjImporterTest.cpp corrade_add_test(ObjImporterTest ObjImporterTest.cpp
LIBRARIES MagnumTrade LIBRARIES MagnumTrade
FILES FILES
emptyFile.obj empty.obj
keywords.obj invalid-incomplete-data.obj
lineMesh.obj invalid-inconsistent-index-tuple.obj
missingData.obj invalid-keyword.obj
mixedPrimitives.obj invalid-mixed-primitives.obj
moreMeshes.obj invalid-number-count.obj
namedMesh.obj invalid-numbers.obj
normals.obj invalid-optional-coordinate.obj
optionalCoordinates.obj mesh-ignored-keyword.obj
pointMesh.obj mesh-multiple.obj
textureCoordinatesNormals.obj mesh-named-first-unnamed.obj
textureCoordinates.obj mesh-named-first-unnamed-index-first.obj
triangleMesh.obj mesh-named.obj
unnamedFirstMesh.obj mesh-normals.obj
wrongIndexCount.obj mesh-positions-optional-coordinate.obj
wrongNumberCount.obj mesh-primitive-lines.obj
wrongNumbers.obj) mesh-primitive-points.obj
mesh-primitive-triangles.obj
mesh-texture-coordinates.obj
mesh-texture-coordinates-normals.obj
mesh-texture-coordinates-optional-coordinate.obj)
target_include_directories(ObjImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>) target_include_directories(ObjImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
if(MAGNUM_OBJIMPORTER_BUILD_STATIC) if(MAGNUM_OBJIMPORTER_BUILD_STATIC)
target_link_libraries(ObjImporterTest PRIVATE ObjImporter) target_link_libraries(ObjImporterTest PRIVATE ObjImporter)

730
src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp

@ -29,6 +29,7 @@
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/TestSuite/Compare/Container.h> #include <Corrade/TestSuite/Compare/Container.h>
#include <Corrade/Utility/DebugStl.h> #include <Corrade/Utility/DebugStl.h>
#include <Corrade/Utility/FormatStl.h>
#include <Corrade/Utility/Path.h> #include <Corrade/Utility/Path.h>
#include "Magnum/Mesh.h" #include "Magnum/Mesh.h"
@ -43,55 +44,38 @@ namespace Magnum { namespace Trade { namespace Test { namespace {
struct ObjImporterTest: TestSuite::Tester { struct ObjImporterTest: TestSuite::Tester {
explicit ObjImporterTest(); explicit ObjImporterTest();
void pointMesh(); void empty();
void lineMesh();
void triangleMesh();
void mixedPrimitives();
void positionsOnly(); void meshPrimitivePoints();
void textureCoordinates(); void meshPrimitiveLines();
void normals(); void meshPrimitiveTriangles();
void textureCoordinatesNormals();
/* Positions alone are tested above */
void meshPositionsOptionalCoordinate();
void meshTextureCoordinates();
void meshTextureCoordinatesOptionalCoordinate();
void meshNormals();
void meshTextureCoordinatesNormals();
void meshIgnoredKeyword();
void meshNamed();
void meshNamedFirstUnnamed();
void emptyFile();
void unnamedMesh();
void namedMesh();
void moreMeshes(); void moreMeshes();
void unnamedFirstMesh();
/* Technically, all invalid cases could be put into a single file, but
void wrongFloat(); because the indexing is global, it would get increasingly hard to
void wrongInteger(); maintain. So it's instead grouped into files by a common error scenario
void unmergedIndexOutOfRange(); with each case testing one file and just the invalid() case testing
void mergedIndexOutOfRange(); separate files. */
void zeroIndex(); void invalid();
void invalidMixedPrimitives();
void explicitOptionalPositionCoordinate(); void invalidNumbers();
void explicitOptionalTextureCoordinate(); void invalidNumberCount();
void unsupportedOptionalPositionCoordinate(); void invalidInconsistentIndexTuple();
void unsupportedOptionalTextureCoordinate(); void invalidIncompleteData();
void invalidOptionalCoordinate();
void shortFloatData();
void longFloatData();
void longOptionalFloatData();
void longIndexData();
void wrongPointIndexData();
void wrongLineIndexData();
void wrongTriangleIndexData();
void polygonIndexData();
void missingPositionData();
void missingNormalData();
void missingTextureCoordinateData();
void missingPositionIndices();
void missingNormalIndices();
void missingTextureCoordinateIndices();
void wrongTextureCoordinateIndexCount();
void wrongNormalIndexCount();
void unsupportedKeyword();
void unknownKeyword();
void openTwice(); void openTwice();
void importTwice(); void importTwice();
@ -100,58 +84,133 @@ struct ObjImporterTest: TestSuite::Tester {
PluginManager::Manager<AbstractImporter> _manager{"nonexistent"}; PluginManager::Manager<AbstractImporter> _manager{"nonexistent"};
}; };
const struct {
const char* name;
const char* filename;
} MeshNamedFirstUnnamedData[]{
{"", "mesh-named-first-unnamed.obj"},
{"index first", "mesh-named-first-unnamed-index-first.obj"},
};
const struct {
const char* name;
const char* filename;
const char* message;
} InvalidData[]{
{"unknown keyword", "invalid-keyword.obj",
"unknown keyword bleh"}
};
const struct {
const char* name;
const char* message;
} InvalidMixedPrimitivesData[]{
{"points after some other",
"mixed primitive MeshPrimitive::Triangles and MeshPrimitive::Points"},
{"lines after some other",
"mixed primitive MeshPrimitive::Points and MeshPrimitive::Lines"},
{"triangles after some other",
"mixed primitive MeshPrimitive::Lines and MeshPrimitive::Triangles"},
};
const struct {
const char* name;
const char* message;
} InvalidNumbersData[]{
{"invalid float literal", "error while converting numeric data"},
{"invalid integer literal", "error while converting numeric data"},
{"position index out of range", "index 1 out of range for 1 vertices"},
{"texture index out of range", "index 4 out of range for 3 vertices"},
{"normal index out of range", "index 3 out of range for 2 vertices"},
{"zero index", "index 0 out of range for 1 vertices"}
};
const struct {
const char* name;
const char* message;
} InvalidNumberCountData[]{
{"two-component position", "invalid float array size"},
{"five-component position with optional fourth component", "invalid float array size"},
{"four-component normal", "invalid float array size"},
{"four-component index tuple", "invalid index data"},
{"point with two indices", "wrong index count for point"},
{"line with one index", "wrong index count for line"},
{"triangle with two indices", "wrong index count for triangle"},
{"quad", "polygons are not supported"}
};
const struct {
const char* name;
const char* message;
} InvalidInconsistentIndexTupleData[]{
{"missing normal reference", "some normal indices are missing"},
{"missing texture reference", "some texture coordinate indices are missing"},
};
const struct {
const char* name;
const char* message;
} InvalidIncompleteDataData[]{
{"missing position data", "incomplete position data"},
{"missing position indices", "incomplete position data"},
{"missing normal data", "incomplete normal data"},
{"missing normal indices", "incomplete normal data"},
{"missing texture coordinate data", "incomplete texture coordinate data"},
{"missing texture coordinate indices", "incomplete texture coordinate data"},
};
const struct {
const char* name;
const char* message;
} InvalidOptionalCoordinateData[]{
{"position with optional fourth component not one", "homogeneous coordinates are not supported"},
{"texture with optional third component not zero", "3D texture coordinates are not supported"}
};
ObjImporterTest::ObjImporterTest() { ObjImporterTest::ObjImporterTest() {
addTests({&ObjImporterTest::pointMesh, addTests({&ObjImporterTest::empty,
&ObjImporterTest::lineMesh,
&ObjImporterTest::triangleMesh, &ObjImporterTest::meshPrimitivePoints,
&ObjImporterTest::mixedPrimitives, &ObjImporterTest::meshPrimitiveLines,
&ObjImporterTest::meshPrimitiveTriangles,
&ObjImporterTest::positionsOnly,
&ObjImporterTest::textureCoordinates, &ObjImporterTest::meshPositionsOptionalCoordinate,
&ObjImporterTest::normals, &ObjImporterTest::meshTextureCoordinates,
&ObjImporterTest::textureCoordinatesNormals, &ObjImporterTest::meshTextureCoordinatesOptionalCoordinate,
&ObjImporterTest::meshNormals,
&ObjImporterTest::emptyFile, &ObjImporterTest::meshTextureCoordinatesNormals,
&ObjImporterTest::unnamedMesh,
&ObjImporterTest::namedMesh, &ObjImporterTest::meshIgnoredKeyword,
&ObjImporterTest::moreMeshes,
&ObjImporterTest::unnamedFirstMesh, &ObjImporterTest::meshNamed});
&ObjImporterTest::wrongFloat, addInstancedTests({&ObjImporterTest::meshNamedFirstUnnamed},
&ObjImporterTest::wrongInteger, Containers::arraySize(MeshNamedFirstUnnamedData));
&ObjImporterTest::unmergedIndexOutOfRange,
&ObjImporterTest::mergedIndexOutOfRange, addTests({&ObjImporterTest::moreMeshes});
&ObjImporterTest::zeroIndex,
addInstancedTests({&ObjImporterTest::invalid},
&ObjImporterTest::explicitOptionalPositionCoordinate, Containers::arraySize(InvalidData));
&ObjImporterTest::explicitOptionalTextureCoordinate,
&ObjImporterTest::unsupportedOptionalPositionCoordinate, addInstancedTests({&ObjImporterTest::invalidMixedPrimitives},
&ObjImporterTest::unsupportedOptionalTextureCoordinate, Containers::arraySize(InvalidMixedPrimitivesData));
&ObjImporterTest::shortFloatData, addInstancedTests({&ObjImporterTest::invalidNumbers},
&ObjImporterTest::longFloatData, Containers::arraySize(InvalidNumbersData));
&ObjImporterTest::longOptionalFloatData,
addInstancedTests({&ObjImporterTest::invalidNumberCount},
&ObjImporterTest::longIndexData, Containers::arraySize(InvalidNumberCountData));
&ObjImporterTest::wrongPointIndexData,
&ObjImporterTest::wrongLineIndexData, addInstancedTests({&ObjImporterTest::invalidInconsistentIndexTuple},
&ObjImporterTest::wrongTriangleIndexData, Containers::arraySize(InvalidInconsistentIndexTupleData));
&ObjImporterTest::polygonIndexData,
addInstancedTests({&ObjImporterTest::invalidIncompleteData},
&ObjImporterTest::missingPositionData, Containers::arraySize(InvalidIncompleteDataData));
&ObjImporterTest::missingNormalData,
&ObjImporterTest::missingTextureCoordinateData, addInstancedTests({&ObjImporterTest::invalidOptionalCoordinate},
&ObjImporterTest::missingPositionIndices, Containers::arraySize(InvalidOptionalCoordinateData));
&ObjImporterTest::missingNormalIndices,
&ObjImporterTest::missingTextureCoordinateIndices, addTests({&ObjImporterTest::openTwice,
&ObjImporterTest::wrongTextureCoordinateIndexCount,
&ObjImporterTest::wrongNormalIndexCount,
&ObjImporterTest::unsupportedKeyword,
&ObjImporterTest::unknownKeyword,
&ObjImporterTest::openTwice,
&ObjImporterTest::importTwice}); &ObjImporterTest::importTwice});
#ifdef OBJIMPORTER_PLUGIN_FILENAME #ifdef OBJIMPORTER_PLUGIN_FILENAME
@ -159,9 +218,25 @@ ObjImporterTest::ObjImporterTest() {
#endif #endif
} }
void ObjImporterTest::pointMesh() { void ObjImporterTest::empty() {
/* Duplicates what's in invalidIncompleteData(MissingPositionData), but
it's good to have such case explicit. It also tests for empty naming. */
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "empty.obj")));
CORRADE_COMPARE(importer->meshCount(), 1);
CORRADE_COMPARE(importer->meshName(0), "");
CORRADE_COMPARE(importer->meshForName(""), -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(0));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete position data\n");
}
void ObjImporterTest::meshPrimitivePoints() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
@ -183,9 +258,9 @@ void ObjImporterTest::pointMesh() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::lineMesh() { void ObjImporterTest::meshPrimitiveLines() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "lineMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-lines.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
@ -205,9 +280,9 @@ void ObjImporterTest::lineMesh() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::triangleMesh() { void ObjImporterTest::meshPrimitiveTriangles() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "triangleMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-triangles.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
@ -228,31 +303,23 @@ void ObjImporterTest::triangleMesh() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::mixedPrimitives() { void ObjImporterTest::meshPositionsOptionalCoordinate() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mixedPrimitives.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-positions-optional-coordinate.obj")));
CORRADE_COMPARE(importer->meshCount(), 1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(0));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): mixed primitive MeshPrimitive::Points and MeshPrimitive::Lines\n");
}
void ObjImporterTest::positionsOnly() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "triangleMesh.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
CORRADE_VERIFY(data); CORRADE_VERIFY(data);
CORRADE_COMPARE(data->attributeCount(), 1); CORRADE_COMPARE(data->attributeCount(), 1);
CORRADE_VERIFY(data->hasAttribute(MeshAttribute::Position)); CORRADE_COMPARE_AS(data->attribute<Vector3>(MeshAttribute::Position),
Containers::arrayView<Vector3>({
{1.5f, 2.0f, 3.0f}
}), TestSuite::Compare::Container);
} }
void ObjImporterTest::textureCoordinates() { void ObjImporterTest::meshTextureCoordinates() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "textureCoordinates.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-texture-coordinates.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
@ -280,9 +347,23 @@ void ObjImporterTest::textureCoordinates() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::normals() { void ObjImporterTest::meshTextureCoordinatesOptionalCoordinate() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-texture-coordinates-optional-coordinate.obj")));
CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0);
CORRADE_VERIFY(data);
CORRADE_COMPARE(data->attributeCount(MeshAttribute::TextureCoordinates), 1);
CORRADE_COMPARE_AS(data->attribute<Vector2>(MeshAttribute::TextureCoordinates),
Containers::arrayView<Vector2>({
{0.5f, 0.7f}
}), TestSuite::Compare::Container);
}
void ObjImporterTest::meshNormals() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "normals.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-normals.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
@ -310,9 +391,9 @@ void ObjImporterTest::normals() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::textureCoordinatesNormals() { void ObjImporterTest::meshTextureCoordinatesNormals() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "textureCoordinatesNormals.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-texture-coordinates-normals.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
const Containers::Optional<MeshData> data = importer->mesh(0); const Containers::Optional<MeshData> data = importer->mesh(0);
@ -350,31 +431,53 @@ void ObjImporterTest::textureCoordinatesNormals() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::emptyFile() { void ObjImporterTest::meshIgnoredKeyword() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "emptyFile.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-ignored-keyword.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
}
void ObjImporterTest::unnamedMesh() { /* Everything should be parsed properly */
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); const Containers::Optional<MeshData> data = importer->mesh(0);
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "emptyFile.obj"))); CORRADE_VERIFY(data);
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(data->primitive(), MeshPrimitive::Points);
CORRADE_COMPARE(importer->meshName(0), ""); CORRADE_COMPARE(data->attributeCount(), 1);
CORRADE_COMPARE(importer->meshForName(""), -1); CORRADE_COMPARE_AS(data->attribute<Vector3>(MeshAttribute::Position),
Containers::arrayView<Vector3>({
{0.0f, 1.0f, 2.0f}
}), TestSuite::Compare::Container);
CORRADE_VERIFY(data->isIndexed());
CORRADE_COMPARE(data->indexType(), MeshIndexType::UnsignedInt);
CORRADE_COMPARE_AS(data->indices<UnsignedInt>(),
Containers::arrayView<UnsignedInt>({0}),
TestSuite::Compare::Container);
} }
void ObjImporterTest::namedMesh() { void ObjImporterTest::meshNamed() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "namedMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-named.obj")));
CORRADE_COMPARE(importer->meshCount(), 1); CORRADE_COMPARE(importer->meshCount(), 1);
CORRADE_COMPARE(importer->meshName(0), "MyMesh"); CORRADE_COMPARE(importer->meshName(0), "MyMesh");
CORRADE_COMPARE(importer->meshForName("MyMesh"), 0); CORRADE_COMPARE(importer->meshForName("MyMesh"), 0);
} }
void ObjImporterTest::meshNamedFirstUnnamed() {
auto&& data = MeshNamedFirstUnnamedData[testCaseInstanceId()];
setTestCaseDescription(data.name);
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, data.filename)));
CORRADE_COMPARE(importer->meshCount(), 2);
CORRADE_COMPARE(importer->meshName(0), "");
CORRADE_COMPARE(importer->meshForName(""), -1);
CORRADE_COMPARE(importer->meshName(1), "SecondMesh");
CORRADE_COMPARE(importer->meshForName("SecondMesh"), 1);
}
void ObjImporterTest::moreMeshes() { void ObjImporterTest::moreMeshes() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "moreMeshes.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-multiple.obj")));
CORRADE_COMPARE(importer->meshCount(), 3); CORRADE_COMPARE(importer->meshCount(), 3);
CORRADE_COMPARE(importer->meshName(0), "PointMesh"); CORRADE_COMPARE(importer->meshName(0), "PointMesh");
@ -452,370 +555,129 @@ void ObjImporterTest::moreMeshes() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void ObjImporterTest::unnamedFirstMesh() { void ObjImporterTest::invalid() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "unnamedFirstMesh.obj"))); setTestCaseDescription(data.name);
CORRADE_COMPARE(importer->meshCount(), 2);
CORRADE_COMPARE(importer->meshName(0), "");
CORRADE_COMPARE(importer->meshForName(""), -1);
CORRADE_COMPARE(importer->meshName(1), "SecondMesh");
CORRADE_COMPARE(importer->meshForName("SecondMesh"), 1);
}
void ObjImporterTest::wrongFloat() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumbers.obj")));
const Int id = importer->meshForName("WrongFloat");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): error while converting numeric data\n");
}
void ObjImporterTest::wrongInteger() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumbers.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, data.filename)));
const Int id = importer->meshForName("WrongInteger");
CORRADE_VERIFY(id > -1);
std::ostringstream out; CORRADE_COMPARE(importer->meshCount(), 1);
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): error while converting numeric data\n");
}
void ObjImporterTest::unmergedIndexOutOfRange() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumbers.obj")));
const Int id = importer->meshForName("PositionIndexOutOfRange");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): index 1 out of range for 1 vertices\n");
}
void ObjImporterTest::mergedIndexOutOfRange() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumbers.obj")));
const Int id = importer->meshForName("TextureIndexOutOfRange");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): index 2 out of range for 1 vertices\n");
}
void ObjImporterTest::zeroIndex() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumbers.obj")));
const Int id = importer->meshForName("ZeroIndex");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(0));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): index 0 out of range for 1 vertices\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::explicitOptionalPositionCoordinate() { void ObjImporterTest::invalidMixedPrimitives() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidMixedPrimitivesData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "optionalCoordinates.obj"))); setTestCaseDescription(data.name);
const Int id = importer->meshForName("SupportedPositionW");
CORRADE_VERIFY(id > -1);
const Containers::Optional<MeshData> data = importer->mesh(id);
CORRADE_VERIFY(data);
CORRADE_COMPARE(data->attributeCount(), 1);
CORRADE_COMPARE_AS(data->attribute<Vector3>(MeshAttribute::Position),
Containers::arrayView<Vector3>({
{1.5f, 2.0f, 3.0f}
}), TestSuite::Compare::Container);
}
void ObjImporterTest::explicitOptionalTextureCoordinate() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "optionalCoordinates.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "invalid-mixed-primitives.obj")));
const Int id = importer->meshForName("SupportedTextureW");
CORRADE_VERIFY(id > -1);
const Containers::Optional<MeshData> data = importer->mesh(id);
CORRADE_VERIFY(data);
CORRADE_COMPARE(data->attributeCount(MeshAttribute::TextureCoordinates), 1);
CORRADE_COMPARE_AS(data->attribute<Vector2>(MeshAttribute::TextureCoordinates),
Containers::arrayView<Vector2>({
{0.5f, 0.7f}
}), TestSuite::Compare::Container);
}
void ObjImporterTest::unsupportedOptionalPositionCoordinate() { /* Ensure we didn't forget to test any case */
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); CORRADE_COMPARE(importer->meshCount(), Containers::arraySize(InvalidMixedPrimitivesData));
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "optionalCoordinates.obj")));
const Int id = importer->meshForName("UnsupportedPositionW");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(data.name));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): homogeneous coordinates are not supported\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::unsupportedOptionalTextureCoordinate() { void ObjImporterTest::invalidNumbers() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidNumbersData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "optionalCoordinates.obj"))); setTestCaseDescription(data.name);
const Int id = importer->meshForName("UnsupportedTextureW");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): 3D texture coordinates are not supported\n");
}
void ObjImporterTest::shortFloatData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "invalid-numbers.obj")));
const Int id = importer->meshForName("ShortFloat");
CORRADE_VERIFY(id > -1);
std::ostringstream out; /* Ensure we didn't forget to test any case */
Error redirectError{&out}; CORRADE_COMPARE(importer->meshCount(), Containers::arraySize(InvalidNumbersData));
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): invalid float array size\n");
}
void ObjImporterTest::longFloatData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj")));
const Int id = importer->meshForName("LongFloat");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(data.name));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): invalid float array size\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::longOptionalFloatData() { void ObjImporterTest::invalidNumberCount() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidNumberCountData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj"))); setTestCaseDescription(data.name);
const Int id = importer->meshForName("LongOptionalFloat");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): invalid float array size\n");
}
void ObjImporterTest::longIndexData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "invalid-number-count.obj")));
const Int id = importer->meshForName("InvalidIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): invalid index data\n");
}
void ObjImporterTest::wrongPointIndexData() { /* Ensure we didn't forget to test any case */
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); CORRADE_COMPARE(importer->meshCount(), Containers::arraySize(InvalidNumberCountData));
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj")));
const Int id = importer->meshForName("WrongPointIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(data.name));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): wrong index count for point\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::wrongLineIndexData() { void ObjImporterTest::invalidInconsistentIndexTuple() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidInconsistentIndexTupleData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj"))); setTestCaseDescription(data.name);
const Int id = importer->meshForName("WrongLineIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): wrong index count for line\n");
}
void ObjImporterTest::wrongTriangleIndexData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "invalid-inconsistent-index-tuple.obj")));
const Int id = importer->meshForName("WrongTriangleIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out; /* Ensure we didn't forget to test any case */
Error redirectError{&out}; CORRADE_COMPARE(importer->meshCount(), Containers::arraySize(InvalidInconsistentIndexTupleData));
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): wrong index count for triangle\n");
}
void ObjImporterTest::polygonIndexData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongNumberCount.obj")));
const Int id = importer->meshForName("PolygonIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(data.name));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): polygons are not supported\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::missingPositionData() { void ObjImporterTest::invalidIncompleteData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidIncompleteDataData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "missingData.obj"))); setTestCaseDescription(data.name);
const Int id = importer->meshForName("MissingPositionData");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete position data\n");
}
void ObjImporterTest::missingPositionIndices() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "missingData.obj")));
const Int id = importer->meshForName("MissingPositionIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete position data\n");
}
void ObjImporterTest::missingNormalData() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "missingData.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "invalid-incomplete-data.obj")));
const Int id = importer->meshForName("MissingNormalData");
CORRADE_VERIFY(id > -1);
std::ostringstream out; /* Ensure we didn't forget to test any case */
Error redirectError{&out}; CORRADE_COMPARE(importer->meshCount(), Containers::arraySize(InvalidIncompleteDataData));
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete normal data\n");
}
void ObjImporterTest::missingNormalIndices() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "missingData.obj")));
const Int id = importer->meshForName("MissingNormalIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(data.name));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete normal data\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::missingTextureCoordinateData() { void ObjImporterTest::invalidOptionalCoordinate() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); auto&& data = InvalidOptionalCoordinateData[testCaseInstanceId()];
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "missingData.obj"))); setTestCaseDescription(data.name);
const Int id = importer->meshForName("MissingTextureData");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete texture coordinate data\n");
}
void ObjImporterTest::missingTextureCoordinateIndices() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "missingData.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "invalid-optional-coordinate.obj")));
const Int id = importer->meshForName("MissingTextureIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out; /* Ensure we didn't forget to test any case */
Error redirectError{&out}; CORRADE_COMPARE(importer->meshCount(), Containers::arraySize(InvalidOptionalCoordinateData));
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): incomplete texture coordinate data\n");
}
void ObjImporterTest::wrongNormalIndexCount() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongIndexCount.obj")));
const Int id = importer->meshForName("ShortNormalIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): some normal indices are missing\n");
}
void ObjImporterTest::wrongTextureCoordinateIndexCount() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "wrongIndexCount.obj")));
const Int id = importer->meshForName("ShortTextureIndices");
CORRADE_VERIFY(id > -1);
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): some texture coordinate indices are missing\n");
}
void ObjImporterTest::unsupportedKeyword() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "keywords.obj")));
const Int id = importer->meshForName("UnsupportedKeyword");
CORRADE_VERIFY(id > -1);
/* Everything should be parsed properly */
const Containers::Optional<MeshData> data = importer->mesh(id);
CORRADE_VERIFY(data);
CORRADE_COMPARE(data->primitive(), MeshPrimitive::Points);
CORRADE_COMPARE(data->attributeCount(), 1);
CORRADE_COMPARE_AS(data->attribute<Vector3>(MeshAttribute::Position),
Containers::arrayView<Vector3>({
{0.0f, 1.0f, 2.0f}
}), TestSuite::Compare::Container);
CORRADE_VERIFY(data->isIndexed());
CORRADE_COMPARE(data->indexType(), MeshIndexType::UnsignedInt);
CORRADE_COMPARE_AS(data->indices<UnsignedInt>(),
Containers::arrayView<UnsignedInt>({0}),
TestSuite::Compare::Container);
}
void ObjImporterTest::unknownKeyword() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "keywords.obj")));
const Int id = importer->meshForName("UnknownKeyword");
CORRADE_VERIFY(id > -1);
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
CORRADE_VERIFY(!importer->mesh(id)); CORRADE_VERIFY(!importer->mesh(data.name));
CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh(): unknown keyword bleh\n"); CORRADE_COMPARE(out.str(), Utility::formatString("Trade::ObjImporter::mesh(): {}\n", data.message));
} }
void ObjImporterTest::openTwice() { void ObjImporterTest::openTwice() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj")));
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj")));
/* Shouldn't crash, leak or anything */ /* Shouldn't crash, leak or anything */
} }
void ObjImporterTest::importTwice() { void ObjImporterTest::importTwice() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter"); Containers::Pointer<AbstractImporter> importer = _manager.instantiate("ObjImporter");
CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "pointMesh.obj"))); CORRADE_VERIFY(importer->openFile(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-primitive-points.obj")));
/* Verify that everything is working the same way on second use */ /* Verify that everything is working the same way on second use */
{ {

0
src/MagnumPlugins/ObjImporter/Test/emptyFile.obj → src/MagnumPlugins/ObjImporter/Test/empty.obj

23
src/MagnumPlugins/ObjImporter/Test/invalid-incomplete-data.obj

@ -0,0 +1,23 @@
o missing position data
p 1
o missing position indices
v 1 2 3
o missing normal data
v 1 2 3
p 3//3
o missing normal indices
v 1 2 3
vn 1 2 3
p 4
o missing texture coordinate data
v 1 2 3
p 5/1
o missing texture coordinate indices
v 1 2 3
vt 1 2
p 6

4
src/MagnumPlugins/ObjImporter/Test/wrongIndexCount.obj → src/MagnumPlugins/ObjImporter/Test/invalid-inconsistent-index-tuple.obj

@ -1,11 +1,11 @@
o ShortNormalIndices o missing normal reference
v 1 2 3 v 1 2 3
vn 1 2 3 vn 1 2 3
p 1//1 p 1//1
p 1 p 1
p 1//1 p 1//1
o ShortTextureIndices o missing texture reference
v 1 2 3 v 1 2 3
vt 1 2 vt 1 2
p 2/2 p 2/2

1
src/MagnumPlugins/ObjImporter/Test/invalid-keyword.obj

@ -0,0 +1 @@
bleh

14
src/MagnumPlugins/ObjImporter/Test/invalid-mixed-primitives.obj

@ -0,0 +1,14 @@
o points after some other
v 2 3 5.0
f 1 1 1
p 1
o lines after some other
v 2 3 5.0
p 2
l 2 2 2
o triangles after some other
v 2 3 5.0
l 3 3
f 3 3 3

29
src/MagnumPlugins/ObjImporter/Test/invalid-number-count.obj

@ -0,0 +1,29 @@
o two-component position
v 0.5 1.0
o five-component position with optional fourth component
v 0.5 1 2 0.0 3.5
o four-component normal
v 0.5 1 2
vn 0.5 1.0 2.3 7.4
o four-component index tuple
v 1 2 3
p 4/1/1/1
o point with two indices
v 1 2 3
p 5 5
o line with one index
v 1 2 3
l 6
o triangle with two indices
v 1 2 3
f 7 7
o quad
v 1 2 3
f 8 8 8 8

31
src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj

@ -0,0 +1,31 @@
o invalid float literal
v 1 bleh 2
p 1
o invalid integer literal
v 1 0 2
p bleh
o position index out of range
v 1 0 2
# Should be 3
p 1
o texture index out of range
v 1 0 2
vt 0 1
vt 0 1
vt 0 1
# Should be 4/3
p 4/4
o normal index out of range
v 1 0 2
vn 0 0 1
vn 0 0 1
# Should be 5/2
p 5//3
o zero index
v 1 0 2
p 0

8
src/MagnumPlugins/ObjImporter/Test/invalid-optional-coordinate.obj

@ -0,0 +1,8 @@
o position with optional fourth component not one
v 1.5 2 3 0.8
p 1
o texture with optional third component not zero
v 1.5 2 3
vt 0.5 0.7 0.5
p 2/1

7
src/MagnumPlugins/ObjImporter/Test/keywords.obj

@ -1,7 +0,0 @@
o UnsupportedKeyword
g VertexGroup
v 0 1 2
p 1
o UnknownKeyword
bleh

3
src/MagnumPlugins/ObjImporter/Test/mesh-ignored-keyword.obj

@ -0,0 +1,3 @@
g VertexGroup
v 0 1 2
p 1

0
src/MagnumPlugins/ObjImporter/Test/moreMeshes.obj → src/MagnumPlugins/ObjImporter/Test/mesh-multiple.obj

3
src/MagnumPlugins/ObjImporter/Test/mesh-named-first-unnamed-index-first.obj

@ -0,0 +1,3 @@
p 1
v 1 2 3
o SecondMesh

0
src/MagnumPlugins/ObjImporter/Test/unnamedFirstMesh.obj → src/MagnumPlugins/ObjImporter/Test/mesh-named-first-unnamed.obj

0
src/MagnumPlugins/ObjImporter/Test/namedMesh.obj → src/MagnumPlugins/ObjImporter/Test/mesh-named.obj

0
src/MagnumPlugins/ObjImporter/Test/normals.obj → src/MagnumPlugins/ObjImporter/Test/mesh-normals.obj

2
src/MagnumPlugins/ObjImporter/Test/mesh-positions-optional-coordinate.obj

@ -0,0 +1,2 @@
v 1.5 2 3 1.0
p 1

0
src/MagnumPlugins/ObjImporter/Test/lineMesh.obj → src/MagnumPlugins/ObjImporter/Test/mesh-primitive-lines.obj

0
src/MagnumPlugins/ObjImporter/Test/pointMesh.obj → src/MagnumPlugins/ObjImporter/Test/mesh-primitive-points.obj

0
src/MagnumPlugins/ObjImporter/Test/triangleMesh.obj → src/MagnumPlugins/ObjImporter/Test/mesh-primitive-triangles.obj

0
src/MagnumPlugins/ObjImporter/Test/textureCoordinatesNormals.obj → src/MagnumPlugins/ObjImporter/Test/mesh-texture-coordinates-normals.obj

3
src/MagnumPlugins/ObjImporter/Test/mesh-texture-coordinates-optional-coordinate.obj

@ -0,0 +1,3 @@
v 1.5 2 3
vt 0.5 0.7 0.0
p 1/1

0
src/MagnumPlugins/ObjImporter/Test/textureCoordinates.obj → src/MagnumPlugins/ObjImporter/Test/mesh-texture-coordinates.obj

23
src/MagnumPlugins/ObjImporter/Test/missingData.obj

@ -1,23 +0,0 @@
o MissingPositionData
p 1
o MissingPositionIndices
v 1 2 3
o MissingNormalData
v 1 2 3
p 3//3
o MissingNormalIndices
v 1 2 3
vn 1 2 3
p 4
o MissingTextureData
v 1 2 3
p 5/1
o MissingTextureIndices
v 1 2 3
vt 1 2
p 6

13
src/MagnumPlugins/ObjImporter/Test/mixedPrimitives.obj

@ -1,13 +0,0 @@
# Positions
v 0.5 2 3
v 0 1.5 1
v 2 3 5.0
# Points
p 1
p 3
p 2
# Lines
l 1 2
l 2 3

17
src/MagnumPlugins/ObjImporter/Test/optionalCoordinates.obj

@ -1,17 +0,0 @@
o SupportedPositionW
v 1.5 2 3 1.0
p 1
o SupportedTextureW
v 1.5 2 3
vt 0.5 0.7 0.0
p 2/1
o UnsupportedPositionW
v 1.5 2 3 0.8
p 3
o UnsupportedTextureW
v 1.5 2 3
vt 0.5 0.7 0.5
p 4/2

29
src/MagnumPlugins/ObjImporter/Test/wrongNumberCount.obj

@ -1,29 +0,0 @@
o ShortFloat
v 0.5 1.0
o LongFloat
v 0.5 1 2
vn 0.5 1.0 2.3 7.4
o LongOptionalFloat
v 0.5 1 2 0.0 3.5
o InvalidIndices
v 1 2 3
p 4/1/1/1
o WrongPointIndices
v 1 2 3
p 5 5
o WrongLineIndices
v 1 2 3
l 6
o WrongTriangleIndices
v 1 2 3
f 7 7
o PolygonIndices
v 1 2 3
f 8 8 8 8

22
src/MagnumPlugins/ObjImporter/Test/wrongNumbers.obj

@ -1,22 +0,0 @@
o WrongFloat
v 1 bleh 2
p 1
o WrongInteger
v 1 0 2
p bleh
o PositionIndexOutOfRange
v 1 0 2
# Should be 3
p 1
o TextureIndexOutOfRange
v 1 0 2
vt 0 1
# Should be 4/1
p 4/2
o ZeroIndex
v 1 0 2
p 0

4
src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt

@ -27,10 +27,6 @@
# property that would have to be set on each target separately. # property that would have to be set on each target separately.
set(CMAKE_FOLDER "MagnumPlugins/TgaImageConverter/Test") set(CMAKE_FOLDER "MagnumPlugins/TgaImageConverter/Test")
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_TGAIMAGECONVERTER_BUILD_STATIC) if(NOT MAGNUM_TGAIMAGECONVERTER_BUILD_STATIC)
set(TGAIMAGECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImageConverter>) set(TGAIMAGECONVERTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImageConverter>)
if(MAGNUM_WITH_TGAIMPORTER) if(MAGNUM_WITH_TGAIMPORTER)

4
src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt

@ -33,10 +33,6 @@ else()
set(TGAIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(TGAIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_TGAIMPORTER_BUILD_STATIC) if(NOT MAGNUM_TGAIMPORTER_BUILD_STATIC)
set(TGAIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImporter>) set(TGAIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:TgaImporter>)
endif() endif()

4
src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt

@ -33,10 +33,6 @@ else()
set(WAVAUDIOIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(WAVAUDIOIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
# CMake before 3.8 has broken $<TARGET_FILE*> expressions for iOS (see
# https://gitlab.kitware.com/cmake/cmake/merge_requests/404) and since Corrade
# doesn't support dynamic plugins on iOS, this sorta works around that. Should
# be revisited when updating Travis to newer Xcode (xcode7.3 has CMake 3.6).
if(NOT MAGNUM_WAVAUDIOIMPORTER_BUILD_STATIC) if(NOT MAGNUM_WAVAUDIOIMPORTER_BUILD_STATIC)
set(WAVAUDIOIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:WavAudioImporter>) set(WAVAUDIOIMPORTER_PLUGIN_FILENAME $<TARGET_FILE:WavAudioImporter>)
endif() endif()

2
toolchains

@ -1 +1 @@
Subproject commit 8847ed06932798f884d8edc7f58d8c0ccf5f1620 Subproject commit 65568a98fa48de0369f35e9788779fdfbe14cacc
Loading…
Cancel
Save