Name Strings

SPV_KHR_16bit_storage

Contact

See Issues list in the Khronos SPIRV-Headers repository: https://github.com/KhronosGroup/SPIRV-Headers

Contributors

  • Alexander Galazin, ARM

  • Jan-Harald Fredriksen, ARM

  • Joerg Wagner, ARM

  • Neil Henning, Codeplay

  • Jeff Bolz, Nvidia

  • David Neto, Google

  • John Kessenich, Google

Notice

Copyright (c) 2016-2017 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html

Status

  • Complete

  • Approved by the SPIR Working Group: 2017-01-11

  • Approved by the Khronos Board of Promoters: 2017-02-24

Version

Last Modified Date

2017-03-23

Revision

8

Dependencies

This extension is written against the SPIR-V Specification, Version 1.1 Revision 1.

This extension requires SPIR-V 1.0.

This extension interacts with SPV_KHR_storage_buffer_storage_class.

Overview

This extension adds new StorageUniformBufferBlock16, StorageUniform16 capabilities that allow to access 16-bit data in objects in Uniform storage class with BufferBlock and Block decorations.

If the SPV_KHR_storage_buffer_storage_class extension is supported, it also allows use of the StorageBuffer16BitAccess and the UniformAndStorageBuffer16BitAccess capabilities, providing the same functionality as the StorageUniformBufferBlock16 and the StorageUniform16 capabilities.

It also adds new StoragePushConstant16 capability that allows access to 16-bit data in objects in PushConstant storage class.

Finally, this extension adds new StorageInputOutput16 capability that allows to access to 16-bit data in objects in Input and Output storage classes.

To facilitate stores of 32-bit data to 16-bit storage this extensions enables use of the FP Rounding Mode decoration in graphics shaders.

Extension Name

To use this extension within a SPIR-V module, the following OpExtension must be present in the module:

OpExtension "SPV_KHR_16bit_storage"

New Capabilities

This extension introduces new capabilities:

StorageUniformBufferBlock16
StorageUniform16
StoragePushConstant16
StorageInputOutput16

If the SPV_KHR_storage_buffer_storage_class extension is supported, the following capabilities are also supported:

StorageBuffer16BitAccess
UniformAndStorageBuffer16BitAccess

New Builtins

None.

New Instructions

None.

Token Number Assignments

StorageUniformBufferBlock16

4433

StorageBuffer16BitAccess

4433

StorageUniform16

4434

UniformAndStorageBuffer16BitAccess

4434

StoragePushConstant16

4435

StorageInputOutput16

4436

Modifications to the SPIR-V Specification, Version 1.1

Modify Section 3.16, FP Rounding Mode, amend the Required Capability column to say:

Any of Kernel, StorageUniformBufferBlock16, StorageUniform16, StoragePushConstant16, StorageInputOutput16.

Modify Section 3.20, Decoration, amend the Required Capability column for the FPRoundingMode decoration to say:

Any of Kernel, StorageUniformBufferBlock16, StorageUniform16, StoragePushConstant16, StorageInputOutput16.

Modify Section 3.31, Capability, adding the following rows to the Capability table:
Capability Depends On

4433

StorageUniformBufferBlock16
Allows a 16-bit OpTypeFloat and OpTypeInt instruction for the sole purpose of creating an OpTypePointer to a 16-bit floating-point or 16-bit integer member of an object in Uniform Storage Class. The object must have BufferBlock decoration.

An object of a 16-bit type produced by dereferencing such a pointer may be the result of a width-only conversion instruction (OpFConvert, OpSConvert, or OpUConvert) from a 32-bit type or of an OpLoad, and may be used as an operand to a width-only conversion instruction to a 32-bit type or as the object argument of an OpStore.

Other uses of 16-bit types are not enabled by this capability.

4434

StorageUniform16
Allows a 16-bit OpTypeFloat and OpTypeInt instruction for the sole purpose of creating an OpTypePointer to a 16-bit floating-point or 16-bit integer member of an object in Uniform Storage Class. The object can have any supported decoration, including BufferBlock decoration.

An object of a 16-bit type produced by dereferencing such a pointer may be the result of a width-only conversion instruction from a 32-bit type or of an OpLoad, and may be used as an operand to a width-only conversion instruction to a 32-bit type or as the object argument of an OpStore.

Other uses of 16-bit types are not enabled by this capability.

StorageUniformBufferBlock16

4435

StoragePushConstant16
Allows a 16-bit OpTypeFloat and OpTypeInt instruction for the sole purpose of creating an OpTypePointer to a 16-bit floating-point or 16-bit integer object in PushConstant Storage Class.

An object of a 16-bit type produced by dereferencing such a pointer may only be the result of a width-only conversion instruction from a 32-bit type or of an OpLoad.

Other uses of 16-bit types are not enabled by this capability.

4436

StorageInputOutput16
Allows a 16-bit OpTypeFloat and OpTypeInt instruction for the sole purpose of creating an OpTypePointer to a 16-bit floating-point or 16-bit integer object in Input or Output Storage Classes.

An object of a 16-bit type produced by dereferencing such a pointer may only be the result of a width-only conversion instruction from a 32-bit type or of an OpLoad, and may only be used as an operand to a width-only conversion instruction to a 32-bit type or as the object argument of an OpStore.

Other uses of 16-bit types are not enabled by this capability.

Validation Rules

A FPRoundingMode decoration can be applied only to:

  • a width-only conversion instruction that is used as the object argument of an OpStore storing through a pointer to a 16-bit floating-point object in Uniform, or PushConstant, or Input, or Output Storage Classes.

Interactions with SPV_KHR_storage_buffer_storage_class

If SPV_KHR_uniform_buffer_storage_class is supported,
modify the description of the StorageUniformBufferBlock16 capability, adding the following sentence to the first paragraph of the description:

The object can also be in the StorageBuffer Storage Class and have any decorations supported for this Storage Class.

modify the description of the StorageUniform16 capability, adding the following sentence to the first paragraph of the description:

The object can also be in the StorageBuffer Storage Class and have any decorations supported for this Storage Class.

Modify Section 3.31, Capability, adding the following rows to the Capability table:
Capability Depends On

4433

StorageBuffer16BitAccess
Same as StorageUniformBufferBlock16

4434

UniformAndStorageBuffer16BitAccess
Same as StorageUniform16

StorageBuffer16BitAccess

Issues

Revision History

Rev Date Author Changes

1

2016-11-22

Alexander Galazin

Initial revision

2

2016-11-28

Alexander Galazin

Address first round of feedback

3

2016-12-01

Alexander Galazin

Removed combined Load/Store and Convert instructions. Renamed capabilities and described them in terms of storage classes.

4

2016-12-08

David Neto

Assigned token numbers

5

2016-12-14

Alexander Galazin

Renamed the extension. Removed changes to the default rounding modes. Made StorageUniform16 dependent on StorageUniformBufferBlock16

6

2017-02-22

JohnK

Clarified that conversions for changing width can only change the width, not the fundamental type domain.

7

2017-03-15

Alexander Galazin

Clarified that FP Rounding mode can be used only if the capabilities from this extension are enabled

8

2017-03-23

Alexander Galazin

Added interactions with SPV_KHR_uniform_buffer_storage_class