runtime pipeline
This commit is contained in:
parent
75c9ae5087
commit
415e523a45
20 changed files with 480 additions and 45 deletions
|
|
@ -215,6 +215,19 @@ export namespace Crafter {
|
|||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr double MappedToNDCBoundless(T mapped, std::uint32_t size) requires(std::is_integral_v<T>) {
|
||||
if constexpr (std::is_same_v<T, std::uint8_t> || std::is_same_v<T, std::int8_t>) {
|
||||
return mapped / SCALEBOUNDLESSDOUBLE8 - 0.5;
|
||||
} else if constexpr (std::is_same_v<T, std::uint16_t> || std::is_same_v<T, std::int16_t>) {
|
||||
return mapped / SCALEBOUNDLESSDOUBLE16 - 0.5;
|
||||
} else if constexpr (std::is_same_v<T, std::uint32_t> || std::is_same_v<T, std::int32_t>) {
|
||||
return mapped / SCALEBOUNDLESSDOUBLE32 - 0.5;
|
||||
} else {
|
||||
return mapped / SCALEBOUNDLESSDOUBLE64 - 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, typename T2>
|
||||
constexpr T MappedToAbsolute(T mapped, T2 absolute) requires(std::is_integral_v<T>) {
|
||||
if constexpr (std::is_same_v<T, std::int8_t> || std::is_same_v<T, std::uint8_t>) {
|
||||
|
|
@ -354,6 +367,11 @@ export namespace Crafter {
|
|||
return (value + alignment - 1) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr T GetTanHalfFov(T fov) {
|
||||
return std::tan(fov * std::numbers::pi / 360.0);
|
||||
}
|
||||
|
||||
#ifdef CRAFTER_GRAPHICS_VULKAN
|
||||
struct DescriptorBinding {
|
||||
VkDescriptorType type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue