diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-30 00:33:56 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-30 03:49:02 +0100 |
commit | f58a6152fc89626e4a8f1746af46e9260d17d404 (patch) | |
tree | 1a7d46460ca7f43c2f7b38be5829736597ffb1e6 /src/video_core/renderer_opengl | |
parent | hle/ipc_helpers: Fix clang-format warnings (diff) | |
download | yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.tar yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.tar.gz yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.tar.bz2 yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.tar.lz yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.tar.xz yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.tar.zst yuzu-f58a6152fc89626e4a8f1746af46e9260d17d404.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 8 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index a05b8b936..c44e2aca2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -167,6 +167,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only, } params.is_layered = SurfaceTargetIsLayered(params.target); + params.is_array = SurfaceTargetIsArray(params.target); params.max_mip_level = config.tic.max_mip_level + 1; params.rt = {}; @@ -877,10 +878,13 @@ void CachedSurface::EnsureTextureView() { UNIMPLEMENTED_IF(gl_is_compressed); const GLenum target{TargetLayer()}; + const GLuint num_layers{target == GL_TEXTURE_CUBE_MAP_ARRAY ? 6u : 1u}; + constexpr GLuint min_layer = 0; + constexpr GLuint min_level = 0; texture_view.Create(); - glTextureView(texture_view.handle, target, texture.handle, gl_internal_format, 0, - params.max_mip_level, 0, 1); + glTextureView(texture_view.handle, target, texture.handle, gl_internal_format, min_level, + params.max_mip_level, min_layer, num_layers); OpenGLState cur_state = OpenGLState::GetCurState(); const auto& old_tex = cur_state.texture_units[0]; diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 37611c4fc..dae0feb20 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -225,6 +225,7 @@ struct SurfaceParams { SurfaceTarget target; u32 max_mip_level; bool is_layered; + bool is_array; bool srgb_conversion; // Parameters used for caching VAddr addr; @@ -294,7 +295,7 @@ public: } const OGLTexture& TextureLayer() { - if (params.is_layered) { + if (params.is_array) { return Texture(); } EnsureTextureView(); |