[gl, vk, spv] Added component type handling for texture buffers and resolve pixel format variants

This commit is contained in:
CamilleLaVey 2025-11-30 17:41:38 -04:00 committed by lizzie
parent 69f6a0573c
commit 7786d69036
10 changed files with 372 additions and 5 deletions

View file

@ -6,6 +6,7 @@
#pragma once
#include <climits>
#include <optional>
#include <utility>
#include "common/assert.h"
#include "common/common_types.h"
@ -202,6 +203,17 @@ bool IsPixelFormatSRGB(PixelFormat format);
bool IsPixelFormatInteger(PixelFormat format);
bool IsPixelFormatSignedInteger(PixelFormat format);
size_t PixelComponentSizeBitsInteger(PixelFormat format);
enum class PixelFormatNumeric {
Float,
Uint,
Sint,
};
PixelFormatNumeric GetPixelFormatNumericType(PixelFormat format);
std::optional<PixelFormat> FindPixelFormatVariant(PixelFormat format,
PixelFormatNumeric target_numeric);
std::pair<u32, u32> GetASTCBlockSize(PixelFormat format);
u64 TranscodedAstcSize(u64 base_size, PixelFormat format);