Fixed bugs in lazy shader compilation.
This commit is contained in:
@@ -4,20 +4,21 @@
|
||||
#include "shader_program/features/point_cloud_features.hpp"
|
||||
|
||||
#include <array>
|
||||
#include "util/enum_bitfield_operators.hpp"
|
||||
|
||||
namespace rendering::requirements::point_cloud
|
||||
{
|
||||
|
||||
struct type
|
||||
{
|
||||
shader_program::capabilities::point_cloud::indices::type shader_program_requirement_index{};
|
||||
shader_program::features::point_cloud::indices::type shader_program_requirement_index{};
|
||||
components::point_cloud_vertex::flags vertex_requirements{
|
||||
components::point_cloud_vertex::flags::none
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
enum class flags : int
|
||||
enum class flags : std::uint8_t
|
||||
{
|
||||
none = 0,
|
||||
position = 1 << 0,
|
||||
@@ -30,30 +31,30 @@ enum class flags : int
|
||||
|
||||
|
||||
constexpr inline auto position = type{
|
||||
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::position,
|
||||
.shader_program_requirement_index = shader_program::features::point_cloud::indices::position,
|
||||
.vertex_requirements = components::point_cloud_vertex::flags::position
|
||||
};
|
||||
|
||||
constexpr inline auto rainbow = type{
|
||||
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::rainbow
|
||||
.shader_program_requirement_index = shader_program::features::point_cloud::indices::rainbow
|
||||
};
|
||||
|
||||
constexpr inline auto vertex_color = type{
|
||||
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::vertex_color,
|
||||
.shader_program_requirement_index = shader_program::features::point_cloud::indices::vertex_color,
|
||||
.vertex_requirements = components::point_cloud_vertex::flags::color
|
||||
};
|
||||
|
||||
constexpr inline auto uniform_color = type{
|
||||
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::uniform_color
|
||||
.shader_program_requirement_index = shader_program::features::point_cloud::indices::uniform_color
|
||||
};
|
||||
|
||||
constexpr inline auto normal = type{
|
||||
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::normal,
|
||||
.shader_program_requirement_index = shader_program::features::point_cloud::indices::normal,
|
||||
.vertex_requirements = components::point_cloud_vertex::flags::normal
|
||||
};
|
||||
|
||||
constexpr inline auto reflectance = type{
|
||||
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::reflectance,
|
||||
.shader_program_requirement_index = shader_program::features::point_cloud::indices::reflectance,
|
||||
.vertex_requirements = components::point_cloud_vertex::flags::reflectance
|
||||
};
|
||||
|
||||
@@ -62,61 +63,4 @@ constexpr inline auto all = std::array{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator|(
|
||||
const rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b
|
||||
) {
|
||||
return static_cast<rendering::requirements::point_cloud::flags>(static_cast<int>(a) | static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator&(
|
||||
const rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b
|
||||
) {
|
||||
return static_cast<rendering::requirements::point_cloud::flags>(static_cast<int>(a) & static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator^(
|
||||
const rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b
|
||||
) {
|
||||
return static_cast<rendering::requirements::point_cloud::flags>(static_cast<int>(a) ^ static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator~(const rendering::requirements::point_cloud::flags& a) {
|
||||
return static_cast<rendering::requirements::point_cloud::flags>(~static_cast<int>(a));
|
||||
}
|
||||
|
||||
constexpr rendering::requirements::point_cloud::flags& operator|=(rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b) {
|
||||
return a = a | b;
|
||||
}
|
||||
|
||||
constexpr rendering::requirements::point_cloud::flags& operator&=(rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b) {
|
||||
return a = a & b;
|
||||
}
|
||||
|
||||
constexpr rendering::requirements::point_cloud::flags& operator^=(rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b) {
|
||||
return a = a ^ b;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator<(
|
||||
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) < static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator<=(
|
||||
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) <= static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator>(
|
||||
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) > static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator>=(
|
||||
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) >= static_cast<int>(rhs);
|
||||
}
|
||||
DEFINE_ENUM_BITFIELD_OPERATORS(rendering::requirements::point_cloud::flags)
|
||||
|
||||
Reference in New Issue
Block a user