Fix: Use correct byte size for GPU_DEPTH_COMPONENT24
Every depth component has a trailing byte for alignment. So it should be 4 bytes, not 3 bytes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user