summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.h')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h426
1 files changed, 184 insertions, 242 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 0f43e863d..1bedae992 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -1,57 +1,26 @@
-// Copyright 2015 Citra Emulator Project
+// Copyright 2018 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <array>
+#include <map>
#include <memory>
-#include <set>
-#include <tuple>
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
-#endif
+#include <vector>
#include <boost/icl/interval_map.hpp>
-#include <boost/icl/interval_set.hpp>
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-#include <boost/optional.hpp>
-#include <glad/glad.h>
-#include "common/assert.h"
-#include "common/common_funcs.h"
#include "common/common_types.h"
+#include "common/hash.h"
#include "common/math_util.h"
-#include "video_core/gpu.h"
-#include "video_core/memory_manager.h"
+#include "video_core/engines/maxwell_3d.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/textures/texture.h"
-struct CachedSurface;
+class CachedSurface;
using Surface = std::shared_ptr<CachedSurface>;
-using SurfaceSet = std::set<Surface>;
-
-using SurfaceRegions = boost::icl::interval_set<Tegra::GPUVAddr>;
-using SurfaceMap = boost::icl::interval_map<Tegra::GPUVAddr, Surface>;
-using SurfaceCache = boost::icl::interval_map<Tegra::GPUVAddr, SurfaceSet>;
-
-using SurfaceInterval = SurfaceCache::interval_type;
-static_assert(std::is_same<SurfaceRegions::interval_type, SurfaceCache::interval_type>() &&
- std::is_same<SurfaceMap::interval_type, SurfaceCache::interval_type>(),
- "incorrect interval types");
-
-using SurfaceRect_Tuple = std::tuple<Surface, MathUtil::Rectangle<u32>>;
using SurfaceSurfaceRect_Tuple = std::tuple<Surface, Surface, MathUtil::Rectangle<u32>>;
-
using PageMap = boost::icl::interval_map<u64, int>;
-enum class ScaleMatch {
- Exact, // only accept same res scale
- Upscale, // only allow higher scale than params
- Ignore // accept every scaled res
-};
-
struct SurfaceParams {
enum class PixelFormat {
ABGR8 = 0,
@@ -61,12 +30,24 @@ struct SurfaceParams {
R8 = 4,
RGBA16F = 5,
R11FG11FB10F = 6,
- DXT1 = 7,
- DXT23 = 8,
- DXT45 = 9,
- DXN1 = 10, // This is also known as BC4
+ RGBA32UI = 7,
+ DXT1 = 8,
+ DXT23 = 9,
+ DXT45 = 10,
+ DXN1 = 11, // This is also known as BC4
+ BC7U = 12,
+ ASTC_2D_4X4 = 13,
- Max,
+ MaxColorFormat,
+
+ // DepthStencil formats
+ Z24S8 = 14,
+ S8Z24 = 15,
+ Z32F = 16,
+
+ MaxDepthStencilFormat,
+
+ Max = MaxDepthStencilFormat,
Invalid = 255,
};
@@ -92,10 +73,10 @@ struct SurfaceParams {
/**
* Gets the compression factor for the specified PixelFormat. This applies to just the
* "compressed width" and "compressed height", not the overall compression factor of a
- * compressed image. This is used for maintaining proper surface sizes for compressed texture
- * formats.
+ * compressed image. This is used for maintaining proper surface sizes for compressed
+ * texture formats.
*/
- static constexpr u32 GetCompresssionFactor(PixelFormat format) {
+ static constexpr u32 GetCompressionFactor(PixelFormat format) {
if (format == PixelFormat::Invalid)
return 0;
@@ -107,18 +88,21 @@ struct SurfaceParams {
1, // R8
1, // RGBA16F
1, // R11FG11FB10F
+ 1, // RGBA32UI
4, // DXT1
4, // DXT23
4, // DXT45
4, // DXN1
+ 4, // BC7U
+ 4, // ASTC_2D_4X4
+ 1, // Z24S8
+ 1, // S8Z24
+ 1, // Z32F
}};
ASSERT(static_cast<size_t>(format) < compression_factor_table.size());
return compression_factor_table[static_cast<size_t>(format)];
}
- u32 GetCompresssionFactor() const {
- return GetCompresssionFactor(pixel_format);
- }
static constexpr u32 GetFormatBpp(PixelFormat format) {
if (format == PixelFormat::Invalid)
@@ -132,10 +116,16 @@ struct SurfaceParams {
8, // R8
64, // RGBA16F
32, // R11FG11FB10F
+ 128, // RGBA32UI
64, // DXT1
128, // DXT23
128, // DXT45
64, // DXN1
+ 128, // BC7U
+ 32, // ASTC_2D_4X4
+ 32, // Z24S8
+ 32, // S8Z24
+ 32, // Z32F
}};
ASSERT(static_cast<size_t>(format) < bpp_table.size());
@@ -145,6 +135,20 @@ struct SurfaceParams {
return GetFormatBpp(pixel_format);
}
+ static PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format) {
+ switch (format) {
+ case Tegra::DepthFormat::S8_Z24_UNORM:
+ return PixelFormat::S8Z24;
+ case Tegra::DepthFormat::Z24_S8_UNORM:
+ return PixelFormat::Z24S8;
+ case Tegra::DepthFormat::Z32_FLOAT:
+ return PixelFormat::Z32F;
+ default:
+ LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
+ UNREACHABLE();
+ }
+ }
+
static PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format) {
switch (format) {
case Tegra::RenderTargetFormat::RGBA8_UNORM:
@@ -156,18 +160,10 @@ struct SurfaceParams {
return PixelFormat::RGBA16F;
case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
return PixelFormat::R11FG11FB10F;
+ case Tegra::RenderTargetFormat::RGBA32_UINT:
+ return PixelFormat::RGBA32UI;
default:
- NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
- UNREACHABLE();
- }
- }
-
- static PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) {
- switch (format) {
- case Tegra::FramebufferConfig::PixelFormat::ABGR8:
- return PixelFormat::ABGR8;
- default:
- NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
+ LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
}
}
@@ -189,6 +185,8 @@ struct SurfaceParams {
return PixelFormat::RGBA16F;
case Tegra::Texture::TextureFormat::BF10GF11RF11:
return PixelFormat::R11FG11FB10F;
+ case Tegra::Texture::TextureFormat::R32_G32_B32_A32:
+ return PixelFormat::RGBA32UI;
case Tegra::Texture::TextureFormat::DXT1:
return PixelFormat::DXT1;
case Tegra::Texture::TextureFormat::DXT23:
@@ -197,8 +195,12 @@ struct SurfaceParams {
return PixelFormat::DXT45;
case Tegra::Texture::TextureFormat::DXN1:
return PixelFormat::DXN1;
+ case Tegra::Texture::TextureFormat::BC7U:
+ return PixelFormat::BC7U;
+ case Tegra::Texture::TextureFormat::ASTC_2D_4X4:
+ return PixelFormat::ASTC_2D_4X4;
default:
- NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
+ LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
}
}
@@ -220,6 +222,8 @@ struct SurfaceParams {
return Tegra::Texture::TextureFormat::R16_G16_B16_A16;
case PixelFormat::R11FG11FB10F:
return Tegra::Texture::TextureFormat::BF10GF11RF11;
+ case PixelFormat::RGBA32UI:
+ return Tegra::Texture::TextureFormat::R32_G32_B32_A32;
case PixelFormat::DXT1:
return Tegra::Texture::TextureFormat::DXT1;
case PixelFormat::DXT23:
@@ -228,6 +232,23 @@ struct SurfaceParams {
return Tegra::Texture::TextureFormat::DXT45;
case PixelFormat::DXN1:
return Tegra::Texture::TextureFormat::DXN1;
+ case PixelFormat::BC7U:
+ return Tegra::Texture::TextureFormat::BC7U;
+ case PixelFormat::ASTC_2D_4X4:
+ return Tegra::Texture::TextureFormat::ASTC_2D_4X4;
+ default:
+ UNREACHABLE();
+ }
+ }
+
+ static Tegra::DepthFormat DepthFormatFromPixelFormat(PixelFormat format) {
+ switch (format) {
+ case PixelFormat::S8Z24:
+ return Tegra::DepthFormat::S8_Z24_UNORM;
+ case PixelFormat::Z24S8:
+ return Tegra::DepthFormat::Z24_S8_UNORM;
+ case PixelFormat::Z32F:
+ return Tegra::DepthFormat::Z32_FLOAT;
default:
UNREACHABLE();
}
@@ -239,7 +260,7 @@ struct SurfaceParams {
case Tegra::Texture::ComponentType::UNORM:
return ComponentType::UNorm;
default:
- NGLOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
+ LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
UNREACHABLE();
}
}
@@ -254,215 +275,153 @@ struct SurfaceParams {
case Tegra::RenderTargetFormat::RGBA16_FLOAT:
case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
return ComponentType::Float;
+ case Tegra::RenderTargetFormat::RGBA32_UINT:
+ return ComponentType::UInt;
default:
- NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
+ LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
}
}
- static ComponentType ComponentTypeFromGPUPixelFormat(
- Tegra::FramebufferConfig::PixelFormat format) {
+ static PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat format) {
switch (format) {
case Tegra::FramebufferConfig::PixelFormat::ABGR8:
- return ComponentType::UNorm;
+ return PixelFormat::ABGR8;
default:
- NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
+ LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
}
}
- static bool CheckFormatsBlittable(PixelFormat pixel_format_a, PixelFormat pixel_format_b) {
- SurfaceType a_type = GetFormatType(pixel_format_a);
- SurfaceType b_type = GetFormatType(pixel_format_b);
-
- if (a_type == SurfaceType::ColorTexture && b_type == SurfaceType::ColorTexture) {
- return true;
- }
-
- if (a_type == SurfaceType::Depth && b_type == SurfaceType::Depth) {
- return true;
- }
-
- if (a_type == SurfaceType::DepthStencil && b_type == SurfaceType::DepthStencil) {
- return true;
+ static ComponentType ComponentTypeFromDepthFormat(Tegra::DepthFormat format) {
+ switch (format) {
+ case Tegra::DepthFormat::S8_Z24_UNORM:
+ case Tegra::DepthFormat::Z24_S8_UNORM:
+ return ComponentType::UNorm;
+ case Tegra::DepthFormat::Z32_FLOAT:
+ return ComponentType::Float;
+ default:
+ LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
+ UNREACHABLE();
}
-
- return false;
}
static SurfaceType GetFormatType(PixelFormat pixel_format) {
- if (static_cast<size_t>(pixel_format) < MaxPixelFormat) {
+ if (static_cast<size_t>(pixel_format) < static_cast<size_t>(PixelFormat::MaxColorFormat)) {
return SurfaceType::ColorTexture;
}
+ if (static_cast<size_t>(pixel_format) <
+ static_cast<size_t>(PixelFormat::MaxDepthStencilFormat)) {
+ return SurfaceType::DepthStencil;
+ }
+
// TODO(Subv): Implement the other formats
ASSERT(false);
return SurfaceType::Invalid;
}
- /// Update the params "size", "end" and "type" from the already set "addr", "width", "height"
- /// and "pixel_format"
- void UpdateParams() {
- if (stride == 0) {
- stride = width;
- }
- type = GetFormatType(pixel_format);
- size = !is_tiled ? BytesInPixels(stride * (height - 1) + width)
- : BytesInPixels(stride * 8 * (height / 8 - 1) + width * 8);
- end = addr + size;
- }
-
- SurfaceInterval GetInterval() const {
- return SurfaceInterval::right_open(addr, end);
- }
-
- // Returns the outer rectangle containing "interval"
- SurfaceParams FromInterval(SurfaceInterval interval) const;
-
- SurfaceInterval GetSubRectInterval(MathUtil::Rectangle<u32> unscaled_rect) const;
-
- // Returns the region of the biggest valid rectange within interval
- SurfaceInterval GetCopyableInterval(const Surface& src_surface) const;
-
- /**
- * Gets the actual width (in pixels) of the surface. This is provided because `width` is used
- * for tracking the surface region in memory, which may be compressed for certain formats. In
- * this scenario, `width` is actually the compressed width.
- */
- u32 GetActualWidth() const {
- return width * GetCompresssionFactor();
- }
-
- /**
- * Gets the actual height (in pixels) of the surface. This is provided because `height` is used
- * for tracking the surface region in memory, which may be compressed for certain formats. In
- * this scenario, `height` is actually the compressed height.
- */
- u32 GetActualHeight() const {
- return height * GetCompresssionFactor();
- }
+ /// Returns the rectangle corresponding to this surface
+ MathUtil::Rectangle<u32> GetRect() const;
- u32 GetScaledWidth() const {
- return width * res_scale;
+ /// Returns the size of this surface in bytes, adjusted for compression
+ size_t SizeInBytes() const {
+ const u32 compression_factor{GetCompressionFactor(pixel_format)};
+ ASSERT(width % compression_factor == 0);
+ ASSERT(height % compression_factor == 0);
+ return (width / compression_factor) * (height / compression_factor) *
+ GetFormatBpp(pixel_format) / CHAR_BIT;
}
- u32 GetScaledHeight() const {
- return height * res_scale;
- }
+ /// Returns the CPU virtual address for this surface
+ VAddr GetCpuAddr() const;
- MathUtil::Rectangle<u32> GetRect() const {
- return {0, height, width, 0};
+ /// Returns true if the specified region overlaps with this surface's region in Switch memory
+ bool IsOverlappingRegion(Tegra::GPUVAddr region_addr, size_t region_size) const {
+ return addr <= (region_addr + region_size) && region_addr <= (addr + size_in_bytes);
}
- MathUtil::Rectangle<u32> GetScaledRect() const {
- return {0, GetScaledHeight(), GetScaledWidth(), 0};
- }
+ /// Creates SurfaceParams from a texture configuration
+ static SurfaceParams CreateForTexture(const Tegra::Texture::FullTextureInfo& config);
+
+ /// Creates SurfaceParams from a framebuffer configuration
+ static SurfaceParams CreateForFramebuffer(
+ const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig& config);
+
+ /// Creates SurfaceParams for a depth buffer configuration
+ static SurfaceParams CreateForDepthBuffer(
+ const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig& config,
+ Tegra::GPUVAddr zeta_address, Tegra::DepthFormat format);
+
+ Tegra::GPUVAddr addr;
+ bool is_tiled;
+ u32 block_height;
+ PixelFormat pixel_format;
+ ComponentType component_type;
+ SurfaceType type;
+ u32 width;
+ u32 height;
+ u32 unaligned_height;
+ size_t size_in_bytes;
+};
- u64 PixelsInBytes(u64 size) const {
- return size * CHAR_BIT / GetFormatBpp(pixel_format);
+/// Hashable variation of SurfaceParams, used for a key in the surface cache
+struct SurfaceKey : Common::HashableStruct<SurfaceParams> {
+ static SurfaceKey Create(const SurfaceParams& params) {
+ SurfaceKey res;
+ res.state = params;
+ return res;
}
+};
- u64 BytesInPixels(u64 pixels) const {
- return pixels * GetFormatBpp(pixel_format) / CHAR_BIT;
+namespace std {
+template <>
+struct hash<SurfaceKey> {
+ size_t operator()(const SurfaceKey& k) const {
+ return k.Hash();
}
-
- VAddr GetCpuAddr() const;
-
- bool ExactMatch(const SurfaceParams& other_surface) const;
- bool CanSubRect(const SurfaceParams& sub_surface) const;
- bool CanExpand(const SurfaceParams& expanded_surface) const;
- bool CanTexCopy(const SurfaceParams& texcopy_params) const;
-
- MathUtil::Rectangle<u32> GetSubRect(const SurfaceParams& sub_surface) const;
- MathUtil::Rectangle<u32> GetScaledSubRect(const SurfaceParams& sub_surface) const;
-
- Tegra::GPUVAddr addr = 0;
- Tegra::GPUVAddr end = 0;
- boost::optional<VAddr> cpu_addr;
- u64 size = 0;
-
- u32 width = 0;
- u32 height = 0;
- u32 stride = 0;
- u32 block_height = 0;
- u16 res_scale = 1;
-
- bool is_tiled = false;
- PixelFormat pixel_format = PixelFormat::Invalid;
- SurfaceType type = SurfaceType::Invalid;
- ComponentType component_type = ComponentType::Invalid;
};
+} // namespace std
-struct CachedSurface : SurfaceParams {
- bool CanFill(const SurfaceParams& dest_surface, SurfaceInterval fill_interval) const;
- bool CanCopy(const SurfaceParams& dest_surface, SurfaceInterval copy_interval) const;
-
- bool IsRegionValid(SurfaceInterval interval) const {
- return (invalid_regions.find(interval) == invalid_regions.end());
- }
+class CachedSurface final {
+public:
+ CachedSurface(const SurfaceParams& params);
- bool IsSurfaceFullyInvalid() const {
- return (invalid_regions & GetInterval()) == SurfaceRegions(GetInterval());
+ const OGLTexture& Texture() const {
+ return texture;
}
- bool registered = false;
- SurfaceRegions invalid_regions;
-
- u64 fill_size = 0; /// Number of bytes to read from fill_data
- std::array<u8, 4> fill_data;
-
- OGLTexture texture;
-
- static constexpr unsigned int GetGLBytesPerPixel(PixelFormat format) {
- if (format == PixelFormat::Invalid)
+ static constexpr unsigned int GetGLBytesPerPixel(SurfaceParams::PixelFormat format) {
+ if (format == SurfaceParams::PixelFormat::Invalid)
return 0;
return SurfaceParams::GetFormatBpp(format) / CHAR_BIT;
}
- std::unique_ptr<u8[]> gl_buffer;
- size_t gl_buffer_size = 0;
+ const SurfaceParams& GetSurfaceParams() const {
+ return params;
+ }
// Read/Write data in Switch memory to/from gl_buffer
- void LoadGLBuffer(Tegra::GPUVAddr load_start, Tegra::GPUVAddr load_end);
- void FlushGLBuffer(Tegra::GPUVAddr flush_start, Tegra::GPUVAddr flush_end);
+ void LoadGLBuffer();
+ void FlushGLBuffer();
// Upload/Download data in gl_buffer in/to this surface's texture
- void UploadGLTexture(const MathUtil::Rectangle<u32>& rect, GLuint read_fb_handle,
- GLuint draw_fb_handle);
- void DownloadGLTexture(const MathUtil::Rectangle<u32>& rect, GLuint read_fb_handle,
- GLuint draw_fb_handle);
+ void UploadGLTexture(GLuint read_fb_handle, GLuint draw_fb_handle);
+ void DownloadGLTexture(GLuint read_fb_handle, GLuint draw_fb_handle);
+
+private:
+ OGLTexture texture;
+ std::vector<u8> gl_buffer;
+ SurfaceParams params;
};
-class RasterizerCacheOpenGL : NonCopyable {
+class RasterizerCacheOpenGL final : NonCopyable {
public:
RasterizerCacheOpenGL();
~RasterizerCacheOpenGL();
- /// Blit one surface's texture to another
- bool BlitSurfaces(const Surface& src_surface, const MathUtil::Rectangle<u32>& src_rect,
- const Surface& dst_surface, const MathUtil::Rectangle<u32>& dst_rect);
-
- void ConvertD24S8toABGR(GLuint src_tex, const MathUtil::Rectangle<u32>& src_rect,
- GLuint dst_tex, const MathUtil::Rectangle<u32>& dst_rect);
-
- /// Copy one surface's region to another
- void CopySurface(const Surface& src_surface, const Surface& dst_surface,
- SurfaceInterval copy_interval);
-
- /// Load a texture from Switch memory to OpenGL and cache it (if not already cached)
- Surface GetSurface(const SurfaceParams& params, ScaleMatch match_res_scale,
- bool load_if_create);
-
- /// Tries to find a framebuffer GPU address based on the provided CPU address
- boost::optional<Tegra::GPUVAddr> TryFindFramebufferGpuAddress(VAddr cpu_addr) const;
-
- /// Attempt to find a subrect (resolution scaled) of a surface, otherwise loads a texture from
- /// Switch memory to OpenGL and caches it (if not already cached)
- SurfaceRect_Tuple GetSurfaceSubRect(const SurfaceParams& params, ScaleMatch match_res_scale,
- bool load_if_create);
-
/// Get a surface based on the texture configuration
Surface GetTextureSurface(const Tegra::Texture::FullTextureInfo& config);
@@ -470,29 +429,21 @@ public:
SurfaceSurfaceRect_Tuple GetFramebufferSurfaces(bool using_color_fb, bool using_depth_fb,
const MathUtil::Rectangle<s32>& viewport);
- /// Get a surface that matches the fill config
- Surface GetFillSurface(const void* config);
+ /// Marks the specified surface as "dirty", in that it is out of sync with Switch memory
+ void MarkSurfaceAsDirty(const Surface& surface);
- /// Get a surface that matches a "texture copy" display transfer config
- SurfaceRect_Tuple GetTexCopySurface(const SurfaceParams& params);
+ /// Tries to find a framebuffer GPU address based on the provided CPU address
+ Surface TryFindFramebufferSurface(VAddr cpu_addr) const;
/// Write any cached resources overlapping the region back to memory (if dirty)
- void FlushRegion(Tegra::GPUVAddr addr, u64 size, Surface flush_surface = nullptr);
-
- /// Mark region as being invalidated by region_owner (nullptr if Switch memory)
- void InvalidateRegion(Tegra::GPUVAddr addr, u64 size, const Surface& region_owner);
+ void FlushRegion(Tegra::GPUVAddr addr, size_t size);
- /// Flush all cached resources tracked by this cache manager
- void FlushAll();
+ /// Mark the specified region as being invalidated
+ void InvalidateRegion(Tegra::GPUVAddr addr, size_t size);
private:
- void DuplicateSurface(const Surface& src_surface, const Surface& dest_surface);
-
- /// Update surface's texture for given region when necessary
- void ValidateSurface(const Surface& surface, Tegra::GPUVAddr addr, u64 size);
-
- /// Create a new surface
- Surface CreateSurface(const SurfaceParams& params);
+ void LoadSurface(const Surface& surface);
+ Surface GetSurface(const SurfaceParams& params);
/// Register surface into the cache
void RegisterSurface(const Surface& surface);
@@ -503,18 +454,9 @@ private:
/// Increase/decrease the number of surface in pages touching the specified region
void UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 size, int delta);
- SurfaceCache surface_cache;
+ std::unordered_map<SurfaceKey, Surface> surface_cache;
PageMap cached_pages;
- SurfaceMap dirty_regions;
- SurfaceSet remove_surfaces;
OGLFramebuffer read_framebuffer;
OGLFramebuffer draw_framebuffer;
-
- OGLVertexArray attributeless_vao;
- OGLBuffer d24s8_abgr_buffer;
- GLsizeiptr d24s8_abgr_buffer_size;
- OGLProgram d24s8_abgr_shader;
- GLint d24s8_abgr_tbo_size_u_id;
- GLint d24s8_abgr_viewport_u_id;
};