formats: Remove old format utils
Some checks failed
ci / reuse (push) Has been cancelled
ci / generate_source (push) Has been cancelled
format / clang-format (push) Has been cancelled
ci / chromium (push) Has been cancelled
ci / build_and_test (Debug, macos-latest) (push) Has been cancelled
ci / build_and_test (Debug, ubuntu-22.04) (push) Has been cancelled
ci / build_and_test (Debug, ubuntu-24.04) (push) Has been cancelled
ci / build_and_test (Debug, windows-latest) (push) Has been cancelled
ci / build_and_test (Release, macos-latest) (push) Has been cancelled
ci / build_and_test (Release, ubuntu-22.04) (push) Has been cancelled
ci / build_and_test (Release, ubuntu-24.04) (push) Has been cancelled
ci / build_and_test (Release, windows-latest) (push) Has been cancelled
ci / windows-arm64 (push) Has been cancelled
ci / android (arm64-v8a) (push) Has been cancelled
ci / android (armeabi-v7a) (push) Has been cancelled

This commit is contained in:
spencer-lunarg 2025-05-22 08:41:19 -04:00 committed by Charles Giessen
parent 4f62821046
commit ae56bd6e65
3 changed files with 0 additions and 130 deletions

View file

@ -236,24 +236,6 @@ inline uint32_t vkuFormatTexelsPerBlock(VkFormat format);
// When dealing with mulit-planar formats, need to consider using vkuGetPlaneIndex.
inline uint32_t vkuFormatTexelBlockSize(VkFormat format);
// Return size, in bytes, of one element of a VkFormat
// Format must not be a depth, stencil, or multiplane format
// Deprecated - Use vkuFormatTexelBlockSize - there is no "element" size in the spec
inline uint32_t vkuFormatElementSize(VkFormat format);
// Return the size in bytes of one texel of a VkFormat
// For compressed or multi-plane, this may be a fractional number
// Deprecated - Use vkuFormatTexelBlockSize - there is no "element" size in the spec
inline uint32_t vkuFormatElementSizeWithAspect(VkFormat format, VkImageAspectFlagBits aspectMask);
// Return the size in bytes of one texel of a VkFormat
// Format must not be a depth, stencil, or multiplane format
inline double vkuFormatTexelSize(VkFormat format);
// Return the size in bytes of one texel of a VkFormat
// For compressed or multi-plane, this may be a fractional number
inline double vkuFormatTexelSizeWithAspect(VkFormat format, VkImageAspectFlagBits aspectMask);
''')
for bits in ['8', '16', '32', '64']:
out.append(f'// Returns whether a VkFormat contains only {bits}-bit sized components\n')
@ -643,41 +625,6 @@ inline uint32_t vkuFormatTexelsPerBlock(VkFormat format) { return vkuGetFormatIn
inline uint32_t vkuFormatTexelBlockSize(VkFormat format) { return vkuGetFormatInfo(format).texel_block_size; }
// Deprecated - Use vkuFormatTexelBlockSize
inline uint32_t vkuFormatElementSize(VkFormat format) {
return vkuFormatElementSizeWithAspect(format, VK_IMAGE_ASPECT_COLOR_BIT);
}
// Deprecated - Use vkuFormatTexelBlockSize
inline uint32_t vkuFormatElementSizeWithAspect(VkFormat format, VkImageAspectFlagBits aspectMask) {
// Depth/Stencil aspect have separate helper functions
if (aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) {
return vkuFormatStencilSize(format) / 8;
} else if (aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) {
return vkuFormatDepthSize(format) / 8;
} else if (vkuFormatIsMultiplane(format)) {
// Element of entire multiplane format is not useful,
// Want to get just a single plane as the lookup format
format = vkuFindMultiplaneCompatibleFormat(format, aspectMask);
}
return vkuGetFormatInfo(format).texel_block_size;
}
inline double vkuFormatTexelSize(VkFormat format) {
return vkuFormatTexelSizeWithAspect(format, VK_IMAGE_ASPECT_COLOR_BIT);
}
inline double vkuFormatTexelSizeWithAspect(VkFormat format, VkImageAspectFlagBits aspectMask) {
double texel_size = (double)(vkuFormatElementSizeWithAspect(format, aspectMask));
VkExtent3D block_extent = vkuFormatTexelBlockExtent(format);
uint32_t texels_per_block = block_extent.width * block_extent.height * block_extent.depth;
if (1 < texels_per_block) {
texel_size /= (double)(texels_per_block);
}
return texel_size;
}
''')
# Could loop the components, but faster to just list these
for bits in ['8', '16', '32', '64']: