diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-02-13 19:27:50 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-02-13 19:27:50 +0100 |
commit | c7325c6a4c0e8981667faaa8bd64cbc36f3a84be (patch) | |
tree | 6b0dddcbb22bd8952056c8d625e897eb70371243 /src/video_core/renderer_opengl/gl_texture_cache.cpp | |
parent | Merge pull request #5919 from ReinUsesLisp/stream-buffer-tragic (diff) | |
download | yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.tar yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.tar.gz yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.tar.bz2 yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.tar.lz yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.tar.xz yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.tar.zst yuzu-c7325c6a4c0e8981667faaa8bd64cbc36f3a84be.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 31eb54123..12434db67 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -763,6 +763,37 @@ void Image::DownloadMemory(ImageBufferMap& map, } } +GLuint Image::StorageHandle() noexcept { + switch (info.format) { + case PixelFormat::A8B8G8R8_SRGB: + case PixelFormat::B8G8R8A8_SRGB: + case PixelFormat::BC1_RGBA_SRGB: + case PixelFormat::BC2_SRGB: + case PixelFormat::BC3_SRGB: + case PixelFormat::BC7_SRGB: + case PixelFormat::ASTC_2D_4X4_SRGB: + case PixelFormat::ASTC_2D_8X8_SRGB: + case PixelFormat::ASTC_2D_8X5_SRGB: + case PixelFormat::ASTC_2D_5X4_SRGB: + case PixelFormat::ASTC_2D_5X5_SRGB: + case PixelFormat::ASTC_2D_10X8_SRGB: + case PixelFormat::ASTC_2D_6X6_SRGB: + case PixelFormat::ASTC_2D_10X10_SRGB: + case PixelFormat::ASTC_2D_12X12_SRGB: + case PixelFormat::ASTC_2D_8X6_SRGB: + case PixelFormat::ASTC_2D_6X5_SRGB: + if (store_view.handle != 0) { + return store_view.handle; + } + store_view.Create(); + glTextureView(store_view.handle, ImageTarget(info), texture.handle, GL_RGBA8, 0, + info.resources.levels, 0, info.resources.layers); + return store_view.handle; + default: + return texture.handle; + } +} + void Image::CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t buffer_offset) { // Compressed formats don't have a pixel format or type const bool is_compressed = gl_format == GL_NONE; |