extension: GL_QCOM_image_processing support

This commit is contained in:
Wooyoung Kim 2023-08-21 17:14:52 -07:00 committed by GitHub
parent 4e7ccd4af5
commit db8719ae07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 939 additions and 5 deletions

View file

@ -0,0 +1,123 @@
spv.tpipBlockMatchSAD.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 72
Capability Shader
Capability TextureBlockMatchQCOM
Extension "SPV_QCOM_image_processing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 13 41
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_QCOM_image_processing"
Name 4 "main"
Name 9 "tgt_coords"
Name 13 "v_texcoord"
Name 26 "ref_coords"
Name 37 "blockSize"
Name 41 "fragColor"
Name 44 "tex2D_src1"
Name 48 "samp"
Name 53 "tex2D_src2"
Name 61 "target_samp"
Name 64 "ref_samp"
Name 71 "tex2DArray_weights"
Decorate 13(v_texcoord) Location 0
Decorate 41(fragColor) Location 0
Decorate 44(tex2D_src1) DescriptorSet 0
Decorate 44(tex2D_src1) Binding 1
Decorate 48(samp) DescriptorSet 0
Decorate 48(samp) Binding 3
Decorate 53(tex2D_src2) DescriptorSet 0
Decorate 53(tex2D_src2) Binding 2
Decorate 44(tex2D_src1) DecorationBlockMatchTextureQCOM
Decorate 53(tex2D_src2) DecorationBlockMatchTextureQCOM
Decorate 61(target_samp) DescriptorSet 0
Decorate 61(target_samp) Binding 4
Decorate 64(ref_samp) DescriptorSet 0
Decorate 64(ref_samp) Binding 5
Decorate 61(target_samp) DecorationBlockMatchTextureQCOM
Decorate 64(ref_samp) DecorationBlockMatchTextureQCOM
Decorate 71(tex2DArray_weights) DescriptorSet 0
Decorate 71(tex2DArray_weights) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypeFloat 32
11: TypeVector 10(float) 4
12: TypePointer Input 11(fvec4)
13(v_texcoord): 12(ptr) Variable Input
14: 6(int) Constant 0
15: TypePointer Input 10(float)
19: TypePointer Function 6(int)
21: 6(int) Constant 1
27: 6(int) Constant 2
32: 6(int) Constant 3
38: 6(int) Constant 4
39: 7(ivec2) ConstantComposite 38 38
40: TypePointer Output 11(fvec4)
41(fragColor): 40(ptr) Variable Output
42: TypeImage 10(float) 2D sampled format:Unknown
43: TypePointer UniformConstant 42
44(tex2D_src1): 43(ptr) Variable UniformConstant
46: TypeSampler
47: TypePointer UniformConstant 46
48(samp): 47(ptr) Variable UniformConstant
50: TypeSampledImage 42
53(tex2D_src2): 43(ptr) Variable UniformConstant
60: TypePointer UniformConstant 50
61(target_samp): 60(ptr) Variable UniformConstant
64(ref_samp): 60(ptr) Variable UniformConstant
69: TypeImage 10(float) 2D array sampled format:Unknown
70: TypePointer UniformConstant 69
71(tex2DArray_weights): 70(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(tgt_coords): 8(ptr) Variable Function
26(ref_coords): 8(ptr) Variable Function
37(blockSize): 8(ptr) Variable Function
16: 15(ptr) AccessChain 13(v_texcoord) 14
17: 10(float) Load 16
18: 6(int) ConvertFToU 17
20: 19(ptr) AccessChain 9(tgt_coords) 14
Store 20 18
22: 15(ptr) AccessChain 13(v_texcoord) 21
23: 10(float) Load 22
24: 6(int) ConvertFToU 23
25: 19(ptr) AccessChain 9(tgt_coords) 14
Store 25 24
28: 15(ptr) AccessChain 13(v_texcoord) 27
29: 10(float) Load 28
30: 6(int) ConvertFToU 29
31: 19(ptr) AccessChain 26(ref_coords) 14
Store 31 30
33: 15(ptr) AccessChain 13(v_texcoord) 32
34: 10(float) Load 33
35: 6(int) ConvertFToU 34
36: 19(ptr) AccessChain 26(ref_coords) 21
Store 36 35
Store 37(blockSize) 39
45: 42 Load 44(tex2D_src1)
49: 46 Load 48(samp)
51: 50 SampledImage 45 49
52: 7(ivec2) Load 9(tgt_coords)
54: 42 Load 53(tex2D_src2)
55: 46 Load 48(samp)
56: 50 SampledImage 54 55
57: 7(ivec2) Load 26(ref_coords)
58: 7(ivec2) Load 37(blockSize)
59: 11(fvec4) ImageBlockMatchSADQCOM 51 52 56 57 58
Store 41(fragColor) 59
62: 50 Load 61(target_samp)
63: 7(ivec2) Load 9(tgt_coords)
65: 50 Load 64(ref_samp)
66: 7(ivec2) Load 26(ref_coords)
67: 7(ivec2) Load 37(blockSize)
68: 11(fvec4) ImageBlockMatchSADQCOM 62 63 65 66 67
Store 41(fragColor) 68
Return
FunctionEnd

View file

@ -0,0 +1,123 @@
spv.tpipBlockMatchSSD.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 72
Capability Shader
Capability TextureBlockMatchQCOM
Extension "SPV_QCOM_image_processing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 13 41
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_QCOM_image_processing"
Name 4 "main"
Name 9 "tgt_coords"
Name 13 "v_texcoord"
Name 26 "ref_coords"
Name 37 "blockSize"
Name 41 "fragColor"
Name 44 "tex2D_src1"
Name 48 "samp"
Name 53 "tex2D_src2"
Name 61 "target_samp"
Name 64 "ref_samp"
Name 71 "tex2DArray_weights"
Decorate 13(v_texcoord) Location 0
Decorate 41(fragColor) Location 0
Decorate 44(tex2D_src1) DescriptorSet 0
Decorate 44(tex2D_src1) Binding 1
Decorate 48(samp) DescriptorSet 0
Decorate 48(samp) Binding 3
Decorate 53(tex2D_src2) DescriptorSet 0
Decorate 53(tex2D_src2) Binding 2
Decorate 44(tex2D_src1) DecorationBlockMatchTextureQCOM
Decorate 53(tex2D_src2) DecorationBlockMatchTextureQCOM
Decorate 61(target_samp) DescriptorSet 0
Decorate 61(target_samp) Binding 4
Decorate 64(ref_samp) DescriptorSet 0
Decorate 64(ref_samp) Binding 5
Decorate 61(target_samp) DecorationBlockMatchTextureQCOM
Decorate 64(ref_samp) DecorationBlockMatchTextureQCOM
Decorate 71(tex2DArray_weights) DescriptorSet 0
Decorate 71(tex2DArray_weights) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypeFloat 32
11: TypeVector 10(float) 4
12: TypePointer Input 11(fvec4)
13(v_texcoord): 12(ptr) Variable Input
14: 6(int) Constant 0
15: TypePointer Input 10(float)
19: TypePointer Function 6(int)
21: 6(int) Constant 1
27: 6(int) Constant 2
32: 6(int) Constant 3
38: 6(int) Constant 4
39: 7(ivec2) ConstantComposite 38 38
40: TypePointer Output 11(fvec4)
41(fragColor): 40(ptr) Variable Output
42: TypeImage 10(float) 2D sampled format:Unknown
43: TypePointer UniformConstant 42
44(tex2D_src1): 43(ptr) Variable UniformConstant
46: TypeSampler
47: TypePointer UniformConstant 46
48(samp): 47(ptr) Variable UniformConstant
50: TypeSampledImage 42
53(tex2D_src2): 43(ptr) Variable UniformConstant
60: TypePointer UniformConstant 50
61(target_samp): 60(ptr) Variable UniformConstant
64(ref_samp): 60(ptr) Variable UniformConstant
69: TypeImage 10(float) 2D array sampled format:Unknown
70: TypePointer UniformConstant 69
71(tex2DArray_weights): 70(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(tgt_coords): 8(ptr) Variable Function
26(ref_coords): 8(ptr) Variable Function
37(blockSize): 8(ptr) Variable Function
16: 15(ptr) AccessChain 13(v_texcoord) 14
17: 10(float) Load 16
18: 6(int) ConvertFToU 17
20: 19(ptr) AccessChain 9(tgt_coords) 14
Store 20 18
22: 15(ptr) AccessChain 13(v_texcoord) 21
23: 10(float) Load 22
24: 6(int) ConvertFToU 23
25: 19(ptr) AccessChain 9(tgt_coords) 14
Store 25 24
28: 15(ptr) AccessChain 13(v_texcoord) 27
29: 10(float) Load 28
30: 6(int) ConvertFToU 29
31: 19(ptr) AccessChain 26(ref_coords) 14
Store 31 30
33: 15(ptr) AccessChain 13(v_texcoord) 32
34: 10(float) Load 33
35: 6(int) ConvertFToU 34
36: 19(ptr) AccessChain 26(ref_coords) 21
Store 36 35
Store 37(blockSize) 39
45: 42 Load 44(tex2D_src1)
49: 46 Load 48(samp)
51: 50 SampledImage 45 49
52: 7(ivec2) Load 9(tgt_coords)
54: 42 Load 53(tex2D_src2)
55: 46 Load 48(samp)
56: 50 SampledImage 54 55
57: 7(ivec2) Load 26(ref_coords)
58: 7(ivec2) Load 37(blockSize)
59: 11(fvec4) ImageBlockMatchSSDQCOM 51 52 56 57 58
Store 41(fragColor) 59
62: 50 Load 61(target_samp)
63: 7(ivec2) Load 9(tgt_coords)
65: 50 Load 64(ref_samp)
66: 7(ivec2) Load 26(ref_coords)
67: 7(ivec2) Load 37(blockSize)
68: 11(fvec4) ImageBlockMatchSSDQCOM 62 63 65 66 67
Store 41(fragColor) 68
Return
FunctionEnd

View file

@ -0,0 +1,81 @@
spv.tpipBoxFilter.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 43
Capability Shader
Capability TextureBoxFilterQCOM
Extension "SPV_QCOM_image_processing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 15 27
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_QCOM_image_processing"
Name 4 "main"
Name 9 "boxSize"
Name 15 "fragColor"
Name 18 "tex2D_src1"
Name 22 "samp"
Name 27 "v_texcoord"
Name 33 "tex_samp"
Name 41 "tex2DArray_weights"
Name 42 "tex2D_src2"
Decorate 15(fragColor) Location 0
Decorate 18(tex2D_src1) DescriptorSet 0
Decorate 18(tex2D_src1) Binding 1
Decorate 22(samp) DescriptorSet 0
Decorate 22(samp) Binding 3
Decorate 27(v_texcoord) Location 0
Decorate 33(tex_samp) DescriptorSet 0
Decorate 33(tex_samp) Binding 4
Decorate 41(tex2DArray_weights) DescriptorSet 0
Decorate 41(tex2DArray_weights) Binding 0
Decorate 42(tex2D_src2) DescriptorSet 0
Decorate 42(tex2D_src2) Binding 2
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 2
8: TypePointer Function 7(fvec2)
10: 6(float) Constant 1075838976
11: 6(float) Constant 1083179008
12: 7(fvec2) ConstantComposite 10 11
13: TypeVector 6(float) 4
14: TypePointer Output 13(fvec4)
15(fragColor): 14(ptr) Variable Output
16: TypeImage 6(float) 2D sampled format:Unknown
17: TypePointer UniformConstant 16
18(tex2D_src1): 17(ptr) Variable UniformConstant
20: TypeSampler
21: TypePointer UniformConstant 20
22(samp): 21(ptr) Variable UniformConstant
24: TypeSampledImage 16
26: TypePointer Input 13(fvec4)
27(v_texcoord): 26(ptr) Variable Input
32: TypePointer UniformConstant 24
33(tex_samp): 32(ptr) Variable UniformConstant
39: TypeImage 6(float) 2D array sampled format:Unknown
40: TypePointer UniformConstant 39
41(tex2DArray_weights): 40(ptr) Variable UniformConstant
42(tex2D_src2): 17(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(boxSize): 8(ptr) Variable Function
Store 9(boxSize) 12
19: 16 Load 18(tex2D_src1)
23: 20 Load 22(samp)
25: 24 SampledImage 19 23
28: 13(fvec4) Load 27(v_texcoord)
29: 7(fvec2) VectorShuffle 28 28 0 1
30: 7(fvec2) Load 9(boxSize)
31: 13(fvec4) ImageBoxFilterQCOM 25 29 30
Store 15(fragColor) 31
34: 24 Load 33(tex_samp)
35: 13(fvec4) Load 27(v_texcoord)
36: 7(fvec2) VectorShuffle 35 35 0 1
37: 7(fvec2) Load 9(boxSize)
38: 13(fvec4) ImageBoxFilterQCOM 34 36 37
Store 15(fragColor) 38
Return
FunctionEnd

View file

@ -0,0 +1,84 @@
spv.tpipSampleWeighted.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 43
Capability Shader
Capability TextureSampleWeightedQCOM
Extension "SPV_QCOM_image_processing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9 21
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_QCOM_image_processing"
Name 4 "main"
Name 9 "fragColor"
Name 12 "tex2D_src1"
Name 16 "samp"
Name 21 "v_texcoord"
Name 27 "tex2DArray_weights"
Name 34 "tex_samp"
Name 39 "tex_samp_array"
Name 42 "tex2D_src2"
Decorate 9(fragColor) Location 0
Decorate 12(tex2D_src1) DescriptorSet 0
Decorate 12(tex2D_src1) Binding 1
Decorate 16(samp) DescriptorSet 0
Decorate 16(samp) Binding 3
Decorate 21(v_texcoord) Location 0
Decorate 27(tex2DArray_weights) DescriptorSet 0
Decorate 27(tex2DArray_weights) Binding 0
Decorate 27(tex2DArray_weights) DecorationWeightTextureQCOM
Decorate 34(tex_samp) DescriptorSet 0
Decorate 34(tex_samp) Binding 4
Decorate 39(tex_samp_array) DescriptorSet 0
Decorate 39(tex_samp_array) Binding 5
Decorate 39(tex_samp_array) DecorationWeightTextureQCOM
Decorate 42(tex2D_src2) DescriptorSet 0
Decorate 42(tex2D_src2) Binding 2
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(fragColor): 8(ptr) Variable Output
10: TypeImage 6(float) 2D sampled format:Unknown
11: TypePointer UniformConstant 10
12(tex2D_src1): 11(ptr) Variable UniformConstant
14: TypeSampler
15: TypePointer UniformConstant 14
16(samp): 15(ptr) Variable UniformConstant
18: TypeSampledImage 10
20: TypePointer Input 7(fvec4)
21(v_texcoord): 20(ptr) Variable Input
22: TypeVector 6(float) 2
25: TypeImage 6(float) 2D array sampled format:Unknown
26: TypePointer UniformConstant 25
27(tex2DArray_weights): 26(ptr) Variable UniformConstant
30: TypeSampledImage 25
33: TypePointer UniformConstant 18
34(tex_samp): 33(ptr) Variable UniformConstant
38: TypePointer UniformConstant 30
39(tex_samp_array): 38(ptr) Variable UniformConstant
42(tex2D_src2): 11(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
13: 10 Load 12(tex2D_src1)
17: 14 Load 16(samp)
19: 18 SampledImage 13 17
23: 7(fvec4) Load 21(v_texcoord)
24: 22(fvec2) VectorShuffle 23 23 0 1
28: 25 Load 27(tex2DArray_weights)
29: 14 Load 16(samp)
31: 30 SampledImage 28 29
32: 7(fvec4) ImageSampleWeightedQCOM 19 24 31
Store 9(fragColor) 32
35: 18 Load 34(tex_samp)
36: 7(fvec4) Load 21(v_texcoord)
37: 22(fvec2) VectorShuffle 36 36 0 1
40: 30 Load 39(tex_samp_array)
41: 7(fvec4) ImageSampleWeightedQCOM 35 37 40
Store 9(fragColor) 41
Return
FunctionEnd

View file

@ -0,0 +1,128 @@
spv.tpipTextureArrays.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 84
Capability Shader
Capability TextureBlockMatchQCOM
Extension "SPV_QCOM_image_processing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 13 46
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_QCOM_image_processing"
Name 4 "main"
Name 9 "tgt_coords"
Name 13 "v_texcoord"
Name 26 "ref_coords"
Name 37 "blockSize"
Name 40 "ii"
Name 46 "fragColor"
Name 51 "samplers"
Name 60 "tex2D_srcs"
Name 67 "samp"
Decorate 13(v_texcoord) Location 0
Decorate 46(fragColor) Location 0
Decorate 51(samplers) DescriptorSet 0
Decorate 51(samplers) Binding 5
Decorate 60(tex2D_srcs) DescriptorSet 0
Decorate 60(tex2D_srcs) Binding 4
Decorate 67(samp) DescriptorSet 0
Decorate 67(samp) Binding 3
Decorate 55 DecorationBlockMatchTextureQCOM
Decorate 63 DecorationBlockMatchTextureQCOM
Decorate 74 DecorationBlockMatchTextureQCOM
Decorate 79 DecorationBlockMatchTextureQCOM
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypeFloat 32
11: TypeVector 10(float) 4
12: TypePointer Input 11(fvec4)
13(v_texcoord): 12(ptr) Variable Input
14: 6(int) Constant 0
15: TypePointer Input 10(float)
19: TypePointer Function 6(int)
21: 6(int) Constant 1
27: 6(int) Constant 2
32: 6(int) Constant 3
38: 6(int) Constant 4
39: 7(ivec2) ConstantComposite 38 38
43: 6(int) Constant 8
45: TypePointer Output 11(fvec4)
46(fragColor): 45(ptr) Variable Output
47: TypeImage 10(float) 2D sampled format:Unknown
48: TypeSampledImage 47
49: TypeArray 48 32
50: TypePointer UniformConstant 49
51(samplers): 50(ptr) Variable UniformConstant
52: TypeInt 32 1
53: 52(int) Constant 0
54: TypePointer UniformConstant 48
58: TypeArray 47 43
59: TypePointer UniformConstant 58
60(tex2D_srcs): 59(ptr) Variable UniformConstant
62: TypePointer UniformConstant 47
65: TypeSampler
66: TypePointer UniformConstant 65
67(samp): 66(ptr) Variable UniformConstant
73: 52(int) Constant 1
4(main): 2 Function None 3
5: Label
9(tgt_coords): 8(ptr) Variable Function
26(ref_coords): 8(ptr) Variable Function
37(blockSize): 8(ptr) Variable Function
40(ii): 19(ptr) Variable Function
16: 15(ptr) AccessChain 13(v_texcoord) 14
17: 10(float) Load 16
18: 6(int) ConvertFToU 17
20: 19(ptr) AccessChain 9(tgt_coords) 14
Store 20 18
22: 15(ptr) AccessChain 13(v_texcoord) 21
23: 10(float) Load 22
24: 6(int) ConvertFToU 23
25: 19(ptr) AccessChain 9(tgt_coords) 14
Store 25 24
28: 15(ptr) AccessChain 13(v_texcoord) 27
29: 10(float) Load 28
30: 6(int) ConvertFToU 29
31: 19(ptr) AccessChain 26(ref_coords) 14
Store 31 30
33: 15(ptr) AccessChain 13(v_texcoord) 32
34: 10(float) Load 33
35: 6(int) ConvertFToU 34
36: 19(ptr) AccessChain 26(ref_coords) 21
Store 36 35
Store 37(blockSize) 39
41: 19(ptr) AccessChain 9(tgt_coords) 14
42: 6(int) Load 41
44: 6(int) UMod 42 43
Store 40(ii) 44
55: 54(ptr) AccessChain 51(samplers) 53
56: 48 Load 55
57: 7(ivec2) Load 9(tgt_coords)
61: 6(int) Load 40(ii)
63: 62(ptr) AccessChain 60(tex2D_srcs) 61
64: 47 Load 63
68: 65 Load 67(samp)
69: 48 SampledImage 64 68
70: 7(ivec2) Load 26(ref_coords)
71: 7(ivec2) Load 37(blockSize)
72: 11(fvec4) ImageBlockMatchSSDQCOM 56 57 69 70 71
Store 46(fragColor) 72
74: 62(ptr) AccessChain 60(tex2D_srcs) 73
75: 47 Load 74
76: 65 Load 67(samp)
77: 48 SampledImage 75 76
78: 7(ivec2) Load 9(tgt_coords)
79: 54(ptr) AccessChain 51(samplers) 73
80: 48 Load 79
81: 7(ivec2) Load 26(ref_coords)
82: 7(ivec2) Load 37(blockSize)
83: 11(fvec4) ImageBlockMatchSADQCOM 77 78 80 81 82
Store 46(fragColor) 83
Return
FunctionEnd

View file

@ -0,0 +1,38 @@
#version 450
#extension GL_QCOM_image_processing : require
precision highp float;
// fragment shader inputs and outputs
layout (location = 0) in vec4 v_texcoord;
layout (location = 0) out vec4 fragColor;
// fragment shader resources
layout(set = 0, binding = 0) uniform texture2DArray tex2DArray_weights;
layout(set = 0, binding = 1) uniform texture2D tex2D_src1;
layout(set = 0, binding = 2) uniform texture2D tex2D_src2;
layout(set = 0, binding = 3) uniform sampler samp;
layout(set = 0, binding = 4) uniform sampler2D target_samp;
layout(set = 0, binding = 5) uniform sampler2D ref_samp;
void main()
{
uvec2 tgt_coords; tgt_coords.x = uint(v_texcoord.x); tgt_coords.x = uint(v_texcoord.y);
uvec2 ref_coords; ref_coords.x = uint(v_texcoord.z); ref_coords.y = uint(v_texcoord.w);
uvec2 blockSize = uvec2(4, 4);
fragColor = textureBlockMatchSADQCOM(
sampler2D(tex2D_src1, samp), // target texture
tgt_coords, // target coords
sampler2D(tex2D_src2, samp), // reference texture
ref_coords, // reference coords
blockSize); // block size
fragColor = textureBlockMatchSADQCOM(
target_samp, // target texture
tgt_coords, // target coords
ref_samp, // reference texture
ref_coords, // reference coords
blockSize); // block size
}

View file

@ -0,0 +1,38 @@
#version 450
#extension GL_QCOM_image_processing : require
precision highp float;
// fragment shader inputs and outputs
layout (location = 0) in vec4 v_texcoord;
layout (location = 0) out vec4 fragColor;
// fragment shader resources
layout(set = 0, binding = 0) uniform texture2DArray tex2DArray_weights;
layout(set = 0, binding = 1) uniform texture2D tex2D_src1;
layout(set = 0, binding = 2) uniform texture2D tex2D_src2;
layout(set = 0, binding = 3) uniform sampler samp;
layout(set = 0, binding = 4) uniform sampler2D target_samp;
layout(set = 0, binding = 5) uniform sampler2D ref_samp;
void main()
{
uvec2 tgt_coords; tgt_coords.x = uint(v_texcoord.x); tgt_coords.x = uint(v_texcoord.y);
uvec2 ref_coords; ref_coords.x = uint(v_texcoord.z); ref_coords.y = uint(v_texcoord.w);
uvec2 blockSize = uvec2(4, 4);
fragColor = textureBlockMatchSSDQCOM(
sampler2D(tex2D_src1, samp), // target texture
tgt_coords, // target coords
sampler2D(tex2D_src2, samp), // reference texture
ref_coords, // reference coords
blockSize); // block size
fragColor = textureBlockMatchSSDQCOM(
target_samp, // target texture
tgt_coords, // target coords
ref_samp, // reference texture
ref_coords, // reference coords
blockSize); // block size
}

View file

@ -0,0 +1,32 @@
#version 450
#extension GL_QCOM_image_processing : require
precision highp float;
// fragment shader inputs and outputs
layout (location = 0) in vec4 v_texcoord;
layout (location = 0) out vec4 fragColor;
// fragment shader resources
layout(set = 0, binding = 0) uniform texture2DArray tex2DArray_weights;
layout(set = 0, binding = 1) uniform texture2D tex2D_src1;
layout(set = 0, binding = 2) uniform texture2D tex2D_src2;
layout(set = 0, binding = 3) uniform sampler samp;
layout(set = 0, binding = 4) uniform sampler2D tex_samp;
void main()
{
vec2 boxSize = vec2(2.5, 4.5);
fragColor = textureBoxFilterQCOM(
sampler2D(tex2D_src1, samp), // source texture
v_texcoord.xy, // tex coords
boxSize); // box size
fragColor = textureBoxFilterQCOM(
tex_samp, // combined source texture
v_texcoord.xy, // tex coords
boxSize); // box size
}

View file

@ -0,0 +1,32 @@
#version 450
#extension GL_QCOM_image_processing : require
precision highp float;
// fragment shader inputs and outputs
layout (location = 0) in vec4 v_texcoord;
layout (location = 0) out vec4 fragColor;
// fragment shader resources
layout(set = 0, binding = 0) uniform texture2DArray tex2DArray_weights;
layout(set = 0, binding = 1) uniform texture2D tex2D_src1;
layout(set = 0, binding = 2) uniform texture2D tex2D_src2;
layout(set = 0, binding = 3) uniform sampler samp;
layout(set = 0, binding = 4) uniform sampler2D tex_samp;
layout(set = 0, binding = 5) uniform sampler2DArray tex_samp_array;
void main()
{
fragColor = textureWeightedQCOM(
sampler2D(tex2D_src1, samp), // source texture
v_texcoord.xy, // tex coords
sampler2DArray(tex2DArray_weights, samp)); // weight texture
fragColor = textureWeightedQCOM(
tex_samp, // combined source texture
v_texcoord.xy, // tex coords
tex_samp_array); // combined weight texture
}

View file

@ -0,0 +1,40 @@
#version 450
#extension GL_QCOM_image_processing : require
precision highp float;
// fragment shader inputs and outputs
layout (location = 0) in vec4 v_texcoord;
layout (location = 0) out vec4 fragColor;
// fragment shader resources
layout(set = 0, binding = 3) uniform sampler samp;
layout(set = 0, binding = 4) uniform texture2D tex2D_srcs[8];
layout(set = 0, binding = 5) uniform sampler2D samplers[3];
void main()
{
uvec2 tgt_coords; tgt_coords.x = uint(v_texcoord.x); tgt_coords.x = uint(v_texcoord.y);
uvec2 ref_coords; ref_coords.x = uint(v_texcoord.z); ref_coords.y = uint(v_texcoord.w);
uvec2 blockSize = uvec2(4, 4);
uint ii = tgt_coords.x % 8;
fragColor = textureBlockMatchSSDQCOM(
samplers[0], // target texture
tgt_coords, // target coords
sampler2D(tex2D_srcs[ii], samp), // reference texture
ref_coords, // reference coords
blockSize); // block size
fragColor = textureBlockMatchSADQCOM(
sampler2D(tex2D_srcs[1], samp), // target texture
tgt_coords, // target coords
samplers[1], // reference texture
ref_coords, // reference coords
blockSize); // block size
}