diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-16 08:12:38 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-16 08:19:32 +0100 |
commit | 6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7 (patch) | |
tree | 06b9087f7921595d336b98503c0e9fcf25694775 /src/video_core/renderer_opengl/gl_texture_cache.cpp | |
parent | Merge pull request #3401 from FernandoS27/synchronization (diff) | |
download | yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.tar yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.tar.gz yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.tar.bz2 yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.tar.lz yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.tar.xz yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.tar.zst yuzu-6a0220b2e1a0d7692b8f32f66ae7bc86cb63fab7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index d4b81cd87..af520e332 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -398,24 +398,36 @@ CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, const ViewParams& p CachedSurfaceView::~CachedSurfaceView() = default; void CachedSurfaceView::Attach(GLenum attachment, GLenum target) const { - ASSERT(params.num_layers == 1 && params.num_levels == 1); + ASSERT(params.num_levels == 1); - const auto& owner_params = surface.GetSurfaceParams(); + const GLuint texture = surface.GetTexture(); + if (params.num_layers > 1) { + // Layered framebuffer attachments + UNIMPLEMENTED_IF(params.base_layer != 0); + + switch (params.target) { + case SurfaceTarget::Texture2DArray: + glFramebufferTexture(target, attachment, texture, params.base_level); + break; + default: + UNIMPLEMENTED(); + } + return; + } - switch (owner_params.target) { + const GLenum view_target = surface.GetTarget(); + switch (surface.GetSurfaceParams().target) { case SurfaceTarget::Texture1D: - glFramebufferTexture1D(target, attachment, surface.GetTarget(), surface.GetTexture(), - params.base_level); + glFramebufferTexture1D(target, attachment, view_target, texture, params.base_level); break; case SurfaceTarget::Texture2D: - glFramebufferTexture2D(target, attachment, surface.GetTarget(), surface.GetTexture(), - params.base_level); + glFramebufferTexture2D(target, attachment, view_target, texture, params.base_level); break; case SurfaceTarget::Texture1DArray: case SurfaceTarget::Texture2DArray: case SurfaceTarget::TextureCubemap: case SurfaceTarget::TextureCubeArray: - glFramebufferTextureLayer(target, attachment, surface.GetTexture(), params.base_level, + glFramebufferTextureLayer(target, attachment, texture, params.base_level, params.base_layer); break; default: |