1#version 450 2#extension GL_QCOM_image_processing : require 3 4precision highp float; 5 6// fragment shader inputs and outputs 7layout (location = 0) in vec4 v_texcoord; 8 9layout (location = 0) out vec4 fragColor; 10 11// fragment shader resources 12layout(set = 0, binding = 3) uniform sampler samp; 13 14 15layout(set = 0, binding = 4) uniform texture2D tex2D_srcs[8]; 16layout(set = 0, binding = 5) uniform sampler2D samplers[3]; 17 18void main() 19{ 20 21 uvec2 tgt_coords; tgt_coords.x = uint(v_texcoord.x); tgt_coords.x = uint(v_texcoord.y); 22 uvec2 ref_coords; ref_coords.x = uint(v_texcoord.z); ref_coords.y = uint(v_texcoord.w); 23 uvec2 blockSize = uvec2(4, 4); 24 uint ii = tgt_coords.x % 8; 25 fragColor = textureBlockMatchSSDQCOM( 26 samplers[0], // target texture 27 tgt_coords, // target coords 28 sampler2D(tex2D_srcs[ii], samp), // reference texture 29 ref_coords, // reference coords 30 blockSize); // block size 31 32 fragColor = textureBlockMatchSADQCOM( 33 sampler2D(tex2D_srcs[1], samp), // target texture 34 tgt_coords, // target coords 35 samplers[1], // reference texture 36 ref_coords, // reference coords 37 blockSize); // block size 38 39} 40 41