vk_fsr.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/math_util.h"
  6. #include "video_core/vulkan_common/vulkan_memory_allocator.h"
  7. #include "video_core/vulkan_common/vulkan_wrapper.h"
  8. namespace Vulkan {
  9. class Device;
  10. class VKScheduler;
  11. class FSR {
  12. public:
  13. explicit FSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_count,
  14. VkExtent2D output_size);
  15. VkImageView Draw(VKScheduler& scheduler, size_t image_index, VkImageView image_view,
  16. const Common::Rectangle<int>& crop_rect);
  17. private:
  18. void CreateDescriptorPool();
  19. void CreateDescriptorSetLayout();
  20. void CreateDescriptorSets();
  21. void CreateImages();
  22. void CreateSampler();
  23. void CreateShaders();
  24. void CreatePipeline();
  25. void CreatePipelineLayout();
  26. void UpdateDescriptorSet(std::size_t image_index, VkImageView image_view) const;
  27. const Device& device;
  28. MemoryAllocator& memory_allocator;
  29. size_t image_count;
  30. VkExtent2D output_size;
  31. vk::DescriptorPool descriptor_pool;
  32. vk::DescriptorSetLayout descriptor_set_layout;
  33. vk::DescriptorSets descriptor_sets;
  34. vk::PipelineLayout pipeline_layout;
  35. vk::ShaderModule easu_shader;
  36. vk::ShaderModule rcas_shader;
  37. vk::Pipeline easu_pipeline;
  38. vk::Pipeline rcas_pipeline;
  39. vk::Sampler sampler;
  40. std::vector<vk::Image> images;
  41. std::vector<vk::ImageView> image_views;
  42. std::vector<MemoryCommit> buffer_commits;
  43. };
  44. } // namespace Vulkan