diff options
| author | 2024-01-19 19:14:34 -0500 | |
|---|---|---|
| committer | 2024-02-09 09:20:53 -0500 | |
| commit | 0cbb555e9aab4ec18491a400176caa0dce9a9ad1 (patch) | |
| tree | 351f2330cf6dd37f231b444e5e25e6e5132a8853 /src/video_core/renderer_opengl | |
| parent | core: fix multiprocess with nce (diff) | |
| download | yuzu-0cbb555e9aab4ec18491a400176caa0dce9a9ad1.tar.gz yuzu-0cbb555e9aab4ec18491a400176caa0dce9a9ad1.tar.xz yuzu-0cbb555e9aab4ec18491a400176caa0dce9a9ad1.zip | |
video_core: defensively program around unmapped device pointers
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/present/layer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/present/layer.cpp b/src/video_core/renderer_opengl/present/layer.cpp index 8643e07c6..e3fffaa06 100644 --- a/src/video_core/renderer_opengl/present/layer.cpp +++ b/src/video_core/renderer_opengl/present/layer.cpp | |||
| @@ -131,10 +131,12 @@ FramebufferTextureInfo Layer::LoadFBToScreenInfo(const Tegra::FramebufferConfig& | |||
| 131 | const u64 size_in_bytes{Tegra::Texture::CalculateSize( | 131 | const u64 size_in_bytes{Tegra::Texture::CalculateSize( |
| 132 | true, bytes_per_pixel, framebuffer.stride, framebuffer.height, 1, block_height_log2, 0)}; | 132 | true, bytes_per_pixel, framebuffer.stride, framebuffer.height, 1, block_height_log2, 0)}; |
| 133 | const u8* const host_ptr{device_memory.GetPointer<u8>(framebuffer_addr)}; | 133 | const u8* const host_ptr{device_memory.GetPointer<u8>(framebuffer_addr)}; |
| 134 | const std::span<const u8> input_data(host_ptr, size_in_bytes); | 134 | if (host_ptr) { |
| 135 | Tegra::Texture::UnswizzleTexture(gl_framebuffer_data, input_data, bytes_per_pixel, | 135 | const std::span<const u8> input_data(host_ptr, size_in_bytes); |
| 136 | framebuffer.width, framebuffer.height, 1, block_height_log2, | 136 | Tegra::Texture::UnswizzleTexture(gl_framebuffer_data, input_data, bytes_per_pixel, |
| 137 | 0); | 137 | framebuffer.width, framebuffer.height, 1, |
| 138 | block_height_log2, 0); | ||
| 139 | } | ||
| 138 | 140 | ||
| 139 | glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); | 141 | glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); |
| 140 | glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(framebuffer.stride)); | 142 | glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(framebuffer.stride)); |