diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-21 05:11:49 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-27 18:41:06 +0100 |
commit | 27ddbeb01cba488e2b59409a0375f6c98b431102 (patch) | |
tree | dc8c144fc61d43545db555a73cb8bfebe1422c7b /src/video_core/renderer_opengl/gl_rasterizer_cache.h | |
parent | Merge pull request #2169 from lioncash/naming (diff) | |
download | yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.tar yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.tar.gz yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.tar.bz2 yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.tar.lz yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.tar.xz yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.tar.zst yuzu-27ddbeb01cba488e2b59409a0375f6c98b431102.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 838554c35..32fc6538a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -354,31 +354,19 @@ public: return texture; } - const OGLTexture& TextureLayer() { - if (params.is_array) { - return Texture(); + const OGLTexture& Texture(bool as_array) { + if (params.is_array == as_array) { + return texture; + } else { + EnsureTextureDiscrepantView(); + return discrepant_view; } - EnsureTextureView(); - return texture_view; } GLenum Target() const { return gl_target; } - GLenum TargetLayer() const { - using VideoCore::Surface::SurfaceTarget; - switch (params.target) { - case SurfaceTarget::Texture1D: - return GL_TEXTURE_1D_ARRAY; - case SurfaceTarget::Texture2D: - return GL_TEXTURE_2D_ARRAY; - case SurfaceTarget::TextureCubemap: - return GL_TEXTURE_CUBE_MAP_ARRAY; - } - return Target(); - } - const SurfaceParams& GetSurfaceParams() const { return params; } @@ -398,10 +386,10 @@ public: private: void UploadGLMipmapTexture(u32 mip_map, GLuint read_fb_handle, GLuint draw_fb_handle); - void EnsureTextureView(); + void EnsureTextureDiscrepantView(); OGLTexture texture; - OGLTexture texture_view; + OGLTexture discrepant_view; std::vector<std::vector<u8>> gl_buffer; SurfaceParams params{}; GLenum gl_target{}; |