diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-23 09:28:34 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:30 +0200 |
commit | d621e96d0de212cc16897eadf71e8a1b2e1eb5dc (patch) | |
tree | 8695f2f4dddf2564b63e4574d6616ccb0e79568c /src/video_core/renderer_opengl/gl_texture_cache.h | |
parent | spirv: Be aware of NAN unaware drivers (diff) | |
download | yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.gz yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.bz2 yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.lz yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.xz yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.zst yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 817b0e650..2e3e02b79 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -9,6 +9,7 @@ #include <glad/glad.h> +#include "shader_recompiler/shader_info.h" #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/util_shaders.h" #include "video_core/texture_cache/texture_cache.h" @@ -127,13 +128,12 @@ private: OGLTexture null_image_1d_array; OGLTexture null_image_cube_array; OGLTexture null_image_3d; - OGLTexture null_image_rect; OGLTextureView null_image_view_1d; OGLTextureView null_image_view_2d; OGLTextureView null_image_view_2d_array; OGLTextureView null_image_view_cube; - std::array<GLuint, VideoCommon::NUM_IMAGE_VIEW_TYPES> null_image_views; + std::array<GLuint, Shader::NUM_TEXTURE_TYPES> null_image_views{}; }; class Image : public VideoCommon::ImageBase { @@ -154,8 +154,6 @@ public: void UploadMemory(const ImageBufferMap& map, std::span<const VideoCommon::BufferImageCopy> copies); - void UploadMemory(const ImageBufferMap& map, std::span<const VideoCommon::BufferCopy> copies); - void DownloadMemory(ImageBufferMap& map, std::span<const VideoCommon::BufferImageCopy> copies); GLuint StorageHandle() noexcept; @@ -170,7 +168,6 @@ private: void CopyImageToBuffer(const VideoCommon::BufferImageCopy& copy, size_t buffer_offset); OGLTexture texture; - OGLBuffer buffer; OGLTextureView store_view; GLenum gl_internal_format = GL_NONE; GLenum gl_format = GL_NONE; @@ -182,12 +179,14 @@ class ImageView : public VideoCommon::ImageViewBase { public: explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&); + explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo&, + const VideoCommon::ImageViewInfo&, GPUVAddr); explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, const VideoCommon::ImageViewInfo& view_info); explicit ImageView(TextureCacheRuntime&, const VideoCommon::NullImageParams&); - [[nodiscard]] GLuint Handle(ImageViewType query_type) const noexcept { - return views[static_cast<size_t>(query_type)]; + [[nodiscard]] GLuint Handle(Shader::TextureType handle_type) const noexcept { + return views[static_cast<size_t>(handle_type)]; } [[nodiscard]] GLuint DefaultHandle() const noexcept { @@ -198,15 +197,25 @@ public: return internal_format; } + [[nodiscard]] GPUVAddr GpuAddr() const noexcept { + return gpu_addr; + } + + [[nodiscard]] u32 BufferSize() const noexcept { + return buffer_size; + } + private: - void SetupView(const Device& device, Image& image, ImageViewType view_type, GLuint handle, + void SetupView(const Device& device, Image& image, Shader::TextureType view_type, GLuint handle, const VideoCommon::ImageViewInfo& info, VideoCommon::SubresourceRange view_range); - std::array<GLuint, VideoCommon::NUM_IMAGE_VIEW_TYPES> views{}; + std::array<GLuint, Shader::NUM_TEXTURE_TYPES> views{}; std::vector<OGLTextureView> stored_views; - GLuint default_handle = 0; GLenum internal_format = GL_NONE; + GLuint default_handle = 0; + GPUVAddr gpu_addr = 0; + u32 buffer_size = 0; }; class ImageAlloc : public VideoCommon::ImageAllocBase {}; |