💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8 KiB

  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_RENDER_OPERATION_HPP
  20. #define ANTKEEPER_RENDER_OPERATION_HPP
  21. #include <engine/math/vector.hpp>
  22. #include <engine/gl/vertex-array.hpp>
  23. #include <engine/gl/vertex-buffer.hpp>
  24. #include <engine/gl/primitive-topology.hpp>
  25. #include <engine/render/material.hpp>
  26. #include <cstdint>
  27. #include <memory>
  28. #include <span>
  29. namespace render {
  30. /**
  31. * Atomic render operation.
  32. */
  33. struct operation
  34. {
  35. gl::primitive_topology primitive_topology{gl::primitive_topology::triangle_list};
  36. const gl::vertex_array* vertex_array{nullptr};
  37. const gl::vertex_buffer* vertex_buffer{nullptr};
  38. std::size_t vertex_offset{0};
  39. std::size_t vertex_stride{0};
  40. std::uint32_t first_vertex{0};
  41. std::uint32_t vertex_count{0};
  42. std::uint32_t first_instance{0};
  43. std::uint32_t instance_count{1};
  44. std::shared_ptr<render::material> material;
  45. math::fmat4 transform{math::fmat4::identity()};
  46. float depth{};
  47. std::span<const math::fmat4> matrix_palette{};
  48. std::uint32_t layer_mask{};
  49. };
  50. } // namespace render
  51. #endif // ANTKEEPER_RENDER_OPERATION_HPP