首页 > 其他分享 >vulkan/数据格式说明- normalized

vulkan/数据格式说明- normalized

时间:2024-01-18 19:55:06浏览次数:30  
标签:FORMAT VK PACK32 normalized components 数据格式 UNORM vulkan A8B8G8R8

  • VK_FORMAT_A8B8G8R8_UNORM_PACK32

  • VK_FORMAT_A8B8G8R8_SNORM_PACK32

  • VK_FORMAT_A8B8G8R8_USCALED_PACK32

  • VK_FORMAT_A8B8G8R8_SSCALED_PACK32

  • VK_FORMAT_A8B8G8R8_UINT_PACK32

 

引用规范中的 Identification of Formats 和 Conversion from Normalized Fixed-Point to Floating-Point

  • UNORM 是 float 范围内的 [0, 1] 。
  • SNORM 相同,但在 [-1, 1]
的范围内
  • USCALED 是转换为 float
的无符号整数值
  • SSCALED 是转换为 float
的整数值
  • UINT是一个无符号整数
  • SINT 是有符号整数

对于 VK_FORMAT_R8_* :
  • 用于 UNORM 原始 0 将给出 0.0f ,原始 255 将给出 1.0f
  • 用于 SNORM 原始 -127 (resp. 129 ) 将给出 -1.0f ,原始 127 将给出 1.0f
  • USCALED 原始 0 将给出 0.0f ,原始 255 将给出 255.0f
  • SSCALED raw -128 (resp. 128 ) 会给出 -128.0f , raw 127 会给出 127.0f
  -128 (-2n-1) 在 SNORM 中没有意义,只是简单地钳制到 -1.0f 。  

33.1.3. Packed Formats

For the purposes of address alignment when accessing buffer memory containing vertex attribute or texel data, the following formats are considered packed - components of the texels or attributes are stored in bitfields packed into one or more 8-, 16-, or 32-bit fundamental data type.

  • Packed into 8-bit data types:

    • VK_FORMAT_R4G4_UNORM_PACK8

  • Packed into 16-bit data types:

    • VK_FORMAT_R4G4B4A4_UNORM_PACK16

    • VK_FORMAT_B4G4R4A4_UNORM_PACK16

    • VK_FORMAT_R5G6B5_UNORM_PACK16

    • VK_FORMAT_B5G6R5_UNORM_PACK16

    • VK_FORMAT_R5G5B5A1_UNORM_PACK16

    • VK_FORMAT_B5G5R5A1_UNORM_PACK16

    • VK_FORMAT_A1R5G5B5_UNORM_PACK16

    • VK_FORMAT_R10X6_UNORM_PACK16

    • VK_FORMAT_R10X6G10X6_UNORM_2PACK16

    • VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16

    • VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16

    • VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16

    • VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16

    • VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16

    • VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16

    • VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16

    • VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16

    • VK_FORMAT_R12X4_UNORM_PACK16

    • VK_FORMAT_R12X4G12X4_UNORM_2PACK16

    • VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16

    • VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16

    • VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16

    • VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16

    • VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16

    • VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16

    • VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16

    • VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16

  • Packed into 32-bit data types:

    • VK_FORMAT_A8B8G8R8_UNORM_PACK32

    • VK_FORMAT_A8B8G8R8_SNORM_PACK32

    • VK_FORMAT_A8B8G8R8_USCALED_PACK32

    • VK_FORMAT_A8B8G8R8_SSCALED_PACK32

    • VK_FORMAT_A8B8G8R8_UINT_PACK32

    • VK_FORMAT_A8B8G8R8_SINT_PACK32

    • VK_FORMAT_A8B8G8R8_SRGB_PACK32

    • VK_FORMAT_A2R10G10B10_UNORM_PACK32

    • VK_FORMAT_A2R10G10B10_SNORM_PACK32

    • VK_FORMAT_A2R10G10B10_USCALED_PACK32

    • VK_FORMAT_A2R10G10B10_SSCALED_PACK32

    • VK_FORMAT_A2R10G10B10_UINT_PACK32

    • VK_FORMAT_A2R10G10B10_SINT_PACK32

    • VK_FORMAT_A2B10G10R10_UNORM_PACK32

    • VK_FORMAT_A2B10G10R10_SNORM_PACK32

    • VK_FORMAT_A2B10G10R10_USCALED_PACK32

    • VK_FORMAT_A2B10G10R10_SSCALED_PACK32

    • VK_FORMAT_A2B10G10R10_UINT_PACK32

    • VK_FORMAT_A2B10G10R10_SINT_PACK32

    • VK_FORMAT_B10G11R11_UFLOAT_PACK32

    • VK_FORMAT_E5B9G9R9_UFLOAT_PACK32

    • VK_FORMAT_X8_D24_UNORM_PACK32

33.1.4. Identification of Formats

A “format” is represented by a single enum value. The name of a format is usually built up by using the following pattern:

    VK_FORMAT_{component-format|compression-scheme}_{numeric-format}

The component-format indicates either the size of the R, G, B, and A components (if they are present) in the case of a color format, or the size of the depth (D) and stencil (S) components (if they are present) in the case of a depth/stencil format (see below). An X indicates a component that is unused, but may be present for padding.

 
Table 34. Interpretation of Numeric Format
Numeric formatType-Declaration instructionsNumeric typeDescription

UNORM

OpTypeFloat

floating-point

The components are unsigned normalized values in the range [0,1]

SNORM

OpTypeFloat

floating-point

The components are signed normalized values in the range [-1,1]

USCALED

OpTypeFloat

floating-point

The components are unsigned integer values that get converted to floating-point in the range [0,2n-1]

SSCALED

OpTypeFloat

floating-point

The components are signed integer values that get converted to floating-point in the range [-2n-1,2n-1-1]

UINT

OpTypeInt

unsigned integer

The components are unsigned integer values in the range [0,2n-1]

SINT

OpTypeInt

signed integer

The components are signed integer values in the range [-2n-1,2n-1-1]

UFLOAT

OpTypeFloat

floating-point

The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)

SFLOAT

OpTypeFloat

floating-point

The components are signed floating-point numbers

SRGB

OpTypeFloat

floating-point

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

n is the number of bits in the component.

The suffix _PACKnn indicates that the format is packed into an underlying type with nn bits. The suffix _mPACKnn is a short-hand that indicates that the format has m groups of components (which may or may not be stored in separate planes) that are each packed into an underlying type with nn bits.

The suffix _BLOCK indicates that the format is a block-compressed format, with the representation of multiple pixels encoded interdependently within a region.

Table 35. Interpretation of Compression Scheme
Compression schemeDescription

BC

Block Compression. See Block-Compressed Image Formats.

ETC2

Ericsson Texture Compression. See ETC Compressed Image Formats.

EAC

ETC2 Alpha Compression. See ETC Compressed Image Formats.

ASTC

Adaptive Scalable Texture Compression (LDR Profile). See ASTC Compressed Image Formats.


 

 

 

标签:FORMAT,VK,PACK32,normalized,components,数据格式,UNORM,vulkan,A8B8G8R8
From: https://www.cnblogs.com/FastEarth/p/17973273

相关文章

  • vulkan/图元重启(Primitive restart)
    在Vulkan/OpenGL绘制图形时,可能需要绘制多个并不相连的图形。这样的情况下这几个图形没法被当做一个图形来处理。也就需要多次调用 DrawArrays 或 DrawElements.如果图形很多,可能会需要用一个循环来调用:for(inti=0;i<num_objects;i++){glDrawArrays(GL_TRIA......
  • 图像数据格式转换
    TESTHALCON.h#pragmaonce#include<QtWidgets/QWidget>#include<QImage>#include<QObject>#include"..\TEST-HALCON\halcon12\x64\include\halconcpp\HalconCpp.h"usingnamespaceHalconCpp;/****************************......
  • vulkan/descriptorSet
    参考Shaderlayout(binding=0)uniformUniformBufferObject{mat4model;mat4view;mat4proj;}ubo;layout(location=0)invec2inPosition;layout(location=1)invec3inColor;layout(location=2)invec2inTexCoord;layout(location=0)......
  • 第七章 文件与数据格式化
    strip()方法删除多余空格:用户输入数据时,很有可能会无意中输入多余的空格,或者在一些场景中,字符串前后不允许出现空格和特殊字符,此时就需要去除字符串中的空格和特殊字符。这里的特殊字符,指的是制表符(\t)、回车符(\r)、换行符(\n)等。python中,字符串变量提供了3种方法来删除字符串......
  • Chrome 浏览器开启 Json 数据格式化显示
    Chrome浏览器开启Json数据格式化显示默认格式安装扩展程序JSONView......
  • Vulkan/VkPresentModeKHR
    呈现模式:对于交换链对显示模式的设置应该是最重要的,因为它代表实际显示图像到屏幕的时机。在Vulkan中有四种显示模式:1.VK_PRESENT_MODE_IMMEDIATE_KHR由应用提交的图像立刻被传输到屏幕。这种方式可能导致图像不完整。2.VK_PRESENT_MODE_FIFO_KHR交换链是一个队列,当......
  • Vulkan/Graphics Pipelines
    渲染是vulkan最基础的功能,也是众多图形化应用最核心的部分。vulkan的渲染过程可以当作是通过执行不同阶段的命令以此来在展示设备上渲染出图片的过程。 vulkan中,渲染管线可以看作是一条生产流水线,命令在管线的开头进入,并且在管线内不同阶段执行。每个阶段都有诸如变换,读取命令......
  • Vulkan/Renderpasses
    能将渲染管线和运算管线区别开了的要素之一是——通用,在你使用一个渲染管线渲染图像之后也可能进行其他处理或展示给yoghurt。在复杂的图形应用中,图像需要经过许多通道才能生成,每个通道都负责不同的部分,比如全屏幕的后处理或合成,或渲染UI元素等。这些通道可以由vulkan的一个渲染......
  • Vulkan/FrameBuffer
    帧缓冲(Framebuffer)代表由渲染管线进行渲染的一组图像。它们影响管线的最后几个阶段:深度模板测试,颜色混合,逻辑运算,多重采样等等。一个帧缓冲对象总是附着在一个渲染通道上并且可以用在多个具有相似模板编排的渲染通道中。调用vkCreateFramebuffer创建帧缓冲对象。在VkFramebuffer......
  • Visual Studio 2022:Vulkan 环境配置
    (前置)安装VulkanSDK,并确认安装目录,此后记为%VulkanDir%(例如:C:/VulkanSDK/1.3.261.1)VisualStudio中新建C++项目,进入“项目”>>“[项目名]属性”,上方两个选项设置为“所有配置”“所有平台”C/C++>>常规>>附加包含目录:添加%VulkanDir%/Include(替换%VulkanDir%为实际目录,下同)......