dolphin/Source/Core/VideoBackends/OGL/SamplerCache.h
Martino Fontana a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00

48 lines
1.1 KiB
C++

// Copyright 2013 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <array>
#include <map>
#include <memory>
#include "Common/CommonTypes.h"
#include "Common/GL/GLExtensions/GLExtensions.h"
#include "VideoCommon/Constants.h"
#include "VideoCommon/RenderState.h"
namespace OGL
{
class SamplerCache
{
public:
SamplerCache();
~SamplerCache();
SamplerCache(const SamplerCache&) = delete;
SamplerCache& operator=(const SamplerCache&) = delete;
SamplerCache(SamplerCache&&) = delete;
SamplerCache& operator=(SamplerCache&&) = delete;
void SetSamplerState(u32 stage, const SamplerState& state);
void InvalidateBinding(u32 stage);
void Clear();
void BindNearestSampler(int stage);
void BindLinearSampler(int stage);
private:
static void SetParameters(GLuint sampler_id, const SamplerState& params);
std::map<SamplerState, GLuint> m_cache;
std::array<std::pair<SamplerState, GLuint>, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS>
m_active_samplers{};
GLuint m_point_sampler;
GLuint m_linear_sampler;
};
extern std::unique_ptr<SamplerCache> g_sampler_cache;
} // namespace OGL