std140 implementation
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "opengl/shading/uniform_block.hpp"
|
||||
#include <array>
|
||||
|
||||
#include "util/enum_bitfield_operators.hpp"
|
||||
|
||||
namespace zgl::shading::mesh_uniform_blocks
|
||||
{
|
||||
|
||||
enum class flags : std::uint16_t
|
||||
{
|
||||
none = 0,
|
||||
material = 1 << 0,
|
||||
lighting = 1 << 1
|
||||
};
|
||||
|
||||
constexpr inline auto material = uniform_block{ 0 };
|
||||
constexpr inline auto lighting = uniform_block{ 1 };
|
||||
|
||||
constexpr inline auto all = std::array{
|
||||
material,
|
||||
lighting
|
||||
};
|
||||
|
||||
constexpr inline auto names = std::array{
|
||||
"material",
|
||||
"lighting"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
DEFINE_ENUM_BITFIELD_OPERATORS(zgl::shading::mesh_uniform_blocks::flags)
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "opengl/shading/uniform_block.hpp"
|
||||
#include <array>
|
||||
|
||||
#include "util/enum_bitfield_operators.hpp"
|
||||
|
||||
namespace zgl::shading::point_cloud_uniform_blocks
|
||||
{
|
||||
|
||||
enum class flags : std::uint16_t
|
||||
{
|
||||
none = 0,
|
||||
material = 1 << 0,
|
||||
lighting = 1 << 1
|
||||
};
|
||||
|
||||
constexpr inline auto material = uniform_block{ 0 };
|
||||
constexpr inline auto lighting = uniform_block{ 1 };
|
||||
|
||||
constexpr inline auto all = std::array{
|
||||
material,
|
||||
lighting
|
||||
};
|
||||
|
||||
constexpr inline auto names = std::array{
|
||||
"material",
|
||||
"lighting"
|
||||
};
|
||||
}
|
||||
|
||||
DEFINE_ENUM_BITFIELD_OPERATORS(zgl::shading::point_cloud_uniform_blocks::flags)
|
||||
Reference in New Issue
Block a user