Name Strings

SPV_QCOM_image_processing2

Contact

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

Contributors

  • Jeff Leger, Qualcomm

  • Ruihao Zhang, Qualcomm

  • Wooyoung Kim, Qualcomm

Notice

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

Status

  • Final

Version

Last Modified Date

2023-11-12

Revision

1

Dependencies

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

This extension requires SPIR-V 1.4.

Overview

This extension introduces a new set of operations for image processing, along with a new capability and a new decoration.

Extension Name

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

OpExtension "SPV_QCOM_image_processing2"

New Capabilities

This extension introduces a new capability:

TextureBlockMatch2QCOM

New Decorations

The extension adds a new sampler decoration.

BlockMatchSamplerQCOM

New Instructions

Instructions added under the TextureBlockMatch2QCOM capability:

OpImageBlockMatchWindowSADQCOM
OpImageBlockMatchWindowSSDQCOM
OpImageBlockMatchGatherSADQCOM
OpImageBlockMatchGatherSSDQCOM

Modifications to the SPIR-V Specification, Version 1.6

Capabilities

Modify Section 3.31, "Capability", adding the following row to the Capability table:

Capability Implicitly declares

4498

TextureBlockMatch2QCOM
Add texture block match2 operations. This capability is required to use any of the OpImageBlockMatchWindow* or OpImageBlockMatchGather* instructions.

Decorations

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

Decoration Extra Operands Enabling Capabilities

4499

BlockMatchSamplerQCOM
Apply to samplers used to create Target Sampled Image and Reference Sampled Image in OpImageBlockMatchWindowSSDQCOM or OpImageBlockMatchWindowSADQCOM. Behavior is defined by the runtime environment.

TextureBlockMatch2QCOM

Instructions

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

OpImageBlockMatchWindowSSDQCOM

Windowed image block match operation with sum of square differences.

Result Type is the type of the result of windowed 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 and BlockMatchSamplerQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM and the sampler object which is used to construct the object must be decorated with BlockMatchSamplerQCOM. 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 and BlockMatchSamplerQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM and the sampler object which is used to construct the object must be decorated with BlockMatchSamplerQCOM. 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:
TextureBlockMatch2QCOM

8

4500

<id> Result Type

<id> Result

<id> Target Sampled Image

<id> Target Coordinate

<id> Reference Sampled Image

<id> Reference Coordinate

<id> Block Size

OpImageBlockMatchWindowSADQCOM

Windowed image block match operation with sum of absolute differences.

Result Type is the type of the result of windowed 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 and BlockMatchSamplerQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM and the sampler object which is used to construct the object must be decorated with BlockMatchSamplerQCOM. 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 and BlockMatchSamplerQCOM. Otherwise, a texture object which is used to construct the object must be decorated with BlockMatchTextureQCOM and the sampler object which is used to construct the object must be decorated with BlockMatchSamplerQCOM. 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:
TextureBlockMatch2QCOM

8

4501

<id> Result Type

<id> Result

<id> Target Sampled Image

<id> Target Coordinate

<id> Reference Sampled Image

<id> Reference Coordinate

<id> Block Size

OpImageBlockMatchGatherSSDQCOM

Gathered image block match operation with sum of square differences.

Result Type is the type of the result of gathered 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:
TextureBlockMatch2QCOM

8

4502

<id> Result Type

<id> Result

<id> Target Sampled Image

<id> Target Coordinate

<id> Reference Sampled Image

<id> Reference Coordinate

<id> Block Size

OpImageBlockMatchGatherSADQCOM

Gathered image block match operation with sum of absolute differences.

Result Type is the type of the result of gathered 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:
TextureBlockMatch2QCOM

8

4503

<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 BlockMatchSamplerQCOM 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_processing2"

Issues

Revision History

Rev Date Author Changes

1

2023-11-12

Wooyoung Kim

Initial version