diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-05-21 18:48:28 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:33 +0200 |
commit | ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96 (patch) | |
tree | a44c1ad2957fa0f0239c59b3447e6f574063992a /src/video_core | |
parent | texture_cache: Handle uncontinuous surfaces. (diff) | |
download | yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.gz yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.bz2 yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.lz yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.xz yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.zst yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 2 | ||||
-rw-r--r-- | src/video_core/texture_cache/surface_params.h | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d613cb1dc..8fe115aec 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -822,8 +822,14 @@ TextureBufferUsage RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, c unit.sampler = sampler_cache.GetSampler(texture.tsc); if (const auto view{texture_cache.GetTextureSurface(texture, entry)}; view) { - view->ApplySwizzle(texture.tic.x_source, texture.tic.y_source, texture.tic.z_source, - texture.tic.w_source); + if (view->GetSurfaceParams().IsBuffer()) { + // Record that this texture is a texture buffer. + texture_buffer_usage.set(bindpoint); + } else { + // Apply swizzle to textures that are not buffers. + view->ApplySwizzle(texture.tic.x_source, texture.tic.y_source, texture.tic.z_source, + texture.tic.w_source); + } state.texture_units[current_bindpoint].texture = view->GetTexture(); } else { // Can occur when texture addr is null or its memory is unmapped/invalid diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 51d9aae94..5ec911adc 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -291,7 +291,7 @@ std::optional<ShaderDiskCacheDecompiled> ShaderDiskCacheOpenGL::LoadDecompiledEn } ShaderDiskCacheDecompiled entry; - entry.code = std::move(code); + entry.code = std::string(reinterpret_cast<const char*>(code.data()), code_size); u32 const_buffers_count{}; if (!LoadObjectFromPrecompiled(const_buffers_count)) { diff --git a/src/video_core/texture_cache/surface_params.h b/src/video_core/texture_cache/surface_params.h index 13a08a60f..d9aa0b521 100644 --- a/src/video_core/texture_cache/surface_params.h +++ b/src/video_core/texture_cache/surface_params.h @@ -167,6 +167,10 @@ public: return VideoCore::Surface::GetFormatCompressionType(pixel_format); } + bool IsBuffer() const { + return target == VideoCore::Surface::SurfaceTarget::TextureBuffer; + } + std::string TargetName() const; bool is_tiled; |