Name Strings

SPV_QCOM_image_processing

Contact

To report problems with this extension, please open a new issue at:

Contributors

  • Balaji Calidas, Qualcomm

  • Jeff Leger, Qualcomm

  • Ruihao Zhang, Qualcomm

  • Wooyoung Kim, Qualcomm

Notice

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

Status

  • Final

Version

Last Modified Date

2022-09-21

Revision

1

Dependencies

This extension is written against the SPIR-V Specification, Version 1.6 Revision 2.

This extension requires SPIR-V 1.4.

Overview

This extension introduces a new set of operations for image processing, along with new capabilities and two new decorations.

Extension Name

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

OpExtension "SPV_QCOM_image_processing"

New Capabilities

This extension introduces new capabilities:

TextureSampleWeightedQCOM
TextureBoxFilterQCOM
TextureBlockMatchQCOM

New Decorations

The extension adds two new decorations for texture types.

WeightTextureQCOM
BlockMatchTextureQCOM

New Instructions

Instruction added under the TextureSampleWeightedQCOM capability:

OpImageSampleWeightedQCOM

Instruction added under the TextureBoxFilterQCOM capability:

OpImageBoxFilterQCOM

Instructions added under the TextureBlockMatchQCOM capability:

OpImageBlockMatchSSDQCOM
OpImageBlockMatchSADQCOM

Modifications to the SPIR-V Specification, Version 1.6

Capabilities

Modify Section 3.31, "Capability", adding these rows to the Capability table:

Capability Implicitly declares

4484

TextureSampleWeightedQCOM
Add weighted sample operation.

4485

TextureBoxFilterQCOM
Add box filter operation.

4486

TextureBlockMatchQCOM
Add block matching operations (sum of absolute/square differences).

Decorations

Modify Section 3.20, "Decoration", adding the following rows to the Decoration table:

Decoration Extra Operands Enabling Capabilities

4487

WeightTextureQCOM
Apply to a texture used as Weight Image in OpImageSampleWeightedQCOM. Behavior is defined by the runtime environment.

TextureSampleWeightedQCOM

4488

BlockMatchTextureQCOM
Apply to textures used as Target Sampled Image and Reference Sampled Image in OpImageBlockMatchSSDQCOM/OpImageBlockMatchSADQCOM.
Behavior is defined by the runtime environment.

TextureBlockMatchQCOM

Instructions

Modify Section 3.42.10, "Image Instructions", adding before OpImageSampleFootprintNV:

OpImageSampleWeightedQCOM

Weighted sample operation

Result Type is the type of the result of weighted sample operation

Texture Sampled Image must be an object whose type is OpTypeSampledImage. The MS operand of the underlying OpTypeImage must be 0.

Coordinate must be a vector of floating-point type, whose vector size is 2.

Weight Image must be an object whose type is OpTypeSampledImage. If the object is an interface object, it must be decorated with WeightTextureQCOM. Otherwise, a texture object which is used to construct the object must be decorated with WeightTextureQCOM. The MS operand of the underlying OpTypeImage must be 0.

Capability:
TextureSampleWeightedQCOM

6

4480

<id> Result Type

<id> Result

<id> Texture Sampled Image

<id> Coordinate

<id> Weight Image

OpImageBoxFilterQCOM

Image box filter operation.

Result Type is the type of the result of image box filter operation

Texture Sampled Image must be an object whose type is OpTypeSampledImage. The MS operand of the underlying OpTypeImage must be 0.

Coordinate must be a vector of floating-point type, whose vector size is 2.
Box Size must be a vector of floating-point type, whose vector size is 2 and signedness is 0.

Capability:
TextureBoxFilterQCOM

6

4481

<id> Result Type

<id> Result

<id> Texture Sampled Image

<id> Coordinate

<id> Box Size

OpImageBlockMatchSSDQCOM

Image block match operation with sum of square differences.

Result Type is the type of the result of image block match sum of square differences

Target Sampled Image must be an object whose type is OpTypeSampledImage. If the object is an interface object, it must be decorated with BlockMatchTextureQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM. The MS operand of the underlying OpTypeImage must be 0.

Target Coordinate must be a vector of integer type, whose vector size is 2 and signedness is 0.

Reference Sampled Image must be an object whose type is OpTypeSampledImage. If the object is an interface object, it must be decorated with BlockMatchTextureQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM. The MS operand of the underlying OpTypeImage must be 0.

Reference Coordinate must be a vector of integer type, whose vector size is 2 and signedness is 0.

Block Size must be a vector of integer type, whose vector size is 2 and signedness is 0.

Capability:
TextureBlockMatchQCOM

8

4482

<id> Result Type

<id> Result

<id> Target Sampled Image

<id> Target Coordinate

<id> Reference Sampled Image

<id> Reference Coordinate

<id> Block Size

OpImageBlockMatchSADQCOM

Image block match operation with sum of absolute differences.

Result Type is the type of the result of image block match sum of absolute differences

Target Sampled Image must be an object whose type is OpTypeSampledImage. If the object is an interface object, it must be decorated with BlockMatchTextureQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM. The MS operand of the underlying OpTypeImage must be 0.

Target Coordinate must be a vector of integer type, whose vector size is 2 and signedness is 0.

Reference Sampled Image must be an object whose type is OpTypeSampledImage. If the object is an interface object, it must be decorated with BlockMatchTextureQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM. The MS operand of the underlying OpTypeImage must be 0.

Reference Coordinate must be a vector of integer type, whose vector size is 2 and signedness is 0.

Block Size must be a vector of integer type, whose vector size is 2 and signedness is 0.

Capability:
TextureBlockMatchQCOM

8

4483

<id> Result Type

<id> Result

<id> Target Sampled Image

<id> Target Coordinate

<id> Reference Sampled Image

<id> Reference Coordinate

<id> Block Size

Validation Rules

An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:

An object decorated with either WeightTextureQCOM or BlockMatchTextureQCOM must be used only with the corresponding built-in functions. Such an object must not be used with any other functions.

OpExtension "SPV_QCOM_image_processing"

Issues

Revision History

Rev Date Author Changes

0

2021-12-07

Ruihao Zhang

Initial version

1

2022-09-21

Wooyoung Kim

Replaced "should" with "must".
Changed the SPV version requirement from 1.0 to 1.4