| // Copyright 2015-2023 The Khronos Group Inc. |
| // |
| // SPDX-License-Identifier: CC-BY-4.0 |
| |
| [[formats]] |
| = Formats |
| |
| <<< |
| |
| [[formats-numericformat]] |
| .Interpretation of Numeric Format |
| [width="95%",cols="2,3,10",options="header"] |
| |==== |
| | Numeric format | SPIR-V _Sampled Type_ | Description |
| | etext:UNORM | OpTypeFloat | The components are unsigned normalized values in the range [eq]#[0,1]# |
| | etext:SNORM | OpTypeFloat | The components are signed normalized values in the range [eq]#[-1,1]# |
| | etext:USCALED | OpTypeFloat | The components are unsigned integer values that get converted to floating-point in the range [0,2^n^-1] |
| | etext:SSCALED | OpTypeFloat | The components are signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1] |
| | etext:UINT | OpTypeInt | The components are unsigned integer values in the range [0,2^n^-1] |
| | etext:SINT | OpTypeInt | The components are signed integer values in the range [-2^n-1^,2^n-1^-1] |
| | etext:UFLOAT | OpTypeFloat | The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats) |
| | etext:SFLOAT | OpTypeFloat | The components are signed floating-point numbers |
| | etext:SRGB | OpTypeFloat | The R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value |
| 3+| [eq]#n# is the number of bits in the component. |
| |==== |
| |
| The suffix etext:_PACKnn indicates that the format is packed into an |
| underlying type with etext:nn bits. |
| ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] |
| The suffix etext:_mPACKnn is a short-hand that indicates that the format has |
| etext:m groups of components (which may or may not be stored in separate |
| _planes_) that are each packed into an underlying type with etext:nn bits. |
| endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] |