environment.h 807 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <array>
  3. #include "common/common_types.h"
  4. #include "shader_recompiler/program_header.h"
  5. #include "shader_recompiler/stage.h"
  6. namespace Shader {
  7. class Environment {
  8. public:
  9. virtual ~Environment() = default;
  10. [[nodiscard]] virtual u64 ReadInstruction(u32 address) = 0;
  11. [[nodiscard]] virtual u32 TextureBoundBuffer() const = 0;
  12. [[nodiscard]] virtual std::array<u32, 3> WorkgroupSize() const = 0;
  13. [[nodiscard]] const ProgramHeader& SPH() const noexcept {
  14. return sph;
  15. }
  16. [[nodiscard]] Stage ShaderStage() const noexcept {
  17. return stage;
  18. }
  19. [[nodiscard]] u32 StartAddress() const noexcept {
  20. return start_address;
  21. }
  22. protected:
  23. ProgramHeader sph{};
  24. Stage stage{};
  25. u32 start_address{};
  26. };
  27. } // namespace Shader