shader: Initial OpenGL implementation

This commit is contained in:
ReinUsesLisp 2021-05-23 04:28:34 -03:00 committed by ameerj
parent 850b08a16c
commit d621e96d0d
38 changed files with 1427 additions and 705 deletions

View file

@ -43,7 +43,7 @@ std::string Name(const ImageBase& image) {
return "Invalid";
}
std::string Name(const ImageViewBase& image_view, std::optional<ImageViewType> type) {
std::string Name(const ImageViewBase& image_view) {
const u32 width = image_view.size.width;
const u32 height = image_view.size.height;
const u32 depth = image_view.size.depth;
@ -51,7 +51,7 @@ std::string Name(const ImageViewBase& image_view, std::optional<ImageViewType> t
const u32 num_layers = image_view.range.extent.layers;
const std::string level = num_levels > 1 ? fmt::format(":{}", num_levels) : "";
switch (type.value_or(image_view.type)) {
switch (image_view.type) {
case ImageViewType::e1D:
return fmt::format("ImageView 1D {}{}", width, level);
case ImageViewType::e2D:

View file

@ -255,8 +255,7 @@ struct RenderTargets;
[[nodiscard]] std::string Name(const ImageBase& image);
[[nodiscard]] std::string Name(const ImageViewBase& image_view,
std::optional<ImageViewType> type = std::nullopt);
[[nodiscard]] std::string Name(const ImageViewBase& image_view);
[[nodiscard]] std::string Name(const RenderTargets& render_targets);