diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-14 23:16:27 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:36:11 +0200 |
commit | 84139586c9e6c95a7f3faaa09d04eb11b2bcd70c (patch) | |
tree | 94e6d2746b7d0d60d5b5316d4867c0a9fe1edaba /src/video_core/renderer_opengl/gl_texture_cache.cpp | |
parent | gl_texture_cache: Add fast copy path (diff) | |
download | yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.tar yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.tar.gz yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.tar.bz2 yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.tar.lz yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.tar.xz yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.tar.zst yuzu-84139586c9e6c95a7f3faaa09d04eb11b2bcd70c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 00f9ab92f..ba6d3af4b 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -428,13 +428,28 @@ CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, ViewKey key) CachedSurfaceView::~CachedSurfaceView() = default; -GLuint CachedSurfaceView::GetTexture() { - // TODO(Rodrigo): Remove this entry and attach the super texture to the framebuffer through - // legacy API (also dropping Intel driver issues). - if (texture_view_2d.texture.handle == 0) { - texture_view_2d = CreateTextureView(GL_TEXTURE_2D); +void CachedSurfaceView::Attach(GLenum attachment) const { + ASSERT(key.num_layers == 1 && key.num_levels == 1); + + switch (params.GetTarget()) { + case SurfaceTarget::Texture1D: + glFramebufferTexture1D(GL_DRAW_FRAMEBUFFER, attachment, surface.GetTarget(), + surface.GetTexture(), key.base_level); + break; + case SurfaceTarget::Texture2D: + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, attachment, surface.GetTarget(), + surface.GetTexture(), key.base_level); + break; + case SurfaceTarget::Texture1DArray: + case SurfaceTarget::Texture2DArray: + case SurfaceTarget::TextureCubemap: + case SurfaceTarget::TextureCubeArray: + glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, attachment, surface.GetTexture(), + key.base_level, key.base_layer); + break; + default: + UNIMPLEMENTED(); } - return texture_view_2d.texture.handle; } GLuint CachedSurfaceView::GetTexture(Tegra::Shader::TextureType texture_type, bool is_array, |