Skip to content

Commit

Permalink
Vk: functions for translating generic enums to Vulkan values.
Browse files Browse the repository at this point in the history
Because I don't yet have any source file that's assert-independent, the
MagnumVkObjects library is commented out, as it is completely empty
right now.
  • Loading branch information
mosra committed Oct 21, 2018
1 parent 46781bb commit b0a1719
Show file tree
Hide file tree
Showing 12 changed files with 1,149 additions and 82 deletions.
13 changes: 13 additions & 0 deletions doc/changelog.dox
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,19 @@ See also:
- @ref Trade::AnySceneImporter "AnySceneImporter" gained support for
animation import

@subsubsection changelog-latest-new-vk Vk library

- New @ref Vk library that'll be the home of a Vulkan graphics backend in the
future
- New functions @ref Vk::hasVkPrimitiveTopology(),
@ref Vk::vkPrimitiveTopology(), @ref Vk::hasVkIndexType(),
@ref Vk::vkIndexType(), @ref Vk::hasVkFormat(), @ref Vk::vkFormat(),
@ref Vk::vkFilter(), @ref Vk::vkSamplerMipmapMode(),
@ref Vk::hasVkSamplerAddressMode(), @ref Vk::vkSamplerAddressMode() for
converting generic @ref MeshPrimitive, @ref MeshIndexType,
@ref PixelFormat, @ref CompressedPixelFormat, @ref SamplerFilter,
@ref SamplerMipmap and @ref SamplerWrapping enums to Vulkan-specific values

@subsection changelog-latest-changes Changes and improvements

@subsubsection changelog-latest-changes-audio Audio library
Expand Down
4 changes: 2 additions & 2 deletions src/Magnum/GL/Test/PixelFormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void PixelFormatTest::mapFormatDeprecated() {

void PixelFormatTest::mapFormatUnsupported() {
#ifndef MAGNUM_TARGET_GLES2
CORRADE_SKIP("All pixel formats are supported on ES3+");
CORRADE_SKIP("All pixel formats are supported on ES3+.");
#else
std::ostringstream out;
Error redirectError{&out};
Expand Down Expand Up @@ -480,7 +480,7 @@ void PixelFormatTest::mapCompressedFormatDeprecated() {

void PixelFormatTest::mapCompressedFormatUnsupported() {
#if 1
CORRADE_SKIP("All compressed pixel formats are currently supported everywhere");
CORRADE_SKIP("All compressed pixel formats are currently supported everywhere.");
#else
CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::Bc1RGBAUnorm));
Expand Down
40 changes: 30 additions & 10 deletions src/Magnum/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,58 +46,70 @@ namespace Magnum {
In case of OpenGL, corresponds to @ref GL::MeshPrimitive and is convertible to
it using @ref GL::meshPrimitive(). See documentation of each value for more
information about the mapping.
In case of Vulkan, corresponds to @type_vk_keyword{PrimitiveTopology} and is
convertible to it using @ref Vk::vkPrimitiveTopology(). See documentation of
each value for more information about the mapping. Note that not every mode is available there, use @ref Vk::hasVkPrimitiveTopology() to check for its
presence.
*/
enum class MeshPrimitive: UnsignedInt {
/**
* Single points.
*
* Corresponds to @ref GL::MeshPrimitive::Points.
* Corresponds to @ref GL::MeshPrimitive::Points /
* @def_vk_keyword{PRIMITIVE_TOPOLOGY_POINT_LIST,PrimitiveTopology}.
*/
Points,

/**
* Each pair of vertices defines a single line, lines aren't
* connected together.
*
* Corresponds to @ref GL::MeshPrimitive::Lines.
* Corresponds to @ref GL::MeshPrimitive::Lines /
* @def_vk_keyword{PRIMITIVE_TOPOLOGY_LINE_LIST,PrimitiveTopology}.
*/
Lines,

/**
* Line strip, last and first vertex are connected together.
*
* Corresponds to @ref GL::MeshPrimitive::LineLoop.
* Corresponds to @ref GL::MeshPrimitive::LineLoop. Not supported on
* Vulkan.
*/
LineLoop,

/**
* First two vertices define first line segment, each following
* vertex defines another segment.
*
* Corresponds to @ref GL::MeshPrimitive::LineStrip.
* Corresponds to @ref GL::MeshPrimitive::LineStrip /
* @def_vk_keyword{PRIMITIVE_TOPOLOGY_LINE_STRIP,PrimitiveTopology}.
*/
LineStrip,

/**
* Each three vertices define one triangle.
*
* Corresponds to @ref GL::MeshPrimitive::Triangles.
* Corresponds to @ref GL::MeshPrimitive::Triangles /
* @def_vk_keyword{PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,PrimitiveTopology}.
*/
Triangles,

/**
* First three vertices define first triangle, each following
* vertex defines another triangle.
*
* Corresponds to @ref GL::MeshPrimitive::TriangleStrip.
* Corresponds to @ref GL::MeshPrimitive::TriangleStrip /
* @def_vk_keyword{PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,PrimitiveTopology}.
*/
TriangleStrip,

/**
* First vertex is center, each following vertex is connected to
* previous and center vertex.
*
* Corresponds to @ref GL::MeshPrimitive::TriangleFan.
* Corresponds to @ref GL::MeshPrimitive::TriangleFan /
* @def_vk_keyword{PRIMITIVE_TOPOLOGY_TRIANGLE_FAN,PrimitiveTopology}.
*/
TriangleFan,

Expand Down Expand Up @@ -143,27 +155,35 @@ MAGNUM_EXPORT Debug& operator<<(Debug& debug, MeshPrimitive value);
In case of OpenGL, corresponds to @ref GL::MeshIndexType and is convertible to
it using @ref GL::meshIndexType(). See documentation of each value for more
information about the mapping.
In case of Vulkan, corresponds to @type_vk_keyword{IndexType} and is
convertible to it using @ref Vk::vkIndexType(). See documentation of each value
for more information about the mapping. Note that not every type is available
there, use @ref Vk::hasVkIndexType() to check for its presence.
@see @ref meshIndexTypeSize()
*/
enum class MeshIndexType: UnsignedInt {
/**
* Unsigned byte
*
* Corresponds to @ref GL::MeshIndexType::UnsignedByte.
* Corresponds to @ref GL::MeshIndexType::UnsignedByte. Not available on
* Vulkan.
*/
UnsignedByte,

/**
* Unsigned short
*
* Corresponds to @ref GL::MeshIndexType::UnsignedShort.
* Corresponds to @ref GL::MeshIndexType::UnsignedShort /
* @def_vk_keyword{INDEX_TYPE_UINT16,IndexType}.
*/
UnsignedShort,

/**
* Unsigned int
*
* Corresponds to @ref GL::MeshIndexType::UnsignedInt.
* Corresponds to @ref GL::MeshIndexType::UnsignedInt /
* @def_vk_keyword{INDEX_TYPE_UINT32,IndexType}.
*/
UnsignedInt
};
Expand Down
Loading

0 comments on commit b0a1719

Please sign in to comment.