Utilities for creating data format descriptors. More...
#include <assert.h>#include <stdlib.h>#include <string.h>#include <KHR/khr_df.h>#include "dfd.h"Functions | |
| uint32_t * | createDFDUnpacked (int bigEndian, int numChannels, int bytes, int redBlueSwap, enum VkSuffix suffix) |
| Create a Data Format Descriptor for an unpacked format. | |
| uint32_t * | createDFDPackedPadded (int bigEndian, int numChannels, int bits[], int paddings[], int channels[], enum VkSuffix suffix) |
| Create a Data Format Descriptor for a packed format. | |
| uint32_t * | createDFDPacked (int bigEndian, int numChannels, int bits[], int channels[], enum VkSuffix suffix) |
| Create a Data Format Descriptor for a packed format. | |
| uint32_t * | createDFDCompressed (enum VkCompScheme compScheme, int bwidth, int bheight, int bdepth, enum VkSuffix suffix) |
| Create a Data Format Descriptor for a compressed format. | |
| uint32_t * | createDFDDepthStencil (int depthBits, int stencilBits, int sizeBytes) |
| Create a Data Format Descriptor for a depth-stencil format. | |
| uint32_t * | createDFDAlpha (int bigEndian, int bytes, enum VkSuffix suffix) |
| Create a Data Format Descriptor for an alpha-only format. | |
Utilities for creating data format descriptors.
| uint32_t * createDFDAlpha | ( | int | bigEndian, |
| int | bytes, | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for an alpha-only format.
| bigEndian | Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| bytes | The number of bytes per channel. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDCompressed | ( | enum VkCompScheme | compScheme, |
| int | bwidth, | ||
| int | bheight, | ||
| int | bdepth, | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for a compressed format.
| compScheme | Vulkan-style compression scheme enumeration. |
| bwidth | Block width in texel coordinates. |
| bheight | Block height in texel coordinates. |
| bdepth | Block depth in texel coordinates. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDDepthStencil | ( | int | depthBits, |
| int | stencilBits, | ||
| int | sizeBytes | ||
| ) |
Create a Data Format Descriptor for a depth-stencil format.
| depthBits | The numeber of bits in the depth channel. |
| stencilBits | The numeber of bits in the stencil channel. |
| sizeBytes | The total byte size of the texel. |
| uint32_t * createDFDPacked | ( | int | bigEndian, |
| int | numChannels, | ||
| int | bits[], | ||
| int | channels[], | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for a packed format.
| bigEndian | Big-endian flag: Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| numChannels | The number of color channels. |
| bits[] | An array of length numChannels. Each entry is the number of bits composing the channel, in order starting at bit 0 of the packed type. |
| channels[] | An array of length numChannels. Each entry enumerates the channel type: 0 = red, 1 = green, 2 = blue, 15 = alpha, in order starting at bit 0 of the packed type. These values match channel IDs for RGBSDA in the Khronos Data Format header. To simplify iteration through channels, channel id 3 is a synonym for alpha. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDPackedPadded | ( | int | bigEndian, |
| int | numChannels, | ||
| int | bits[], | ||
| int | paddings[], | ||
| int | channels[], | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for a packed format.
| bigEndian | Big-endian flag: Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| numChannels | The number of color channels. |
| bits[] | An array of length numChannels. Each entry is the number of bits composing the channel, in order starting at bit 0 of the packed type. |
| paddings[] | An array of length numChannels. Each entry is the number of padding bits after each channel. |
| channels[] | An array of length numChannels. Each entry enumerates the channel type: 0 = red, 1 = green, 2 = blue, 15 = alpha, in order starting at bit 0 of the packed type. These values match channel IDs for RGBSDA in the Khronos Data Format header. To simplify iteration through channels, channel id 3 is a synonym for alpha. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDUnpacked | ( | int | bigEndian, |
| int | numChannels, | ||
| int | bytes, | ||
| int | redBlueSwap, | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for an unpacked format.
| bigEndian | Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| numChannels | The number of color channels. |
| bytes | The number of bytes per channel. |
| redBlueSwap | Normally channels appear in consecutive R, G, B, A order in memory; redBlueSwap inverts red and blue, allowing B, G, R, A. |
| suffix | Indicates the format suffix for the type. |