rasterizer_cache: Touch up MatchFlags comments

This commit is contained in:
emufan4568
2022-09-06 22:32:16 +03:00
committed by GPUCode
parent 5ab5fdcc22
commit 623293d272
4 changed files with 26 additions and 44 deletions

View File

@ -15,24 +15,6 @@
namespace OpenGL { namespace OpenGL {
static Aspect ToAspect(SurfaceType type) {
switch (type) {
case SurfaceType::Color:
case SurfaceType::Texture:
case SurfaceType::Fill:
return Aspect::Color;
case SurfaceType::Depth:
return Aspect::Depth;
case SurfaceType::DepthStencil:
return Aspect::DepthStencil;
default:
LOG_CRITICAL(Render_OpenGL, "Unknown SurfaceType {}", type);
UNREACHABLE();
}
return Aspect::Color;
}
CachedSurface::~CachedSurface() { CachedSurface::~CachedSurface() {
if (texture.handle) { if (texture.handle) {
auto tag = is_custom ? HostTextureTag{PixelFormat::RGBA8, auto tag = is_custom ? HostTextureTag{PixelFormat::RGBA8,

View File

@ -16,25 +16,6 @@
namespace OpenGL { namespace OpenGL {
// TODO: Deduplicate this
static Aspect ToAspect(SurfaceType type) {
switch (type) {
case SurfaceType::Color:
case SurfaceType::Texture:
case SurfaceType::Fill:
return Aspect::Color;
case SurfaceType::Depth:
return Aspect::Depth;
case SurfaceType::DepthStencil:
return Aspect::DepthStencil;
default:
LOG_CRITICAL(Render_OpenGL, "Unknown SurfaceType {}", type);
UNREACHABLE();
}
return Aspect::Color;
}
template <typename Map, typename Interval> template <typename Map, typename Interval>
static constexpr auto RangeFromInterval(Map& map, const Interval& interval) { static constexpr auto RangeFromInterval(Map& map, const Interval& interval) {
return boost::make_iterator_range(map.equal_range(interval)); return boost::make_iterator_range(map.equal_range(interval));
@ -106,13 +87,12 @@ void RasterizerCache::CopySurface(const Surface& src_surface, const Surface& dst
} }
enum MatchFlags { enum MatchFlags {
Invalid = 1, // Flag that can be applied to other match types, invalid matches require Invalid = 1, ///< Surface is allowed to be only partially valid
// validation before they can be used Exact = 1 << 1, ///< Surface perfectly matches params
Exact = 1 << 1, // Surfaces perfectly match SubRect = 1 << 2, ///< Surface encompasses params
SubRect = 1 << 2, // Surface encompasses params Copy = 1 << 3, ///< Surface that can be used as a copy source
Copy = 1 << 3, // Surface we can copy from Expand = 1 << 4, ///< Surface that can expand params
Expand = 1 << 4, // Surface that can expand params TexCopy = 1 << 5 ///< Surface that will match a display transfer "texture copy" parameters
TexCopy = 1 << 5 // Surface that will match a display transfer "texture copy" parameters
}; };
static constexpr MatchFlags operator|(MatchFlags lhs, MatchFlags rhs) { static constexpr MatchFlags operator|(MatchFlags lhs, MatchFlags rhs) {

View File

@ -89,4 +89,22 @@ ClearValue MakeClearValue(Aspect aspect, PixelFormat format, const u8* fill_data
return result; return result;
} }
Aspect ToAspect(SurfaceType type) {
switch (type) {
case SurfaceType::Color:
case SurfaceType::Texture:
case SurfaceType::Fill:
return Aspect::Color;
case SurfaceType::Depth:
return Aspect::Depth;
case SurfaceType::DepthStencil:
return Aspect::DepthStencil;
default:
LOG_CRITICAL(Render_OpenGL, "Unknown SurfaceType {}", type);
UNREACHABLE();
}
return Aspect::Color;
}
} // namespace OpenGL } // namespace OpenGL

View File

@ -49,6 +49,8 @@ struct TextureCubeConfig {
[[nodiscard]] ClearValue MakeClearValue(Aspect aspect, PixelFormat format, const u8* fill_data); [[nodiscard]] ClearValue MakeClearValue(Aspect aspect, PixelFormat format, const u8* fill_data);
[[nodiscard]] Aspect ToAspect(SurfaceType type);
} // namespace OpenGL } // namespace OpenGL
namespace std { namespace std {