mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 02:52:10 +01:00
[dxvk] Introduce per-aspect version of computeImageDataSize
This commit is contained in:
parent
957d99ed8d
commit
e9851bee86
@ -145,10 +145,16 @@ namespace dxvk::util {
|
||||
|
||||
VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent) {
|
||||
const DxvkFormatInfo* formatInfo = lookupFormatInfo(format);
|
||||
return computeImageDataSize(format, extent, formatInfo->aspectMask);
|
||||
}
|
||||
|
||||
|
||||
VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent, VkImageAspectFlags aspects) {
|
||||
const DxvkFormatInfo* formatInfo = lookupFormatInfo(format);
|
||||
|
||||
VkDeviceSize size = 0;
|
||||
|
||||
for (auto aspects = formatInfo->aspectMask; aspects; ) {
|
||||
while (aspects) {
|
||||
auto aspect = vk::getNextAspect(aspects);
|
||||
auto elementSize = formatInfo->elementSize;
|
||||
auto planeExtent = extent;
|
||||
|
@ -298,6 +298,19 @@ namespace dxvk::util {
|
||||
*/
|
||||
VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent);
|
||||
|
||||
/**
|
||||
* \brief Computes image data size, in bytes
|
||||
*
|
||||
* Convenience method that can be used to compute the number
|
||||
* of bytes required to store image data in a given format
|
||||
* for the given aspects.
|
||||
* \param [in] format The image format
|
||||
* \param [in] extent Image size, in pixels
|
||||
* \param [in] aspects Aspect mask
|
||||
* \returns Data size, in bytes
|
||||
*/
|
||||
VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent, VkImageAspectFlags aspects);
|
||||
|
||||
/**
|
||||
* \brief Applies a component mapping to a component mask
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user