diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-25 23:40:08 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-25 23:40:08 +0200 |
commit | 18d24fbdd00ee2d05cd02c2794d56b396118f9d5 (patch) | |
tree | 09d8f49d420fc4ef304e833015dd109f92c379f0 | |
parent | gl_resource_manager: Correct MakeStreamCopy (diff) | |
download | yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.tar yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.tar.gz yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.tar.bz2 yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.tar.lz yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.tar.xz yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.tar.zst yuzu-18d24fbdd00ee2d05cd02c2794d56b396118f9d5.zip |
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 16 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 6 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index c5e3b7a94..d539bf07c 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -244,7 +244,6 @@ CachedSurface::~CachedSurface() { void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) { MICROPROFILE_SCOPE(OpenGL_Texture_Download); - // TODO(Rodrigo): Optimize alignment SCOPE_EXIT({ glPixelStorei(GL_PACK_ROW_LENGTH, 0); }); for (u32 level = 0; level < params.emulated_levels; ++level) { @@ -272,7 +271,6 @@ void CachedSurface::UploadTexture(std::vector<u8>& staging_buffer) { } void CachedSurface::UploadTextureMipmap(u32 level, std::vector<u8>& staging_buffer) { - // TODO(Rodrigo): Optimize alignment glPixelStorei(GL_UNPACK_ALIGNMENT, std::min(8U, params.GetRowAlignment(level))); glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(params.GetMipWidth(level))); @@ -421,10 +419,10 @@ void CachedSurfaceView::ApplySwizzle(SwizzleSource x_source, SwizzleSource y_sou OGLTextureView CachedSurfaceView::CreateTextureView() const { const auto& owner_params = surface.GetSurfaceParams(); - OGLTextureView tv; - tv.Create(); + OGLTextureView texture_view; + texture_view.Create(); - const GLuint handle{tv.handle}; + const GLuint handle{texture_view.handle}; const FormatTuple& tuple{ GetFormatTuple(owner_params.pixel_format, owner_params.component_type)}; @@ -433,7 +431,7 @@ OGLTextureView CachedSurfaceView::CreateTextureView() const { ApplyTextureDefaults(owner_params, handle); - return tv; + return texture_view; } TextureCacheOpenGL::TextureCacheOpenGL(Core::System& system, @@ -529,6 +527,7 @@ void TextureCacheOpenGL::ImageBlit(View& src_view, View& dst_view, void TextureCacheOpenGL::BufferCopy(Surface& src_surface, Surface& dst_surface) { const auto& src_params = src_surface->GetSurfaceParams(); const auto& dst_params = dst_surface->GetSurfaceParams(); + UNIMPLEMENTED_IF(src_params.num_levels > 1 || dst_params.num_levels > 1); const auto source_format = GetFormatTuple(src_params.pixel_format, src_params.component_type); const auto dest_format = GetFormatTuple(dst_params.pixel_format, dst_params.component_type); @@ -591,10 +590,7 @@ void TextureCacheOpenGL::BufferCopy(Surface& src_surface, Surface& dst_surface) } GLuint TextureCacheOpenGL::FetchPBO(std::size_t buffer_size) { - if (buffer_size < 0) { - UNREACHABLE(); - return 0; - } + ASSERT_OR_EXECUTE(buffer_size <= 0, { return 0; }); const u32 l2 = Common::Log2Ceil64(static_cast<u64>(buffer_size)); OGLBuffer& cp = copy_pbo_cache[l2]; if (cp.handle == 0) { diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index cdc44a60c..8da81dba3 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -90,17 +90,17 @@ public: } u32 GetWidth() const { - const auto owner_params = GetSurfaceParams(); + const auto& owner_params = GetSurfaceParams(); return owner_params.GetMipWidth(params.base_level); } u32 GetHeight() const { - const auto owner_params = GetSurfaceParams(); + const auto& owner_params = GetSurfaceParams(); return owner_params.GetMipHeight(params.base_level); } u32 GetDepth() const { - const auto owner_params = GetSurfaceParams(); + const auto& owner_params = GetSurfaceParams(); return owner_params.GetMipDepth(params.base_level); } |