summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-05-21 12:48:28 -0400
committerGravatar ReinUsesLisp2019-06-20 21:38:33 -0300
commitea1525dab1bf7e9e56471b6d5fd50014bfeb4f96 (patch)
treea44c1ad2957fa0f0239c59b3447e6f574063992a /src
parenttexture_cache: Handle uncontinuous surfaces. (diff)
downloadyuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.gz
yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.tar.xz
yuzu-ea1525dab1bf7e9e56471b6d5fd50014bfeb4f96.zip
Fix rebase errors
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_shader_disk_cache.cpp2
-rw-r--r--src/video_core/texture_cache/surface_params.h4
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
822 unit.sampler = sampler_cache.GetSampler(texture.tsc); 822 unit.sampler = sampler_cache.GetSampler(texture.tsc);
823 823
824 if (const auto view{texture_cache.GetTextureSurface(texture, entry)}; view) { 824 if (const auto view{texture_cache.GetTextureSurface(texture, entry)}; view) {
825 view->ApplySwizzle(texture.tic.x_source, texture.tic.y_source, texture.tic.z_source, 825 if (view->GetSurfaceParams().IsBuffer()) {
826 texture.tic.w_source); 826 // Record that this texture is a texture buffer.
827 texture_buffer_usage.set(bindpoint);
828 } else {
829 // Apply swizzle to textures that are not buffers.
830 view->ApplySwizzle(texture.tic.x_source, texture.tic.y_source, texture.tic.z_source,
831 texture.tic.w_source);
832 }
827 state.texture_units[current_bindpoint].texture = view->GetTexture(); 833 state.texture_units[current_bindpoint].texture = view->GetTexture();
828 } else { 834 } else {
829 // Can occur when texture addr is null or its memory is unmapped/invalid 835 // 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
291 } 291 }
292 292
293 ShaderDiskCacheDecompiled entry; 293 ShaderDiskCacheDecompiled entry;
294 entry.code = std::move(code); 294 entry.code = std::string(reinterpret_cast<const char*>(code.data()), code_size);
295 295
296 u32 const_buffers_count{}; 296 u32 const_buffers_count{};
297 if (!LoadObjectFromPrecompiled(const_buffers_count)) { 297 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:
167 return VideoCore::Surface::GetFormatCompressionType(pixel_format); 167 return VideoCore::Surface::GetFormatCompressionType(pixel_format);
168 } 168 }
169 169
170 bool IsBuffer() const {
171 return target == VideoCore::Surface::SurfaceTarget::TextureBuffer;
172 }
173
170 std::string TargetName() const; 174 std::string TargetName() const;
171 175
172 bool is_tiled; 176 bool is_tiled;