gl: Fix staging buffer size calculation

This commit is contained in:
kd-11 2019-05-19 21:29:33 +03:00 committed by kd-11
parent 9a26c0abda
commit c3b234f972

View File

@ -606,7 +606,8 @@ namespace gl
// The rest of sampler state is now handled by sampler state objects
// Calculate staging buffer size
size_t texture_data_sz = depth * height * width * get_format_block_size_in_bytes(gcm_format);
const u32 aligned_pitch = align<u32>(width * get_format_block_size_in_bytes(gcm_format), 4);
size_t texture_data_sz = depth * height * aligned_pitch;
std::vector<gsl::byte> data_upload_buf(texture_data_sz);
const auto format_type = get_format_type(gcm_format);