vulkan-3.26.1: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Extensions.VK_QCOM_image_processing2

Description

Name

VK_QCOM_image_processing2 - device extension

VK_QCOM_image_processing2

Name String
VK_QCOM_image_processing2
Extension Type
Device extension
Registered Extension Number
519
Revision
1
Ratification Status
Not ratified
Extension and Version Dependencies
VK_QCOM_image_processing
Contact

Other Extension Metadata

Last Modified Date
2023-03-10
Interactions and External Dependencies
Contributors
  • Jeff Leger, Qualcomm Technologies, Inc.

Description

This extension enables support for the SPIR-V TextureBlockMatch2QCOM capability. It builds on the functionality of QCOM_image_processing with the addition of 4 new image processing operations.

  • The opImageBlockMatchWindowSADQCOM` SPIR-V instruction builds upon the functionality of opImageBlockMatchSADQCOM` by repeatedly performing block match operations across a 2D window. The “2D windowExtent” and “compareMode” are are specified by SamplerBlockMatchWindowCreateInfoQCOM in the sampler used to create the target image. Like OpImageBlockMatchSADQCOM, opImageBlockMatchWindowSADQCOM computes an error metric, that describes whether a block of texels in the target image matches a corresponding block of texels in the reference image. Unlike OpImageBlockMatchSADQCOM, this instruction computes an error metric at each (X,Y) location within the 2D window and returns either the minimum or maximum error. The instruction only supports single-component formats. Refer to the pseudocode below for details.
  • The opImageBlockMatchWindowSSDQCOM follows the same pattern, computing the SSD error metric at each location within the 2D window.
  • The opImageBlockMatchGatherSADQCOM builds upon OpImageBlockMatchSADQCOM. This instruction computes an error metric, that describes whether a block of texels in the /target image matches a corresponding block of texels in the reference image/. The instruction computes the SAD error metric at 4 texel offsets and returns the error metric for each offset in the X,Y,Z,and W components. The instruction only supports single-component texture formats. Refer to the pseudocode below for details.
  • The opImageBlockMatchGatherSSDQCOM follows the same pattern, computing the SSD error metric for 4 offsets.

Each of the above 4 image processing instructions are limited to single-component formats.

Below is the pseudocode for GLSL built-in function textureWindowBlockMatchSADQCOM. The pseudocode for textureWindowBlockMatchSSD is identical other than replacing all instances of "SAD" with "SSD".

vec4 textureBlockMatchWindowSAD( sampler2D target,
                                 uvec2 targetCoord,
                                 samler2D reference,
                                 uvec2 refCoord,
                                 uvec2 blocksize) {
    // compareMode (MIN or MAX) comes from the vkSampler associated with `target`
    // uvec2 window  comes from the vkSampler associated with `target`
    minSAD = INF;
    maxSAD = -INF;
    uvec2 minCoord;
    uvec2 maxCoord;

    for (uint x=0, x < window.width; x++) {
        for (uint y=0; y < window.height; y++) {
            float SAD = textureBlockMatchSAD(target,
                                            targetCoord + uvec2(x, y),
                                            reference,
                                            refCoord,
                                            blocksize).x;
            // Note: the below comparison operator will produce undefined results
            // if SAD is a denorm value.
            if (SAD < minSAD) {
                minSAD = SAD;
                minCoord = uvec2(x,y);
            }
            if (SAD > maxSAD) {
                maxSAD = SAD;
                maxCoord = uvec2(x,y);
            }
        }
    }
    if (compareMode=MIN) {
        return vec4(minSAD, minCoord.x, minCoord.y, 0.0);
    } else {
        return vec4(maxSAD, maxCoord.x, maxCoord.y, 0.0);
    }
}

Below is the pseudocode for textureBlockMatchGatherSADQCOM. The pseudocode for textureBlockMatchGatherSSD follows an identical pattern.

vec4 textureBlockMatchGatherSAD( sampler2D target,
                                 uvec2 targetCoord,
                                 samler2D reference,
                                 uvec2 refCoord,
                                 uvec2 blocksize) {
    vec4 out;
    for (uint x=0, x<4; x++) {
            float SAD = textureBlockMatchSAD(target,
                                            targetCoord + uvec2(x, 0),
                                            reference,
                                            refCoord,
                                            blocksize).x;
            out[x] = SAD;
    }
    return out;
}

New Structures

New Enums

New Enum Constants

Issues

1) What is the precision of the min/max comparison checks?

RESOLVED: Intermediate computations for the new operations are performed at 16-bit floating point precision. If the value of "float SAD" in the above code sample is a 16-bit denorm value, then behavior of the MIN/MAX comparison is undefined.

Version History

  • Revision 1, 2023-03-10 (Jeff Leger)

See Also

BlockMatchWindowCompareModeQCOM, PhysicalDeviceImageProcessing2FeaturesQCOM, PhysicalDeviceImageProcessing2PropertiesQCOM, SamplerBlockMatchWindowCreateInfoQCOM

Document Notes

For more information, see the Vulkan Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

data PhysicalDeviceImageProcessing2FeaturesQCOM Source #

VkPhysicalDeviceImageProcessing2FeaturesQCOM - Structure describing image processing features that can be supported by an implementation

Members

This structure describes the following features:

Description

If the PhysicalDeviceImageProcessing2FeaturesQCOM structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. PhysicalDeviceImageProcessing2FeaturesQCOM can also be used in the pNext chain of DeviceCreateInfo to selectively enable these features.

Valid Usage (Implicit)

See Also

VK_QCOM_image_processing2, Bool32, StructureType

Constructors

PhysicalDeviceImageProcessing2FeaturesQCOM 

Fields

  • textureBlockMatch2 :: Bool

    textureBlockMatch2 indicates that the implementation supports shader modules that declare the TextureBlockMatch2QCOM capability.

Instances

Instances details
Storable PhysicalDeviceImageProcessing2FeaturesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Show PhysicalDeviceImageProcessing2FeaturesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Eq PhysicalDeviceImageProcessing2FeaturesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

FromCStruct PhysicalDeviceImageProcessing2FeaturesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

ToCStruct PhysicalDeviceImageProcessing2FeaturesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Zero PhysicalDeviceImageProcessing2FeaturesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

data PhysicalDeviceImageProcessing2PropertiesQCOM Source #

VkPhysicalDeviceImageProcessing2PropertiesQCOM - Structure containing image processing2 properties

Description

If the PhysicalDeviceImageProcessing2PropertiesQCOM structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

These are properties of the image processing2 information of a physical device.

Valid Usage (Implicit)

See Also

VK_QCOM_image_processing2, Extent2D, StructureType

Constructors

PhysicalDeviceImageProcessing2PropertiesQCOM 

Fields

Instances

Instances details
Storable PhysicalDeviceImageProcessing2PropertiesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Show PhysicalDeviceImageProcessing2PropertiesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

FromCStruct PhysicalDeviceImageProcessing2PropertiesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

ToCStruct PhysicalDeviceImageProcessing2PropertiesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Zero PhysicalDeviceImageProcessing2PropertiesQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

data SamplerBlockMatchWindowCreateInfoQCOM Source #

VkSamplerBlockMatchWindowCreateInfoQCOM - Structure specifying the block match window parameters

Valid Usage (Implicit)

See Also

VK_QCOM_image_processing2, BlockMatchWindowCompareModeQCOM, Extent2D, StructureType

Constructors

SamplerBlockMatchWindowCreateInfoQCOM 

Fields

Instances

Instances details
Storable SamplerBlockMatchWindowCreateInfoQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Show SamplerBlockMatchWindowCreateInfoQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

FromCStruct SamplerBlockMatchWindowCreateInfoQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

ToCStruct SamplerBlockMatchWindowCreateInfoQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Zero SamplerBlockMatchWindowCreateInfoQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

newtype BlockMatchWindowCompareModeQCOM Source #

VkBlockMatchWindowCompareModeQCOM - Block match window compare modes

See Also

VK_QCOM_image_processing2, SamplerBlockMatchWindowCreateInfoQCOM

Bundled Patterns

pattern BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM :: BlockMatchWindowCompareModeQCOM

BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM specifies that windowed block match operations return the minimum error within the window.

pattern BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM :: BlockMatchWindowCompareModeQCOM

BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM specifies that windowed block match operations return the maximum error within the window.

Instances

Instances details
Storable BlockMatchWindowCompareModeQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Read BlockMatchWindowCompareModeQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Show BlockMatchWindowCompareModeQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Eq BlockMatchWindowCompareModeQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Ord BlockMatchWindowCompareModeQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

Zero BlockMatchWindowCompareModeQCOM Source # 
Instance details

Defined in Vulkan.Extensions.VK_QCOM_image_processing2

type QCOM_IMAGE_PROCESSING_2_EXTENSION_NAME = "VK_QCOM_image_processing2" Source #

pattern QCOM_IMAGE_PROCESSING_2_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #