2018-08-23 23:30:27 +02:00
|
|
|
// Copyright 2018 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-01-06 07:58:43 +01:00
|
|
|
#include <array>
|
2019-04-04 17:58:06 +02:00
|
|
|
#include <atomic>
|
2019-04-29 02:08:31 +02:00
|
|
|
#include <bitset>
|
2018-08-23 23:30:27 +02:00
|
|
|
#include <memory>
|
2019-09-25 04:34:18 +02:00
|
|
|
#include <string>
|
2019-01-05 05:00:06 +01:00
|
|
|
#include <tuple>
|
2019-02-03 01:14:36 +01:00
|
|
|
#include <unordered_map>
|
2019-09-25 04:34:18 +02:00
|
|
|
#include <unordered_set>
|
2019-04-04 17:58:06 +02:00
|
|
|
#include <vector>
|
2019-01-05 05:00:06 +01:00
|
|
|
|
|
|
|
#include <glad/glad.h>
|
2018-08-23 23:30:27 +02:00
|
|
|
|
|
|
|
#include "common/common_types.h"
|
2019-11-18 22:35:21 +01:00
|
|
|
#include "video_core/engines/shader_type.h"
|
2018-08-23 23:30:27 +02:00
|
|
|
#include "video_core/renderer_opengl/gl_resource_manager.h"
|
2020-05-23 01:55:38 +02:00
|
|
|
#include "video_core/shader_cache.h"
|
2018-08-23 23:30:27 +02:00
|
|
|
|
2020-06-12 02:24:45 +02:00
|
|
|
namespace Tegra {
|
|
|
|
class MemoryManager;
|
2019-04-06 22:59:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Core::Frontend {
|
|
|
|
class EmuWindow;
|
|
|
|
}
|
2019-01-15 20:28:42 +01:00
|
|
|
|
2018-08-23 23:30:27 +02:00
|
|
|
namespace OpenGL {
|
|
|
|
|
2019-04-10 23:03:52 +02:00
|
|
|
class Device;
|
2018-11-08 12:08:00 +01:00
|
|
|
class RasterizerOpenGL;
|
|
|
|
|
2018-08-23 23:30:27 +02:00
|
|
|
using Maxwell = Tegra::Engines::Maxwell3D::Regs;
|
2020-02-26 20:13:47 +01:00
|
|
|
|
2021-02-17 00:52:12 +01:00
|
|
|
class Shader {
|
2018-08-23 23:30:27 +02:00
|
|
|
public:
|
2021-02-17 00:52:12 +01:00
|
|
|
explicit Shader();
|
2020-05-23 01:55:38 +02:00
|
|
|
~Shader();
|
2018-08-23 23:30:27 +02:00
|
|
|
};
|
|
|
|
|
2020-05-23 01:55:38 +02:00
|
|
|
class ShaderCacheOpenGL final : public VideoCommon::ShaderCache<Shader> {
|
2018-08-23 23:30:27 +02:00
|
|
|
public:
|
2020-12-05 17:40:14 +01:00
|
|
|
explicit ShaderCacheOpenGL(RasterizerOpenGL& rasterizer_,
|
|
|
|
Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu,
|
|
|
|
Tegra::Engines::Maxwell3D& maxwell3d_,
|
|
|
|
Tegra::Engines::KeplerCompute& kepler_compute_,
|
|
|
|
Tegra::MemoryManager& gpu_memory_, const Device& device_);
|
2020-05-23 01:55:38 +02:00
|
|
|
~ShaderCacheOpenGL() override;
|
2018-11-08 12:08:00 +01:00
|
|
|
|
2019-01-06 07:58:43 +01:00
|
|
|
private:
|
2019-04-06 22:59:56 +02:00
|
|
|
Core::Frontend::EmuWindow& emu_window;
|
2020-06-12 02:24:45 +02:00
|
|
|
Tegra::GPU& gpu;
|
|
|
|
Tegra::MemoryManager& gpu_memory;
|
|
|
|
Tegra::Engines::Maxwell3D& maxwell3d;
|
|
|
|
Tegra::Engines::KeplerCompute& kepler_compute;
|
2019-04-10 23:03:52 +02:00
|
|
|
const Device& device;
|
2018-08-23 23:30:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace OpenGL
|