summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-05-12 18:31:03 -0300
committerGravatar ReinUsesLisp2019-06-20 21:36:12 -0300
commitc2ed348bddc1cd1bd97ce789d7855b1571e45ef4 (patch)
tree2cea9018ea39fe3b4c32e2aec95a3d45617211a8 /src
parentgl_framebuffer_cache: Use a hashed struct to cache framebuffers (diff)
downloadyuzu-c2ed348bddc1cd1bd97ce789d7855b1571e45ef4.tar.gz
yuzu-c2ed348bddc1cd1bd97ce789d7855b1571e45ef4.tar.xz
yuzu-c2ed348bddc1cd1bd97ce789d7855b1571e45ef4.zip
surface_params: Ensure pitch is always written to avoid surface leaks
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/surface_params.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp
index 6f39f8468..8472b69dc 100644
--- a/src/video_core/texture_cache/surface_params.cpp
+++ b/src/video_core/texture_cache/surface_params.cpp
@@ -111,6 +111,7 @@ SurfaceParams SurfaceParams::CreateForDepthBuffer(
111 params.unaligned_height = zeta_height; 111 params.unaligned_height = zeta_height;
112 params.target = SurfaceTarget::Texture2D; 112 params.target = SurfaceTarget::Texture2D;
113 params.depth = 1; 113 params.depth = 1;
114 params.pitch = 0;
114 params.num_levels = 1; 115 params.num_levels = 1;
115 params.is_layered = false; 116 params.is_layered = false;
116 return params; 117 return params;
@@ -131,6 +132,7 @@ SurfaceParams SurfaceParams::CreateForFramebuffer(Core::System& system, std::siz
131 params.component_type = ComponentTypeFromRenderTarget(config.format); 132 params.component_type = ComponentTypeFromRenderTarget(config.format);
132 params.type = GetFormatType(params.pixel_format); 133 params.type = GetFormatType(params.pixel_format);
133 if (params.is_tiled) { 134 if (params.is_tiled) {
135 params.pitch = 0;
134 params.width = config.width; 136 params.width = config.width;
135 } else { 137 } else {
136 const u32 bpp = GetFormatBpp(params.pixel_format) / CHAR_BIT; 138 const u32 bpp = GetFormatBpp(params.pixel_format) / CHAR_BIT;