• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2021 Qualcomm Technologies, Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_QCOM_image_processing.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10    2022-07-08
11*Interactions and External Dependencies*::
12  - This extension provides API support for
13    {GLSLregistry}/qcom/GLSL_QCOM_image_processing.txt[`GL_QCOM_image_processing`]
14
15*Contributors*::
16  - Jeff Leger, Qualcomm Technologies, Inc.
17  - Ruihao Zhang, Qualcomm Technologies, Inc.
18
19=== Description
20
21GPUs are commonly used to process images for various applications from 3D
22graphics to UI and from composition to compute applications.
23Simple scaling and filtering can be done with bilinear filtering, which
24comes for free during texture sampling.
25However, as screen sizes get larger and more use cases rely on GPU such as
26camera and video post-processing needs, there is increasing demand for GPU
27to support higher order filtering and other advanced image processing.
28
29This extension introduces a new set of SPIR-V built-in functions for image
30processing.
31It exposes the following new imaging operations
32
33  * The `OpImageSampleWeightedQCOM` instruction takes 3 operands: _sampled
34    image_, _weight image_, and texture coordinates.
35    The instruction computes a weighted average of an MxN region of texels
36  in the _sampled image_, using a set of MxN weights in the _weight image_.
37  * The `OpImageBoxFilterQCOM` instruction takes 3 operands: _sampled
38    image_, _box size_, and texture coordinates.
39    Note that _box size_ specifies a floating point width and height in
40    texels.
41    The instruction computes a weighted average of all texels in the
42    _sampled image_ that are covered (either partially or fully) by a box
43    with the specified size and centered at the specified texture
44    coordinates.
45  * The `OpImageBlockMatchSADQCOM` and `OpImageBlockMatchSSDQCOM`
46    instructions each takes 5 operands: _target image_, _target
47    coordinates_, _reference image_, _reference coordinates_, and _block
48    size_.
49    Each instruction computes an error metric, that describes whether a
50    block of texels in the _target image_ matches a corresponding block of
51    texels in the _reference image_.
52    The error metric is computed per-component.
53    `OpImageBlockMatchSADQCOM` computes "Sum Of Absolute Difference" and
54    `OpImageBlockMatchSSDQCOM` computes "Sum of Squared Difference".
55
56Each of the image processing instructions operate only on 2D images.
57The instructions do not-support sampling of mipmap, multi-plane,
58multi-layer, multi-sampled, or depth/stencil images.
59The instructions can be used in any shader stage.
60
61Implementations of this this extension should support these operations
62natively at the HW instruction level, offering potential performance gains
63as well as ease of development.
64
65include::{generated}/interfaces/VK_QCOM_image_processing.adoc[]
66
67=== Version History
68
69  * Revision 1, 2022-07-08 (Jeff Leger)
70