diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh index 660cab90864..8bcd58cda12 100644 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@ -470,7 +470,9 @@ inline size_t to_bytesize(eGPUTextureFormat format) case GPU_DEPTH_COMPONENT32F: return 32 / 8; case GPU_DEPTH_COMPONENT24: - return 24 / 8; + /* Depth component 24 uses 3 bytes to store the depth value, and reserved 1 byte for + * alignment. */ + return (24 + 8) / 8; case GPU_DEPTH_COMPONENT16: return 16 / 8; }