diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index e560111c3..6956535e5 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -396,6 +396,10 @@ OGLTexture MakeImage(const VideoCommon::ImageInfo& info, GLenum gl_internal_form | |||
| 396 | UNREACHABLE_MSG("Invalid image format={}", format); | 396 | UNREACHABLE_MSG("Invalid image format={}", format); |
| 397 | return GL_R32UI; | 397 | return GL_R32UI; |
| 398 | } | 398 | } |
| 399 | |||
| 400 | [[nodiscard]] u32 NextPow2(u32 value) { | ||
| 401 | return 1U << (32U - std::countl_zero(value - 1U)); | ||
| 402 | } | ||
| 399 | } // Anonymous namespace | 403 | } // Anonymous namespace |
| 400 | 404 | ||
| 401 | ImageBufferMap::~ImageBufferMap() { | 405 | ImageBufferMap::~ImageBufferMap() { |
| @@ -1304,7 +1308,7 @@ void FormatConversionPass::ConvertImage(Image& dst_image, Image& src_image, | |||
| 1304 | const u32 copy_size = region.width * region.height * region.depth * img_bpp; | 1308 | const u32 copy_size = region.width * region.height * region.depth * img_bpp; |
| 1305 | if (pbo_size < copy_size) { | 1309 | if (pbo_size < copy_size) { |
| 1306 | intermediate_pbo.Create(); | 1310 | intermediate_pbo.Create(); |
| 1307 | pbo_size = copy_size; | 1311 | pbo_size = NextPow2(copy_size); |
| 1308 | glNamedBufferData(intermediate_pbo.handle, pbo_size, nullptr, GL_STREAM_COPY); | 1312 | glNamedBufferData(intermediate_pbo.handle, pbo_size, nullptr, GL_STREAM_COPY); |
| 1309 | } | 1313 | } |
| 1310 | // Copy from source to PBO | 1314 | // Copy from source to PBO |