summaryrefslogtreecommitdiff
path: root/appendices/VK_QCOM_filter_cubic_clamp.adoc
blob: c2dad2716c1964e25b256beb95901d73ccd4d05e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2023 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}VK_QCOM_filter_cubic_clamp.adoc[]

=== Other Extension Metadata

*Last Modified Date*::
    2023-08-02
*Contributors*::
  - Jeff Leger, Qualcomm Technologies, Inc.

=== Description

This extension extends cubic filtering by adding the ability to enable an
anti-ringing clamp.
Cubic filtering samples from a 4x4 region of texels and computes a cubic
weighted average of the region.
In some cases, the resulting value is outside the range of any of the texels
in the 4x4 region.
This is sometimes referred to as "`filter overshoot`" or "`filter ringing`"
and can occur when there is a sharp discontinuity in the 4x4 region being
filtered.
For some use cases this "`ringing`" can produces unacceptable artifacts.

The solution to the ringing problem is to clamp the post-cubic-filtered
value to be within the max and min of texel values in the 4x4 region.
While such "`range clamping`" can be performed in shader code, the
additional texture fetches and clamping ALU operations can be costly.

Certain Adreno GPUs are able to perform the range clamp in the texture unit
during cubic filtering at significant performance/power savings versus a
shader-based clamping approach.
This extension exposes such hardware functionality.

This extension extends elink:VkSamplerReductionMode, adding
ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM which
enables the range clamp operation.

include::{generated}/interfaces/VK_QCOM_filter_cubic_clamp.adoc[]

=== Version History

  * Revision 1, 2023-08-02 (jleger)
  ** Initial version